Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include<stdio.h> #define N 100 #define W 0 #define G 1 #define B 2 int n,M[N][N]; int color[N],d[N],f[N],t; void dfs_visit(int u){ int v; color[u] = G; d[u] = ++t; for(v = 0;v < n;v++){ if(M[u][v]==0) continue; if(color[v] == W){ dfs_visit(v); } } color[u] = B; f[u] = ++t; } int main(){ int u,v,k; int i,j; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++) M[i][j]=0; } for(i=0;i<n;i++){ scanf("%d %d",&u,&k); u--; for(j=0;j<k;j++){ scanf("%d",&v); v--; M[u][v] = 1; } } for(u=0;u<n;u++){ color[u] = W; } t = 0; for(u=0;u<n;u++){ if(color[u] == W) dfs_visit(u); } for(u=0;u<n;u++){ printf("%d %d %d\n",u+1,d[u],f[u]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195376/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195376/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @t = dso_local local_unnamed_addr global i32 0, align 4 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [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 [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs_visit(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @t, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @t, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %5 = trunc i64 %indvars.iv to i32 tail call void @dfs_visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @t, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @t, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %u = alloca i32, align 4 %v = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp70 = icmp sgt i32 %0, 0 br i1 %cmp70, label %for.cond1.preheader.us.preheader, label %for.cond45.preheader.thread for.cond1.preheader.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader %unroll_iter = and i64 %1, 4294967288 br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @M, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %gep = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 400), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep102 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 800), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep102, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep103 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1200), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep103, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep104 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep104, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep105 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep105, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep106 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2400), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep106, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep107 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2800), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep107, i8 0, i64 %2, i1 false), !tbaa !5 %indvar.next.7 = add nuw nsw i64 %indvar, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !11 for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @M, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !12 for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp70, label %for.body11, label %for.cond45.preheader.thread for.cond28.preheader: ; preds = %for.inc25 %cmp2976 = icmp sgt i32 %18, 0 br i1 %cmp2976, label %for.body38.preheader, label %for.cond45.preheader.thread for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.175 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %u, ptr noundef nonnull %k) %13 = load i32, ptr %u, align 4, !tbaa !5 %dec = add nsw i32 %13, -1 store i32 %dec, ptr %u, align 4, !tbaa !5 %14 = load i32, ptr %k, align 4, !tbaa !5 %cmp1472 = icmp sgt i32 %14, 0 br i1 %cmp1472, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.173 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %15 = load i32, ptr %v, align 4, !tbaa !5 %dec17 = add nsw i32 %15, -1 store i32 %dec17, ptr %v, align 4, !tbaa !5 %16 = load i32, ptr %u, align 4, !tbaa !5 %idxprom18 = sext i32 %16 to i64 %idxprom20 = sext i32 %dec17 to i64 %arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.173, 1 %17 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %17 br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !14 for.inc25: ; preds = %for.body15, %for.body11 %inc26 = add nuw nsw i32 %i.175, 1 %18 = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %18 br i1 %cmp10, label %for.body11, label %for.cond28.preheader, !llvm.loop !15 for.body38.preheader: ; preds = %for.cond28.preheader %19 = zext i32 %18 to i64 %20 = shl nuw nsw i64 %19, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %20, i1 false), !tbaa !5 store i32 0, ptr @t, align 4, !tbaa !5 store i32 0, ptr %u, align 4, !tbaa !5 br label %for.body38 for.cond45.preheader.thread: ; preds = %for.cond9.preheader, %entry, %for.cond28.preheader store i32 0, ptr @t, align 4, !tbaa !5 br label %for.end55 for.cond45.preheader: ; preds = %for.inc42 %21 = icmp sgt i32 %24, 0 store i32 0, ptr %u, align 4, !tbaa !5 br i1 %21, label %for.body47, label %for.end55 for.body38: ; preds = %for.body38.preheader, %for.inc42 %22 = phi i32 [ %24, %for.inc42 ], [ %18, %for.body38.preheader ] %storemerge6680 = phi i32 [ %inc43, %for.inc42 ], [ 0, %for.body38.preheader ] %idxprom39 = sext i32 %storemerge6680 to i64 %arrayidx40 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom39 %23 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp41 = icmp eq i32 %23, 0 br i1 %cmp41, label %if.then, label %for.inc42 if.then: ; preds = %for.body38 call void @dfs_visit(i32 noundef %storemerge6680) %.pre = load i32, ptr %u, align 4, !tbaa !5 %.pre89 = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc42 for.inc42: ; preds = %for.body38, %if.then %24 = phi i32 [ %22, %for.body38 ], [ %.pre89, %if.then ] %25 = phi i32 [ %storemerge6680, %for.body38 ], [ %.pre, %if.then ] %inc43 = add nsw i32 %25, 1 store i32 %inc43, ptr %u, align 4, !tbaa !5 %cmp37 = icmp slt i32 %inc43, %24 br i1 %cmp37, label %for.body38, label %for.cond45.preheader, !llvm.loop !16 for.body47: ; preds = %for.cond45.preheader, %for.body47 %storemerge6782 = phi i32 [ %inc54, %for.body47 ], [ 0, %for.cond45.preheader ] %add = add nsw i32 %storemerge6782, 1 %idxprom48 = sext i32 %storemerge6782 to i64 %arrayidx49 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom48 %26 = load i32, ptr %arrayidx49, align 4, !tbaa !5 %arrayidx51 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom48 %27 = load i32, ptr %arrayidx51, align 4, !tbaa !5 %call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add, i32 noundef %26, i32 noundef %27) %28 = load i32, ptr %u, align 4, !tbaa !5 %inc54 = add nsw i32 %28, 1 store i32 %inc54, ptr %u, align 4, !tbaa !5 %29 = load i32, ptr @n, align 4, !tbaa !5 %cmp46 = icmp slt i32 %inc54, %29 br i1 %cmp46, label %for.body47, label %for.end55, !llvm.loop !17 for.end55: ; preds = %for.body47, %for.cond45.preheader.thread, %for.cond45.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> #define N 100 #define WHITE 0 #define BLACK 1 #define GRAY 2 int n,M[N][N]; int color[N],d[N],f[N],tt; void DFS_visit(int u){ /*再帰関数による深さ優先探索*/ int v; color[u]=GRAY; d[u]=++tt; /*最初の訪問*/ for(v=0;v<n;v++){ if(M[u][v]==0) continue; if(color[v]==WHITE){ DFS_visit(v); } } color[u] = BLACK; f[u]=++tt; /*訪問終了*/ } void DFS(){ int u; for(u=0;u<n;u++){ color[u]=WHITE; tt=0; } for(u=0;u<n;u++){/* 未訪問のuを始点として深さ優先探索 */ if(color[u]==WHITE) DFS_visit(u); } for(u=0;u<n;u++){ printf("%d %d %d\n",u+1,d[u],f[u]); } } int main(){ int i,j,u,v,k; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ M[i][j]=0; } } for(i=0;i<n;i++){ scanf("%d %d",&u,&k); u--; for(j=0;j<k;j++){ scanf("%d",&v); v--; M[u][v]=1; } } DFS(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195419/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195419/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @tt = dso_local local_unnamed_addr global i32 0, align 4 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @DFS_visit(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 2, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @tt, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @tt, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %5 = trunc i64 %indvars.iv to i32 tail call void @DFS_visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @tt, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 1, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @tt, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @DFS() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.body3.preheader, label %for.end19 for.body3.preheader: ; preds = %entry store i32 0, ptr @tt, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5 br label %for.body3 for.cond10.preheader: ; preds = %for.inc7 %3 = icmp sgt i32 %7, 0 br i1 %3, label %for.body12, label %for.end19 for.body3: ; preds = %for.body3.preheader, %for.inc7 %4 = phi i32 [ %0, %for.body3.preheader ], [ %7, %for.inc7 ] %indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ] %arrayidx5 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %5, 0 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %6 = trunc i64 %indvars.iv to i32 tail call void @DFS_visit(i32 noundef %6) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = sext i32 %7 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !11 for.body12: ; preds = %for.cond10.preheader, %for.body12 %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body12 ], [ 0, %for.cond10.preheader ] %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39 %9 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39 %10 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv.next40 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11, i32 noundef %9, i32 noundef %10) %12 = load i32, ptr @n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp11 = icmp slt i64 %indvars.iv.next40, %13 br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !12 for.end19: ; preds = %for.body12, %entry, %for.cond10.preheader ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %u = alloca i32, align 4 %v = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp40 = icmp sgt i32 %0, 0 br i1 %cmp40, label %for.cond1.preheader.us.preheader, label %DFS.exit for.cond1.preheader.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader %unroll_iter = and i64 %1, 4294967288 br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @M, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %gep = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 400), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep51 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 800), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep51, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep52 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1200), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep52, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep53 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep53, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep54 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep54, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep55 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2400), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep56 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2800), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, i1 false), !tbaa !5 %indvar.next.7 = add nuw nsw i64 %indvar, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !13 for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @M, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !14 for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp40, label %for.body11, label %DFS.exit for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.145 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u, ptr noundef nonnull %k) %13 = load i32, ptr %u, align 4, !tbaa !5 %dec = add nsw i32 %13, -1 store i32 %dec, ptr %u, align 4, !tbaa !5 %14 = load i32, ptr %k, align 4, !tbaa !5 %cmp1442 = icmp sgt i32 %14, 0 br i1 %cmp1442, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.143 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v) %15 = load i32, ptr %v, align 4, !tbaa !5 %dec17 = add nsw i32 %15, -1 store i32 %dec17, ptr %v, align 4, !tbaa !5 %16 = load i32, ptr %u, align 4, !tbaa !5 %idxprom18 = sext i32 %16 to i64 %idxprom20 = sext i32 %dec17 to i64 %arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.143, 1 %17 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %17 br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !16 for.inc25: ; preds = %for.body15, %for.body11 %inc26 = add nuw nsw i32 %i.145, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %.pr br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !17 for.end27: ; preds = %for.inc25 %cmp31.i = icmp sgt i32 %.pr, 0 br i1 %cmp31.i, label %for.body3.preheader.i, label %DFS.exit for.body3.preheader.i: ; preds = %for.end27 store i32 0, ptr @tt, align 4, !tbaa !5 %18 = zext i32 %.pr to i64 %19 = shl nuw nsw i64 %18, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %19, i1 false), !tbaa !5 br label %for.body3.i for.cond10.preheader.i: ; preds = %for.inc7.i %20 = icmp sgt i32 %24, 0 br i1 %20, label %for.body12.i, label %DFS.exit for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i %21 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %24, %for.inc7.i ] %indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ] %arrayidx5.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i %22 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %22, 0 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %23 = trunc i64 %indvars.iv.i to i32 call void @DFS_visit(i32 noundef %23) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %24 = phi i32 [ %21, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %25 = sext i32 %24 to i64 %cmp2.i = icmp slt i64 %indvars.iv.next.i, %25 br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !11 for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i %indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ] %indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1 %arrayidx14.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39.i %26 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5 %arrayidx16.i = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39.i %27 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5 %28 = trunc i64 %indvars.iv.next40.i to i32 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28, i32 noundef %26, i32 noundef %27) %29 = load i32, ptr @n, align 4, !tbaa !5 %30 = sext i32 %29 to i64 %cmp11.i = icmp slt i64 %indvars.iv.next40.i, %30 br i1 %cmp11.i, label %for.body12.i, label %DFS.exit, !llvm.loop !12 DFS.exit: ; preds = %for.body12.i, %entry, %for.cond9.preheader, %for.end27, %for.cond10.preheader.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> #include<stdlib.h> int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); int a[n],i,j; for(i=0;i<n;i++) { scanf("%d",&a[i]); } if(a[0]!=a[1] && a[0]!=a[2]) { printf("1\n"); } else if(a[n-1]!=a[n-2] && a[n-1]!=a[n-3]) { printf("%d\n",n); } else { for(i=1;i<n-1;i++) { if(a[i]!=a[i+1] && a[i]!=a[i-1]) { printf("%d\n",i+1); } } } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19547/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19547/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = 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: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec67 = add nsw i32 %0, -1 store i32 %dec67, ptr %t, align 4, !tbaa !5 %tobool.not68 = icmp eq i32 %0, 0 br i1 %tobool.not68, label %while.end, label %while.body while.body: ; preds = %entry, %if.end50 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = zext i32 %1 to i64 %3 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %2, align 16 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp62 = icmp sgt i32 %4, 0 br i1 %cmp62, label %for.body, label %if.then for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %.pre = load i32, ptr %vla, align 16, !tbaa !5 %arrayidx4.phi.trans.insert = getelementptr inbounds i32, ptr %vla, i64 1 %.pre75 = load i32, ptr %arrayidx4.phi.trans.insert, align 4, !tbaa !5 %cmp5.not = icmp eq i32 %.pre, %.pre75 br i1 %cmp5.not, label %if.else, label %land.lhs.true land.lhs.true: ; preds = %for.end %arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 2 %7 = load i32, ptr %arrayidx7, align 8, !tbaa !5 %cmp8.not = icmp eq i32 %.pre, %7 br i1 %cmp8.not, label %if.else, label %if.then if.then: ; preds = %while.body, %land.lhs.true %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end50 if.else: ; preds = %land.lhs.true, %for.end %sub = add nsw i32 %5, -1 %idxprom10 = sext i32 %sub to i64 %arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %idxprom10 %8 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %sub12 = add nsw i32 %5, -2 %idxprom13 = sext i32 %sub12 to i64 %arrayidx14 = getelementptr inbounds i32, ptr %vla, i64 %idxprom13 %9 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %cmp15.not = icmp eq i32 %8, %9 br i1 %cmp15.not, label %if.else26, label %land.lhs.true16 land.lhs.true16: ; preds = %if.else %sub20 = add nsw i32 %5, -3 %idxprom21 = sext i32 %sub20 to i64 %arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %idxprom21 %10 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.not = icmp eq i32 %8, %10 br i1 %cmp23.not, label %if.else26, label %if.then24 if.then24: ; preds = %land.lhs.true16 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5) br label %if.end50 if.else26: ; preds = %land.lhs.true16, %if.else %cmp2965 = icmp sgt i32 %5, 2 br i1 %cmp2965, label %for.body30.preheader, label %if.end50 for.body30.preheader: ; preds = %if.else26 %invariant.gep = getelementptr i32, ptr %vla, i64 -1 br label %for.body30 for.body30: ; preds = %for.body30.preheader, %for.inc46 %11 = phi i32 [ %5, %for.body30.preheader ], [ %16, %for.inc46 ] %indvars.iv71 = phi i64 [ 1, %for.body30.preheader ], [ %indvars.iv.next72, %for.inc46 ] %arrayidx32 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv71 %12 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %arrayidx34 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next72 %13 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %cmp35.not = icmp eq i32 %12, %13 br i1 %cmp35.not, label %for.inc46, label %land.lhs.true36 land.lhs.true36: ; preds = %for.body30 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv71 %14 = load i32, ptr %gep, align 4, !tbaa !5 %cmp42.not = icmp eq i32 %12, %14 br i1 %cmp42.not, label %for.inc46, label %if.then43 if.then43: ; preds = %land.lhs.true36 %15 = trunc i64 %indvars.iv.next72 to i32 %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15) %.pre76 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc46 for.inc46: ; preds = %for.body30, %land.lhs.true36, %if.then43 %16 = phi i32 [ %11, %for.body30 ], [ %11, %land.lhs.true36 ], [ %.pre76, %if.then43 ] %sub28 = add nsw i32 %16, -1 %17 = sext i32 %sub28 to i64 %cmp29 = icmp slt i64 %indvars.iv.next72, %17 br i1 %cmp29, label %for.body30, label %if.end50, !llvm.loop !11 if.end50: ; preds = %for.inc46, %if.else26, %if.then24, %if.then call void @llvm.stackrestore.p0(ptr %3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 %18 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %18, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %18, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12 while.end: ; preds = %if.end50, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> #define N 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[N][N],color[N],d[N],f[N],tt; void dfs_visit(int u){ int v; color[u]=GRAY; d[u]=++tt; for(v=0;v<n;v++){ if(M[u][v]==0) continue; if(color[v]==WHITE){ dfs_visit(v); } } color[u]=BLACK; f[u]=++tt; } void dfs(){ int u; for(u=0;u<n;u++){ color[u]=WHITE; } tt=0; for(u=0;u<n;u++){ if(color[u]==WHITE){ dfs_visit(u); } } for(u=0;u<n;u++){ printf("%d %d %d\n",u+1,d[u],f[u]); } } int main(){ int u,v,k,i,j; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ M[i][j]=0; } } for(i=0;i<n;i++){ scanf("%d%d",&u,&k); u--; for(j=0;j<k;j++){ scanf("%d",&v); v--; M[u][v]=1; } } dfs(); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195512/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195512/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @color = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @tt = dso_local local_unnamed_addr global i32 0, align 4 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @dfs_visit(i32 noundef %u) local_unnamed_addr #0 { entry: %idxprom = sext i32 %u to i64 %arrayidx = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom store i32 1, ptr %arrayidx, align 4, !tbaa !5 %0 = load i32, ptr @tt, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @tt, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp27 = icmp sgt i32 %1, 0 br i1 %cmp27, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 0 br i1 %cmp7, label %for.inc, label %if.end if.end: ; preds = %for.body %arrayidx9 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %if.end %5 = trunc i64 %indvars.iv to i32 tail call void @dfs_visit(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %if.end, %if.then11, %for.body %6 = phi i32 [ %2, %if.end ], [ %.pre, %if.then11 ], [ %2, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre30 = load i32, ptr @tt, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre30, %for.end.loopexit ], [ %inc, %entry ] store i32 2, ptr %arrayidx, align 4, !tbaa !5 %inc16 = add nsw i32 %8, 1 store i32 %inc16, ptr @tt, align 4, !tbaa !5 %arrayidx18 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc16, ptr %arrayidx18, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @dfs() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.body3.preheader, label %for.cond10.preheader.thread for.cond10.preheader.thread: ; preds = %entry store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.end19 for.body3.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %2, i1 false), !tbaa !5 store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.body3 for.cond10.preheader: ; preds = %for.inc7 %3 = icmp sgt i32 %7, 0 br i1 %3, label %for.body12, label %for.end19 for.body3: ; preds = %for.body3.preheader, %for.inc7 %4 = phi i32 [ %0, %for.body3.preheader ], [ %7, %for.inc7 ] %indvars.iv = phi i64 [ 0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc7 ] %arrayidx5 = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp6 = icmp eq i32 %5, 0 br i1 %cmp6, label %if.then, label %for.inc7 if.then: ; preds = %for.body3 %6 = trunc i64 %indvars.iv to i32 tail call void @dfs_visit(i32 noundef %6) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.body3, %if.then %7 = phi i32 [ %4, %for.body3 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = sext i32 %7 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %8 br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !11 for.body12: ; preds = %for.cond10.preheader, %for.body12 %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body12 ], [ 0, %for.cond10.preheader ] %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %arrayidx14 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39 %9 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %arrayidx16 = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39 %10 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %11 = trunc i64 %indvars.iv.next40 to i32 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11, i32 noundef %9, i32 noundef %10) %12 = load i32, ptr @n, align 4, !tbaa !5 %13 = sext i32 %12 to i64 %cmp11 = icmp slt i64 %indvars.iv.next40, %13 br i1 %cmp11, label %for.body12, label %for.end19, !llvm.loop !12 for.end19: ; preds = %for.body12, %for.cond10.preheader.thread, %for.cond10.preheader ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %u = alloca i32, align 4 %v = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %u) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp40 = icmp sgt i32 %0, 0 br i1 %cmp40, label %for.cond1.preheader.us.preheader, label %for.cond10.preheader.thread.i for.cond1.preheader.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 %xtraiter = and i64 %1, 7 %3 = icmp ult i32 %0, 8 br i1 %3, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us.preheader.new for.cond1.preheader.us.preheader.new: ; preds = %for.cond1.preheader.us.preheader %unroll_iter = and i64 %1, 4294967288 br label %for.cond1.preheader.us for.cond1.preheader.us: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond1.preheader.us ] %niter = phi i64 [ 0, %for.cond1.preheader.us.preheader.new ], [ %niter.next.7, %for.cond1.preheader.us ] %4 = mul nuw nsw i64 %indvar, 400 %scevgep = getelementptr i8, ptr @M, i64 %4 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %2, i1 false), !tbaa !5 %5 = mul nuw i64 %indvar, 400 %gep = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 400), i64 %5 tail call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 0, i64 %2, i1 false), !tbaa !5 %6 = mul nuw i64 %indvar, 400 %gep51 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 800), i64 %6 tail call void @llvm.memset.p0.i64(ptr align 16 %gep51, i8 0, i64 %2, i1 false), !tbaa !5 %7 = mul nuw i64 %indvar, 400 %gep52 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1200), i64 %7 tail call void @llvm.memset.p0.i64(ptr align 16 %gep52, i8 0, i64 %2, i1 false), !tbaa !5 %8 = mul nuw i64 %indvar, 400 %gep53 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 1600), i64 %8 tail call void @llvm.memset.p0.i64(ptr align 16 %gep53, i8 0, i64 %2, i1 false), !tbaa !5 %9 = mul nuw i64 %indvar, 400 %gep54 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2000), i64 %9 tail call void @llvm.memset.p0.i64(ptr align 16 %gep54, i8 0, i64 %2, i1 false), !tbaa !5 %10 = mul nuw i64 %indvar, 400 %gep55 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2400), i64 %10 tail call void @llvm.memset.p0.i64(ptr align 16 %gep55, i8 0, i64 %2, i1 false), !tbaa !5 %11 = mul nuw i64 %indvar, 400 %gep56 = getelementptr i8, ptr getelementptr (i8, ptr @M, i64 2800), i64 %11 tail call void @llvm.memset.p0.i64(ptr align 16 %gep56, i8 0, i64 %2, i1 false), !tbaa !5 %indvar.next.7 = add nuw nsw i64 %indvar, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond9.preheader.unr-lcssa, label %for.cond1.preheader.us, !llvm.loop !13 for.cond9.preheader.unr-lcssa: ; preds = %for.cond1.preheader.us, %for.cond1.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvar.next.7, %for.cond1.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil for.cond1.preheader.us.epil: ; preds = %for.cond9.preheader.unr-lcssa, %for.cond1.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond1.preheader.us.epil ], [ %indvar.unr, %for.cond9.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond1.preheader.us.epil ], [ 0, %for.cond9.preheader.unr-lcssa ] %12 = mul nuw nsw i64 %indvar.epil, 400 %scevgep.epil = getelementptr i8, ptr @M, i64 %12 tail call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 0, i64 %2, i1 false), !tbaa !5 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond9.preheader, label %for.cond1.preheader.us.epil, !llvm.loop !14 for.cond9.preheader: ; preds = %for.cond1.preheader.us.epil, %for.cond9.preheader.unr-lcssa br i1 %cmp40, label %for.body11, label %for.cond10.preheader.thread.i for.body11: ; preds = %for.cond9.preheader, %for.inc25 %i.145 = phi i32 [ %inc26, %for.inc25 ], [ 0, %for.cond9.preheader ] %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %u, ptr noundef nonnull %k) %13 = load i32, ptr %u, align 4, !tbaa !5 %dec = add nsw i32 %13, -1 store i32 %dec, ptr %u, align 4, !tbaa !5 %14 = load i32, ptr %k, align 4, !tbaa !5 %cmp1442 = icmp sgt i32 %14, 0 br i1 %cmp1442, label %for.body15, label %for.inc25 for.body15: ; preds = %for.body11, %for.body15 %j.143 = phi i32 [ %inc23, %for.body15 ], [ 0, %for.body11 ] %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v) %15 = load i32, ptr %v, align 4, !tbaa !5 %dec17 = add nsw i32 %15, -1 store i32 %dec17, ptr %v, align 4, !tbaa !5 %16 = load i32, ptr %u, align 4, !tbaa !5 %idxprom18 = sext i32 %16 to i64 %idxprom20 = sext i32 %dec17 to i64 %arrayidx21 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom18, i64 %idxprom20 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 %inc23 = add nuw nsw i32 %j.143, 1 %17 = load i32, ptr %k, align 4, !tbaa !5 %cmp14 = icmp slt i32 %inc23, %17 br i1 %cmp14, label %for.body15, label %for.inc25, !llvm.loop !16 for.inc25: ; preds = %for.body15, %for.body11 %inc26 = add nuw nsw i32 %i.145, 1 %.pr = load i32, ptr @n, align 4, !tbaa !5 %cmp10 = icmp slt i32 %inc26, %.pr br i1 %cmp10, label %for.body11, label %for.end27, !llvm.loop !17 for.end27: ; preds = %for.inc25 %cmp31.i = icmp sgt i32 %.pr, 0 br i1 %cmp31.i, label %for.body3.preheader.i, label %for.cond10.preheader.thread.i for.cond10.preheader.thread.i: ; preds = %entry, %for.cond9.preheader, %for.end27 store i32 0, ptr @tt, align 4, !tbaa !5 br label %dfs.exit for.body3.preheader.i: ; preds = %for.end27 %18 = zext i32 %.pr to i64 %19 = shl nuw nsw i64 %18, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %19, i1 false), !tbaa !5 store i32 0, ptr @tt, align 4, !tbaa !5 br label %for.body3.i for.cond10.preheader.i: ; preds = %for.inc7.i %20 = icmp sgt i32 %24, 0 br i1 %20, label %for.body12.i, label %dfs.exit for.body3.i: ; preds = %for.inc7.i, %for.body3.preheader.i %21 = phi i32 [ %.pr, %for.body3.preheader.i ], [ %24, %for.inc7.i ] %indvars.iv.i = phi i64 [ 0, %for.body3.preheader.i ], [ %indvars.iv.next.i, %for.inc7.i ] %arrayidx5.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv.i %22 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5 %cmp6.i = icmp eq i32 %22, 0 br i1 %cmp6.i, label %if.then.i, label %for.inc7.i if.then.i: ; preds = %for.body3.i %23 = trunc i64 %indvars.iv.i to i32 call void @dfs_visit(i32 noundef %23) %.pre.i = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc7.i for.inc7.i: ; preds = %if.then.i, %for.body3.i %24 = phi i32 [ %21, %for.body3.i ], [ %.pre.i, %if.then.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %25 = sext i32 %24 to i64 %cmp2.i = icmp slt i64 %indvars.iv.next.i, %25 br i1 %cmp2.i, label %for.body3.i, label %for.cond10.preheader.i, !llvm.loop !11 for.body12.i: ; preds = %for.cond10.preheader.i, %for.body12.i %indvars.iv39.i = phi i64 [ %indvars.iv.next40.i, %for.body12.i ], [ 0, %for.cond10.preheader.i ] %indvars.iv.next40.i = add nuw nsw i64 %indvars.iv39.i, 1 %arrayidx14.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv39.i %26 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5 %arrayidx16.i = getelementptr inbounds [100 x i32], ptr @f, i64 0, i64 %indvars.iv39.i %27 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5 %28 = trunc i64 %indvars.iv.next40.i to i32 %call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %28, i32 noundef %26, i32 noundef %27) %29 = load i32, ptr @n, align 4, !tbaa !5 %30 = sext i32 %29 to i64 %cmp11.i = icmp slt i64 %indvars.iv.next40.i, %30 br i1 %cmp11.i, label %for.body12.i, label %dfs.exit, !llvm.loop !12 dfs.exit: ; preds = %for.body12.i, %for.cond10.preheader.thread.i, %for.cond10.preheader.i call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %u) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include<stdio.h> int C[101][101]={0}; int d[101]={0}; int f[101]={0}; int count = 0; int n; void DFS(int i){ int j; d[i] = ++count; for(j=0; j<n; j++){ if(C[i][j] != 0 && d[j] == 0) DFS(j); } f[i] = ++count; } int main(){ int i,j,k,v,u; int id[101]; scanf("%d",&n); for(i=0; i<n; i++){ scanf("%d %d",&id[i],&k); for(j=0; j<k; j++){ scanf("%d",&v); C[id[i]-1][v-1]=1; } } for(i=0; i<n; i++){ if(d[i] == 0) DFS(i); } for(i=0; i<n; i++){ printf("%d %d %d\n",id[i],d[i],f[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195556/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195556/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @C = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @f = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @count = dso_local local_unnamed_addr global i32 0, align 4 @n = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @DFS(i32 noundef %i) local_unnamed_addr #0 { entry: %0 = load i32, ptr @count, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @count, align 4, !tbaa !5 %idxprom = sext i32 %i to i64 %arrayidx = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp19 = icmp sgt i32 %1, 0 br i1 %cmp19, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx4 = getelementptr inbounds [101 x [101 x i32]], ptr @C, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp5.not = icmp eq i32 %3, 0 br i1 %cmp5.not, label %for.inc, label %land.lhs.true land.lhs.true: ; preds = %for.body %arrayidx7 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %cmp8 = icmp eq i32 %4, 0 br i1 %cmp8, label %if.then, label %for.inc if.then: ; preds = %land.lhs.true %5 = trunc i64 %indvars.iv to i32 tail call void @DFS(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true, %if.then %6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.inc %.pre22 = load i32, ptr @count, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre22, %for.end.loopexit ], [ %inc, %entry ] %inc10 = add nsw i32 %8, 1 store i32 %inc10, ptr @count, align 4, !tbaa !5 %arrayidx12 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %idxprom store i32 %inc10, ptr %arrayidx12, align 4, !tbaa !5 ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %k = alloca i32, align 4 %v = alloca i32, align 4 %id = alloca [101 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #4 call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %id) #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 %cmp53 = icmp sgt i32 %0, 0 br i1 %cmp53, label %for.body, label %for.end37 for.cond16.preheader: ; preds = %for.inc13 %cmp1755 = icmp sgt i32 %5, 0 br i1 %cmp1755, label %for.body18, label %for.end37 for.body: ; preds = %entry, %for.inc13 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc13 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [101 x i32], ptr %id, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %k) %1 = load i32, ptr %k, align 4, !tbaa !5 %cmp351 = icmp sgt i32 %1, 0 br i1 %cmp351, label %for.body4, label %for.inc13 for.body4: ; preds = %for.body, %for.body4 %j.052 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %v) %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom8 = sext i32 %sub to i64 %3 = load i32, ptr %v, align 4, !tbaa !5 %sub10 = add nsw i32 %3, -1 %idxprom11 = sext i32 %sub10 to i64 %arrayidx12 = getelementptr inbounds [101 x [101 x i32]], ptr @C, i64 0, i64 %idxprom8, i64 %idxprom11 store i32 1, ptr %arrayidx12, align 4, !tbaa !5 %inc = add nuw nsw i32 %j.052, 1 %4 = load i32, ptr %k, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %4 br i1 %cmp3, label %for.body4, label %for.inc13, !llvm.loop !11 for.inc13: ; preds = %for.body4, %for.body %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.cond16.preheader, !llvm.loop !12 for.cond25.preheader: ; preds = %for.inc22 %7 = icmp sgt i32 %11, 0 br i1 %7, label %for.body27, label %for.end37 for.body18: ; preds = %for.cond16.preheader, %for.inc22 %8 = phi i32 [ %11, %for.inc22 ], [ %5, %for.cond16.preheader ] %indvars.iv60 = phi i64 [ %indvars.iv.next61, %for.inc22 ], [ 0, %for.cond16.preheader ] %arrayidx20 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv60 %9 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21 = icmp eq i32 %9, 0 br i1 %cmp21, label %if.then, label %for.inc22 if.then: ; preds = %for.body18 %10 = trunc i64 %indvars.iv60 to i32 call void @DFS(i32 noundef %10) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc22 for.inc22: ; preds = %for.body18, %if.then %11 = phi i32 [ %8, %for.body18 ], [ %.pre, %if.then ] %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %12 = sext i32 %11 to i64 %cmp17 = icmp slt i64 %indvars.iv.next61, %12 br i1 %cmp17, label %for.body18, label %for.cond25.preheader, !llvm.loop !13 for.body27: ; preds = %for.cond25.preheader, %for.body27 %indvars.iv63 = phi i64 [ %indvars.iv.next64, %for.body27 ], [ 0, %for.cond25.preheader ] %arrayidx29 = getelementptr inbounds [101 x i32], ptr %id, i64 0, i64 %indvars.iv63 %13 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %arrayidx31 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv63 %14 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %arrayidx33 = getelementptr inbounds [101 x i32], ptr @f, i64 0, i64 %indvars.iv63 %15 = load i32, ptr %arrayidx33, align 4, !tbaa !5 %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13, i32 noundef %14, i32 noundef %15) %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1 %16 = load i32, ptr @n, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp26 = icmp slt i64 %indvars.iv.next64, %17 br i1 %cmp26, label %for.body27, label %for.end37, !llvm.loop !14 for.end37: ; preds = %for.body27, %entry, %for.cond16.preheader, %for.cond25.preheader call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %id) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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> void fuka(int); int n; int cnt=1; int a[101][101],b[101],c[101],d[101]; int main(){ int i,j,x,y,z; scanf("%d",&n); b[0]=0; for(i=0;i<n;i++){ scanf("%d%d",&x,&y); for(j=0;j<y;j++){ scanf("%d",&z); a[x-1][z-1]=1; } } for(i=0;i<n;i++){ if(b[i]==0)fuka(i); } for(i=0;i<n;i++)printf("%d %d %d\n",i+1,c[i],d[i]); return 0; } void fuka(int x){ int i; c[x]=cnt; cnt++; b[x]=1; for(i=0;i<n;i++){ if(a[x][i]==1 && b[i]==0)fuka(i); } d[x]=cnt; cnt++; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195606/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195606/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @cnt = dso_local local_unnamed_addr global i32 1, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n = dso_local global i32 0, align 4 @b = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @a = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [10 x i8] c"%d %d %d\0A\00", align 1 @c = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 %z = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #4 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) store i32 0, ptr @b, align 16, !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp45 = icmp sgt i32 %0, 0 br i1 %cmp45, label %for.body, label %for.end31 for.cond12.preheader: ; preds = %for.inc9 %cmp1347 = icmp sgt i32 %5, 0 br i1 %cmp1347, label %for.body14, label %for.end31 for.body: ; preds = %entry, %for.inc9 %i.046 = phi i32 [ %inc10, %for.inc9 ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %1 = load i32, ptr %y, align 4, !tbaa !5 %cmp343 = icmp sgt i32 %1, 0 br i1 %cmp343, label %for.body4, label %for.inc9 for.body4: ; preds = %for.body, %for.body4 %j.044 = phi i32 [ %inc, %for.body4 ], [ 0, %for.body ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %z) %2 = load i32, ptr %x, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %z, align 4, !tbaa !5 %sub6 = add nsw i32 %3, -1 %idxprom7 = sext i32 %sub6 to i64 %arrayidx8 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %idxprom, i64 %idxprom7 store i32 1, ptr %arrayidx8, align 4, !tbaa !5 %inc = add nuw nsw i32 %j.044, 1 %4 = load i32, ptr %y, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %4 br i1 %cmp3, label %for.body4, label %for.inc9, !llvm.loop !9 for.inc9: ; preds = %for.body4, %for.body %inc10 = add nuw nsw i32 %i.046, 1 %5 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc10, %5 br i1 %cmp, label %for.body, label %for.cond12.preheader, !llvm.loop !11 for.cond21.preheader: ; preds = %for.inc18 %6 = icmp sgt i32 %10, 0 br i1 %6, label %for.body23, label %for.end31 for.body14: ; preds = %for.cond12.preheader, %for.inc18 %7 = phi i32 [ %10, %for.inc18 ], [ %5, %for.cond12.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc18 ], [ 0, %for.cond12.preheader ] %arrayidx16 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv %8 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %cmp17 = icmp eq i32 %8, 0 br i1 %cmp17, label %if.then, label %for.inc18 if.then: ; preds = %for.body14 %9 = trunc i64 %indvars.iv to i32 call void @fuka(i32 noundef %9) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc18 for.inc18: ; preds = %for.body14, %if.then %10 = phi i32 [ %7, %for.body14 ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %11 = sext i32 %10 to i64 %cmp13 = icmp slt i64 %indvars.iv.next, %11 br i1 %cmp13, label %for.body14, label %for.cond21.preheader, !llvm.loop !12 for.body23: ; preds = %for.cond21.preheader, %for.body23 %indvars.iv52 = phi i64 [ %indvars.iv.next53, %for.body23 ], [ 0, %for.cond21.preheader ] %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %arrayidx25 = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %indvars.iv52 %12 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %arrayidx27 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv52 %13 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %14 = trunc i64 %indvars.iv.next53 to i32 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14, i32 noundef %12, i32 noundef %13) %15 = load i32, ptr @n, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp22 = icmp slt i64 %indvars.iv.next53, %16 br i1 %cmp22, label %for.body23, label %for.end31, !llvm.loop !13 for.end31: ; preds = %for.body23, %entry, %for.cond12.preheader, %for.cond21.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %z) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 @fuka(i32 noundef %x) local_unnamed_addr #3 { entry: %0 = load i32, ptr @cnt, align 4, !tbaa !5 %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds [101 x i32], ptr @c, i64 0, i64 %idxprom store i32 %0, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @cnt, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %idxprom store i32 1, ptr %arrayidx2, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp22 = icmp sgt i32 %1, 0 br i1 %cmp22, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %2 = phi i32 [ %6, %for.inc ], [ %1, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %arrayidx6 = getelementptr inbounds [101 x [101 x i32]], ptr @a, i64 0, i64 %idxprom, i64 %indvars.iv %3 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %cmp7 = icmp eq i32 %3, 1 br i1 %cmp7, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %arrayidx9 = getelementptr inbounds [101 x i32], ptr @b, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, 0 br i1 %cmp10, label %if.then, label %for.inc if.then: ; preds = %land.lhs.true %5 = trunc i64 %indvars.iv to i32 tail call void @fuka(i32 noundef %5) %.pre = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body, %land.lhs.true, %if.then %6 = phi i32 [ %2, %for.body ], [ %2, %land.lhs.true ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.end.loopexit, !llvm.loop !14 for.end.loopexit: ; preds = %for.inc %.pre25 = load i32, ptr @cnt, align 4, !tbaa !5 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %8 = phi i32 [ %.pre25, %for.end.loopexit ], [ %inc, %entry ] %arrayidx13 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom store i32 %8, ptr %arrayidx13, align 4, !tbaa !5 %inc14 = add nsw i32 %8, 1 store i32 %inc14, ptr @cnt, align 4, !tbaa !5 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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(void) { int n,m,val; long long count=0; scanf("%d %d",&n,&m); if(m%n!=0) { printf("-1\n"); return 0; } val = m/n; while(val%2==0) { count++; val/=2; } while(val%3==0) { count++; val/=3; } if(val==1) printf("%lld\n",count); else printf("-1\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19565/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19565/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !5 %1 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %0, %1 %div = sdiv i32 %0, %1 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %if.end, label %if.then if.then: ; preds = %entry %puts26 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup if.end: ; preds = %entry %2 = and i32 %div, 1 %cmp327 = icmp eq i32 %2, 0 br i1 %cmp327, label %while.body, label %while.cond5.preheader while.cond5.preheader: ; preds = %while.body, %if.end %val.0.lcssa = phi i32 [ %div, %if.end ], [ %div4, %while.body ] %count.0.lcssa = phi i64 [ 0, %if.end ], [ %inc, %while.body ] %rem631 = srem i32 %val.0.lcssa, 3 %cmp732 = icmp eq i32 %rem631, 0 br i1 %cmp732, label %while.body8, label %while.end11 while.body: ; preds = %if.end, %while.body %count.029 = phi i64 [ %inc, %while.body ], [ 0, %if.end ] %val.028 = phi i32 [ %div4, %while.body ], [ %div, %if.end ] %inc = add nuw nsw i64 %count.029, 1 %div4 = sdiv i32 %val.028, 2 %3 = and i32 %div4, 1 %cmp3 = icmp eq i32 %3, 0 br i1 %cmp3, label %while.body, label %while.cond5.preheader, !llvm.loop !9 while.body8: ; preds = %while.cond5.preheader, %while.body8 %count.134 = phi i64 [ %inc9, %while.body8 ], [ %count.0.lcssa, %while.cond5.preheader ] %val.133 = phi i32 [ %div10, %while.body8 ], [ %val.0.lcssa, %while.cond5.preheader ] %inc9 = add nuw nsw i64 %count.134, 1 %div10 = sdiv i32 %val.133, 3 %rem6 = srem i32 %div10, 3 %cmp7 = icmp eq i32 %rem6, 0 br i1 %cmp7, label %while.body8, label %while.end11, !llvm.loop !11 while.end11: ; preds = %while.body8, %while.cond5.preheader %val.1.lcssa = phi i32 [ %val.0.lcssa, %while.cond5.preheader ], [ %div10, %while.body8 ] %count.1.lcssa = phi i64 [ %count.0.lcssa, %while.cond5.preheader ], [ %inc9, %while.body8 ] %cmp12 = icmp eq i32 %val.1.lcssa, 1 br i1 %cmp12, label %if.then13, label %if.else if.then13: ; preds = %while.end11 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %count.1.lcssa) br label %cleanup if.else: ; preds = %while.end11 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup cleanup: ; preds = %if.then13, %if.else, %if.then call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <stdlib.h> int n, m, q; int a[55], b[55], c[55], d[55]; int A[10] = {}; int dfs(int *A, int j) { if (j == n) { int ans = 0; for (int i = 0; i < q; i++) { if (A[b[i]] - A[a[i]] == c[i]) { ans += d[i]; } } return ans; } int max = 0; for (int i = A[j - 1]; i <= m; i++) { A[j] = i; int t = dfs(A, j + 1); max = (max > t) ? max : t; } return max; } int main() { scanf("%d %d %d", &n, &m, &q); for (int i = 0; i < q; i++) { scanf("%d %d %d %d", &a[i], &b[i], &c[i], &d[i]); a[i]--; b[i]--; } A[0] = 1; printf("%d", dfs(A, 1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195693/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195693/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @A = dso_local global [10 x i32] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @q = dso_local global i32 0, align 4 @b = dso_local global [55 x i32] zeroinitializer, align 16 @a = dso_local global [55 x i32] zeroinitializer, align 16 @c = dso_local global [55 x i32] zeroinitializer, align 16 @d = dso_local global [55 x i32] zeroinitializer, align 16 @m = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable define dso_local i32 @dfs(ptr nocapture noundef %A, i32 noundef %j) local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp eq i32 %0, %j br i1 %cmp, label %for.cond.preheader, label %if.end14 for.cond.preheader: ; preds = %entry %1 = load i32, ptr @q, align 4, !tbaa !5 %cmp152 = icmp sgt i32 %1, 0 br i1 %cmp152, label %for.body.preheader, label %return for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %1 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %ans.053 = phi i32 [ 0, %for.body.preheader ], [ %ans.1, %for.inc ] %arrayidx = getelementptr inbounds [55 x i32], ptr @b, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom2 = sext i32 %2 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2 %3 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds [55 x i32], ptr @a, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %idxprom6 = sext i32 %4 to i64 %arrayidx7 = getelementptr inbounds i32, ptr %A, i64 %idxprom6 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %sub = sub nsw i32 %3, %5 %arrayidx9 = getelementptr inbounds [55 x i32], ptr @c, i64 0, i64 %indvars.iv %6 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %sub, %6 br i1 %cmp10, label %if.then11, label %for.inc if.then11: ; preds = %for.body %arrayidx13 = getelementptr inbounds [55 x i32], ptr @d, i64 0, i64 %indvars.iv %7 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %add = add nsw i32 %7, %ans.053 br label %for.inc for.inc: ; preds = %for.body, %if.then11 %ans.1 = phi i32 [ %add, %if.then11 ], [ %ans.053, %for.body ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %return, label %for.body, !llvm.loop !9 if.end14: ; preds = %entry %sub16 = add nsw i32 %j, -1 %idxprom17 = sext i32 %sub16 to i64 %arrayidx18 = getelementptr inbounds i32, ptr %A, i64 %idxprom17 %8 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %9 = load i32, ptr @m, align 4, !tbaa !5 %cmp20.not49 = icmp sgt i32 %8, %9 br i1 %cmp20.not49, label %return, label %for.body22.lr.ph for.body22.lr.ph: ; preds = %if.end14 %idxprom23 = sext i32 %j to i64 %arrayidx24 = getelementptr inbounds i32, ptr %A, i64 %idxprom23 %add25 = add nsw i32 %j, 1 br label %for.body22 for.body22: ; preds = %for.body22.lr.ph, %for.body22 %i15.051 = phi i32 [ %8, %for.body22.lr.ph ], [ %inc28, %for.body22 ] %max.050 = phi i32 [ 0, %for.body22.lr.ph ], [ %cond, %for.body22 ] store i32 %i15.051, ptr %arrayidx24, align 4, !tbaa !5 %call = tail call i32 @dfs(ptr noundef nonnull %A, i32 noundef %add25) %cond = tail call i32 @llvm.smax.i32(i32 %max.050, i32 %call) %inc28 = add nsw i32 %i15.051, 1 %10 = load i32, ptr @m, align 4, !tbaa !5 %cmp20.not.not = icmp slt i32 %i15.051, %10 br i1 %cmp20.not.not, label %for.body22, label %return, !llvm.loop !11 return: ; preds = %for.body22, %for.inc, %if.end14, %for.cond.preheader %retval.0 = phi i32 [ 0, %for.cond.preheader ], [ 0, %if.end14 ], [ %ans.1, %for.inc ], [ %cond, %for.body22 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m, ptr noundef nonnull @q) %0 = load i32, ptr @q, align 4, !tbaa !5 %cmp22 = icmp sgt i32 %0, 0 br i1 %cmp22, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry store i32 1, ptr @A, align 16, !tbaa !5 %call13 = tail call i32 @dfs(ptr noundef nonnull @A, i32 noundef 1) %call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %call13) ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [55 x i32], ptr @a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [55 x i32], ptr @b, i64 0, i64 %indvars.iv %arrayidx4 = getelementptr inbounds [55 x i32], ptr @c, i64 0, i64 %indvars.iv %arrayidx6 = getelementptr inbounds [55 x i32], ptr @d, i64 0, i64 %indvars.iv %call7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx6) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %dec = add nsw i32 %1, -1 store i32 %dec, ptr %arrayidx, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %dec12 = add nsw i32 %2, -1 store i32 %dec12, ptr %arrayidx2, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @q, 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.cond.cleanup, !llvm.loop !12 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> int main(void){ int N; scanf("%d", &N); int p[N+1]; for(int i = 1; i <= N; i++){ scanf("%d", &p[i]); } int c = 0; for(int i = 1; i < N; i++){ if(p[i] == i){ c++; p[i+1] = i; } } if(p[N] == N){ c++; } printf("%d\n", c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195736/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195736/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp.not33 = icmp slt i32 %3, 1 br i1 %cmp.not33, label %for.cond.cleanup5, label %for.body for.cond3.preheader: ; preds = %for.body %cmp435 = icmp sgt i32 %4, 1 br i1 %cmp435, label %for.body6.preheader, label %for.cond.cleanup5 for.body6.preheader: ; preds = %for.cond3.preheader %wide.trip.count = zext i32 %4 to i64 br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %N, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %5 br i1 %cmp.not.not, label %for.body, label %for.cond3.preheader, !llvm.loop !9 for.cond.cleanup5: ; preds = %for.inc14, %entry, %for.cond3.preheader %.lcssa47 = phi i32 [ %4, %for.cond3.preheader ], [ %3, %entry ], [ %4, %for.inc14 ] %c.0.lcssa = phi i32 [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %c.1, %for.inc14 ] %idxprom17 = sext i32 %.lcssa47 to i64 %arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %idxprom17 %6 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %cmp19 = icmp eq i32 %6, %.lcssa47 %inc21 = zext i1 %cmp19 to i32 %spec.select = add nsw i32 %c.0.lcssa, %inc21 %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 for.body6: ; preds = %for.body6.preheader, %for.inc14 %indvars.iv41 = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next42.pre-phi, %for.inc14 ] %c.036 = phi i32 [ 0, %for.body6.preheader ], [ %c.1, %for.inc14 ] %arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv41 %7 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %8 = zext i32 %7 to i64 %cmp9 = icmp eq i64 %indvars.iv41, %8 br i1 %cmp9, label %if.then, label %for.body6.for.inc14_crit_edge for.body6.for.inc14_crit_edge: ; preds = %for.body6 %.pre = add nuw nsw i64 %indvars.iv41, 1 br label %for.inc14 if.then: ; preds = %for.body6 %inc10 = add nsw i32 %c.036, 1 %9 = add nuw nsw i64 %indvars.iv41, 1 %arrayidx13 = getelementptr inbounds i32, ptr %vla, i64 %9 %10 = trunc i64 %indvars.iv41 to i32 store i32 %10, ptr %arrayidx13, align 4, !tbaa !5 br label %for.inc14 for.inc14: ; preds = %for.body6.for.inc14_crit_edge, %if.then %indvars.iv.next42.pre-phi = phi i64 [ %.pre, %for.body6.for.inc14_crit_edge ], [ %9, %if.then ] %c.1 = phi i32 [ %c.036, %for.body6.for.inc14_crit_edge ], [ %inc10, %if.then ] %exitcond.not = icmp eq i64 %indvars.iv.next42.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 declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(){ long long int n,m; scanf("%lld %lld", &n, &m); if(n==m) { printf("0"); return 0; } else if(n<m) { if(m % n == 0) { long long int count = 0; int i; int r = m/n; for(i=2;i<=3;i++) { while(r % i ==0) { count++; r/=i; if(r==1) break; } } if(r==1) printf("%lld", count); else if(r!=1) printf("-1"); } else { printf("-1"); return 0; } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19578/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19578/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca 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 %1 = load i64, ptr %m, align 8, !tbaa !5 %cmp = icmp eq i64 %0, %1 br i1 %cmp, label %if.then, label %if.else if.then: ; preds = %entry %putchar = call i32 @putchar(i32 48) br label %cleanup if.else: ; preds = %entry %cmp2 = icmp slt i64 %0, %1 br i1 %cmp2, label %if.then3, label %cleanup if.then3: ; preds = %if.else %rem = srem i64 %1, %0 %div = sdiv i64 %1, %0 %cmp4 = icmp eq i64 %rem, 0 br i1 %cmp4, label %if.then5, label %if.else27 if.then5: ; preds = %if.then3 %conv = trunc i64 %div to i32 br label %while.cond while.cond: ; preds = %if.then5, %while.body %count.1 = phi i64 [ %inc, %while.body ], [ 0, %if.then5 ] %r.1 = phi i32 [ %div11, %while.body ], [ %conv, %if.then5 ] %2 = and i32 %r.1, 1 %cmp9 = icmp eq i32 %2, 0 br i1 %cmp9, label %while.body, label %while.cond.1.preheader while.body: ; preds = %while.cond %inc = add nuw nsw i64 %count.1, 1 %div11 = sdiv i32 %r.1, 2 %3 = and i32 %r.1, -2 %cmp12 = icmp eq i32 %3, 2 br i1 %cmp12, label %while.cond.1.preheader, label %while.cond, !llvm.loop !9 while.cond.1.preheader: ; preds = %while.cond, %while.body %count.1.1.ph = phi i64 [ %count.1, %while.cond ], [ %inc, %while.body ] %r.1.1.ph = phi i32 [ %r.1, %while.cond ], [ 1, %while.body ] br label %while.cond.1 while.cond.1: ; preds = %while.cond.1.preheader, %while.body.1 %count.1.1 = phi i64 [ %inc.1, %while.body.1 ], [ %count.1.1.ph, %while.cond.1.preheader ] %r.1.1 = phi i32 [ %div11.1, %while.body.1 ], [ %r.1.1.ph, %while.cond.1.preheader ] %rem8.1 = srem i32 %r.1.1, 3 %div11.1 = sdiv i32 %r.1.1, 3 %cmp9.1 = icmp eq i32 %rem8.1, 0 br i1 %cmp9.1, label %while.body.1, label %for.inc.1 while.body.1: ; preds = %while.cond.1 %inc.1 = add nsw i64 %count.1.1, 1 %r.1.1.off = add i32 %r.1.1, -3 %cmp12.1 = icmp ult i32 %r.1.1.off, 3 br i1 %cmp12.1, label %if.then18, label %while.cond.1, !llvm.loop !9 for.inc.1: ; preds = %while.cond.1 %cmp16 = icmp eq i32 %r.1.1, 1 br i1 %cmp16, label %if.then18, label %if.then23 if.then18: ; preds = %while.body.1, %for.inc.1 %count.2.148 = phi i64 [ %count.1.1, %for.inc.1 ], [ %inc.1, %while.body.1 ] %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %count.2.148) br label %cleanup if.then23: ; preds = %for.inc.1 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3) br label %cleanup if.else27: ; preds = %if.then3 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3) br label %cleanup cleanup: ; preds = %if.else, %if.then23, %if.then18, %if.else27, %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 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int a, b, c; scanf("%d %d %d", &a, &b, &c); if(a < b && b < c)printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195822/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195822/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195866/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195866/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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){ if(b<c){ printf("Yes\n"); } else{ printf("No\n"); } } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195909/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195909/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.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<b&&b<c)printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_195952/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_195952/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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)&&(b<c)){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196001/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196001/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 x,y,z; scanf("%d %d %d",&x,&y,&z); if(x<y&&y<z){printf("Yes\n"); } else{printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196045/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196045/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %x = alloca i32, align 4 %y = alloca i32, align 4 %z = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %z) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %z) %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %z, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 %z) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 && b<c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196089/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196089/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b < c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196131/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196131/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b < c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196175/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196175/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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", &a); scanf("%d", &b); scanf("%d", &c); if (a < b && b < c) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196218/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196218/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %call2 = 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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp3 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp3, i1 false %str.3.str = select i1 %or.cond, 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&&b<c) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196261/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196261/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b < c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196304/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196304/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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&&b<c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196355/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196355/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196399/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196399/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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&&b<c){; printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196441/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196441/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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&&a<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196485/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196485/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %0, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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){ if(b<c){ printf("Yes\n"); }else { printf("No\n"); } } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196535/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196535/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.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<b) { if(b<c) { printf("Yes\n"); } else { printf("No\n"); } } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196579/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196579/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.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<b&&b<c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196629/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196629/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b < c){ puts("Yes"); } else{ puts("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196672/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196672/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = 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 && b<c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196715/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196715/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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> #include <stdlib.h> int main(void) { int i,j,k; scanf("%d",&i); scanf("%d",&j); scanf("%d",&k); if(i<j && j<k)printf("Yes\n"); else printf("No\n"); return EXIT_SUCCESS; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196759/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196759/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %i = alloca i32, align 4 %j = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %0 = load i32, ptr %i, align 4, !tbaa !5 %1 = load i32, ptr %j, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %k, align 4 %cmp3 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp3, i1 false %str.3.str = select i1 %or.cond, 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 %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind 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 && b < c ){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196801/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196801/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196845/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196845/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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){ if(b<c){ printf("Yes\n"); }else{ printf("No\n"); } }else{printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_196896/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_196896/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.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 ara[27]; int main() { int n,i,sum=0,count=0; char j; char str[100010]={}; scanf("%d",&n); scanf("%s",str); if(n>26) printf("-1\n"); else { for(i=0; i<n; i++) { j=str[i]-'a'+1; ara[j]++; } for(i=1;i<=26;i++) { sum+=ara[i]; if(ara[i]) count++; } printf("%d",(sum-count)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19699/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19699/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @ara = dso_local local_unnamed_addr global [27 x i32] zeroinitializer, align 16 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %str = alloca [100010 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 100010, ptr nonnull %str) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100010) %str, i8 0, i64 100010, i1 false) %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 %cmp = icmp sgt i32 %0, 26 br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp333 = icmp sgt i32 %0, 0 br i1 %cmp333, label %for.body.preheader, label %for.cond8.preheader for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.cond8.preheader.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end24 for.cond8.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond8.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond8.preheader.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds [100010 x i8], ptr %str, i64 0, i64 %indvars.iv.unr %2 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9 %add.epil = add i8 %2, -96 %idxprom5.epil = sext i8 %add.epil to i64 %arrayidx6.epil = getelementptr inbounds [27 x i32], ptr @ara, i64 0, i64 %idxprom5.epil %3 = load i32, ptr %arrayidx6.epil, align 4, !tbaa !5 %inc.epil = add nsw i32 %3, 1 store i32 %inc.epil, ptr %arrayidx6.epil, align 4, !tbaa !5 br label %for.cond8.preheader for.cond8.preheader: ; preds = %for.body.epil, %for.cond8.preheader.loopexit.unr-lcssa, %for.cond.preheader %4 = load <16 x i32>, ptr getelementptr inbounds ([27 x i32], ptr @ara, i64 0, i64 1), align 4, !tbaa !5 %5 = icmp ne <16 x i32> %4, zeroinitializer %6 = load <8 x i32>, ptr getelementptr inbounds ([27 x i32], ptr @ara, i64 0, i64 17), align 4, !tbaa !5 %7 = icmp ne <8 x i32> %6, zeroinitializer %8 = load i32, ptr getelementptr inbounds ([27 x i32], ptr @ara, i64 0, i64 25), align 4, !tbaa !5 %tobool.not.24 = icmp ne i32 %8, 0 %inc18.24.neg = sext i1 %tobool.not.24 to i32 %9 = load i32, ptr getelementptr inbounds ([27 x i32], ptr @ara, i64 0, i64 26), align 8, !tbaa !5 %tobool.not.25 = icmp ne i32 %9, 0 %inc18.25.neg = sext i1 %tobool.not.25 to i32 %10 = bitcast <16 x i1> %5 to i16 %11 = call i16 @llvm.ctpop.i16(i16 %10), !range !10 %12 = zext i16 %11 to i32 %13 = bitcast <8 x i1> %7 to i8 %14 = call i8 @llvm.ctpop.i8(i8 %13), !range !11 %15 = zext i8 %14 to i32 %16 = call i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %4) %17 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %6) %op.rdx71 = add i32 %16, %17 %op.rdx72 = add i32 %op.rdx71, %inc18.25.neg %op.rdx73 = add i32 %8, %inc18.24.neg %op.rdx75 = add i32 %op.rdx72, %op.rdx73 %18 = add nuw nsw i32 %12, %15 %op.rdx76 = sub i32 %9, %18 %op.rdx77 = add i32 %op.rdx75, %op.rdx76 %call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %op.rdx77) br label %if.end24 for.body: ; preds = %for.body, %for.body.preheader.new %indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %arrayidx = getelementptr inbounds [100010 x i8], ptr %str, i64 0, i64 %indvars.iv %19 = load i8, ptr %arrayidx, align 2, !tbaa !9 %add = add i8 %19, -96 %idxprom5 = sext i8 %add to i64 %arrayidx6 = getelementptr inbounds [27 x i32], ptr @ara, i64 0, i64 %idxprom5 %20 = load i32, ptr %arrayidx6, align 4, !tbaa !5 %inc = add nsw i32 %20, 1 store i32 %inc, ptr %arrayidx6, align 4, !tbaa !5 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds [100010 x i8], ptr %str, i64 0, i64 %indvars.iv.next %21 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %add.1 = add i8 %21, -96 %idxprom5.1 = sext i8 %add.1 to i64 %arrayidx6.1 = getelementptr inbounds [27 x i32], ptr @ara, i64 0, i64 %idxprom5.1 %22 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5 %inc.1 = add nsw i32 %22, 1 store i32 %inc.1, ptr %arrayidx6.1, align 4, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond8.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !12 if.end24: ; preds = %for.cond8.preheader, %if.then call void @llvm.lifetime.end.p0(i64 100010, ptr nonnull %str) #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v16i32(<16 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v8i32(<8 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i16 @llvm.ctpop.i16(i16) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.ctpop.i8(i8) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = !{i16 0, i16 17} !11 = !{i8 0, i8 9} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int a,b,c; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); if(a<b&&b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197031/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197031/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %call2 = 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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp3 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp3, i1 false %str.3.str = select i1 %or.cond, 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&&b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197082/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197082/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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", &a); scanf("%d", &b); scanf("%d", &c); if (a < b && b < c) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197132/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197132/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %call2 = 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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp3 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp3, i1 false %str.3.str = select i1 %or.cond, 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) if (b < c) printf("Yes\n"); else printf("No\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197183/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197183/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.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<b)&&(b<c)) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197226/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197226/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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> #include<string.h> int main(void) { int n,a[26],i,j,sum,count; char s[100000]; while(scanf("%d",&n)!=EOF) { getchar(); memset(a,0,sizeof(a)); for(j=0;j<n;j++) { scanf("%c",&s[j]); a[s[j]-'a'+0]++; } getchar(); sum=0; count=0; for(i=0;i<26;i++) { sum+=a[i]; if(a[i]>1) count+=a[i]-1; } if(sum>26) printf("-1\n"); else { printf("%d\n",count); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19727/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19727/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 @str = private unnamed_addr constant [3 x i8] c"-1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [26 x i32], align 16 %s = alloca [100000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %a) #6 call void @llvm.lifetime.start.p0(i64 100000, ptr nonnull %s) #6 %call49 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not50 = icmp eq i32 %call49, -1 br i1 %cmp.not50, label %while.end, label %while.body.preheader while.body.preheader: ; preds = %entry %arrayidx15.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 8 %arrayidx15.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 12 %arrayidx15.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 13 %arrayidx15.15 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 15 %arrayidx15.16 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 16 %arrayidx15.24 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 24 %arrayidx15.25 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 25 br label %while.body while.body: ; preds = %while.body.preheader, %if.end33 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = call i32 @getc(ptr noundef %0) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %a, i8 0, i64 104, i1 false) %1 = load i32, ptr %n, align 4, !tbaa !9 %cmp244 = icmp sgt i32 %1, 0 br i1 %cmp244, label %for.body, label %for.end for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ] %arrayidx = getelementptr inbounds [100000 x i8], ptr %s, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %2 = load i8, ptr %arrayidx, align 1, !tbaa !11 %conv = sext i8 %2 to i64 %sub = add nsw i64 %conv, -97 %arrayidx7 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %sub %3 = load i32, ptr %arrayidx7, align 4, !tbaa !9 %inc = add nsw i32 %3, 1 store i32 %inc, ptr %arrayidx7, align 4, !tbaa !9 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !9 %5 = sext i32 %4 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp2, label %for.body, label %for.end.loopexit, !llvm.loop !12 for.end.loopexit: ; preds = %for.body %6 = load <8 x i32>, ptr %a, align 16, !tbaa !9 %7 = load <4 x i32>, ptr %arrayidx15.8.phi.trans.insert, align 16, !tbaa !9 %.pre66 = load i32, ptr %arrayidx15.12.phi.trans.insert, align 16, !tbaa !9 %8 = load <2 x i32>, ptr %arrayidx15.13.phi.trans.insert, align 4, !tbaa !9 br label %for.end for.end: ; preds = %for.end.loopexit, %while.body %9 = phi i32 [ %.pre66, %for.end.loopexit ], [ 0, %while.body ] %10 = phi <8 x i32> [ %6, %for.end.loopexit ], [ zeroinitializer, %while.body ] %11 = phi <4 x i32> [ %7, %for.end.loopexit ], [ zeroinitializer, %while.body ] %12 = phi <2 x i32> [ %8, %for.end.loopexit ], [ zeroinitializer, %while.body ] %13 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i43 = call i32 @getc(ptr noundef %13) %14 = extractelement <2 x i32> %12, i64 0 %15 = extractelement <2 x i32> %12, i64 1 %16 = load i32, ptr %arrayidx15.15, align 4, !tbaa !9 %17 = load <8 x i32>, ptr %arrayidx15.16, align 16, !tbaa !9 %18 = shufflevector <8 x i32> %17, <8 x i32> %10, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> %19 = load i32, ptr %arrayidx15.24, align 16, !tbaa !9 %20 = load i32, ptr %arrayidx15.25, align 4, !tbaa !9 %21 = call i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %18) %22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %11) %op.rdx71 = add i32 %21, %22 %op.rdx72 = add i32 %op.rdx71, %14 %op.rdx73 = add i32 %15, %16 %op.rdx74 = add i32 %19, %20 %op.rdx75 = add i32 %op.rdx72, %op.rdx73 %op.rdx76 = add i32 %op.rdx74, %9 %op.rdx77 = add i32 %op.rdx75, %op.rdx76 %cmp28 = icmp sgt i32 %op.rdx77, 26 br i1 %cmp28, label %if.then30, label %if.else if.then30: ; preds = %for.end %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end33 if.else: ; preds = %for.end %cmp19.25 = icmp sgt i32 %20, 1 %sub23.25 = add nsw i32 %20, -1 %add24.25 = select i1 %cmp19.25, i32 %sub23.25, i32 0 %cmp19.24 = icmp sgt i32 %19, 1 %sub23.24 = add nsw i32 %19, -1 %add24.24 = select i1 %cmp19.24, i32 %sub23.24, i32 0 %23 = icmp sgt <8 x i32> %17, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1> %24 = add nsw <8 x i32> %17, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1> %25 = select <8 x i1> %23, <8 x i32> %24, <8 x i32> zeroinitializer %26 = shufflevector <8 x i32> %10, <8 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %27 = shufflevector <4 x i32> %11, <4 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %28 = shufflevector <16 x i32> %26, <16 x i32> %27, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 16, i32 17, i32 18, i32 19, i32 poison, i32 poison, i32 poison, i32 poison> %29 = insertelement <16 x i32> %28, i32 %9, i64 12 %30 = shufflevector <2 x i32> %12, <2 x i32> poison, <16 x i32> <i32 0, i32 1, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison> %31 = shufflevector <16 x i32> %29, <16 x i32> %30, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 16, i32 17, i32 poison> %32 = insertelement <16 x i32> %31, i32 %16, i64 15 %33 = icmp sgt <16 x i32> %32, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1> %34 = add nsw <16 x i32> %32, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1> %35 = select <16 x i1> %33, <16 x i32> %34, <16 x i32> zeroinitializer %36 = call i32 @llvm.vector.reduce.add.v16i32(<16 x i32> %35) %37 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %25) %op.rdx = add i32 %36, %37 %op.rdx69 = add i32 %op.rdx, %add24.24 %op.rdx70 = add i32 %op.rdx69, %add24.25 %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %op.rdx70) br label %if.end33 if.end33: ; preds = %if.else, %if.then30 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %if.end33, %entry call void @llvm.lifetime.end.p0(i64 100000, ptr nonnull %s) #6 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %a) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v16i32(<16 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v8i32(<8 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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 = !{!7, !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13}
#include <stdio.h> int main() { int n, h; scanf("%d", &n); if (n >= 190) { n -= 190; h = (n % 3); n = n / 3 + 100; switch (h) { case 0: n /= 100; break; case 1: n %= 100; n /= 10; break; case 2: n %= 10; break; } } if (n >= 10) { n -= 10; if ((n & 1) == 0) { n = (n>>1) / 10 + 1; } else { n = (n>>1) % 10; } } printf("%d\n", n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19732/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19732/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp sgt i32 %0, 189 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %sub = add nsw i32 %0, -190 %rem = urem i32 %sub, 3 %div = udiv i32 %sub, 3 %add = add nuw nsw i32 %div, 100 switch i32 %rem, label %if.then8 [ i32 0, label %sw.bb i32 1, label %sw.bb2 i32 2, label %sw.bb5 ] sw.bb: ; preds = %if.then %div1 = udiv i32 %add, 100 store i32 %div1, ptr %n, align 4, !tbaa !5 br label %if.end sw.bb2: ; preds = %if.then %rem3 = urem i32 %add, 100 %div4.lhs.trunc = trunc i32 %rem3 to i8 %div423 = udiv i8 %div4.lhs.trunc, 10 %div4.zext = zext i8 %div423 to i32 store i32 %div4.zext, ptr %n, align 4, !tbaa !5 br label %if.end17 sw.bb5: ; preds = %if.then %rem6 = urem i32 %add, 10 store i32 %rem6, ptr %n, align 4, !tbaa !5 br label %if.end17 if.end: ; preds = %sw.bb, %entry %1 = phi i32 [ %div1, %sw.bb ], [ %0, %entry ] %cmp7 = icmp sgt i32 %1, 9 br i1 %cmp7, label %if.then8, label %if.end17 if.then8: ; preds = %if.then, %if.end %2 = phi i32 [ %1, %if.end ], [ %add, %if.then ] %sub9 = add nsw i32 %2, -10 %and = and i32 %2, 1 %cmp10 = icmp eq i32 %and, 0 br i1 %cmp10, label %if.then11, label %if.else if.then11: ; preds = %if.then8 %div12 = udiv i32 %sub9, 20 %add13 = add nuw nsw i32 %div12, 1 store i32 %add13, ptr %n, align 4, !tbaa !5 br label %if.end17 if.else: ; preds = %if.then8 %shr14 = lshr i32 %sub9, 1 %rem15 = urem i32 %shr14, 10 store i32 %rem15, ptr %n, align 4, !tbaa !5 br label %if.end17 if.end17: ; preds = %sw.bb5, %sw.bb2, %if.then11, %if.else, %if.end %3 = phi i32 [ %rem6, %sw.bb5 ], [ %div4.zext, %sw.bb2 ], [ %add13, %if.then11 ], [ %rem15, %if.else ], [ %1, %if.end ] %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %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() { int a, b, c; scanf("%d%d%d", &a, &b, &c); if (a < b && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197370/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197370/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b<c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197413/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197413/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b < c ){ printf( "Yes\n"); } else { printf( "No\n" ); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197457/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197457/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 n,ans,num,c,x1,x2,x3; scanf("%d",&n); if(n>9) { n=n-9; num=9; if(n>180) { n=n-180; num+=90; num+=n/3; //num+=1; c=n%3; if(c!=0) num+=1; x3=num%10; num=num/10; x2=num%10; num=num/10; x1=num%10; num=num/10; if(c==0) ans=x3; else if(c==1) ans=x1; else ans=x2; } else { num+=n/2; c=n%2; if(c!=0) num+=1; x2=num%10; num/=10; x1=num%10; num/=10; if(c==0) ans=x2; else ans=x1; } } else ans=n; printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_19750/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_19750/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp sgt i32 %.fr, 9 br i1 %cmp, label %if.then, label %if.end39 if.then: ; preds = %entry %sub = add nsw i32 %.fr, -9 store i32 %sub, ptr %n, align 4, !tbaa !5 %cmp1 = icmp ugt i32 %.fr, 189 br i1 %cmp1, label %if.then2, label %if.else21 if.then2: ; preds = %if.then %sub3 = add nsw i32 %.fr, -189 store i32 %sub3, ptr %n, align 4, !tbaa !5 %div = udiv i32 %sub3, 3 %rem = urem i32 %sub3, 3 %cmp5.not = icmp eq i32 %rem, 0 %spec.select.v = select i1 %cmp5.not, i32 99, i32 100 %spec.select = add nuw nsw i32 %spec.select.v, %div %div11 = udiv i32 %spec.select, 100 %rem12 = urem i32 %div11, 10 switch i32 %rem, label %if.else18 [ i32 0, label %if.then15 i32 1, label %if.end39 ] if.then15: ; preds = %if.then2 %rem8 = urem i32 %spec.select, 10 br label %if.end39 if.else18: ; preds = %if.then2 %div9 = udiv i32 %spec.select, 10 %rem10 = urem i32 %div9, 10 br label %if.end39 if.else21: ; preds = %if.then %div2261 = lshr i32 %sub, 1 %rem24 = and i32 %sub, 1 %cmp25.not = icmp eq i32 %rem24, 0 %1 = trunc i32 %div2261 to i8 br i1 %cmp25.not, label %if.then34, label %if.else35 if.then34: ; preds = %if.else21 %rem29.lhs.trunc = add nuw nsw i8 %1, 9 %rem2963 = urem i8 %rem29.lhs.trunc, 10 %rem29.zext = zext i8 %rem2963 to i32 br label %if.end39 if.else35: ; preds = %if.else21 %div30.lhs.trunc = add nuw nsw i8 %1, 10 %div3064 = udiv i8 %div30.lhs.trunc, 10 %div30.zext = zext i8 %div3064 to i32 %rem31.urem = add nsw i32 %div30.zext, -10 %rem31.cmp = icmp ult i8 %1, 90 %rem31 = select i1 %rem31.cmp, i32 %div30.zext, i32 %rem31.urem br label %if.end39 if.end39: ; preds = %entry, %if.then2, %if.else18, %if.then15, %if.else35, %if.then34 %ans.0 = phi i32 [ %rem8, %if.then15 ], [ %rem10, %if.else18 ], [ %rem29.zext, %if.then34 ], [ %rem31, %if.else35 ], [ %rem12, %if.then2 ], [ %.fr, %entry ] %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.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 a,b,c; scanf("%d %d %d",&a,&b,&c); if(a < b && b < c) puts("Yes"); else puts("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197543/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197543/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %.str.1..str.2 = select i1 %or.cond, ptr @.str.1, ptr @.str.2 %call3 = 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&&b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197587/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197587/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b<c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197637/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197637/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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); puts(a < b && b < c ? "Yes" : "No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197680/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197680/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %3 = select i1 %cmp, i1 %cmp1, i1 false %cond = select i1 %3, ptr @.str.1, ptr @.str.2 %call2 = 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(){ int a; int b; int c; scanf("%d",&a); scanf("%d",&b); scanf("%d",&c); if(a<b&&b<c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197723/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197723/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %call2 = 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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp3 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp3, i1 false %str.3.str = select i1 %or.cond, 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 && b < c ){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197767/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197767/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197824/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197824/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 argc, char* argv[]) { int a, b, c; scanf("%d %d %d", &a, &b, &c); if(c <= a){ printf("No\n"); }else if(c <= b){ printf("No\n"); }else if(b <= a){ printf("No\n"); }else{ printf("Yes\n"); } return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197875/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197875/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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(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) #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 %c, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %cmp.not = icmp sgt i32 %0, %1 br i1 %cmp.not, label %if.else, label %if.end12 if.else: ; preds = %entry %2 = load i32, ptr %b, align 4, !tbaa !5 %cmp2.not = icmp sgt i32 %0, %2 br i1 %cmp2.not, label %if.else5, label %if.end12 if.else5: ; preds = %if.else %cmp6.not = icmp sgt i32 %2, %1 %str.str.3 = select i1 %cmp6.not, ptr @str, ptr @str.5 br label %if.end12 if.end12: ; preds = %if.else5, %if.else, %entry %str.4.sink = phi ptr [ @str.5, %entry ], [ @str.5, %if.else ], [ %str.str.3, %if.else5 ] %puts16 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.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 < b && b < c) { printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_197969/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_197969/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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&&b<c){ printf("Yes\n"); }else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198018/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198018/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b < c ) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198069/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198069/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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; int b; int c; scanf("%d %d %d",&a,&b,&c); if(a<b&&b<c)printf("Yes\n") ; else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198111/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198111/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198155/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198155/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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> #include <stdlib.h> int main() { int a,b,c; scanf("%d %d %d",&a,&b,&c); if ((a<b) && (b<c)) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198205/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198205/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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> float a, b, c; int main(){ scanf("%d %d %d", &a, &b, &c); if (a < b && b < c && a < c){ printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198249/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198249/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @a = dso_local global float 0.000000e+00, align 4 @b = dso_local global float 0.000000e+00, align 4 @c = dso_local global float 0.000000e+00, align 4 @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: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @a, ptr noundef nonnull @b, ptr noundef nonnull @c) %0 = load float, ptr @a, align 4, !tbaa !5 %1 = load float, ptr @b, align 4, !tbaa !5 %cmp = fcmp olt float %0, %1 br i1 %cmp, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %entry %2 = load float, ptr @c, align 4, !tbaa !5 %cmp1 = fcmp olt float %1, %2 %cmp3 = fcmp olt float %0, %2 %or.cond = and i1 %cmp1, %cmp3 br i1 %or.cond, label %if.end, label %if.else if.else: ; preds = %land.lhs.true, %entry br label %if.end if.end: ; preds = %land.lhs.true, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(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 = { nofree nounwind "no-trapping-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 } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"float", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int a, b, c; scanf("%d %d %d", &a, &b, &c); if(a<b && b<c) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198292/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198292/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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&&b<c){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198379/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198379/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b < c) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198421/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198421/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b<c)printf("Yes\n"); else printf("No\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198465/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198465/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 && b<c) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198508/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198508/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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) { if (b < c){ printf ("Yes\n"); } else { printf ("No\n"); } } else { printf ("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198551/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198551/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %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 %cmp1 = icmp slt i32 %1, %2 %str.4.str.3 = select i1 %cmp1, ptr @str.4, ptr @str.3 %str.4.sink = select i1 %cmp, ptr %str.4.str.3, ptr @str.3 %puts9 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.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; if (scanf("%d%d%d", &a, &b, &c) != 3) return 1; puts(a < b && b < c ? "Yes" : "No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198595/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198595/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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) %cmp.not = icmp eq i32 %call, 3 br i1 %cmp.not, label %if.end, label %cleanup if.end: ; preds = %entry %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4 %cmp1 = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp2 = icmp slt i32 %1, %2 %3 = select i1 %cmp1, i1 %cmp2, i1 false %cond = select i1 %3, ptr @.str.1, ptr @.str.2 %call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond) 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 %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 %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 @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 && b < c) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198638/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198638/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp = icmp slt i32 %0, %1 %2 = load i32, ptr %c, align 4 %cmp1 = icmp slt i32 %1, %2 %or.cond = select i1 %cmp, i1 %cmp1, i1 false %str.3.str = select i1 %or.cond, 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 N,a[3][110],i,j,ans=0,c; scanf("%d",&N); for(i=1;i<=2;i++){ for(j=1;j<=N;j++){ scanf("%d",&a[i][j]); } } for(i=1;i<=N;i++){ c=0; for(j=1;j<=i;j++){ c+=a[1][j]; } for(j=i;j<=N;j++){ c+=a[2][j]; } if(ans<c){ ans=c; } } printf("\n%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198681/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198681/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"\0A%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 [3 x [110 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 1320, ptr nonnull %a) #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 = icmp slt i32 %0, 1 br i1 %1, label %for.end35, label %for.body3 for.cond10.preheader: ; preds = %for.body3.1 %cmp11.not63 = icmp slt i32 %6, 1 br i1 %cmp11.not63, label %for.end35, label %for.cond13.preheader.preheader for.cond13.preheader.preheader: ; preds = %for.cond10.preheader %2 = add i32 %6, 1 %3 = add nuw i32 %6, 2 %wide.trip.count89 = zext i32 %3 to i64 %wide.trip.count82 = zext i32 %2 to i64 br label %for.cond13.preheader for.body3: ; preds = %entry, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 1, %entry ] %arrayidx5 = getelementptr inbounds [3 x [110 x i32]], ptr %a, i64 0, i64 1, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %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.not.not = icmp slt i64 %indvars.iv, %5 br i1 %cmp2.not.not, label %for.body3, label %for.inc7, !llvm.loop !9 for.inc7: ; preds = %for.body3 %cmp2.not55.1 = icmp slt i32 %4, 1 br i1 %cmp2.not55.1, label %for.end35, label %for.body3.1 for.body3.1: ; preds = %for.inc7, %for.body3.1 %indvars.iv.1 = phi i64 [ %indvars.iv.next.1, %for.body3.1 ], [ 1, %for.inc7 ] %arrayidx5.1 = getelementptr inbounds [3 x [110 x i32]], ptr %a, i64 0, i64 2, i64 %indvars.iv.1 %call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1) %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1 %6 = load i32, ptr %N, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp2.not.not.1 = icmp slt i64 %indvars.iv.1, %7 br i1 %cmp2.not.not.1, label %for.body3.1, label %for.cond10.preheader, !llvm.loop !9 for.cond13.preheader: ; preds = %for.cond13.preheader.preheader, %for.end31 %indvar = phi i64 [ 0, %for.cond13.preheader.preheader ], [ %indvar.next, %for.end31 ] %indvars.iv84 = phi i64 [ 2, %for.cond13.preheader.preheader ], [ %indvars.iv.next85, %for.end31 ] %indvars.iv77 = phi i64 [ 1, %for.cond13.preheader.preheader ], [ %indvars.iv.next78, %for.end31 ] %ans.065 = phi i32 [ 0, %for.cond13.preheader.preheader ], [ %spec.select, %for.end31 ] %8 = xor i64 %indvar, -1 %9 = add i64 %8, %wide.trip.count82 %min.iters.check100 = icmp ult i64 %indvars.iv77, 8 br i1 %min.iters.check100, label %for.body15.preheader, label %vector.ph101 vector.ph101: ; preds = %for.cond13.preheader %n.vec103 = and i64 %indvars.iv77, -8 %ind.end104 = or i64 %n.vec103, 1 br label %vector.body107 vector.body107: ; preds = %vector.body107, %vector.ph101 %index108 = phi i64 [ 0, %vector.ph101 ], [ %index.next114, %vector.body107 ] %vec.phi109 = phi <4 x i32> [ zeroinitializer, %vector.ph101 ], [ %12, %vector.body107 ] %vec.phi110 = phi <4 x i32> [ zeroinitializer, %vector.ph101 ], [ %13, %vector.body107 ] %offset.idx111 = or i64 %index108, 1 %10 = getelementptr inbounds [3 x [110 x i32]], ptr %a, i64 0, i64 1, i64 %offset.idx111 %wide.load112 = load <4 x i32>, ptr %10, align 4, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 %wide.load113 = load <4 x i32>, ptr %11, align 4, !tbaa !5 %12 = add <4 x i32> %wide.load112, %vec.phi109 %13 = add <4 x i32> %wide.load113, %vec.phi110 %index.next114 = add nuw i64 %index108, 8 %14 = icmp eq i64 %index.next114, %n.vec103 br i1 %14, label %middle.block98, label %vector.body107, !llvm.loop !11 middle.block98: ; preds = %vector.body107 %bin.rdx115 = add <4 x i32> %13, %12 %15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx115) %cmp.n106 = icmp eq i64 %indvars.iv77, %n.vec103 br i1 %cmp.n106, label %for.body24.preheader, label %for.body15.preheader for.body15.preheader: ; preds = %for.cond13.preheader, %middle.block98 %indvars.iv72.ph = phi i64 [ 1, %for.cond13.preheader ], [ %ind.end104, %middle.block98 ] %c.059.ph = phi i32 [ 0, %for.cond13.preheader ], [ %15, %middle.block98 ] br label %for.body15 for.body15: ; preds = %for.body15.preheader, %for.body15 %indvars.iv72 = phi i64 [ %indvars.iv.next73, %for.body15 ], [ %indvars.iv72.ph, %for.body15.preheader ] %c.059 = phi i32 [ %add, %for.body15 ], [ %c.059.ph, %for.body15.preheader ] %arrayidx18 = getelementptr inbounds [3 x [110 x i32]], ptr %a, i64 0, i64 1, i64 %indvars.iv72 %16 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %add = add nsw i32 %16, %c.059 %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1 %exitcond.not = icmp eq i64 %indvars.iv.next73, %indvars.iv84 br i1 %exitcond.not, label %for.body24.preheader, label %for.body15, !llvm.loop !14 for.body24.preheader: ; preds = %for.body15, %middle.block98 %add.lcssa = phi i32 [ %15, %middle.block98 ], [ %add, %for.body15 ] %min.iters.check = icmp ult i64 %9, 8 br i1 %min.iters.check, label %for.body24.preheader117, label %vector.ph vector.ph: ; preds = %for.body24.preheader %n.vec = and i64 %9, -8 %ind.end = add i64 %indvars.iv77, %n.vec %17 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %add.lcssa, i64 0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %17, %vector.ph ], [ %20, %vector.body ] %vec.phi96 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ] %offset.idx = add i64 %indvars.iv77, %index %18 = getelementptr inbounds [3 x [110 x i32]], ptr %a, i64 0, i64 2, i64 %offset.idx %wide.load = load <4 x i32>, ptr %18, align 4, !tbaa !5 %19 = getelementptr inbounds i32, ptr %18, i64 4 %wide.load97 = load <4 x i32>, ptr %19, align 4, !tbaa !5 %20 = add <4 x i32> %wide.load, %vec.phi %21 = add <4 x i32> %wide.load97, %vec.phi96 %index.next = add nuw i64 %index, 8 %22 = icmp eq i64 %index.next, %n.vec br i1 %22, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %21, %20 %23 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %9, %n.vec br i1 %cmp.n, label %for.end31, label %for.body24.preheader117 for.body24.preheader117: ; preds = %for.body24.preheader, %middle.block %indvars.iv79.ph = phi i64 [ %indvars.iv77, %for.body24.preheader ], [ %ind.end, %middle.block ] %c.162.ph = phi i32 [ %add.lcssa, %for.body24.preheader ], [ %23, %middle.block ] br label %for.body24 for.body24: ; preds = %for.body24.preheader117, %for.body24 %indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.body24 ], [ %indvars.iv79.ph, %for.body24.preheader117 ] %c.162 = phi i32 [ %add28, %for.body24 ], [ %c.162.ph, %for.body24.preheader117 ] %arrayidx27 = getelementptr inbounds [3 x [110 x i32]], ptr %a, i64 0, i64 2, i64 %indvars.iv79 %24 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %add28 = add nsw i32 %24, %c.162 %indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1 %exitcond83.not = icmp eq i64 %indvars.iv.next80, %wide.trip.count82 br i1 %exitcond83.not, label %for.end31, label %for.body24, !llvm.loop !16 for.end31: ; preds = %for.body24, %middle.block %add28.lcssa = phi i32 [ %23, %middle.block ], [ %add28, %for.body24 ] %spec.select = call i32 @llvm.smax.i32(i32 %ans.065, i32 %add28.lcssa) %indvars.iv.next78 = add i64 %indvars.iv77, 1 %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %exitcond90.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count89 %indvar.next = add i64 %indvar, 1 br i1 %exitcond90.not, label %for.end35, label %for.cond13.preheader, !llvm.loop !17 for.end35: ; preds = %for.end31, %entry, %for.inc7, %for.cond10.preheader %ans.0.lcssa = phi i32 [ 0, %for.cond10.preheader ], [ 0, %for.inc7 ], [ 0, %entry ], [ %spec.select, %for.end31 ] %call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 1320, 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 nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !13, !12} !15 = distinct !{!15, !10, !12, !13} !16 = distinct !{!16, !10, !13, !12} !17 = distinct !{!17, !10}
#include<stdio.h> int main(){ int n; scanf("%d",&n); int i,j,k; int a[2][n]; for(i=0;i<2;i++){ for(j=0;j<n;j++){ scanf("%d",&a[i][j]); } } int pt[n],ans; for(i=0;i<n;i++){ pt[i]=0; for(j=0;j<n;j++){ if(j<=i){ pt[i]+=a[0][j]; } if(j>=i){ pt[i]+=a[1][j]; } } } ans=pt[0]; for(i=1;i<n;i++){ if(ans<pt[i]){ ans=pt[i]; } } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198724/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198724/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %3 = shl nuw nsw i64 %1, 1 %vla = alloca i32, i64 %3, align 16 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = icmp sgt i32 %4, 0 call void @llvm.assume(i1 %5) br label %for.body3 for.body3: ; preds = %entry, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %entry ] %arrayidx5 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %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 %cmp2 = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !9 for.inc7: ; preds = %for.body3 %cmp277.1 = icmp sgt i32 %6, 0 call void @llvm.assume(i1 %cmp277.1) %arrayidx.1 = getelementptr inbounds i32, ptr %vla, i64 %1 br label %for.body3.1 for.body3.1: ; preds = %for.body3.1, %for.inc7 %indvars.iv.1 = phi i64 [ 0, %for.inc7 ], [ %indvars.iv.next.1, %for.body3.1 ] %arrayidx5.1 = getelementptr inbounds i32, ptr %arrayidx.1, i64 %indvars.iv.1 %call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1) %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2.1 = icmp slt i64 %indvars.iv.next.1, %9 br i1 %cmp2.1, label %for.body3.1, label %for.end9, !llvm.loop !9 for.end9: ; preds = %for.body3.1 %10 = zext i32 %8 to i64 %vla10 = alloca i32, i64 %10, align 16 %cmp1282 = icmp sgt i32 %8, 0 call void @llvm.assume(i1 %cmp1282) %arrayidx27 = getelementptr inbounds i32, ptr %vla, i64 %1 br label %for.body13.us for.body13.us: ; preds = %for.cond16.for.inc37_crit_edge.us, %for.end9 %indvars.iv95 = phi i64 [ %indvars.iv.next96, %for.cond16.for.inc37_crit_edge.us ], [ 0, %for.end9 ] %arrayidx15.us = getelementptr inbounds i32, ptr %vla10, i64 %indvars.iv95 store i32 0, ptr %arrayidx15.us, align 4, !tbaa !5 br label %for.body18.us for.body18.us: ; preds = %for.body13.us, %for.inc34.us %11 = phi i32 [ 0, %for.body13.us ], [ %15, %for.inc34.us ] %indvars.iv92 = phi i64 [ 0, %for.body13.us ], [ %indvars.iv.next93, %for.inc34.us ] %cmp19.not.us = icmp ugt i64 %indvars.iv92, %indvars.iv95 br i1 %cmp19.not.us, label %if.end.us, label %if.then.us if.then.us: ; preds = %for.body18.us %arrayidx22.us = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv92 %12 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5 %add.us = add nsw i32 %11, %12 store i32 %add.us, ptr %arrayidx15.us, align 4, !tbaa !5 br label %if.end.us if.end.us: ; preds = %if.then.us, %for.body18.us %13 = phi i32 [ %add.us, %if.then.us ], [ %11, %for.body18.us ] %cmp25.not.us = icmp ult i64 %indvars.iv92, %indvars.iv95 br i1 %cmp25.not.us, label %for.inc34.us, label %if.then26.us if.then26.us: ; preds = %if.end.us %arrayidx29.us = getelementptr inbounds i32, ptr %arrayidx27, i64 %indvars.iv92 %14 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %add32.us = add nsw i32 %13, %14 store i32 %add32.us, ptr %arrayidx15.us, align 4, !tbaa !5 br label %for.inc34.us for.inc34.us: ; preds = %if.then26.us, %if.end.us %15 = phi i32 [ %add32.us, %if.then26.us ], [ %13, %if.end.us ] %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1 %exitcond.not = icmp eq i64 %indvars.iv.next93, %10 br i1 %exitcond.not, label %for.cond16.for.inc37_crit_edge.us, label %for.body18.us, !llvm.loop !11 for.cond16.for.inc37_crit_edge.us: ; preds = %for.inc34.us %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1 %exitcond99.not = icmp eq i64 %indvars.iv.next96, %10 br i1 %exitcond99.not, label %for.end39, label %for.body13.us, !llvm.loop !12 for.end39: ; preds = %for.cond16.for.inc37_crit_edge.us %.pre = load i32, ptr %vla10, align 16, !tbaa !5 %cmp4284 = icmp ugt i32 %8, 1 br i1 %cmp4284, label %for.body43.preheader, label %for.end53 for.body43.preheader: ; preds = %for.end39 %16 = add nsw i64 %10, -1 %min.iters.check = icmp ult i32 %8, 9 br i1 %min.iters.check, label %for.body43.preheader116, label %vector.ph vector.ph: ; preds = %for.body43.preheader %n.vec = and i64 %16, -8 %ind.end = or i64 %n.vec, 1 %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %19, %vector.body ] %vec.phi114 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %20, %vector.body ] %offset.idx = or i64 %index, 1 %17 = getelementptr inbounds i32, ptr %vla10, i64 %offset.idx %wide.load = load <4 x i32>, ptr %17, align 4, !tbaa !5 %18 = getelementptr inbounds i32, ptr %17, i64 4 %wide.load115 = load <4 x i32>, ptr %18, align 4, !tbaa !5 %19 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %20 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi114, <4 x i32> %wide.load115) %index.next = add nuw i64 %index, 8 %21 = icmp eq i64 %index.next, %n.vec br i1 %21, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %19, <4 x i32> %20) %22 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %16, %n.vec br i1 %cmp.n, label %for.end53, label %for.body43.preheader116 for.body43.preheader116: ; preds = %for.body43.preheader, %middle.block %indvars.iv100.ph = phi i64 [ 1, %for.body43.preheader ], [ %ind.end, %middle.block ] %ans.086.ph = phi i32 [ %.pre, %for.body43.preheader ], [ %22, %middle.block ] br label %for.body43 for.body43: ; preds = %for.body43.preheader116, %for.body43 %indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.body43 ], [ %indvars.iv100.ph, %for.body43.preheader116 ] %ans.086 = phi i32 [ %spec.select, %for.body43 ], [ %ans.086.ph, %for.body43.preheader116 ] %arrayidx45 = getelementptr inbounds i32, ptr %vla10, i64 %indvars.iv100 %23 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %ans.086, i32 %23) %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1 %exitcond104.not = icmp eq i64 %indvars.iv.next101, %10 br i1 %exitcond104.not, label %for.end53, label %for.body43, !llvm.loop !16 for.end53: ; preds = %for.body43, %middle.block, %for.end39 %ans.0.lcssa = phi i32 [ %.pre, %for.end39 ], [ %22, %middle.block ], [ %spec.select, %for.body43 ] %call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: 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}
#include<stdio.h> int main(void) { int N; scanf("%d", &N); int A[2][N]; for (int i = 0; i < N; i++){ scanf("%d", &A[0][i]); } for (int i = 0; i < N; i++){ scanf("%d", &A[1][i]); } int candy = 0; for (int i = 0; i < N; i++){ int rest1 = 0; int rest2 = 0; for(int j = 0; j <= i; j++){ rest1 += A[0][j]; } for(int j = i; j < N; j++){ rest2 += A[1][j]; } if (candy < rest1 + rest2){ candy = rest1 +rest2; } } printf("%d", candy); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198768/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198768/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %3 = shl nuw nsw i64 %1, 1 %vla = alloca i32, i64 %3, align 16 %4 = load i32, ptr %N, align 4, !tbaa !5 %cmp65 = icmp sgt i32 %4, 0 br i1 %cmp65, label %for.body, label %for.cond.cleanup18 for.cond4.preheader: ; preds = %for.body %cmp567 = icmp sgt i32 %5, 0 br i1 %cmp567, label %for.body7.lr.ph, label %for.cond.cleanup18 for.body7.lr.ph: ; preds = %for.cond4.preheader %arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %1 br label %for.body7 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1) %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.cond4.preheader, !llvm.loop !9 for.cond16.preheader: ; preds = %for.body7 %cmp1775 = icmp sgt i32 %7, 0 br i1 %cmp1775, label %for.cond20.preheader.lr.ph, label %for.cond.cleanup18 for.cond20.preheader.lr.ph: ; preds = %for.cond16.preheader %arrayidx35 = getelementptr inbounds i32, ptr %vla, i64 %1 %wide.trip.count101 = zext i32 %7 to i64 br label %for.cond20.preheader for.body7: ; preds = %for.body7.lr.ph, %for.body7 %indvars.iv81 = phi i64 [ 0, %for.body7.lr.ph ], [ %indvars.iv.next82, %for.body7 ] %arrayidx10 = getelementptr inbounds i32, ptr %arrayidx8, i64 %indvars.iv81 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10) %indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1 %7 = load i32, ptr %N, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp5 = icmp slt i64 %indvars.iv.next82, %8 br i1 %cmp5, label %for.body7, label %for.cond16.preheader, !llvm.loop !11 for.cond20.preheader: ; preds = %for.cond20.preheader.lr.ph, %for.cond.cleanup33 %indvars.iv96 = phi i64 [ 1, %for.cond20.preheader.lr.ph ], [ %indvars.iv.next97, %for.cond.cleanup33 ] %indvars.iv89 = phi i64 [ 0, %for.cond20.preheader.lr.ph ], [ %indvars.iv.next90, %for.cond.cleanup33 ] %candy.076 = phi i32 [ 0, %for.cond20.preheader.lr.ph ], [ %spec.select, %for.cond.cleanup33 ] %9 = sub nsw i64 %wide.trip.count101, %indvars.iv89 %min.iters.check112 = icmp ult i64 %indvars.iv96, 8 br i1 %min.iters.check112, label %for.body23.preheader, label %vector.ph113 vector.ph113: ; preds = %for.cond20.preheader %n.vec115 = and i64 %indvars.iv96, 9223372036854775800 br label %vector.body118 vector.body118: ; preds = %vector.body118, %vector.ph113 %index119 = phi i64 [ 0, %vector.ph113 ], [ %index.next124, %vector.body118 ] %vec.phi120 = phi <4 x i32> [ zeroinitializer, %vector.ph113 ], [ %12, %vector.body118 ] %vec.phi121 = phi <4 x i32> [ zeroinitializer, %vector.ph113 ], [ %13, %vector.body118 ] %10 = getelementptr inbounds i32, ptr %vla, i64 %index119 %wide.load122 = load <4 x i32>, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 %wide.load123 = load <4 x i32>, ptr %11, align 16, !tbaa !5 %12 = add <4 x i32> %wide.load122, %vec.phi120 %13 = add <4 x i32> %wide.load123, %vec.phi121 %index.next124 = add nuw i64 %index119, 8 %14 = icmp eq i64 %index.next124, %n.vec115 br i1 %14, label %middle.block110, label %vector.body118, !llvm.loop !12 middle.block110: ; preds = %vector.body118 %bin.rdx125 = add <4 x i32> %13, %12 %15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx125) %cmp.n117 = icmp eq i64 %indvars.iv96, %n.vec115 br i1 %cmp.n117, label %for.body34.preheader, label %for.body23.preheader for.body23.preheader: ; preds = %for.cond20.preheader, %middle.block110 %indvars.iv84.ph = phi i64 [ 0, %for.cond20.preheader ], [ %n.vec115, %middle.block110 ] %rest1.069.ph = phi i32 [ 0, %for.cond20.preheader ], [ %15, %middle.block110 ] br label %for.body23 for.cond.cleanup18: ; preds = %for.cond.cleanup33, %entry, %for.cond4.preheader, %for.cond16.preheader %candy.0.lcssa = phi i32 [ 0, %for.cond16.preheader ], [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %spec.select, %for.cond.cleanup33 ] %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %candy.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 for.body34.preheader: ; preds = %for.body23, %middle.block110 %add.lcssa = phi i32 [ %15, %middle.block110 ], [ %add, %for.body23 ] %min.iters.check = icmp ult i64 %9, 8 br i1 %min.iters.check, label %for.body34.preheader127, label %vector.ph vector.ph: ; preds = %for.body34.preheader %n.vec = and i64 %9, -8 %ind.end = add i64 %indvars.iv89, %n.vec %16 = getelementptr i32, ptr %arrayidx35, i64 %indvars.iv89 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ] %vec.phi108 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ] %17 = getelementptr i32, ptr %16, i64 %index %wide.load = load <4 x i32>, ptr %17, align 4, !tbaa !5 %18 = getelementptr inbounds i32, ptr %17, i64 4 %wide.load109 = load <4 x i32>, ptr %18, align 4, !tbaa !5 %19 = add <4 x i32> %wide.load, %vec.phi %20 = add <4 x i32> %wide.load109, %vec.phi108 %index.next = add nuw i64 %index, 8 %21 = icmp eq i64 %index.next, %n.vec br i1 %21, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %20, %19 %22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %9, %n.vec br i1 %cmp.n, label %for.cond.cleanup33, label %for.body34.preheader127 for.body34.preheader127: ; preds = %for.body34.preheader, %middle.block %indvars.iv91.ph = phi i64 [ %indvars.iv89, %for.body34.preheader ], [ %ind.end, %middle.block ] %rest2.072.ph = phi i32 [ 0, %for.body34.preheader ], [ %22, %middle.block ] br label %for.body34 for.body23: ; preds = %for.body23.preheader, %for.body23 %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.body23 ], [ %indvars.iv84.ph, %for.body23.preheader ] %rest1.069 = phi i32 [ %add, %for.body23 ], [ %rest1.069.ph, %for.body23.preheader ] %arrayidx26 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv84 %23 = load i32, ptr %arrayidx26, align 4, !tbaa !5 %add = add nsw i32 %23, %rest1.069 %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %exitcond.not = icmp eq i64 %indvars.iv.next85, %indvars.iv96 br i1 %exitcond.not, label %for.body34.preheader, label %for.body23, !llvm.loop !16 for.cond.cleanup33: ; preds = %for.body34, %middle.block %add38.lcssa = phi i32 [ %22, %middle.block ], [ %add38, %for.body34 ] %add42 = add nsw i32 %add38.lcssa, %add.lcssa %spec.select = call i32 @llvm.smax.i32(i32 %candy.076, i32 %add42) %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1 %indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1 %exitcond102.not = icmp eq i64 %indvars.iv.next90, %wide.trip.count101 br i1 %exitcond102.not, label %for.cond.cleanup18, label %for.cond20.preheader, !llvm.loop !17 for.body34: ; preds = %for.body34.preheader127, %for.body34 %indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.body34 ], [ %indvars.iv91.ph, %for.body34.preheader127 ] %rest2.072 = phi i32 [ %add38, %for.body34 ], [ %rest2.072.ph, %for.body34.preheader127 ] %arrayidx37 = getelementptr inbounds i32, ptr %arrayidx35, i64 %indvars.iv91 %24 = load i32, ptr %arrayidx37, align 4, !tbaa !5 %add38 = add nsw i32 %24, %rest2.072 %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 %exitcond95.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count101 br i1 %exitcond95.not, label %for.cond.cleanup33, label %for.body34, !llvm.loop !18 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !13, !14} !16 = distinct !{!16, !10, !14, !13} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !14, !13}
#include <stdio.h> #include <stdlib.h> #define lli long long int typedef enum{ false, true }Boolean; Boolean canBreak(lli N, lli A, lli B, lli *h, lli k){ lli i, dec = k * B, rem = 0; for(i = 0; i < N; i++){ if(h[i] > dec){ rem += 1 + (h[i] - dec - 1) / (A - B); } } if(rem <= k){ return true; } else{ return false; } } int main(){ lli N, A, B, i, j, k; scanf("%lld%lld%lld", &N, &A, &B); lli *h = (lli *)malloc(sizeof(lli) * N); lli hmax = 0; for(i = 0; i < N; i++){ scanf("%lld", &h[i]); if(h[i] > hmax){ hmax = h[i]; } } //printf("test: hmax = %lld\n", hmax); for(j = 1; j <= hmax; j *= 2){} //printf("test: j = %lld\n", j); for(k = 0; j > 0; ){ j /= 2; //printf("test: k = %lld\n", k); if(canBreak(N, A, B, h, k) == true){ //printf("true\n"); k -= j; } else{ //printf("false\n"); k += j; } } if(canBreak(N, A, B, h, k) == true){ printf("%lld\n", k); } else{ printf("%lld\n", k + 1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198810/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198810/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @canBreak(i64 noundef %N, i64 noundef %A, i64 noundef %B, ptr nocapture noundef readonly %h, i64 noundef %k) local_unnamed_addr #0 { entry: %mul = mul nsw i64 %k, %B %cmp18 = icmp sgt i64 %N, 0 br i1 %cmp18, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %0 = xor i64 %mul, -1 %sub4 = sub nsw i64 %A, %B %xtraiter = and i64 %N, 1 %1 = icmp eq i64 %N, 1 br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %N, -2 br label %for.body for.body: ; preds = %for.inc.1, %for.body.lr.ph.new %rem.020 = phi i64 [ 0, %for.body.lr.ph.new ], [ %rem.1.1, %for.inc.1 ] %i.019 = phi i64 [ 0, %for.body.lr.ph.new ], [ %inc.1, %for.inc.1 ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.inc.1 ] %arrayidx = getelementptr inbounds i64, ptr %h, i64 %i.019 %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %cmp1 = icmp sgt i64 %2, %mul br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %for.body %sub3 = add i64 %2, %0 %div = sdiv i64 %sub3, %sub4 %add = add i64 %rem.020, 1 %add5 = add i64 %add, %div br label %for.inc for.inc: ; preds = %for.body, %if.then %rem.1 = phi i64 [ %add5, %if.then ], [ %rem.020, %for.body ] %inc = or i64 %i.019, 1 %arrayidx.1 = getelementptr inbounds i64, ptr %h, i64 %inc %3 = load i64, ptr %arrayidx.1, align 8, !tbaa !5 %cmp1.1 = icmp sgt i64 %3, %mul br i1 %cmp1.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %sub3.1 = add i64 %3, %0 %div.1 = sdiv i64 %sub3.1, %sub4 %add.1 = add i64 %rem.1, 1 %add5.1 = add i64 %add.1, %div.1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %rem.1.1 = phi i64 [ %add5.1, %if.then.1 ], [ %rem.1, %for.inc ] %inc.1 = add nuw nsw i64 %i.019, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9 for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.lr.ph %rem.1.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %rem.1.1, %for.inc.1 ] %rem.020.unr = phi i64 [ 0, %for.body.lr.ph ], [ %rem.1.1, %for.inc.1 ] %i.019.unr = phi i64 [ 0, %for.body.lr.ph ], [ %inc.1, %for.inc.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %arrayidx.epil = getelementptr inbounds i64, ptr %h, i64 %i.019.unr %4 = load i64, ptr %arrayidx.epil, align 8, !tbaa !5 %cmp1.epil = icmp sgt i64 %4, %mul br i1 %cmp1.epil, label %if.then.epil, label %for.end if.then.epil: ; preds = %for.body.epil %sub3.epil = add i64 %4, %0 %div.epil = sdiv i64 %sub3.epil, %sub4 %add.epil = add i64 %rem.020.unr, 1 %add5.epil = add i64 %add.epil, %div.epil br label %for.end for.end: ; preds = %for.end.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %entry %rem.0.lcssa = phi i64 [ 0, %entry ], [ %rem.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add5.epil, %if.then.epil ], [ %rem.020.unr, %for.body.epil ] %cmp6.not = icmp sle i64 %rem.0.lcssa, %k %. = zext i1 %cmp6.not to i32 ret i32 %. } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %N = alloca i64, align 8 %A = alloca i64, align 8 %B = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #6 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %A, ptr noundef nonnull %B) %0 = load i64, ptr %N, align 8, !tbaa !5 %mul = shl i64 %0, 3 %call1 = call noalias ptr @malloc(i64 noundef %mul) #7 %cmp70 = icmp sgt i64 %0, 0 br i1 %cmp70, label %for.body, label %for.cond6.preheader for.cond6.preheader: ; preds = %for.body, %entry %.lcssa = phi i64 [ %0, %entry ], [ %.pr, %for.body ] %hmax.0.lcssa = phi i64 [ 0, %entry ], [ %spec.select, %for.body ] br label %for.cond6 for.body: ; preds = %entry, %for.body %hmax.072 = phi i64 [ %spec.select, %for.body ], [ 0, %entry ] %i.071 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %call1, i64 %i.071 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %arrayidx) %1 = load i64, ptr %arrayidx, align 8, !tbaa !5 %spec.select = call i64 @llvm.smax.i64(i64 %1, i64 %hmax.072) %inc = add nuw nsw i64 %i.071, 1 %.pr = load i64, ptr %N, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %.pr br i1 %cmp, label %for.body, label %for.cond6.preheader, !llvm.loop !11 for.cond6: ; preds = %for.cond6, %for.cond6.preheader %j.0 = phi i64 [ %mul10, %for.cond6 ], [ 1, %for.cond6.preheader ] %cmp7.not = icmp sgt i64 %j.0, %hmax.0.lcssa %mul10 = shl nsw i64 %j.0, 1 br i1 %cmp7.not, label %for.cond12.preheader, label %for.cond6, !llvm.loop !12 for.cond12.preheader: ; preds = %for.cond6 %2 = load i64, ptr %B, align 8, !tbaa !5 %cmp18.i = icmp sgt i64 %.lcssa, 0 %3 = load i64, ptr %A, align 8 %sub4.i = sub nsw i64 %3, %2 br i1 %cmp18.i, label %for.body14.us.preheader, label %for.body14 for.body14.us.preheader: ; preds = %for.cond12.preheader %xtraiter = and i64 %.lcssa, 1 %4 = icmp eq i64 %.lcssa, 1 %unroll_iter = and i64 %.lcssa, -2 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.body14.us for.body14.us: ; preds = %for.body14.us.preheader, %canBreak.exit.loopexit.us %k.075.us = phi i64 [ %k.1.us, %canBreak.exit.loopexit.us ], [ 0, %for.body14.us.preheader ] %j.174.us = phi i64 [ %div47.us, %canBreak.exit.loopexit.us ], [ %j.0, %for.body14.us.preheader ] %mul.i.us = mul nsw i64 %2, %k.075.us %5 = xor i64 %mul.i.us, -1 br i1 %4, label %canBreak.exit.loopexit.us.unr-lcssa, label %for.body.i.us for.body.i.us: ; preds = %for.body14.us, %for.inc.i.us.1 %rem.020.i.us = phi i64 [ %rem.1.i.us.1, %for.inc.i.us.1 ], [ 0, %for.body14.us ] %i.019.i.us = phi i64 [ %inc.i.us.1, %for.inc.i.us.1 ], [ 0, %for.body14.us ] %niter = phi i64 [ %niter.next.1, %for.inc.i.us.1 ], [ 0, %for.body14.us ] %arrayidx.i.us = getelementptr inbounds i64, ptr %call1, i64 %i.019.i.us %6 = load i64, ptr %arrayidx.i.us, align 8, !tbaa !5 %cmp1.i.us = icmp sgt i64 %6, %mul.i.us br i1 %cmp1.i.us, label %if.then.i.us, label %for.inc.i.us if.then.i.us: ; preds = %for.body.i.us %sub3.i.us = add i64 %6, %5 %div.i.us = sdiv i64 %sub3.i.us, %sub4.i %add.i.us = add i64 %rem.020.i.us, 1 %add5.i.us = add i64 %add.i.us, %div.i.us br label %for.inc.i.us for.inc.i.us: ; preds = %if.then.i.us, %for.body.i.us %rem.1.i.us = phi i64 [ %add5.i.us, %if.then.i.us ], [ %rem.020.i.us, %for.body.i.us ] %inc.i.us = or i64 %i.019.i.us, 1 %arrayidx.i.us.1 = getelementptr inbounds i64, ptr %call1, i64 %inc.i.us %7 = load i64, ptr %arrayidx.i.us.1, align 8, !tbaa !5 %cmp1.i.us.1 = icmp sgt i64 %7, %mul.i.us br i1 %cmp1.i.us.1, label %if.then.i.us.1, label %for.inc.i.us.1 if.then.i.us.1: ; preds = %for.inc.i.us %sub3.i.us.1 = add i64 %7, %5 %div.i.us.1 = sdiv i64 %sub3.i.us.1, %sub4.i %add.i.us.1 = add i64 %rem.1.i.us, 1 %add5.i.us.1 = add i64 %add.i.us.1, %div.i.us.1 br label %for.inc.i.us.1 for.inc.i.us.1: ; preds = %if.then.i.us.1, %for.inc.i.us %rem.1.i.us.1 = phi i64 [ %add5.i.us.1, %if.then.i.us.1 ], [ %rem.1.i.us, %for.inc.i.us ] %inc.i.us.1 = add nuw nsw i64 %i.019.i.us, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %canBreak.exit.loopexit.us.unr-lcssa, label %for.body.i.us, !llvm.loop !9 canBreak.exit.loopexit.us.unr-lcssa: ; preds = %for.inc.i.us.1, %for.body14.us %rem.1.i.us.lcssa.ph = phi i64 [ undef, %for.body14.us ], [ %rem.1.i.us.1, %for.inc.i.us.1 ] %rem.020.i.us.unr = phi i64 [ 0, %for.body14.us ], [ %rem.1.i.us.1, %for.inc.i.us.1 ] %i.019.i.us.unr = phi i64 [ 0, %for.body14.us ], [ %inc.i.us.1, %for.inc.i.us.1 ] br i1 %lcmp.mod.not, label %canBreak.exit.loopexit.us, label %for.body.i.us.epil for.body.i.us.epil: ; preds = %canBreak.exit.loopexit.us.unr-lcssa %arrayidx.i.us.epil = getelementptr inbounds i64, ptr %call1, i64 %i.019.i.us.unr %8 = load i64, ptr %arrayidx.i.us.epil, align 8, !tbaa !5 %cmp1.i.us.epil = icmp sgt i64 %8, %mul.i.us br i1 %cmp1.i.us.epil, label %if.then.i.us.epil, label %canBreak.exit.loopexit.us if.then.i.us.epil: ; preds = %for.body.i.us.epil %sub3.i.us.epil = add i64 %8, %5 %div.i.us.epil = sdiv i64 %sub3.i.us.epil, %sub4.i %add.i.us.epil = add i64 %rem.020.i.us.unr, 1 %add5.i.us.epil = add i64 %add.i.us.epil, %div.i.us.epil br label %canBreak.exit.loopexit.us canBreak.exit.loopexit.us: ; preds = %for.body.i.us.epil, %if.then.i.us.epil, %canBreak.exit.loopexit.us.unr-lcssa %rem.1.i.us.lcssa = phi i64 [ %rem.1.i.us.lcssa.ph, %canBreak.exit.loopexit.us.unr-lcssa ], [ %add5.i.us.epil, %if.then.i.us.epil ], [ %rem.020.i.us.unr, %for.body.i.us.epil ] %div47.us = lshr i64 %j.174.us, 1 %cmp6.not.i.not.us = icmp sgt i64 %rem.1.i.us.lcssa, %k.075.us %9 = sub nsw i64 0, %div47.us %k.1.p.us = select i1 %cmp6.not.i.not.us, i64 %div47.us, i64 %9 %k.1.us = add i64 %k.1.p.us, %k.075.us %cmp13.not.us = icmp ult i64 %j.174.us, 2 br i1 %cmp13.not.us, label %for.end19, label %for.body14.us, !llvm.loop !13 for.body14: ; preds = %for.cond12.preheader, %for.body14 %k.075 = phi i64 [ %k.1, %for.body14 ], [ 0, %for.cond12.preheader ] %j.174 = phi i64 [ %div47, %for.body14 ], [ %j.0, %for.cond12.preheader ] %div47 = lshr i64 %j.174, 1 %cmp6.not.i.not = icmp slt i64 %k.075, 0 %10 = sub nsw i64 0, %div47 %k.1.p = select i1 %cmp6.not.i.not, i64 %div47, i64 %10 %k.1 = add i64 %k.1.p, %k.075 %cmp13.not = icmp ult i64 %j.174, 2 br i1 %cmp13.not, label %for.end19, label %for.body14, !llvm.loop !13 for.end19: ; preds = %for.body14, %canBreak.exit.loopexit.us %.us-phi = phi i64 [ %k.1.us, %canBreak.exit.loopexit.us ], [ %k.1, %for.body14 ] %mul.i48 = mul nsw i64 %2, %.us-phi br i1 %cmp18.i, label %for.body.lr.ph.i53, label %canBreak.exit69 for.body.lr.ph.i53: ; preds = %for.end19 %11 = xor i64 %mul.i48, -1 %xtraiter81 = and i64 %.lcssa, 1 %12 = icmp eq i64 %.lcssa, 1 br i1 %12, label %canBreak.exit69.loopexit.unr-lcssa, label %for.body.lr.ph.i53.new for.body.lr.ph.i53.new: ; preds = %for.body.lr.ph.i53 %unroll_iter84 = and i64 %.lcssa, -2 br label %for.body.i55 for.body.i55: ; preds = %for.inc.i60.1, %for.body.lr.ph.i53.new %rem.020.i56 = phi i64 [ 0, %for.body.lr.ph.i53.new ], [ %rem.1.i61.1, %for.inc.i60.1 ] %i.019.i57 = phi i64 [ 0, %for.body.lr.ph.i53.new ], [ %inc.i62.1, %for.inc.i60.1 ] %niter85 = phi i64 [ 0, %for.body.lr.ph.i53.new ], [ %niter85.next.1, %for.inc.i60.1 ] %arrayidx.i58 = getelementptr inbounds i64, ptr %call1, i64 %i.019.i57 %13 = load i64, ptr %arrayidx.i58, align 8, !tbaa !5 %cmp1.i59 = icmp sgt i64 %13, %mul.i48 br i1 %cmp1.i59, label %if.then.i64, label %for.inc.i60 if.then.i64: ; preds = %for.body.i55 %sub3.i65 = add i64 %13, %11 %div.i66 = sdiv i64 %sub3.i65, %sub4.i %add.i67 = add i64 %rem.020.i56, 1 %add5.i68 = add i64 %add.i67, %div.i66 br label %for.inc.i60 for.inc.i60: ; preds = %if.then.i64, %for.body.i55 %rem.1.i61 = phi i64 [ %add5.i68, %if.then.i64 ], [ %rem.020.i56, %for.body.i55 ] %inc.i62 = or i64 %i.019.i57, 1 %arrayidx.i58.1 = getelementptr inbounds i64, ptr %call1, i64 %inc.i62 %14 = load i64, ptr %arrayidx.i58.1, align 8, !tbaa !5 %cmp1.i59.1 = icmp sgt i64 %14, %mul.i48 br i1 %cmp1.i59.1, label %if.then.i64.1, label %for.inc.i60.1 if.then.i64.1: ; preds = %for.inc.i60 %sub3.i65.1 = add i64 %14, %11 %div.i66.1 = sdiv i64 %sub3.i65.1, %sub4.i %add.i67.1 = add i64 %rem.1.i61, 1 %add5.i68.1 = add i64 %add.i67.1, %div.i66.1 br label %for.inc.i60.1 for.inc.i60.1: ; preds = %if.then.i64.1, %for.inc.i60 %rem.1.i61.1 = phi i64 [ %add5.i68.1, %if.then.i64.1 ], [ %rem.1.i61, %for.inc.i60 ] %inc.i62.1 = add nuw nsw i64 %i.019.i57, 2 %niter85.next.1 = add i64 %niter85, 2 %niter85.ncmp.1 = icmp eq i64 %niter85.next.1, %unroll_iter84 br i1 %niter85.ncmp.1, label %canBreak.exit69.loopexit.unr-lcssa, label %for.body.i55, !llvm.loop !9 canBreak.exit69.loopexit.unr-lcssa: ; preds = %for.inc.i60.1, %for.body.lr.ph.i53 %rem.1.i61.lcssa.ph = phi i64 [ undef, %for.body.lr.ph.i53 ], [ %rem.1.i61.1, %for.inc.i60.1 ] %rem.020.i56.unr = phi i64 [ 0, %for.body.lr.ph.i53 ], [ %rem.1.i61.1, %for.inc.i60.1 ] %i.019.i57.unr = phi i64 [ 0, %for.body.lr.ph.i53 ], [ %inc.i62.1, %for.inc.i60.1 ] %lcmp.mod82.not = icmp eq i64 %xtraiter81, 0 br i1 %lcmp.mod82.not, label %canBreak.exit69, label %for.body.i55.epil for.body.i55.epil: ; preds = %canBreak.exit69.loopexit.unr-lcssa %arrayidx.i58.epil = getelementptr inbounds i64, ptr %call1, i64 %i.019.i57.unr %15 = load i64, ptr %arrayidx.i58.epil, align 8, !tbaa !5 %cmp1.i59.epil = icmp sgt i64 %15, %mul.i48 br i1 %cmp1.i59.epil, label %if.then.i64.epil, label %canBreak.exit69 if.then.i64.epil: ; preds = %for.body.i55.epil %sub3.i65.epil = add i64 %15, %11 %div.i66.epil = sdiv i64 %sub3.i65.epil, %sub4.i %add.i67.epil = add i64 %rem.020.i56.unr, 1 %add5.i68.epil = add i64 %add.i67.epil, %div.i66.epil br label %canBreak.exit69 canBreak.exit69: ; preds = %canBreak.exit69.loopexit.unr-lcssa, %if.then.i64.epil, %for.body.i55.epil, %for.end19 %rem.0.lcssa.i50 = phi i64 [ 0, %for.end19 ], [ %rem.1.i61.lcssa.ph, %canBreak.exit69.loopexit.unr-lcssa ], [ %add5.i68.epil, %if.then.i64.epil ], [ %rem.020.i56.unr, %for.body.i55.epil ] %cmp6.not.i51.not = icmp sgt i64 %rem.0.lcssa.i50, %.us-phi %add25 = zext i1 %cmp6.not.i51.not to i64 %add25.sink = add nsw i64 %.us-phi, %add25 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add25.sink) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #6 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #6 call void @llvm.lifetime.end.p0(i64 8, 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: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #5 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> #include <string.h> typedef struct mobile { int ll; int lr; int il; int ir; int w; } mb; mb a[101]; int gcd(int a,int b) { int r = a % b; if (r == 0) return b; return gcd(b,r); } int lcm(int a,int b) { int g = a > b ? gcd(a,b) : gcd(b,a); return a / g * b; } int weight(int i) { mb *p = &a[i]; int lw,rw,g; if (i == 0) return 1; if (p->w != 0) return p->w; lw = weight(p->il); rw = weight(p->ir); lw /= (lw > p->lr) ? gcd(lw,p->lr) : gcd(p->lr,lw); rw /= (rw > p->ll) ? gcd(rw,p->ll) : gcd(p->ll,rw); p->w = (p->ll + p->lr) * lcm(lw,rw); return p->w; } int main() { int n,i,j,w,mw; for(;;){ scanf("%d",&n); if(n == 0) break; memset(a,0,sizeof(a)); for(i=1;i<=n;i++){ scanf("%d%d%d%d",&a[i].ll,&a[i].lr,&a[i].il,&a[i].ir); j = a[i].ll > a[i].lr ? gcd(a[i].ll,a[i].lr) : gcd(a[i].lr,a[i].ll); if(j != 0){ a[i].ll /= j; a[i].lr /= j; } } mw = 0; for(i=1;i<=n;i++){ w = weight(i); if(mw<w) mw = w; } printf("%d\n",mw); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198854/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198854/source.c" target datalayout = "e-m:e-p270: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.mobile = type { i32, i32, i32, i32, i32 } @a = dso_local global [101 x %struct.mobile] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse, %entry %a.tr = phi i32 [ %a, %entry ], [ %b.tr, %tailrecurse ] %b.tr = phi i32 [ %b, %entry ], [ %rem, %tailrecurse ] %rem = srem i32 %a.tr, %b.tr %cmp = icmp eq i32 %rem, 0 br i1 %cmp, label %cleanup, label %tailrecurse cleanup: ; preds = %tailrecurse ret i32 %b.tr } ; 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 norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp = icmp sgt i32 %a, %b br i1 %cmp, label %tailrecurse.i, label %tailrecurse.i8 tailrecurse.i: ; preds = %entry, %tailrecurse.i %a.tr.i = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %a, %entry ] %b.tr.i = phi i32 [ %rem.i, %tailrecurse.i ], [ %b, %entry ] %rem.i = srem i32 %a.tr.i, %b.tr.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %cond.end, label %tailrecurse.i tailrecurse.i8: ; preds = %entry, %tailrecurse.i8 %a.tr.i9 = phi i32 [ %b.tr.i10, %tailrecurse.i8 ], [ %b, %entry ] %b.tr.i10 = phi i32 [ %rem.i11, %tailrecurse.i8 ], [ %a, %entry ] %rem.i11 = srem i32 %a.tr.i9, %b.tr.i10 %cmp.i12 = icmp eq i32 %rem.i11, 0 br i1 %cmp.i12, label %cond.end, label %tailrecurse.i8 cond.end: ; preds = %tailrecurse.i8, %tailrecurse.i %cond = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %b.tr.i10, %tailrecurse.i8 ] %div = sdiv i32 %a, %cond %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @weight(i32 noundef %i) local_unnamed_addr #2 { entry: %idxprom = sext i32 %i to i64 %arrayidx = getelementptr inbounds [101 x %struct.mobile], ptr @a, i64 0, i64 %idxprom %cmp = icmp eq i32 %i, 0 br i1 %cmp, label %cleanup, label %if.end if.end: ; preds = %entry %w = getelementptr inbounds [101 x %struct.mobile], ptr @a, i64 0, i64 %idxprom, i32 4 %0 = load i32, ptr %w, align 4, !tbaa !5 %cmp1.not = icmp eq i32 %0, 0 br i1 %cmp1.not, label %if.end4, label %cleanup if.end4: ; preds = %if.end %il = getelementptr inbounds [101 x %struct.mobile], ptr @a, i64 0, i64 %idxprom, i32 2 %1 = load i32, ptr %il, align 4, !tbaa !10 %call = tail call i32 @weight(i32 noundef %1) %ir = getelementptr inbounds [101 x %struct.mobile], ptr @a, i64 0, i64 %idxprom, i32 3 %2 = load i32, ptr %ir, align 4, !tbaa !11 %call5 = tail call i32 @weight(i32 noundef %2) %lr = getelementptr inbounds [101 x %struct.mobile], ptr @a, i64 0, i64 %idxprom, i32 1 %3 = load i32, ptr %lr, align 4, !tbaa !12 %cmp6 = icmp sgt i32 %call, %3 br i1 %cmp6, label %tailrecurse.i, label %tailrecurse.i54 tailrecurse.i: ; preds = %if.end4, %tailrecurse.i %a.tr.i = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %call, %if.end4 ] %b.tr.i = phi i32 [ %rem.i, %tailrecurse.i ], [ %3, %if.end4 ] %rem.i = srem i32 %a.tr.i, %b.tr.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %cond.end, label %tailrecurse.i tailrecurse.i54: ; preds = %if.end4, %tailrecurse.i54 %a.tr.i55 = phi i32 [ %b.tr.i56, %tailrecurse.i54 ], [ %3, %if.end4 ] %b.tr.i56 = phi i32 [ %rem.i57, %tailrecurse.i54 ], [ %call, %if.end4 ] %rem.i57 = srem i32 %a.tr.i55, %b.tr.i56 %cmp.i58 = icmp eq i32 %rem.i57, 0 br i1 %cmp.i58, label %cond.end, label %tailrecurse.i54 cond.end: ; preds = %tailrecurse.i54, %tailrecurse.i %cond = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %b.tr.i56, %tailrecurse.i54 ] %div = sdiv i32 %call, %cond %4 = load i32, ptr %arrayidx, align 4, !tbaa !13 %cmp11 = icmp sgt i32 %call5, %4 br i1 %cmp11, label %tailrecurse.i60, label %tailrecurse.i66 tailrecurse.i60: ; preds = %cond.end, %tailrecurse.i60 %a.tr.i61 = phi i32 [ %b.tr.i62, %tailrecurse.i60 ], [ %call5, %cond.end ] %b.tr.i62 = phi i32 [ %rem.i63, %tailrecurse.i60 ], [ %4, %cond.end ] %rem.i63 = srem i32 %a.tr.i61, %b.tr.i62 %cmp.i64 = icmp eq i32 %rem.i63, 0 br i1 %cmp.i64, label %cond.end18, label %tailrecurse.i60 tailrecurse.i66: ; preds = %cond.end, %tailrecurse.i66 %a.tr.i67 = phi i32 [ %b.tr.i68, %tailrecurse.i66 ], [ %4, %cond.end ] %b.tr.i68 = phi i32 [ %rem.i69, %tailrecurse.i66 ], [ %call5, %cond.end ] %rem.i69 = srem i32 %a.tr.i67, %b.tr.i68 %cmp.i70 = icmp eq i32 %rem.i69, 0 br i1 %cmp.i70, label %cond.end18, label %tailrecurse.i66 cond.end18: ; preds = %tailrecurse.i66, %tailrecurse.i60 %cond19 = phi i32 [ %b.tr.i62, %tailrecurse.i60 ], [ %b.tr.i68, %tailrecurse.i66 ] %div20 = sdiv i32 %call5, %cond19 %add = add nsw i32 %4, %3 %cmp.i72 = icmp sgt i32 %div, %div20 br i1 %cmp.i72, label %tailrecurse.i.i, label %tailrecurse.i8.i tailrecurse.i.i: ; preds = %cond.end18, %tailrecurse.i.i %a.tr.i.i = phi i32 [ %b.tr.i.i, %tailrecurse.i.i ], [ %div, %cond.end18 ] %b.tr.i.i = phi i32 [ %rem.i.i, %tailrecurse.i.i ], [ %div20, %cond.end18 ] %rem.i.i = srem i32 %a.tr.i.i, %b.tr.i.i %cmp.i.i = icmp eq i32 %rem.i.i, 0 br i1 %cmp.i.i, label %lcm.exit, label %tailrecurse.i.i tailrecurse.i8.i: ; preds = %cond.end18, %tailrecurse.i8.i %a.tr.i9.i = phi i32 [ %b.tr.i10.i, %tailrecurse.i8.i ], [ %div20, %cond.end18 ] %b.tr.i10.i = phi i32 [ %rem.i11.i, %tailrecurse.i8.i ], [ %div, %cond.end18 ] %rem.i11.i = srem i32 %a.tr.i9.i, %b.tr.i10.i %cmp.i12.i = icmp eq i32 %rem.i11.i, 0 br i1 %cmp.i12.i, label %lcm.exit, label %tailrecurse.i8.i lcm.exit: ; preds = %tailrecurse.i8.i, %tailrecurse.i.i %cond.i = phi i32 [ %b.tr.i.i, %tailrecurse.i.i ], [ %b.tr.i10.i, %tailrecurse.i8.i ] %div.i = sdiv i32 %div, %cond.i %mul.i = mul i32 %div20, %add %mul = mul i32 %mul.i, %div.i store i32 %mul, ptr %w, align 4, !tbaa !5 br label %cleanup cleanup: ; preds = %if.end, %entry, %lcm.exit %retval.0 = phi i32 [ %mul, %lcm.exit ], [ 1, %entry ], [ %0, %if.end ] ret i32 %retval.0 } ; 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) #7 %call87 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !14 %cmp88 = icmp eq i32 %0, 0 br i1 %cmp88, label %for.end52, label %if.end if.end: ; preds = %entry, %for.end50 %1 = phi i32 [ %7, %for.end50 ], [ %0, %entry ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2020) @a, i8 0, i64 2020, i1 false) %cmp2.not82 = icmp slt i32 %1, 1 br i1 %cmp2.not82, label %for.end50, label %for.body for.cond41.preheader: ; preds = %for.inc %cmp42.not84 = icmp slt i32 %4, 1 br i1 %cmp42.not84, label %for.end50, label %for.body43 for.body: ; preds = %if.end, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %if.end ] %arrayidx = getelementptr inbounds [101 x %struct.mobile], ptr @a, i64 0, i64 %indvars.iv %lr = getelementptr inbounds [101 x %struct.mobile], ptr @a, i64 0, i64 %indvars.iv, i32 1 %il = getelementptr inbounds [101 x %struct.mobile], ptr @a, i64 0, i64 %indvars.iv, i32 2 %ir = getelementptr inbounds [101 x %struct.mobile], ptr @a, i64 0, i64 %indvars.iv, i32 3 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %lr, ptr noundef nonnull %il, ptr noundef nonnull %ir) %2 = load i32, ptr %arrayidx, align 4, !tbaa !13 %3 = load i32, ptr %lr, align 4, !tbaa !12 %cmp16 = icmp sgt i32 %2, %3 br i1 %cmp16, label %tailrecurse.i, label %tailrecurse.i75 tailrecurse.i: ; preds = %for.body, %tailrecurse.i %a.tr.i = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %2, %for.body ] %b.tr.i = phi i32 [ %rem.i, %tailrecurse.i ], [ %3, %for.body ] %rem.i = srem i32 %a.tr.i, %b.tr.i %cmp.i = icmp eq i32 %rem.i, 0 br i1 %cmp.i, label %cond.end, label %tailrecurse.i tailrecurse.i75: ; preds = %for.body, %tailrecurse.i75 %a.tr.i76 = phi i32 [ %b.tr.i77, %tailrecurse.i75 ], [ %3, %for.body ] %b.tr.i77 = phi i32 [ %rem.i78, %tailrecurse.i75 ], [ %2, %for.body ] %rem.i78 = srem i32 %a.tr.i76, %b.tr.i77 %cmp.i79 = icmp eq i32 %rem.i78, 0 br i1 %cmp.i79, label %cond.end, label %tailrecurse.i75 cond.end: ; preds = %tailrecurse.i75, %tailrecurse.i %cond = phi i32 [ %b.tr.i, %tailrecurse.i ], [ %b.tr.i77, %tailrecurse.i75 ] %cmp31.not = icmp eq i32 %cond, 0 br i1 %cmp31.not, label %for.inc, label %if.then32 if.then32: ; preds = %cond.end %div = sdiv i32 %2, %cond store i32 %div, ptr %arrayidx, align 4, !tbaa !13 %div39 = sdiv i32 %3, %cond store i32 %div39, ptr %lr, align 4, !tbaa !12 br label %for.inc for.inc: ; preds = %cond.end, %if.then32 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !14 %5 = sext i32 %4 to i64 %cmp2.not.not = icmp slt i64 %indvars.iv, %5 br i1 %cmp2.not.not, label %for.body, label %for.cond41.preheader, !llvm.loop !15 for.body43: ; preds = %for.cond41.preheader, %for.body43 %mw.086 = phi i32 [ %spec.select, %for.body43 ], [ 0, %for.cond41.preheader ] %i.185 = phi i32 [ %inc49, %for.body43 ], [ 1, %for.cond41.preheader ] %call44 = call i32 @weight(i32 noundef %i.185) %spec.select = call i32 @llvm.smax.i32(i32 %mw.086, i32 %call44) %inc49 = add nuw nsw i32 %i.185, 1 %6 = load i32, ptr %n, align 4, !tbaa !14 %cmp42.not.not = icmp slt i32 %i.185, %6 br i1 %cmp42.not.not, label %for.body43, label %for.end50, !llvm.loop !17 for.end50: ; preds = %for.body43, %if.end, %for.cond41.preheader %mw.0.lcssa = phi i32 [ 0, %for.cond41.preheader ], [ 0, %if.end ], [ %spec.select, %for.body43 ] %call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mw.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %7 = load i32, ptr %n, align 4, !tbaa !14 %cmp = icmp eq i32 %7, 0 br i1 %cmp, label %for.end52, label %if.end for.end52: ; preds = %for.end50, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 16} !6 = !{!"mobile", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!6, !7, i64 8} !11 = !{!6, !7, i64 12} !12 = !{!6, !7, i64 4} !13 = !{!6, !7, i64 0} !14 = !{!7, !7, i64 0} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.mustprogress"} !17 = distinct !{!17, !16}
#include <limits.h> #include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // 内部定数 #define D_ON 1 // 汎用フラグ - ON #define D_OFF 0 // 汎用フラグ - OFF #define D_VTX_MAX 1000 // 最大頂点数 #define D_EDGE_MAX 2000 // 最大辺数 // 内部構造体 - 頂点情報 typedef struct Vtx { long long mlScore; // スコア int miInf; // 無限フラグ } Vtx; // 内部構造体 - 辺情報 typedef struct Edge { int miVFNo; // 頂点 - 元 1~ int miVTNo; // 頂点 - 先 1~ int miScore; // スコア } Edge; // 内部変数 static Vtx sz1Vtx[D_VTX_MAX + 5]; // 頂点 static int siVCnt; // 頂点数 static Edge sz1Edge[D_EDGE_MAX]; // 辺 static int siECnt; // 辺数 // 内部変数 - テスト用 #ifdef D_TEST static int siRes; static FILE *szpFpT, *szpFpA; #endif // 頂点更新 - スコア・無限フラグ int fUpVtx( int piInf // <I> 無限フラグの更新 [1]あり [0]なし ) { int i, j; // 頂点のスコア - 更新(最大でも頂点数のループで更新が終了 - 頂点が1直線) for (i = 0; i < siVCnt; i++) { for (j = 0; j < siECnt; j++) { // 頂点(元) Vtx *lzpVtxF = &sz1Vtx[sz1Edge[j].miVFNo]; // 接続有無 if (lzpVtxF->mlScore == LLONG_MIN) { continue; } // スコア long long llSocre = lzpVtxF->mlScore + (long long)sz1Edge[j].miScore; // 頂点(先) Vtx *lzpVtxT = &sz1Vtx[sz1Edge[j].miVTNo]; if (lzpVtxT->mlScore < llSocre) { lzpVtxT->mlScore = llSocre; if (piInf == D_ON) { lzpVtxT->miInf = D_ON; } } } } return 0; } // 実行メイン int fMain( int piTNo // <I> テスト番号 1~ ) { int i; char lc1Buf[1024], lc1Out[1024]; // データ初期化 memset(sz1Vtx, 0, sizeof(sz1Vtx)); // 頂点 // テストファイルオープン #ifdef D_TEST sprintf(lc1Buf, ".\\Test\\T%d.txt", piTNo); szpFpT = fopen(lc1Buf, "r"); sprintf(lc1Buf, ".\\Test\\A%d.txt", piTNo); szpFpA = fopen(lc1Buf, "r"); siRes = 0; #endif // 頂点数・辺数取得 #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpT); #else fgets(lc1Buf, sizeof(lc1Buf), stdin); #endif sscanf(lc1Buf, "%d%d", &siVCnt, &siECnt); // 辺取得 for (i = 0; i < siECnt; i++) { #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpT); #else fgets(lc1Buf, sizeof(lc1Buf), stdin); #endif sscanf(lc1Buf, "%d%d%d", &sz1Edge[i].miVFNo, &sz1Edge[i].miVTNo, &sz1Edge[i].miScore); } // 頂点のスコア - 初期化 sz1Vtx[1].mlScore = 0; for (i = 2; i <= siVCnt; i++) { sz1Vtx[i].mlScore = LLONG_MIN; } // 頂点のスコア - 更新 fUpVtx(D_OFF); // まだ更新できるかチェック(ループの有無チェック) fUpVtx(D_ON); // 結果セット if (sz1Vtx[siVCnt].miInf == D_ON) { sprintf(lc1Out, "inf\n"); } else { sprintf(lc1Out, "%lld\n", sz1Vtx[siVCnt].mlScore); } // 結果表示 #ifdef D_TEST fgets(lc1Buf, sizeof(lc1Buf), szpFpA); if (strcmp(lc1Buf, lc1Out)) { siRes = -1; } #else printf("%s", lc1Out); #endif // テストファイルクローズ #ifdef D_TEST fclose(szpFpT); fclose(szpFpA); #endif // テスト結果 #ifdef D_TEST if (siRes == 0) { printf("OK %d\n", piTNo); } else { printf("NG %d\n", piTNo); } #endif return 0; } int main() { #ifdef D_TEST int i; for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) { fMain(i); } #else fMain(0); #endif return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_198940/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_198940/source.c" target datalayout = "e-m:e-p270: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.Vtx = type { i64, i32 } %struct.Edge = type { i32, i32, i32 } @siVCnt = internal global i32 0, align 4 @siECnt = internal global i32 0, align 4 @sz1Vtx = internal unnamed_addr global [1005 x %struct.Vtx] zeroinitializer, align 16 @sz1Edge = internal global [2000 x %struct.Edge] zeroinitializer, align 16 @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"inf\0A\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.4 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @fUpVtx(i32 noundef %piInf) local_unnamed_addr #0 { entry: %0 = load i32, ptr @siVCnt, align 4, !tbaa !5 %cmp40 = icmp sgt i32 %0, 0 br i1 %cmp40, label %for.cond1.preheader.lr.ph, label %for.end26 for.cond1.preheader.lr.ph: ; preds = %entry %1 = load i32, ptr @siECnt, align 4, !tbaa !5 %cmp238 = icmp sgt i32 %1, 0 br i1 %cmp238, label %for.cond1.preheader.lr.ph.split.us, label %for.end26 for.cond1.preheader.lr.ph.split.us: ; preds = %for.cond1.preheader.lr.ph %cmp19 = icmp eq i32 %piInf, 1 %wide.trip.count70 = zext i32 %1 to i64 br i1 %cmp19, label %for.cond1.preheader.us.us, label %for.cond1.preheader.us for.cond1.preheader.us.us: ; preds = %for.cond1.preheader.lr.ph.split.us, %for.cond1.for.inc24_crit_edge.split.us.us.us %i.041.us.us = phi i32 [ %inc25.us.us, %for.cond1.for.inc24_crit_edge.split.us.us.us ], [ 0, %for.cond1.preheader.lr.ph.split.us ] br label %for.body3.us.us.us for.body3.us.us.us: ; preds = %cleanup.us.us.us, %for.cond1.preheader.us.us %indvars.iv67 = phi i64 [ %indvars.iv.next68, %cleanup.us.us.us ], [ 0, %for.cond1.preheader.us.us ] %arrayidx.us.us.us = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv67 %2 = load i32, ptr %arrayidx.us.us.us, align 4, !tbaa !9 %idxprom4.us.us.us = sext i32 %2 to i64 %arrayidx5.us.us.us = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom4.us.us.us %3 = load i64, ptr %arrayidx5.us.us.us, align 16, !tbaa !11 %cmp6.us.us.us = icmp eq i64 %3, -9223372036854775808 br i1 %cmp6.us.us.us, label %cleanup.us.us.us, label %if.end.us.us.us if.end.us.us.us: ; preds = %for.body3.us.us.us %miScore.us.us.us = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv67, i32 2 %4 = load i32, ptr %miScore.us.us.us, align 4, !tbaa !14 %conv.us.us.us = sext i32 %4 to i64 %add.us.us.us = add nsw i64 %3, %conv.us.us.us %miVTNo.us.us.us = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv67, i32 1 %5 = load i32, ptr %miVTNo.us.us.us, align 4, !tbaa !15 %idxprom12.us.us.us = sext i32 %5 to i64 %arrayidx13.us.us.us = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom12.us.us.us %6 = load i64, ptr %arrayidx13.us.us.us, align 16, !tbaa !11 %cmp15.us.us.us = icmp slt i64 %6, %add.us.us.us br i1 %cmp15.us.us.us, label %if.then17.us.us.us, label %cleanup.us.us.us if.then17.us.us.us: ; preds = %if.end.us.us.us store i64 %add.us.us.us, ptr %arrayidx13.us.us.us, align 16, !tbaa !11 %miInf.us.us.us = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom12.us.us.us, i32 1 store i32 1, ptr %miInf.us.us.us, align 8, !tbaa !16 br label %cleanup.us.us.us cleanup.us.us.us: ; preds = %if.then17.us.us.us, %if.end.us.us.us, %for.body3.us.us.us %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %exitcond71.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count70 br i1 %exitcond71.not, label %for.cond1.for.inc24_crit_edge.split.us.us.us, label %for.body3.us.us.us, !llvm.loop !17 for.cond1.for.inc24_crit_edge.split.us.us.us: ; preds = %cleanup.us.us.us %inc25.us.us = add nuw nsw i32 %i.041.us.us, 1 %exitcond72.not = icmp eq i32 %inc25.us.us, %0 br i1 %exitcond72.not, label %for.end26, label %for.cond1.preheader.us.us, !llvm.loop !19 for.cond1.preheader.us: ; preds = %for.cond1.preheader.lr.ph.split.us, %for.cond1.for.inc24_crit_edge.split.us61 %i.041.us = phi i32 [ %inc25.us, %for.cond1.for.inc24_crit_edge.split.us61 ], [ 0, %for.cond1.preheader.lr.ph.split.us ] br label %for.body3.us42 for.body3.us42: ; preds = %for.cond1.preheader.us, %cleanup.us58 %indvars.iv = phi i64 [ 0, %for.cond1.preheader.us ], [ %indvars.iv.next, %cleanup.us58 ] %arrayidx.us45 = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv %7 = load i32, ptr %arrayidx.us45, align 4, !tbaa !9 %idxprom4.us46 = sext i32 %7 to i64 %arrayidx5.us47 = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom4.us46 %8 = load i64, ptr %arrayidx5.us47, align 16, !tbaa !11 %cmp6.us48 = icmp eq i64 %8, -9223372036854775808 br i1 %cmp6.us48, label %cleanup.us58, label %if.end.us49 if.end.us49: ; preds = %for.body3.us42 %miScore.us50 = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv, i32 2 %9 = load i32, ptr %miScore.us50, align 4, !tbaa !14 %conv.us51 = sext i32 %9 to i64 %add.us52 = add nsw i64 %8, %conv.us51 %miVTNo.us53 = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv, i32 1 %10 = load i32, ptr %miVTNo.us53, align 4, !tbaa !15 %idxprom12.us54 = sext i32 %10 to i64 %arrayidx13.us55 = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom12.us54 %11 = load i64, ptr %arrayidx13.us55, align 16, !tbaa !11 %cmp15.us56 = icmp slt i64 %11, %add.us52 br i1 %cmp15.us56, label %if.then17.us57, label %cleanup.us58 if.then17.us57: ; preds = %if.end.us49 store i64 %add.us52, ptr %arrayidx13.us55, align 16, !tbaa !11 br label %cleanup.us58 cleanup.us58: ; preds = %if.then17.us57, %if.end.us49, %for.body3.us42 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count70 br i1 %exitcond.not, label %for.cond1.for.inc24_crit_edge.split.us61, label %for.body3.us42, !llvm.loop !17 for.cond1.for.inc24_crit_edge.split.us61: ; preds = %cleanup.us58 %inc25.us = add nuw nsw i32 %i.041.us, 1 %exitcond66.not = icmp eq i32 %inc25.us, %0 br i1 %exitcond66.not, label %for.end26, label %for.cond1.preheader.us, !llvm.loop !19 for.end26: ; preds = %for.cond1.for.inc24_crit_edge.split.us61, %for.cond1.for.inc24_crit_edge.split.us.us.us, %for.cond1.preheader.lr.ph, %entry ret i32 0 } ; 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 @fMain(i32 %piTNo) local_unnamed_addr #2 { entry: %lc1Buf = alloca [1024 x i8], align 16 %lc1Out = alloca [1024 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #6 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Out) #6 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16080) @sz1Vtx, i8 0, i64 16080, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !20 %call = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %0) %call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str, ptr noundef nonnull @siVCnt, ptr noundef nonnull @siECnt) #6 %1 = load i32, ptr @siECnt, align 4, !tbaa !5 %cmp50 = icmp sgt i32 %1, 0 br i1 %cmp50, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %2 = load ptr, ptr @stdin, align 8, !tbaa !20 %call4 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %2) %arrayidx = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv %miVTNo = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv, i32 1 %miScore = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv, i32 2 %call10 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %miVTNo, ptr noundef nonnull %miScore) #6 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @siECnt, 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 !22 for.end: ; preds = %for.body, %entry %.lcssa49 = phi i32 [ %1, %entry ], [ %3, %for.body ] store i64 0, ptr getelementptr inbounds ([1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 1), align 16, !tbaa !11 %5 = load i32, ptr @siVCnt, align 4, !tbaa !5 %cmp12.not52 = icmp slt i32 %5, 2 br i1 %cmp12.not52, label %for.end18, label %for.body13.preheader for.body13.preheader: ; preds = %for.end %6 = add nuw i32 %5, 1 %wide.trip.count = zext i32 %6 to i64 %7 = add nsw i64 %wide.trip.count, -2 %8 = add nsw i64 %wide.trip.count, -3 %xtraiter = and i64 %7, 3 %9 = icmp ult i64 %8, 3 br i1 %9, label %for.end18.loopexit.unr-lcssa, label %for.body13.preheader.new for.body13.preheader.new: ; preds = %for.body13.preheader %unroll_iter = and i64 %7, -4 br label %for.body13 for.body13: ; preds = %for.body13, %for.body13.preheader.new %indvars.iv56 = phi i64 [ 2, %for.body13.preheader.new ], [ %indvars.iv.next57.3, %for.body13 ] %niter = phi i64 [ 0, %for.body13.preheader.new ], [ %niter.next.3, %for.body13 ] %arrayidx15 = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv56 store i64 -9223372036854775808, ptr %arrayidx15, align 16, !tbaa !11 %indvars.iv.next57 = or i64 %indvars.iv56, 1 %arrayidx15.1 = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv.next57 store i64 -9223372036854775808, ptr %arrayidx15.1, align 16, !tbaa !11 %indvars.iv.next57.1 = add nuw nsw i64 %indvars.iv56, 2 %arrayidx15.2 = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv.next57.1 store i64 -9223372036854775808, ptr %arrayidx15.2, align 16, !tbaa !11 %indvars.iv.next57.2 = add nuw nsw i64 %indvars.iv56, 3 %arrayidx15.3 = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv.next57.2 store i64 -9223372036854775808, ptr %arrayidx15.3, align 16, !tbaa !11 %indvars.iv.next57.3 = add nuw nsw i64 %indvars.iv56, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.end18.loopexit.unr-lcssa, label %for.body13, !llvm.loop !23 for.end18.loopexit.unr-lcssa: ; preds = %for.body13, %for.body13.preheader %indvars.iv56.unr = phi i64 [ 2, %for.body13.preheader ], [ %indvars.iv.next57.3, %for.body13 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end18, label %for.body13.epil for.body13.epil: ; preds = %for.end18.loopexit.unr-lcssa, %for.body13.epil %indvars.iv56.epil = phi i64 [ %indvars.iv.next57.epil, %for.body13.epil ], [ %indvars.iv56.unr, %for.end18.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body13.epil ], [ 0, %for.end18.loopexit.unr-lcssa ] %arrayidx15.epil = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %indvars.iv56.epil store i64 -9223372036854775808, ptr %arrayidx15.epil, align 16, !tbaa !11 %indvars.iv.next57.epil = add nuw nsw i64 %indvars.iv56.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end18, label %for.body13.epil, !llvm.loop !24 for.end18: ; preds = %for.end18.loopexit.unr-lcssa, %for.body13.epil, %for.end %cmp40.i = icmp sgt i32 %5, 0 %cmp238.i = icmp sgt i32 %.lcssa49, 0 %or.cond = and i1 %cmp238.i, %cmp40.i br i1 %or.cond, label %for.cond1.preheader.lr.ph.split.us.i, label %fUpVtx.exit45 for.cond1.preheader.lr.ph.split.us.i: ; preds = %for.end18 %wide.trip.count70.i = zext i32 %.lcssa49 to i64 br label %for.cond1.preheader.us.i for.cond1.preheader.us.i: ; preds = %for.cond1.for.inc24_crit_edge.split.us61.i, %for.cond1.preheader.lr.ph.split.us.i %i.041.us.i = phi i32 [ %inc25.us.i, %for.cond1.for.inc24_crit_edge.split.us61.i ], [ 0, %for.cond1.preheader.lr.ph.split.us.i ] br label %for.body3.us42.i for.body3.us42.i: ; preds = %cleanup.us58.i, %for.cond1.preheader.us.i %indvars.iv.i = phi i64 [ 0, %for.cond1.preheader.us.i ], [ %indvars.iv.next.i, %cleanup.us58.i ] %arrayidx.us45.i = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv.i %10 = load i32, ptr %arrayidx.us45.i, align 4, !tbaa !9 %idxprom4.us46.i = sext i32 %10 to i64 %arrayidx5.us47.i = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom4.us46.i %11 = load i64, ptr %arrayidx5.us47.i, align 16, !tbaa !11 %cmp6.us48.i = icmp eq i64 %11, -9223372036854775808 br i1 %cmp6.us48.i, label %cleanup.us58.i, label %if.end.us49.i if.end.us49.i: ; preds = %for.body3.us42.i %miScore.us50.i = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv.i, i32 2 %12 = load i32, ptr %miScore.us50.i, align 4, !tbaa !14 %conv.us51.i = sext i32 %12 to i64 %add.us52.i = add nsw i64 %11, %conv.us51.i %miVTNo.us53.i = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv.i, i32 1 %13 = load i32, ptr %miVTNo.us53.i, align 4, !tbaa !15 %idxprom12.us54.i = sext i32 %13 to i64 %arrayidx13.us55.i = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom12.us54.i %14 = load i64, ptr %arrayidx13.us55.i, align 16, !tbaa !11 %cmp15.us56.i = icmp slt i64 %14, %add.us52.i br i1 %cmp15.us56.i, label %if.then17.us57.i, label %cleanup.us58.i if.then17.us57.i: ; preds = %if.end.us49.i store i64 %add.us52.i, ptr %arrayidx13.us55.i, align 16, !tbaa !11 br label %cleanup.us58.i cleanup.us58.i: ; preds = %if.then17.us57.i, %if.end.us49.i, %for.body3.us42.i %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count70.i br i1 %exitcond.not.i, label %for.cond1.for.inc24_crit_edge.split.us61.i, label %for.body3.us42.i, !llvm.loop !17 for.cond1.for.inc24_crit_edge.split.us61.i: ; preds = %cleanup.us58.i %inc25.us.i = add nuw nsw i32 %i.041.us.i, 1 %exitcond66.not.i = icmp eq i32 %inc25.us.i, %5 br i1 %exitcond66.not.i, label %for.cond1.preheader.us.us.i, label %for.cond1.preheader.us.i, !llvm.loop !19 for.cond1.preheader.us.us.i: ; preds = %for.cond1.for.inc24_crit_edge.split.us61.i, %for.cond1.for.inc24_crit_edge.split.us.us.us.i %i.041.us.us.i = phi i32 [ %inc25.us.us.i, %for.cond1.for.inc24_crit_edge.split.us.us.us.i ], [ 0, %for.cond1.for.inc24_crit_edge.split.us61.i ] br label %for.body3.us.us.us.i for.body3.us.us.us.i: ; preds = %cleanup.us.us.us.i, %for.cond1.preheader.us.us.i %indvars.iv67.i = phi i64 [ %indvars.iv.next68.i, %cleanup.us.us.us.i ], [ 0, %for.cond1.preheader.us.us.i ] %arrayidx.us.us.us.i = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv67.i %15 = load i32, ptr %arrayidx.us.us.us.i, align 4, !tbaa !9 %idxprom4.us.us.us.i = sext i32 %15 to i64 %arrayidx5.us.us.us.i = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom4.us.us.us.i %16 = load i64, ptr %arrayidx5.us.us.us.i, align 16, !tbaa !11 %cmp6.us.us.us.i = icmp eq i64 %16, -9223372036854775808 br i1 %cmp6.us.us.us.i, label %cleanup.us.us.us.i, label %if.end.us.us.us.i if.end.us.us.us.i: ; preds = %for.body3.us.us.us.i %miScore.us.us.us.i = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv67.i, i32 2 %17 = load i32, ptr %miScore.us.us.us.i, align 4, !tbaa !14 %conv.us.us.us.i = sext i32 %17 to i64 %add.us.us.us.i = add nsw i64 %16, %conv.us.us.us.i %miVTNo.us.us.us.i = getelementptr inbounds [2000 x %struct.Edge], ptr @sz1Edge, i64 0, i64 %indvars.iv67.i, i32 1 %18 = load i32, ptr %miVTNo.us.us.us.i, align 4, !tbaa !15 %idxprom12.us.us.us.i = sext i32 %18 to i64 %arrayidx13.us.us.us.i = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom12.us.us.us.i %19 = load i64, ptr %arrayidx13.us.us.us.i, align 16, !tbaa !11 %cmp15.us.us.us.i = icmp slt i64 %19, %add.us.us.us.i br i1 %cmp15.us.us.us.i, label %if.then17.us.us.us.i, label %cleanup.us.us.us.i if.then17.us.us.us.i: ; preds = %if.end.us.us.us.i store i64 %add.us.us.us.i, ptr %arrayidx13.us.us.us.i, align 16, !tbaa !11 %miInf.us.us.us.i = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom12.us.us.us.i, i32 1 store i32 1, ptr %miInf.us.us.us.i, align 8, !tbaa !16 br label %cleanup.us.us.us.i cleanup.us.us.us.i: ; preds = %if.then17.us.us.us.i, %if.end.us.us.us.i, %for.body3.us.us.us.i %indvars.iv.next68.i = add nuw nsw i64 %indvars.iv67.i, 1 %exitcond71.not.i = icmp eq i64 %indvars.iv.next68.i, %wide.trip.count70.i br i1 %exitcond71.not.i, label %for.cond1.for.inc24_crit_edge.split.us.us.us.i, label %for.body3.us.us.us.i, !llvm.loop !17 for.cond1.for.inc24_crit_edge.split.us.us.us.i: ; preds = %cleanup.us.us.us.i %inc25.us.us.i = add nuw nsw i32 %i.041.us.us.i, 1 %exitcond72.not.i = icmp eq i32 %inc25.us.us.i, %5 br i1 %exitcond72.not.i, label %fUpVtx.exit45, label %for.cond1.preheader.us.us.i, !llvm.loop !19 fUpVtx.exit45: ; preds = %for.cond1.for.inc24_crit_edge.split.us.us.us.i, %for.end18 %idxprom21 = sext i32 %5 to i64 %miInf = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom21, i32 1 %20 = load i32, ptr %miInf, align 8, !tbaa !16 %cmp23 = icmp eq i32 %20, 1 br i1 %cmp23, label %if.then, label %if.else if.then: ; preds = %fUpVtx.exit45 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(5) %lc1Out, ptr noundef nonnull align 1 dereferenceable(5) @.str.2, i64 5, i1 false) br label %if.end if.else: ; preds = %fUpVtx.exit45 %arrayidx22 = getelementptr inbounds [1005 x %struct.Vtx], ptr @sz1Vtx, i64 0, i64 %idxprom21 %21 = load i64, ptr %arrayidx22, align 16, !tbaa !11 %call30 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Out, ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %21) #6 br label %if.end if.end: ; preds = %if.else, %if.then %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, ptr noundef nonnull %lc1Out) call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Out) #6 call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %call = tail call i32 @fMain(i32 poison) ret i32 0 } ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5 attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 0} !10 = !{!"Edge", !6, i64 0, !6, i64 4, !6, i64 8} !11 = !{!12, !13, i64 0} !12 = !{!"Vtx", !13, i64 0, !6, i64 8} !13 = !{!"long long", !7, i64 0} !14 = !{!10, !6, i64 8} !15 = !{!10, !6, i64 4} !16 = !{!12, !6, i64 8} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.mustprogress"} !19 = distinct !{!19, !18} !20 = !{!21, !21, i64 0} !21 = !{!"any pointer", !7, i64 0} !22 = distinct !{!22, !18} !23 = distinct !{!23, !18} !24 = distinct !{!24, !25} !25 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> #include <stdlib.h> #include <limits.h> struct vertex { int k; int visited; int vlist[100][2]; }; int main(int argc, char *argv[]) { int n, i, j; int e; struct vertex *adj; int v; int op, cost, mine, newv; int sum; scanf("%d", &n); adj = (struct vertex *)malloc(sizeof(struct vertex) * n); for (i = 0; i < n; i++) { adj[i].k = 0; adj[i].visited = 0; for (j = 0; j < 100; j++) { adj[i].vlist[j][0] = -1; adj[i].vlist[j][1] = -1; } } for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { scanf("%d", &e); if (e != -1) { adj[i].vlist[adj[i].k][0] = j; adj[i].vlist[adj[i].k][1] = e; adj[i].k++; } } } adj[0].visited = 1; v = 1; sum = 0; while (v != n) { mine = INT_MAX; newv = -1; for (i = 0; i < n; i++) { if (adj[i].visited == 1) { for (j = 0; j < adj[i].k; j++) { op = adj[i].vlist[j][0]; cost = adj[i].vlist[j][1]; if (adj[op].visited == 0 && mine > cost) { mine = cost; newv = op; } } } } adj[newv].visited = 1; v++; sum += mine; } printf("%d\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199019/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199019/source.c" target datalayout = "e-m:e-p270: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.vertex = type { i32, i32, [100 x [2 x i32]] } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: 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 %e = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = mul nsw i64 %conv, 808 %call1 = call noalias ptr @malloc(i64 noundef %mul) #6 %cmp165 = icmp sgt i32 %0, 0 br i1 %cmp165, label %for.body.preheader, label %for.cond66.preheader.lr.ph.split for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 %invariant.gep = getelementptr i8, ptr %call1, i64 8 %xtraiter = and i64 %wide.trip.count, 1 %1 = icmp eq i32 %0, 1 br i1 %1, label %for.cond23.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body for.cond23.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %indvar.unr = phi i64 [ 0, %for.body.preheader ], [ %indvar.next.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond23.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond23.preheader.unr-lcssa %2 = mul nuw nsw i64 %indvar.unr, 808 %gep.epil = getelementptr i8, ptr %invariant.gep, i64 %2 %arrayidx.epil = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvar.unr store i32 0, ptr %arrayidx.epil, align 4, !tbaa !9 %visited.epil = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvar.unr, i32 1 store i32 0, ptr %visited.epil, align 4, !tbaa !11 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(800) %gep.epil, i8 -1, i64 800, i1 false), !tbaa !5 br label %for.cond23.preheader for.cond23.preheader: ; preds = %for.cond23.preheader.unr-lcssa, %for.body.epil br i1 %cmp165, label %for.cond27.preheader, label %for.cond66.preheader.lr.ph.split for.body: ; preds = %for.body, %for.body.preheader.new %indvar = phi i64 [ 0, %for.body.preheader.new ], [ %indvar.next.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %3 = mul nuw nsw i64 %indvar, 808 %gep = getelementptr i8, ptr %invariant.gep, i64 %3 %arrayidx = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvar store i32 0, ptr %arrayidx, align 4, !tbaa !9 %visited = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvar, i32 1 store i32 0, ptr %visited, align 4, !tbaa !11 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(800) %gep, i8 -1, i64 800, i1 false), !tbaa !5 %indvar.next = or i64 %indvar, 1 %4 = mul nuw nsw i64 %indvar.next, 808 %gep.1 = getelementptr i8, ptr %invariant.gep, i64 %4 %arrayidx.1 = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvar.next store i32 0, ptr %arrayidx.1, align 4, !tbaa !9 %visited.1 = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvar.next, i32 1 store i32 0, ptr %visited.1, align 4, !tbaa !11 call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(800) %gep.1, i8 -1, i64 800, i1 false), !tbaa !5 %indvar.next.1 = add nuw nsw i64 %indvar, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond23.preheader.unr-lcssa, label %for.body, !llvm.loop !12 for.cond27.preheader: ; preds = %for.cond23.preheader, %for.inc59 %5 = phi i32 [ %10, %for.inc59 ], [ %0, %for.cond23.preheader ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc59 ], [ 0, %for.cond23.preheader ] %cmp28167 = icmp sgt i32 %5, 0 br i1 %cmp28167, label %for.body30.lr.ph, label %for.inc59 for.body30.lr.ph: ; preds = %for.cond27.preheader %arrayidx35 = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv br label %for.body30 for.body30: ; preds = %for.body30.lr.ph, %for.inc56 %j.1168 = phi i32 [ 0, %for.body30.lr.ph ], [ %inc57, %for.inc56 ] %call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %6 = load i32, ptr %e, align 4, !tbaa !5 %cmp32.not = icmp eq i32 %6, -1 br i1 %cmp32.not, label %for.inc56, label %if.then if.then: ; preds = %for.body30 %7 = load i32, ptr %arrayidx35, align 4, !tbaa !9 %idxprom40 = sext i32 %7 to i64 %arrayidx41 = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv, i32 2, i64 %idxprom40 store i32 %j.1168, ptr %arrayidx41, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx35, align 4, !tbaa !9 %idxprom49 = sext i32 %8 to i64 %arrayidx51 = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv, i32 2, i64 %idxprom49, i64 1 store i32 %6, ptr %arrayidx51, align 4, !tbaa !5 %inc55 = add nsw i32 %8, 1 store i32 %inc55, ptr %arrayidx35, align 4, !tbaa !9 br label %for.inc56 for.inc56: ; preds = %for.body30, %if.then %inc57 = add nuw nsw i32 %j.1168, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %cmp28 = icmp slt i32 %inc57, %9 br i1 %cmp28, label %for.body30, label %for.inc59, !llvm.loop !14 for.inc59: ; preds = %for.inc56, %for.cond27.preheader %10 = phi i32 [ %5, %for.cond27.preheader ], [ %9, %for.inc56 ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %11 = sext i32 %10 to i64 %cmp24 = icmp slt i64 %indvars.iv.next, %11 br i1 %cmp24, label %for.cond27.preheader, label %for.end61, !llvm.loop !15 for.end61: ; preds = %for.inc59 %visited63 = getelementptr inbounds %struct.vertex, ptr %call1, i64 0, i32 1 store i32 1, ptr %visited63, align 4, !tbaa !11 %cmp64.not183 = icmp eq i32 %10, 1 br i1 %cmp64.not183, label %while.end, label %for.cond66.preheader.lr.ph for.cond66.preheader.lr.ph: ; preds = %for.end61 %cmp67177 = icmp sgt i32 %10, 0 br i1 %cmp67177, label %for.cond66.preheader.us.preheader, label %for.cond66.preheader.lr.ph.split for.cond66.preheader.us.preheader: ; preds = %for.cond66.preheader.lr.ph %wide.trip.count202 = zext i32 %10 to i64 br label %for.cond66.preheader.us for.cond66.preheader.us: ; preds = %for.cond66.preheader.us.preheader, %for.cond66.for.end110_crit_edge.us %sum.0185.us = phi i32 [ %add.us, %for.cond66.for.end110_crit_edge.us ], [ 0, %for.cond66.preheader.us.preheader ] %v.0184.us = phi i32 [ %inc114.us, %for.cond66.for.end110_crit_edge.us ], [ 1, %for.cond66.preheader.us.preheader ] br label %for.body69.us for.body69.us: ; preds = %for.cond66.preheader.us, %for.inc108.us %indvars.iv199 = phi i64 [ 0, %for.cond66.preheader.us ], [ %indvars.iv.next200, %for.inc108.us ] %newv.0180.us = phi i32 [ -1, %for.cond66.preheader.us ], [ %newv.3.us, %for.inc108.us ] %mine.0179.us = phi i32 [ 2147483647, %for.cond66.preheader.us ], [ %mine.3.us, %for.inc108.us ] %visited72.us = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv199, i32 1 %12 = load i32, ptr %visited72.us, align 4, !tbaa !11 %cmp73.us = icmp eq i32 %12, 1 br i1 %cmp73.us, label %for.cond76.preheader.us, label %for.inc108.us for.inc108.us.loopexit.unr-lcssa: ; preds = %for.body82.us, %for.body82.us.preheader %mine.2.us.lcssa.ph = phi i32 [ undef, %for.body82.us.preheader ], [ %mine.2.us.1, %for.body82.us ] %newv.2.us.lcssa.ph = phi i32 [ undef, %for.body82.us.preheader ], [ %newv.2.us.1, %for.body82.us ] %indvars.iv194.unr = phi i64 [ 0, %for.body82.us.preheader ], [ %indvars.iv.next195.1, %for.body82.us ] %newv.1174.us.unr = phi i32 [ %newv.0180.us, %for.body82.us.preheader ], [ %newv.2.us.1, %for.body82.us ] %mine.1173.us.unr = phi i32 [ %mine.0179.us, %for.body82.us.preheader ], [ %mine.2.us.1, %for.body82.us ] %lcmp.mod215.not = icmp eq i64 %xtraiter214, 0 br i1 %lcmp.mod215.not, label %for.inc108.us, label %for.body82.us.epil for.body82.us.epil: ; preds = %for.inc108.us.loopexit.unr-lcssa %arrayidx87.us.epil = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv199, i32 2, i64 %indvars.iv194.unr %13 = load i32, ptr %arrayidx87.us.epil, align 4, !tbaa !5 %arrayidx94.us.epil = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv199, i32 2, i64 %indvars.iv194.unr, i64 1 %14 = load i32, ptr %arrayidx94.us.epil, align 4, !tbaa !5 %idxprom95.us.epil = sext i32 %13 to i64 %visited97.us.epil = getelementptr inbounds %struct.vertex, ptr %call1, i64 %idxprom95.us.epil, i32 1 %15 = load i32, ptr %visited97.us.epil, align 4, !tbaa !11 %cmp98.us.epil = icmp eq i32 %15, 0 %cmp100.us.epil = icmp sgt i32 %mine.1173.us.unr, %14 %or.cond.us.epil = select i1 %cmp98.us.epil, i1 %cmp100.us.epil, i1 false %mine.2.us.epil = select i1 %or.cond.us.epil, i32 %14, i32 %mine.1173.us.unr %newv.2.us.epil = select i1 %or.cond.us.epil, i32 %13, i32 %newv.1174.us.unr br label %for.inc108.us for.inc108.us: ; preds = %for.body82.us.epil, %for.inc108.us.loopexit.unr-lcssa, %for.cond76.preheader.us, %for.body69.us %mine.3.us = phi i32 [ %mine.0179.us, %for.body69.us ], [ %mine.0179.us, %for.cond76.preheader.us ], [ %mine.2.us.lcssa.ph, %for.inc108.us.loopexit.unr-lcssa ], [ %mine.2.us.epil, %for.body82.us.epil ] %newv.3.us = phi i32 [ %newv.0180.us, %for.body69.us ], [ %newv.0180.us, %for.cond76.preheader.us ], [ %newv.2.us.lcssa.ph, %for.inc108.us.loopexit.unr-lcssa ], [ %newv.2.us.epil, %for.body82.us.epil ] %indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1 %exitcond203.not = icmp eq i64 %indvars.iv.next200, %wide.trip.count202 br i1 %exitcond203.not, label %for.cond66.for.end110_crit_edge.us, label %for.body69.us, !llvm.loop !17 for.body82.us: ; preds = %for.body82.us, %for.body82.us.preheader.new %indvars.iv194 = phi i64 [ 0, %for.body82.us.preheader.new ], [ %indvars.iv.next195.1, %for.body82.us ] %newv.1174.us = phi i32 [ %newv.0180.us, %for.body82.us.preheader.new ], [ %newv.2.us.1, %for.body82.us ] %mine.1173.us = phi i32 [ %mine.0179.us, %for.body82.us.preheader.new ], [ %mine.2.us.1, %for.body82.us ] %niter219 = phi i64 [ 0, %for.body82.us.preheader.new ], [ %niter219.next.1, %for.body82.us ] %arrayidx87.us = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv199, i32 2, i64 %indvars.iv194 %16 = load i32, ptr %arrayidx87.us, align 4, !tbaa !5 %arrayidx94.us = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv199, i32 2, i64 %indvars.iv194, i64 1 %17 = load i32, ptr %arrayidx94.us, align 4, !tbaa !5 %idxprom95.us = sext i32 %16 to i64 %visited97.us = getelementptr inbounds %struct.vertex, ptr %call1, i64 %idxprom95.us, i32 1 %18 = load i32, ptr %visited97.us, align 4, !tbaa !11 %cmp98.us = icmp eq i32 %18, 0 %cmp100.us = icmp sgt i32 %mine.1173.us, %17 %or.cond.us = select i1 %cmp98.us, i1 %cmp100.us, i1 false %mine.2.us = select i1 %or.cond.us, i32 %17, i32 %mine.1173.us %newv.2.us = select i1 %or.cond.us, i32 %16, i32 %newv.1174.us %indvars.iv.next195 = or i64 %indvars.iv194, 1 %arrayidx87.us.1 = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv199, i32 2, i64 %indvars.iv.next195 %19 = load i32, ptr %arrayidx87.us.1, align 4, !tbaa !5 %arrayidx94.us.1 = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv199, i32 2, i64 %indvars.iv.next195, i64 1 %20 = load i32, ptr %arrayidx94.us.1, align 4, !tbaa !5 %idxprom95.us.1 = sext i32 %19 to i64 %visited97.us.1 = getelementptr inbounds %struct.vertex, ptr %call1, i64 %idxprom95.us.1, i32 1 %21 = load i32, ptr %visited97.us.1, align 4, !tbaa !11 %cmp98.us.1 = icmp eq i32 %21, 0 %cmp100.us.1 = icmp sgt i32 %mine.2.us, %20 %or.cond.us.1 = select i1 %cmp98.us.1, i1 %cmp100.us.1, i1 false %mine.2.us.1 = select i1 %or.cond.us.1, i32 %20, i32 %mine.2.us %newv.2.us.1 = select i1 %or.cond.us.1, i32 %19, i32 %newv.2.us %indvars.iv.next195.1 = add nuw nsw i64 %indvars.iv194, 2 %niter219.next.1 = add i64 %niter219, 2 %niter219.ncmp.1 = icmp eq i64 %niter219.next.1, %unroll_iter218 br i1 %niter219.ncmp.1, label %for.inc108.us.loopexit.unr-lcssa, label %for.body82.us, !llvm.loop !18 for.cond76.preheader.us: ; preds = %for.body69.us %arrayidx71.us = getelementptr inbounds %struct.vertex, ptr %call1, i64 %indvars.iv199 %22 = load i32, ptr %arrayidx71.us, align 4, !tbaa !9 %cmp80171.us = icmp sgt i32 %22, 0 br i1 %cmp80171.us, label %for.body82.us.preheader, label %for.inc108.us for.body82.us.preheader: ; preds = %for.cond76.preheader.us %wide.trip.count197 = zext i32 %22 to i64 %xtraiter214 = and i64 %wide.trip.count197, 1 %23 = icmp eq i32 %22, 1 br i1 %23, label %for.inc108.us.loopexit.unr-lcssa, label %for.body82.us.preheader.new for.body82.us.preheader.new: ; preds = %for.body82.us.preheader %unroll_iter218 = and i64 %wide.trip.count197, 4294967294 br label %for.body82.us for.cond66.for.end110_crit_edge.us: ; preds = %for.inc108.us %idxprom111.us = sext i32 %newv.3.us to i64 %visited113.us = getelementptr inbounds %struct.vertex, ptr %call1, i64 %idxprom111.us, i32 1 store i32 1, ptr %visited113.us, align 4, !tbaa !11 %inc114.us = add nuw nsw i32 %v.0184.us, 1 %add.us = add nsw i32 %mine.3.us, %sum.0185.us %cmp64.not.us = icmp eq i32 %inc114.us, %10 br i1 %cmp64.not.us, label %while.end, label %for.cond66.preheader.us, !llvm.loop !19 for.cond66.preheader.lr.ph.split: ; preds = %for.cond23.preheader, %entry, %for.cond66.preheader.lr.ph %.lcssa207210 = phi i32 [ %10, %for.cond66.preheader.lr.ph ], [ %0, %entry ], [ %0, %for.cond23.preheader ] %24 = mul i32 %.lcssa207210, 2147483647 %25 = add i32 %24, -2147483647 br label %while.end while.end: ; preds = %for.cond66.for.end110_crit_edge.us, %for.cond66.preheader.lr.ph.split, %for.end61 %sum.0.lcssa = phi i32 [ 0, %for.end61 ], [ %25, %for.cond66.preheader.lr.ph.split ], [ %add.us, %for.cond66.for.end110_crit_edge.us ] %call115 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } attributes #6 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !6, i64 0} !10 = !{!"vertex", !6, i64 0, !6, i64 4, !7, i64 8} !11 = !{!10, !6, i64 4} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13} !15 = distinct !{!15, !13, !16} !16 = !{!"llvm.loop.unswitch.partial.disable"} !17 = distinct !{!17, !13} !18 = distinct !{!18, !13} !19 = distinct !{!19, !13}
#include<stdio.h> static const int INFTY = (1<<21); #define MAX 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,v,i,M[MAX][MAX]; int prim(void); int main(){ int j,e; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&e); M[i][j]=(e==-1)?INFTY:e; } } printf("%d\n",prim()); return 0; } int prim(){ int u,minv,sum=0; int d[MAX],p[MAX],color[MAX]; for(i=0;i<n;i++){ d[i]=INFTY; p[i]=-1; color[i]=WHITE; } d[0]=0; while(1){ minv=INFTY; u=-1; for(i=0;i<n;i++){ if(minv>d[i]&&color[i]!=BLACK){ u=i; minv=d[i]; } } if(u==-1)break; color[u]=BLACK; for(v=0;v<n;v++){ if(color[v]!=BLACK&&M[u][v]!=INFTY){ if(d[v]>M[u][v]){ d[v]=M[u][v]; p[v]=u; color[v]=GRAY; } } } } for(i=0;i<n;i++){ if(p[i]!=-1)sum+=M[i][p[i]]; } return sum; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199084/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199084/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @i = dso_local local_unnamed_addr global i32 0, align 4 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @v = 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: %e = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) store i32 0, ptr @i, align 4, !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %0, 0 br i1 %cmp17, label %for.cond1.preheader, label %for.end10 for.cond1.preheader: ; preds = %entry, %for.inc8 %1 = phi i32 [ %7, %for.inc8 ], [ %0, %entry ] %2 = phi i32 [ %inc9, %for.inc8 ], [ 0, %entry ] %cmp215 = icmp sgt i32 %1, 0 br i1 %cmp215, label %for.body3, label %for.inc8 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %3 = load i32, ptr %e, align 4 %cmp5 = icmp eq i32 %3, -1 %cond = select i1 %cmp5, i32 2097152, i32 %3 %4 = load i32, ptr @i, align 4, !tbaa !5 %idxprom = sext i32 %4 to i64 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %indvars.iv store i32 %cond, ptr %arrayidx7, align 4, !tbaa !5 %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 %cmp2 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp2, label %for.body3, label %for.inc8, !llvm.loop !9 for.inc8: ; preds = %for.body3, %for.cond1.preheader %7 = phi i32 [ %1, %for.cond1.preheader ], [ %5, %for.body3 ] %8 = phi i32 [ %2, %for.cond1.preheader ], [ %4, %for.body3 ] %inc9 = add nsw i32 %8, 1 store i32 %inc9, ptr @i, align 4, !tbaa !5 %cmp = icmp slt i32 %inc9, %7 br i1 %cmp, label %for.cond1.preheader, label %for.end10, !llvm.loop !11 for.end10: ; preds = %for.inc8, %entry %call11 = call i32 @prim() %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call11) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #3 { entry: %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp94 = icmp sgt i32 %.fr, 0 br i1 %cmp94, label %for.body.preheader, label %for.end77 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 %p, i8 -1, i64 %2, i1 false), !tbaa !5 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.preheader167, 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 !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader167 for.body.preheader167: ; 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.preheader167, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader167 ] %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 !16 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp94, label %while.cond.us.preheader, label %for.end77 while.cond.us.preheader: ; preds = %for.end %wide.trip.count153 = zext i32 %.fr to i64 %wide.trip.count158 = zext i32 %.fr to i64 br label %for.body8.us for.end19.us: ; preds = %for.inc17.us %cmp20.us = icmp eq i32 %u.1.us, -1 br i1 %cmp20.us, label %for.cond61.preheader, label %if.end22.us if.end22.us: ; preds = %for.end19.us %idxprom23.us = sext i32 %u.1.us to i64 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom23.us store i32 2, ptr %arrayidx24.us, align 4, !tbaa !5 br label %for.body27.us for.body27.us: ; preds = %if.end22.us, %for.inc58.us %indvars.iv155 = phi i64 [ 0, %if.end22.us ], [ %indvars.iv.next156, %for.inc58.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv155 %6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30.not.us = icmp eq i32 %6, 2 br i1 %cmp30.not.us, label %for.inc58.us, label %land.lhs.true31.us land.lhs.true31.us: ; preds = %for.body27.us %arrayidx35.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us, i64 %indvars.iv155 %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %cmp36.not.us = icmp eq i32 %7, 2097152 br i1 %cmp36.not.us, label %for.inc58.us, label %if.then37.us if.then37.us: ; preds = %land.lhs.true31.us %arrayidx39.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv155 %8 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp44.us = icmp sgt i32 %8, %7 br i1 %cmp44.us, label %if.then45.us, label %for.inc58.us if.then45.us: ; preds = %if.then37.us store i32 %7, ptr %arrayidx39.us, align 4, !tbaa !5 %arrayidx53.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv155 store i32 %u.1.us, ptr %arrayidx53.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc58.us for.inc58.us: ; preds = %if.then45.us, %if.then37.us, %land.lhs.true31.us, %for.body27.us %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1 %exitcond159.not = icmp eq i64 %indvars.iv.next156, %wide.trip.count158 br i1 %exitcond159.not, label %for.cond25.while.cond.loopexit_crit_edge.us, label %for.body27.us, !llvm.loop !17 for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader %indvars.iv150 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv150.be, %for.body8.us.backedge ] %minv.0100.us = phi i32 [ 2097152, %while.cond.us.preheader ], [ %minv.0100.us.be, %for.body8.us.backedge ] %u.099.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.099.us.be, %for.body8.us.backedge ] %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv150 %9 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.us = icmp sgt i32 %minv.0100.us, %9 br i1 %cmp11.us, label %land.lhs.true.us, label %for.inc17.us land.lhs.true.us: ; preds = %for.body8.us %arrayidx13.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv150 %10 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.not.us = icmp eq i32 %10, 2 %11 = trunc i64 %indvars.iv150 to i32 %spec.select.us = select i1 %cmp14.not.us, i32 %u.099.us, i32 %11 %spec.select93.us = select i1 %cmp14.not.us, i32 %minv.0100.us, i32 %9 br label %for.inc17.us for.inc17.us: ; preds = %land.lhs.true.us, %for.body8.us %u.1.us = phi i32 [ %u.099.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ] %minv.1.us = phi i32 [ %minv.0100.us, %for.body8.us ], [ %spec.select93.us, %land.lhs.true.us ] %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1 %exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153 br i1 %exitcond154.not, label %for.end19.us, label %for.body8.us.backedge for.body8.us.backedge: ; preds = %for.inc17.us, %for.cond25.while.cond.loopexit_crit_edge.us %indvars.iv150.be = phi i64 [ %indvars.iv.next151, %for.inc17.us ], [ 0, %for.cond25.while.cond.loopexit_crit_edge.us ] %minv.0100.us.be = phi i32 [ %minv.1.us, %for.inc17.us ], [ 2097152, %for.cond25.while.cond.loopexit_crit_edge.us ] %u.099.us.be = phi i32 [ %u.1.us, %for.inc17.us ], [ -1, %for.cond25.while.cond.loopexit_crit_edge.us ] br label %for.body8.us, !llvm.loop !18 for.cond25.while.cond.loopexit_crit_edge.us: ; preds = %for.inc58.us store i32 %.fr, ptr @v, align 4, !tbaa !5 br label %for.body8.us.backedge for.cond61.preheader: ; preds = %for.end19.us br i1 %cmp94, label %for.body63.preheader, label %for.end77 for.body63.preheader: ; preds = %for.cond61.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end77.loopexit.unr-lcssa, label %for.body63.preheader.new for.body63.preheader.new: ; preds = %for.body63.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body63 for.body63: ; preds = %for.inc75.1, %for.body63.preheader.new %indvars.iv160 = phi i64 [ 0, %for.body63.preheader.new ], [ %indvars.iv.next161.1, %for.inc75.1 ] %sum.0140 = phi i32 [ 0, %for.body63.preheader.new ], [ %sum.1.1, %for.inc75.1 ] %niter = phi i64 [ 0, %for.body63.preheader.new ], [ %niter.next.1, %for.inc75.1 ] %arrayidx65 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv160 %13 = load i32, ptr %arrayidx65, align 8, !tbaa !5 %cmp66.not = icmp eq i32 %13, -1 br i1 %cmp66.not, label %for.inc75, label %if.then67 if.then67: ; preds = %for.body63 %idxprom72 = sext i32 %13 to i64 %arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv160, i64 %idxprom72 %14 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0140 br label %for.inc75 for.inc75: ; preds = %for.body63, %if.then67 %sum.1 = phi i32 [ %add, %if.then67 ], [ %sum.0140, %for.body63 ] %indvars.iv.next161 = or i64 %indvars.iv160, 1 %arrayidx65.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next161 %15 = load i32, ptr %arrayidx65.1, align 4, !tbaa !5 %cmp66.not.1 = icmp eq i32 %15, -1 br i1 %cmp66.not.1, label %for.inc75.1, label %if.then67.1 if.then67.1: ; preds = %for.inc75 %idxprom72.1 = sext i32 %15 to i64 %arrayidx73.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next161, i64 %idxprom72.1 %16 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc75.1 for.inc75.1: ; preds = %if.then67.1, %for.inc75 %sum.1.1 = phi i32 [ %add.1, %if.then67.1 ], [ %sum.1, %for.inc75 ] %indvars.iv.next161.1 = add nuw nsw i64 %indvars.iv160, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end77.loopexit.unr-lcssa, label %for.body63, !llvm.loop !19 for.end77.loopexit.unr-lcssa: ; preds = %for.inc75.1, %for.body63.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %indvars.iv160.unr = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next161.1, %for.inc75.1 ] %sum.0140.unr = phi i32 [ 0, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end77, label %for.body63.epil for.body63.epil: ; preds = %for.end77.loopexit.unr-lcssa %arrayidx65.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv160.unr %17 = load i32, ptr %arrayidx65.epil, align 4, !tbaa !5 %cmp66.not.epil = icmp eq i32 %17, -1 br i1 %cmp66.not.epil, label %for.end77, label %if.then67.epil if.then67.epil: ; preds = %for.body63.epil %idxprom72.epil = sext i32 %17 to i64 %arrayidx73.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv160.unr, i64 %idxprom72.epil %18 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0140.unr br label %for.end77 for.end77: ; preds = %for.end77.loopexit.unr-lcssa, %if.then67.epil, %for.body63.epil, %for.end, %entry, %for.cond61.preheader %storemerge92.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %entry ], [ 0, %for.end ], [ %.fr, %for.body63.epil ], [ %.fr, %if.then67.epil ], [ %.fr, %for.end77.loopexit.unr-lcssa ] %sum.0.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %entry ], [ 0, %for.end ], [ %sum.1.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %add.epil, %if.then67.epil ], [ %sum.0140.unr, %for.body63.epil ] store i32 %storemerge92.lcssa, ptr @i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 ret i32 %sum.0.lcssa } ; 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) #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 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 nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !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}
#include <stdio.h> int MTS(int); int G[100]; int A[100][100]; int main(){ int i,j,n; int sum; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&A[i][j]); } } sum=MTS(n); printf("%d\n",sum); return 0; } int MTS(int n){ int i,j; int k=1; int max,min; int count=0; int R[100]; G[0]=1; R[0]=0; for(i=1;i<n;i++){ G[i]=0; } while(1){ max=2001; for(i=0;i<k;i++){ for(j=0;j<n;j++){ if(A[R[i]][j] < max && A[R[i]][j] != -1 && G[j]!=1){ max=A[R[i]][j]; min=j; } } } if(k!=n){ R[k]=min; G[min]=1; count+=max; k++; } else break; } return count; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199127/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199127/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @A = dso_local global [100 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @G = 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: %R.i = alloca [100 x i32], align 16 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %.pr = load i32, ptr %n, align 4, !tbaa !5 %cmp19 = icmp sgt i32 %.pr, 0 br i1 %cmp19, label %for.cond1.preheader, label %while.cond.preheader.i.thread while.cond.preheader.i.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %R.i) #5 br label %while.cond.preheader80.i for.cond1.preheader: ; preds = %entry, %for.inc7 %0 = phi i32 [ %3, %for.inc7 ], [ %.pr, %entry ] %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.inc7 ], [ 0, %entry ] %cmp217 = icmp sgt i32 %0, 0 br i1 %cmp217, label %for.body3, label %for.cond1.preheader.for.inc7_crit_edge for.cond1.preheader.for.inc7_crit_edge: ; preds = %for.cond1.preheader %.pre = sext i32 %0 to i64 br label %for.inc7 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv25, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %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 %cmp2 = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !9 for.inc7: ; preds = %for.body3, %for.cond1.preheader.for.inc7_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc7_crit_edge ], [ %2, %for.body3 ] %3 = phi i32 [ %0, %for.cond1.preheader.for.inc7_crit_edge ], [ %1, %for.body3 ] %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %cmp = icmp slt i64 %indvars.iv.next26, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !11 for.end9: ; preds = %for.inc7 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %R.i) #5 store i32 1, ptr @G, align 16, !tbaa !5 store i32 0, ptr %R.i, align 16, !tbaa !5 %cmp68.i = icmp sgt i32 %3, 1 br i1 %cmp68.i, label %while.cond.preheader.thread.i, label %while.cond.preheader.i while.cond.preheader.thread.i: ; preds = %for.end9 %4 = add nsw i32 %3, -1 %5 = zext i32 %4 to i64 %6 = shl nuw nsw i64 %5, 2 call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([100 x i32], ptr @G, i64 0, i64 1), i8 0, i64 %6, i1 false), !tbaa !5 %7 = zext i32 %3 to i64 br label %while.cond.us.preheader.i while.cond.preheader.i: ; preds = %for.end9 %cmp670.i = icmp eq i32 %3, 1 br i1 %cmp670.i, label %while.cond.us.preheader.i, label %while.cond.preheader80.i while.cond.preheader80.i: ; preds = %while.cond.preheader.i.thread, %while.cond.preheader.i store i32 1, ptr @G, align 16, !tbaa !5 br label %if.then39.i while.cond.us.preheader.i: ; preds = %while.cond.preheader.i, %while.cond.preheader.thread.i %.lcssa1631 = phi i64 [ 1, %while.cond.preheader.i ], [ %7, %while.cond.preheader.thread.i ] %xtraiter = and i64 %.lcssa1631, 1 %8 = icmp eq i64 %.lcssa1631, 1 %unroll_iter = and i64 %.lcssa1631, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %while.cond.us.i while.cond.us.i: ; preds = %if.then39.us.i, %while.cond.us.preheader.i %indvars.iv89.i = phi i64 [ 1, %while.cond.us.preheader.i ], [ %indvars.iv.next90.i, %if.then39.us.i ] %min.0.us.i = phi i32 [ undef, %while.cond.us.preheader.i ], [ %min.3.us.us.i.lcssa, %if.then39.us.i ] %count.0.us.i = phi i32 [ 0, %while.cond.us.preheader.i ], [ %add.us.i, %if.then39.us.i ] br label %for.cond5.preheader.us.us.i if.then39.us.i: ; preds = %for.end37.split.us.us.i %arrayidx41.us.i = getelementptr inbounds [100 x i32], ptr %R.i, i64 0, i64 %indvars.iv89.i store i32 %min.3.us.us.i.lcssa, ptr %arrayidx41.us.i, align 4, !tbaa !5 %idxprom42.us.i = sext i32 %min.3.us.us.i.lcssa to i64 %arrayidx43.us.i = getelementptr inbounds [100 x i32], ptr @G, i64 0, i64 %idxprom42.us.i store i32 1, ptr %arrayidx43.us.i, align 4, !tbaa !5 %add.us.i = add nsw i32 %max.2.us.us.i.lcssa, %count.0.us.i %indvars.iv.next90.i = add nuw nsw i64 %indvars.iv89.i, 1 br label %while.cond.us.i for.cond5.preheader.us.us.i: ; preds = %for.cond5.for.inc35_crit_edge.us.us.i, %while.cond.us.i %indvars.iv84.i = phi i64 [ %indvars.iv.next85.i, %for.cond5.for.inc35_crit_edge.us.us.i ], [ 0, %while.cond.us.i ] %min.177.us.us.i = phi i32 [ %min.3.us.us.i.lcssa, %for.cond5.for.inc35_crit_edge.us.us.i ], [ %min.0.us.i, %while.cond.us.i ] %max.076.us.us.i = phi i32 [ %max.2.us.us.i.lcssa, %for.cond5.for.inc35_crit_edge.us.us.i ], [ 2001, %while.cond.us.i ] %arrayidx9.us.us.i = getelementptr inbounds [100 x i32], ptr %R.i, i64 0, i64 %indvars.iv84.i %9 = load i32, ptr %arrayidx9.us.us.i, align 4, !tbaa !5 %idxprom10.us.us.i = sext i32 %9 to i64 br i1 %8, label %for.cond5.for.inc35_crit_edge.us.us.i.unr-lcssa, label %for.body7.us.us.i for.body7.us.us.i: ; preds = %for.cond5.preheader.us.us.i, %for.inc32.us.us.i.1 %indvars.iv.i = phi i64 [ %indvars.iv.next.i.1, %for.inc32.us.us.i.1 ], [ 0, %for.cond5.preheader.us.us.i ] %min.273.us.us.i = phi i32 [ %min.3.us.us.i.1, %for.inc32.us.us.i.1 ], [ %min.177.us.us.i, %for.cond5.preheader.us.us.i ] %max.172.us.us.i = phi i32 [ %max.2.us.us.i.1, %for.inc32.us.us.i.1 ], [ %max.076.us.us.i, %for.cond5.preheader.us.us.i ] %niter = phi i64 [ %niter.next.1, %for.inc32.us.us.i.1 ], [ 0, %for.cond5.preheader.us.us.i ] %arrayidx13.us.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom10.us.us.i, i64 %indvars.iv.i %10 = load i32, ptr %arrayidx13.us.us.i, align 8, !tbaa !5 %cmp14.us.us.i = icmp sge i32 %10, %max.172.us.us.i %cmp21.not.us.us.i = icmp eq i32 %10, -1 %or.cond.us.us.i = or i1 %cmp14.us.us.i, %cmp21.not.us.us.i br i1 %or.cond.us.us.i, label %for.inc32.us.us.i, label %land.lhs.true22.us.us.i land.lhs.true22.us.us.i: ; preds = %for.body7.us.us.i %arrayidx24.us.us.i = getelementptr inbounds [100 x i32], ptr @G, i64 0, i64 %indvars.iv.i %11 = load i32, ptr %arrayidx24.us.us.i, align 8, !tbaa !5 %cmp25.not.us.us.i = icmp eq i32 %11, 1 %spec.select.us.us.i = select i1 %cmp25.not.us.us.i, i32 %max.172.us.us.i, i32 %10 %12 = trunc i64 %indvars.iv.i to i32 %spec.select67.us.us.i = select i1 %cmp25.not.us.us.i, i32 %min.273.us.us.i, i32 %12 br label %for.inc32.us.us.i for.inc32.us.us.i: ; preds = %land.lhs.true22.us.us.i, %for.body7.us.us.i %max.2.us.us.i = phi i32 [ %max.172.us.us.i, %for.body7.us.us.i ], [ %spec.select.us.us.i, %land.lhs.true22.us.us.i ] %min.3.us.us.i = phi i32 [ %min.273.us.us.i, %for.body7.us.us.i ], [ %spec.select67.us.us.i, %land.lhs.true22.us.us.i ] %indvars.iv.next.i = or i64 %indvars.iv.i, 1 %arrayidx13.us.us.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom10.us.us.i, i64 %indvars.iv.next.i %13 = load i32, ptr %arrayidx13.us.us.i.1, align 4, !tbaa !5 %cmp14.us.us.i.1 = icmp sge i32 %13, %max.2.us.us.i %cmp21.not.us.us.i.1 = icmp eq i32 %13, -1 %or.cond.us.us.i.1 = or i1 %cmp14.us.us.i.1, %cmp21.not.us.us.i.1 br i1 %or.cond.us.us.i.1, label %for.inc32.us.us.i.1, label %land.lhs.true22.us.us.i.1 land.lhs.true22.us.us.i.1: ; preds = %for.inc32.us.us.i %arrayidx24.us.us.i.1 = getelementptr inbounds [100 x i32], ptr @G, i64 0, i64 %indvars.iv.next.i %14 = load i32, ptr %arrayidx24.us.us.i.1, align 4, !tbaa !5 %cmp25.not.us.us.i.1 = icmp eq i32 %14, 1 %spec.select.us.us.i.1 = select i1 %cmp25.not.us.us.i.1, i32 %max.2.us.us.i, i32 %13 %15 = trunc i64 %indvars.iv.next.i to i32 %spec.select67.us.us.i.1 = select i1 %cmp25.not.us.us.i.1, i32 %min.3.us.us.i, i32 %15 br label %for.inc32.us.us.i.1 for.inc32.us.us.i.1: ; preds = %land.lhs.true22.us.us.i.1, %for.inc32.us.us.i %max.2.us.us.i.1 = phi i32 [ %max.2.us.us.i, %for.inc32.us.us.i ], [ %spec.select.us.us.i.1, %land.lhs.true22.us.us.i.1 ] %min.3.us.us.i.1 = phi i32 [ %min.3.us.us.i, %for.inc32.us.us.i ], [ %spec.select67.us.us.i.1, %land.lhs.true22.us.us.i.1 ] %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond5.for.inc35_crit_edge.us.us.i.unr-lcssa, label %for.body7.us.us.i, !llvm.loop !13 for.cond5.for.inc35_crit_edge.us.us.i.unr-lcssa: ; preds = %for.inc32.us.us.i.1, %for.cond5.preheader.us.us.i %max.2.us.us.i.lcssa.ph = phi i32 [ undef, %for.cond5.preheader.us.us.i ], [ %max.2.us.us.i.1, %for.inc32.us.us.i.1 ] %min.3.us.us.i.lcssa.ph = phi i32 [ undef, %for.cond5.preheader.us.us.i ], [ %min.3.us.us.i.1, %for.inc32.us.us.i.1 ] %indvars.iv.i.unr = phi i64 [ 0, %for.cond5.preheader.us.us.i ], [ %indvars.iv.next.i.1, %for.inc32.us.us.i.1 ] %min.273.us.us.i.unr = phi i32 [ %min.177.us.us.i, %for.cond5.preheader.us.us.i ], [ %min.3.us.us.i.1, %for.inc32.us.us.i.1 ] %max.172.us.us.i.unr = phi i32 [ %max.076.us.us.i, %for.cond5.preheader.us.us.i ], [ %max.2.us.us.i.1, %for.inc32.us.us.i.1 ] br i1 %lcmp.mod.not, label %for.cond5.for.inc35_crit_edge.us.us.i, label %for.body7.us.us.i.epil for.body7.us.us.i.epil: ; preds = %for.cond5.for.inc35_crit_edge.us.us.i.unr-lcssa %arrayidx13.us.us.i.epil = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom10.us.us.i, i64 %indvars.iv.i.unr %16 = load i32, ptr %arrayidx13.us.us.i.epil, align 4, !tbaa !5 %cmp14.us.us.i.epil = icmp sge i32 %16, %max.172.us.us.i.unr %cmp21.not.us.us.i.epil = icmp eq i32 %16, -1 %or.cond.us.us.i.epil = or i1 %cmp14.us.us.i.epil, %cmp21.not.us.us.i.epil br i1 %or.cond.us.us.i.epil, label %for.cond5.for.inc35_crit_edge.us.us.i, label %land.lhs.true22.us.us.i.epil land.lhs.true22.us.us.i.epil: ; preds = %for.body7.us.us.i.epil %arrayidx24.us.us.i.epil = getelementptr inbounds [100 x i32], ptr @G, i64 0, i64 %indvars.iv.i.unr %17 = load i32, ptr %arrayidx24.us.us.i.epil, align 4, !tbaa !5 %cmp25.not.us.us.i.epil = icmp eq i32 %17, 1 %spec.select.us.us.i.epil = select i1 %cmp25.not.us.us.i.epil, i32 %max.172.us.us.i.unr, i32 %16 %18 = trunc i64 %indvars.iv.i.unr to i32 %spec.select67.us.us.i.epil = select i1 %cmp25.not.us.us.i.epil, i32 %min.273.us.us.i.unr, i32 %18 br label %for.cond5.for.inc35_crit_edge.us.us.i for.cond5.for.inc35_crit_edge.us.us.i: ; preds = %for.body7.us.us.i.epil, %land.lhs.true22.us.us.i.epil, %for.cond5.for.inc35_crit_edge.us.us.i.unr-lcssa %max.2.us.us.i.lcssa = phi i32 [ %max.2.us.us.i.lcssa.ph, %for.cond5.for.inc35_crit_edge.us.us.i.unr-lcssa ], [ %max.172.us.us.i.unr, %for.body7.us.us.i.epil ], [ %spec.select.us.us.i.epil, %land.lhs.true22.us.us.i.epil ] %min.3.us.us.i.lcssa = phi i32 [ %min.3.us.us.i.lcssa.ph, %for.cond5.for.inc35_crit_edge.us.us.i.unr-lcssa ], [ %min.273.us.us.i.unr, %for.body7.us.us.i.epil ], [ %spec.select67.us.us.i.epil, %land.lhs.true22.us.us.i.epil ] %indvars.iv.next85.i = add nuw nsw i64 %indvars.iv84.i, 1 %exitcond88.not.i = icmp eq i64 %indvars.iv.next85.i, %indvars.iv89.i br i1 %exitcond88.not.i, label %for.end37.split.us.us.i, label %for.cond5.preheader.us.us.i, !llvm.loop !14 for.end37.split.us.us.i: ; preds = %for.cond5.for.inc35_crit_edge.us.us.i %cmp38.not.us.i = icmp eq i64 %indvars.iv89.i, %.lcssa1631 br i1 %cmp38.not.us.i, label %MTS.exit, label %if.then39.us.i if.then39.i: ; preds = %if.then39.i, %while.cond.preheader80.i br label %if.then39.i MTS.exit: ; preds = %for.end37.split.us.us.i call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %R.i) #5 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.us.i) 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: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @MTS(i32 noundef %n) local_unnamed_addr #3 { entry: %R = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %R) #5 store i32 1, ptr @G, align 16, !tbaa !5 store i32 0, ptr %R, align 16, !tbaa !5 %cmp68 = icmp sgt i32 %n, 1 br i1 %cmp68, label %while.cond.preheader.thread, label %while.cond.preheader while.cond.preheader.thread: ; preds = %entry %0 = add nsw i32 %n, -1 %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([100 x i32], ptr @G, i64 0, i64 1), i8 0, i64 %2, i1 false), !tbaa !5 br label %while.cond.us.preheader while.cond.preheader: ; preds = %entry %cmp670 = icmp eq i32 %n, 1 br i1 %cmp670, label %while.cond.us.preheader, label %while.cond.preheader80 while.cond.preheader80: ; preds = %while.cond.preheader store i32 1, ptr @G, align 16, !tbaa !5 br label %if.then39 while.cond.us.preheader: ; preds = %while.cond.preheader.thread, %while.cond.preheader %3 = zext i32 %n to i64 %xtraiter = and i64 %3, 1 %4 = icmp eq i32 %n, 1 %unroll_iter = and i64 %3, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %while.cond.us while.cond.us: ; preds = %while.cond.us.preheader, %if.then39.us %indvars.iv89 = phi i64 [ 1, %while.cond.us.preheader ], [ %indvars.iv.next90, %if.then39.us ] %min.0.us = phi i32 [ undef, %while.cond.us.preheader ], [ %min.3.us.us.lcssa, %if.then39.us ] %count.0.us = phi i32 [ 0, %while.cond.us.preheader ], [ %add.us, %if.then39.us ] br label %for.cond5.preheader.us.us if.then39.us: ; preds = %for.end37.split.us.us %arrayidx41.us = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv89 store i32 %min.3.us.us.lcssa, ptr %arrayidx41.us, align 4, !tbaa !5 %idxprom42.us = sext i32 %min.3.us.us.lcssa to i64 %arrayidx43.us = getelementptr inbounds [100 x i32], ptr @G, i64 0, i64 %idxprom42.us store i32 1, ptr %arrayidx43.us, align 4, !tbaa !5 %add.us = add nsw i32 %max.2.us.us.lcssa, %count.0.us %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1 br label %while.cond.us for.cond5.preheader.us.us: ; preds = %for.cond5.for.inc35_crit_edge.us.us, %while.cond.us %indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.cond5.for.inc35_crit_edge.us.us ], [ 0, %while.cond.us ] %min.177.us.us = phi i32 [ %min.3.us.us.lcssa, %for.cond5.for.inc35_crit_edge.us.us ], [ %min.0.us, %while.cond.us ] %max.076.us.us = phi i32 [ %max.2.us.us.lcssa, %for.cond5.for.inc35_crit_edge.us.us ], [ 2001, %while.cond.us ] %arrayidx9.us.us = getelementptr inbounds [100 x i32], ptr %R, i64 0, i64 %indvars.iv84 %5 = load i32, ptr %arrayidx9.us.us, align 4, !tbaa !5 %idxprom10.us.us = sext i32 %5 to i64 br i1 %4, label %for.cond5.for.inc35_crit_edge.us.us.unr-lcssa, label %for.body7.us.us for.body7.us.us: ; preds = %for.cond5.preheader.us.us, %for.inc32.us.us.1 %indvars.iv = phi i64 [ %indvars.iv.next.1, %for.inc32.us.us.1 ], [ 0, %for.cond5.preheader.us.us ] %min.273.us.us = phi i32 [ %min.3.us.us.1, %for.inc32.us.us.1 ], [ %min.177.us.us, %for.cond5.preheader.us.us ] %max.172.us.us = phi i32 [ %max.2.us.us.1, %for.inc32.us.us.1 ], [ %max.076.us.us, %for.cond5.preheader.us.us ] %niter = phi i64 [ %niter.next.1, %for.inc32.us.us.1 ], [ 0, %for.cond5.preheader.us.us ] %arrayidx13.us.us = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom10.us.us, i64 %indvars.iv %6 = load i32, ptr %arrayidx13.us.us, align 8, !tbaa !5 %cmp14.us.us = icmp sge i32 %6, %max.172.us.us %cmp21.not.us.us = icmp eq i32 %6, -1 %or.cond.us.us = or i1 %cmp14.us.us, %cmp21.not.us.us br i1 %or.cond.us.us, label %for.inc32.us.us, label %land.lhs.true22.us.us land.lhs.true22.us.us: ; preds = %for.body7.us.us %arrayidx24.us.us = getelementptr inbounds [100 x i32], ptr @G, i64 0, i64 %indvars.iv %7 = load i32, ptr %arrayidx24.us.us, align 8, !tbaa !5 %cmp25.not.us.us = icmp eq i32 %7, 1 %spec.select.us.us = select i1 %cmp25.not.us.us, i32 %max.172.us.us, i32 %6 %8 = trunc i64 %indvars.iv to i32 %spec.select67.us.us = select i1 %cmp25.not.us.us, i32 %min.273.us.us, i32 %8 br label %for.inc32.us.us for.inc32.us.us: ; preds = %land.lhs.true22.us.us, %for.body7.us.us %max.2.us.us = phi i32 [ %max.172.us.us, %for.body7.us.us ], [ %spec.select.us.us, %land.lhs.true22.us.us ] %min.3.us.us = phi i32 [ %min.273.us.us, %for.body7.us.us ], [ %spec.select67.us.us, %land.lhs.true22.us.us ] %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx13.us.us.1 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom10.us.us, i64 %indvars.iv.next %9 = load i32, ptr %arrayidx13.us.us.1, align 4, !tbaa !5 %cmp14.us.us.1 = icmp sge i32 %9, %max.2.us.us %cmp21.not.us.us.1 = icmp eq i32 %9, -1 %or.cond.us.us.1 = or i1 %cmp14.us.us.1, %cmp21.not.us.us.1 br i1 %or.cond.us.us.1, label %for.inc32.us.us.1, label %land.lhs.true22.us.us.1 land.lhs.true22.us.us.1: ; preds = %for.inc32.us.us %arrayidx24.us.us.1 = getelementptr inbounds [100 x i32], ptr @G, i64 0, i64 %indvars.iv.next %10 = load i32, ptr %arrayidx24.us.us.1, align 4, !tbaa !5 %cmp25.not.us.us.1 = icmp eq i32 %10, 1 %spec.select.us.us.1 = select i1 %cmp25.not.us.us.1, i32 %max.2.us.us, i32 %9 %11 = trunc i64 %indvars.iv.next to i32 %spec.select67.us.us.1 = select i1 %cmp25.not.us.us.1, i32 %min.3.us.us, i32 %11 br label %for.inc32.us.us.1 for.inc32.us.us.1: ; preds = %land.lhs.true22.us.us.1, %for.inc32.us.us %max.2.us.us.1 = phi i32 [ %max.2.us.us, %for.inc32.us.us ], [ %spec.select.us.us.1, %land.lhs.true22.us.us.1 ] %min.3.us.us.1 = phi i32 [ %min.3.us.us, %for.inc32.us.us ], [ %spec.select67.us.us.1, %land.lhs.true22.us.us.1 ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond5.for.inc35_crit_edge.us.us.unr-lcssa, label %for.body7.us.us, !llvm.loop !13 for.cond5.for.inc35_crit_edge.us.us.unr-lcssa: ; preds = %for.inc32.us.us.1, %for.cond5.preheader.us.us %max.2.us.us.lcssa.ph = phi i32 [ undef, %for.cond5.preheader.us.us ], [ %max.2.us.us.1, %for.inc32.us.us.1 ] %min.3.us.us.lcssa.ph = phi i32 [ undef, %for.cond5.preheader.us.us ], [ %min.3.us.us.1, %for.inc32.us.us.1 ] %indvars.iv.unr = phi i64 [ 0, %for.cond5.preheader.us.us ], [ %indvars.iv.next.1, %for.inc32.us.us.1 ] %min.273.us.us.unr = phi i32 [ %min.177.us.us, %for.cond5.preheader.us.us ], [ %min.3.us.us.1, %for.inc32.us.us.1 ] %max.172.us.us.unr = phi i32 [ %max.076.us.us, %for.cond5.preheader.us.us ], [ %max.2.us.us.1, %for.inc32.us.us.1 ] br i1 %lcmp.mod.not, label %for.cond5.for.inc35_crit_edge.us.us, label %for.body7.us.us.epil for.body7.us.us.epil: ; preds = %for.cond5.for.inc35_crit_edge.us.us.unr-lcssa %arrayidx13.us.us.epil = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom10.us.us, i64 %indvars.iv.unr %12 = load i32, ptr %arrayidx13.us.us.epil, align 4, !tbaa !5 %cmp14.us.us.epil = icmp sge i32 %12, %max.172.us.us.unr %cmp21.not.us.us.epil = icmp eq i32 %12, -1 %or.cond.us.us.epil = or i1 %cmp14.us.us.epil, %cmp21.not.us.us.epil br i1 %or.cond.us.us.epil, label %for.cond5.for.inc35_crit_edge.us.us, label %land.lhs.true22.us.us.epil land.lhs.true22.us.us.epil: ; preds = %for.body7.us.us.epil %arrayidx24.us.us.epil = getelementptr inbounds [100 x i32], ptr @G, i64 0, i64 %indvars.iv.unr %13 = load i32, ptr %arrayidx24.us.us.epil, align 4, !tbaa !5 %cmp25.not.us.us.epil = icmp eq i32 %13, 1 %spec.select.us.us.epil = select i1 %cmp25.not.us.us.epil, i32 %max.172.us.us.unr, i32 %12 %14 = trunc i64 %indvars.iv.unr to i32 %spec.select67.us.us.epil = select i1 %cmp25.not.us.us.epil, i32 %min.273.us.us.unr, i32 %14 br label %for.cond5.for.inc35_crit_edge.us.us for.cond5.for.inc35_crit_edge.us.us: ; preds = %for.body7.us.us.epil, %land.lhs.true22.us.us.epil, %for.cond5.for.inc35_crit_edge.us.us.unr-lcssa %max.2.us.us.lcssa = phi i32 [ %max.2.us.us.lcssa.ph, %for.cond5.for.inc35_crit_edge.us.us.unr-lcssa ], [ %max.172.us.us.unr, %for.body7.us.us.epil ], [ %spec.select.us.us.epil, %land.lhs.true22.us.us.epil ] %min.3.us.us.lcssa = phi i32 [ %min.3.us.us.lcssa.ph, %for.cond5.for.inc35_crit_edge.us.us.unr-lcssa ], [ %min.273.us.us.unr, %for.body7.us.us.epil ], [ %spec.select67.us.us.epil, %land.lhs.true22.us.us.epil ] %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %exitcond88.not = icmp eq i64 %indvars.iv.next85, %indvars.iv89 br i1 %exitcond88.not, label %for.end37.split.us.us, label %for.cond5.preheader.us.us, !llvm.loop !14 for.end37.split.us.us: ; preds = %for.cond5.for.inc35_crit_edge.us.us %cmp38.not.us = icmp eq i64 %indvars.iv89, %3 br i1 %cmp38.not.us, label %while.end, label %if.then39.us if.then39: ; preds = %if.then39, %while.cond.preheader80 br label %if.then39 while.end: ; preds = %for.end37.split.us.us call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %R) #5 ret i32 %count.0.us } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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) #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 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 nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include <stdio.h> #define N 100 #define INF 2001 #define WHITE 0 #define BLACK 1 int n,M[N][N]; int d[N],p[N],color[N]; void prim(); int main() { int i,j,sum = 0; scanf("%d",&n); for(i = 0; i < n; i++){ for(j = 0; j < n; j++){ scanf("%d",&M[i][j]); } } prim(); for(i = 0; i < n; i++) if(p[i] != -1) sum += d[i]; printf("%d\n",sum); return 0; } void prim(){ int u,minv,i; for(i = 0; i < n; i++){ d[i] = INF; p[i] = -1; color[i] = WHITE; } d[0] = 0; while(1) { minv = INF; for(i = 0; i < n; i++){ if(minv > d[i] && color[i] != BLACK){ u = i; minv = d[i]; } } if(minv == INF) break; color[u] = BLACK; for(i = 0; i < n; i++){ if(M[i][u] != -1){ if(color[i] != BLACK && M[i][u] < d[i]){ p[i] = u; d[i] = M[i][u]; } } } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199178/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199178/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @M = dso_local global [100 x [100 x i32]] zeroinitializer, align 16 @p = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @d = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @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: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i33 = freeze i32 %0 %cmp34 = icmp sgt i32 %.fr.i33, 0 br i1 %cmp34, label %for.cond1.preheader, label %prim.exit.thread for.cond1.preheader: ; preds = %entry, %for.inc7 %1 = phi i32 [ %.fr.i, %for.inc7 ], [ %.fr.i33, %entry ] %indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.inc7 ], [ 0, %entry ] %cmp231 = icmp sgt i32 %1, 0 br i1 %cmp231, label %for.body3, label %for.inc7 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv43, i64 %indvars.iv %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %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 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !9 for.inc7: ; preds = %for.body3, %for.cond1.preheader %4 = phi i32 [ %1, %for.cond1.preheader ], [ %2, %for.body3 ] %.fr.i = freeze i32 %4 %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %5 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next44, %5 br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !11 for.end9: ; preds = %for.inc7 %cmp84.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp84.i, label %for.body.preheader.i, label %prim.exit.thread prim.exit.thread: ; preds = %for.end9, %entry store i32 0, ptr @d, align 16, !tbaa !5 br label %for.end20 for.body.preheader.i: ; preds = %for.end9 %6 = zext i32 %.fr.i to i64 %7 = shl nuw nsw i64 %6, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @p, i8 -1, i64 %7, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %7, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %6, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %8 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %index store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %9, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %6 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.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv.i store i32 2001, 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, %6 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.block store i32 0, ptr @d, align 16, !tbaa !5 br label %for.body7.us.i for.end18.us.i: ; preds = %for.inc16.us.i %cmp19.us.i = icmp eq i32 %minv.1.us.i, 2001 br i1 %cmp19.us.i, label %prim.exit, label %if.end21.us.i if.end21.us.i: ; preds = %for.end18.us.i %idxprom22.us.i = sext i32 %u.2.us.i to i64 %arrayidx23.us.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom22.us.i store i32 1, ptr %arrayidx23.us.i, align 4, !tbaa !5 br label %for.body26.us.i for.body26.us.i: ; preds = %for.inc55.us.i, %if.end21.us.i %indvars.iv136.i = phi i64 [ 0, %if.end21.us.i ], [ %indvars.iv.next137.i, %for.inc55.us.i ] %arrayidx30.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv136.i, i64 %idxprom22.us.i %11 = load i32, ptr %arrayidx30.us.i, align 4, !tbaa !5 %cmp31.not.us.i = icmp eq i32 %11, -1 br i1 %cmp31.not.us.i, label %for.inc55.us.i, label %if.then32.us.i if.then32.us.i: ; preds = %for.body26.us.i %arrayidx34.us.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv136.i %12 = load i32, ptr %arrayidx34.us.i, align 4, !tbaa !5 %cmp35.not.us.i = icmp eq i32 %12, 1 br i1 %cmp35.not.us.i, label %for.inc55.us.i, label %land.lhs.true36.us.i land.lhs.true36.us.i: ; preds = %if.then32.us.i %arrayidx42.us.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv136.i %13 = load i32, ptr %arrayidx42.us.i, align 4, !tbaa !5 %cmp43.us.i = icmp slt i32 %11, %13 br i1 %cmp43.us.i, label %if.then44.us.i, label %for.inc55.us.i if.then44.us.i: ; preds = %land.lhs.true36.us.i %arrayidx46.us.i = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %indvars.iv136.i store i32 %u.2.us.i, ptr %arrayidx46.us.i, align 4, !tbaa !5 store i32 %11, ptr %arrayidx42.us.i, align 4, !tbaa !5 br label %for.inc55.us.i for.inc55.us.i: ; preds = %if.then44.us.i, %land.lhs.true36.us.i, %if.then32.us.i, %for.body26.us.i %indvars.iv.next137.i = add nuw nsw i64 %indvars.iv136.i, 1 %exitcond140.not.i = icmp eq i64 %indvars.iv.next137.i, %6 br i1 %exitcond140.not.i, label %for.body7.us.i.backedge, label %for.body26.us.i, !llvm.loop !17 for.body7.us.i: ; preds = %for.body7.us.i.backedge, %while.cond.us.preheader.i %indvars.iv131.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv131.i.be, %for.body7.us.i.backedge ] %minv.088.us.i = phi i32 [ 2001, %while.cond.us.preheader.i ], [ %minv.088.us.i.be, %for.body7.us.i.backedge ] %u.187.us.i = phi i32 [ undef, %while.cond.us.preheader.i ], [ %u.2.us.i, %for.body7.us.i.backedge ] %arrayidx9.us.i = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv131.i %14 = load i32, ptr %arrayidx9.us.i, align 4, !tbaa !5 %cmp10.us.i = icmp sgt i32 %minv.088.us.i, %14 br i1 %cmp10.us.i, label %land.lhs.true.us.i, label %for.inc16.us.i land.lhs.true.us.i: ; preds = %for.body7.us.i %arrayidx12.us.i = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv131.i %15 = load i32, ptr %arrayidx12.us.i, align 4, !tbaa !5 %cmp13.not.us.i = icmp eq i32 %15, 1 %16 = trunc i64 %indvars.iv131.i to i32 %spec.select.us.i = select i1 %cmp13.not.us.i, i32 %u.187.us.i, i32 %16 %spec.select83.us.i = select i1 %cmp13.not.us.i, i32 %minv.088.us.i, i32 %14 br label %for.inc16.us.i for.inc16.us.i: ; preds = %land.lhs.true.us.i, %for.body7.us.i %u.2.us.i = phi i32 [ %u.187.us.i, %for.body7.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %minv.1.us.i = phi i32 [ %minv.088.us.i, %for.body7.us.i ], [ %spec.select83.us.i, %land.lhs.true.us.i ] %indvars.iv.next132.i = add nuw nsw i64 %indvars.iv131.i, 1 %exitcond135.not.i = icmp eq i64 %indvars.iv.next132.i, %6 br i1 %exitcond135.not.i, label %for.end18.us.i, label %for.body7.us.i.backedge for.body7.us.i.backedge: ; preds = %for.inc55.us.i, %for.inc16.us.i %indvars.iv131.i.be = phi i64 [ %indvars.iv.next132.i, %for.inc16.us.i ], [ 0, %for.inc55.us.i ] %minv.088.us.i.be = phi i32 [ %minv.1.us.i, %for.inc16.us.i ], [ 2001, %for.inc55.us.i ] br label %for.body7.us.i, !llvm.loop !17 prim.exit: ; preds = %for.end18.us.i br i1 %cmp84.i, label %for.body12.preheader, label %for.end20 for.body12.preheader: ; preds = %prim.exit %xtraiter = and i64 %6, 1 %17 = icmp eq i32 %.fr.i, 1 br i1 %17, label %for.end20.loopexit.unr-lcssa, label %for.body12.preheader.new for.body12.preheader.new: ; preds = %for.body12.preheader %unroll_iter = and i64 %6, 4294967294 br label %for.body12 for.body12: ; preds = %for.inc18.1, %for.body12.preheader.new %indvars.iv46 = phi i64 [ 0, %for.body12.preheader.new ], [ %indvars.iv.next47.1, %for.inc18.1 ] %sum.038 = phi i32 [ 0, %for.body12.preheader.new ], [ %sum.1.1, %for.inc18.1 ] %niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.inc18.1 ] %arrayidx14 = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %indvars.iv46 %18 = load i32, ptr %arrayidx14, align 8, !tbaa !5 %cmp15.not = icmp eq i32 %18, -1 br i1 %cmp15.not, label %for.inc18, label %if.then if.then: ; preds = %for.body12 %arrayidx17 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv46 %19 = load i32, ptr %arrayidx17, align 8, !tbaa !5 %add = add nsw i32 %19, %sum.038 br label %for.inc18 for.inc18: ; preds = %for.body12, %if.then %sum.1 = phi i32 [ %add, %if.then ], [ %sum.038, %for.body12 ] %indvars.iv.next47 = or i64 %indvars.iv46, 1 %arrayidx14.1 = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %indvars.iv.next47 %20 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5 %cmp15.not.1 = icmp eq i32 %20, -1 br i1 %cmp15.not.1, label %for.inc18.1, label %if.then.1 if.then.1: ; preds = %for.inc18 %arrayidx17.1 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv.next47 %21 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5 %add.1 = add nsw i32 %21, %sum.1 br label %for.inc18.1 for.inc18.1: ; preds = %if.then.1, %for.inc18 %sum.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %sum.1, %for.inc18 ] %indvars.iv.next47.1 = add nuw nsw i64 %indvars.iv46, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end20.loopexit.unr-lcssa, label %for.body12, !llvm.loop !18 for.end20.loopexit.unr-lcssa: ; preds = %for.inc18.1, %for.body12.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body12.preheader ], [ %sum.1.1, %for.inc18.1 ] %indvars.iv46.unr = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next47.1, %for.inc18.1 ] %sum.038.unr = phi i32 [ 0, %for.body12.preheader ], [ %sum.1.1, %for.inc18.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end20, label %for.body12.epil for.body12.epil: ; preds = %for.end20.loopexit.unr-lcssa %arrayidx14.epil = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %indvars.iv46.unr %22 = load i32, ptr %arrayidx14.epil, align 4, !tbaa !5 %cmp15.not.epil = icmp eq i32 %22, -1 br i1 %cmp15.not.epil, label %for.end20, label %if.then.epil if.then.epil: ; preds = %for.body12.epil %arrayidx17.epil = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv46.unr %23 = load i32, ptr %arrayidx17.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %23, %sum.038.unr br label %for.end20 for.end20: ; preds = %for.end20.loopexit.unr-lcssa, %if.then.epil, %for.body12.epil, %prim.exit.thread, %prim.exit %sum.0.lcssa = phi i32 [ 0, %prim.exit ], [ 0, %prim.exit.thread ], [ %sum.1.lcssa.ph, %for.end20.loopexit.unr-lcssa ], [ %add.epil, %if.then.epil ], [ %sum.038.unr, %for.body12.epil ] %call21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @prim() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp84 = icmp sgt i32 %.fr, 0 br i1 %cmp84, label %for.body.preheader, label %for.end.thread for.end.thread: ; preds = %entry store i32 0, ptr @d, align 16, !tbaa !5 br label %while.end for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @p, i8 -1, i64 %2, i1 false), !tbaa !5 tail 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.preheader141, 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 2001, i32 2001, i32 2001, i32 2001>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, 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 !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader141 for.body.preheader141: ; 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.preheader141, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader141 ] %arrayidx = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv store i32 2001, 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 !20 for.end: ; preds = %for.body, %middle.block store i32 0, ptr @d, align 16, !tbaa !5 br i1 %cmp84, label %while.cond.us.preheader, label %while.end while.cond.us.preheader: ; preds = %for.end %wide.trip.count134 = zext i32 %.fr to i64 %wide.trip.count139 = zext i32 %.fr to i64 br label %for.body7.us for.end18.us: ; preds = %for.inc16.us %cmp19.us = icmp eq i32 %minv.1.us, 2001 br i1 %cmp19.us, label %while.end, label %if.end21.us if.end21.us: ; preds = %for.end18.us %idxprom22.us = sext i32 %u.2.us to i64 %arrayidx23.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom22.us store i32 1, ptr %arrayidx23.us, align 4, !tbaa !5 br label %for.body26.us for.body26.us: ; preds = %if.end21.us, %for.inc55.us %indvars.iv136 = phi i64 [ 0, %if.end21.us ], [ %indvars.iv.next137, %for.inc55.us ] %arrayidx30.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv136, i64 %idxprom22.us %6 = load i32, ptr %arrayidx30.us, align 4, !tbaa !5 %cmp31.not.us = icmp eq i32 %6, -1 br i1 %cmp31.not.us, label %for.inc55.us, label %if.then32.us if.then32.us: ; preds = %for.body26.us %arrayidx34.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv136 %7 = load i32, ptr %arrayidx34.us, align 4, !tbaa !5 %cmp35.not.us = icmp eq i32 %7, 1 br i1 %cmp35.not.us, label %for.inc55.us, label %land.lhs.true36.us land.lhs.true36.us: ; preds = %if.then32.us %arrayidx42.us = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv136 %8 = load i32, ptr %arrayidx42.us, align 4, !tbaa !5 %cmp43.us = icmp slt i32 %6, %8 br i1 %cmp43.us, label %if.then44.us, label %for.inc55.us if.then44.us: ; preds = %land.lhs.true36.us %arrayidx46.us = getelementptr inbounds [100 x i32], ptr @p, i64 0, i64 %indvars.iv136 store i32 %u.2.us, ptr %arrayidx46.us, align 4, !tbaa !5 store i32 %6, ptr %arrayidx42.us, align 4, !tbaa !5 br label %for.inc55.us for.inc55.us: ; preds = %if.then44.us, %land.lhs.true36.us, %if.then32.us, %for.body26.us %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %exitcond140.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count139 br i1 %exitcond140.not, label %for.body7.us.backedge, label %for.body26.us, !llvm.loop !17 for.body7.us: ; preds = %for.body7.us.backedge, %while.cond.us.preheader %indvars.iv131 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv131.be, %for.body7.us.backedge ] %minv.088.us = phi i32 [ 2001, %while.cond.us.preheader ], [ %minv.088.us.be, %for.body7.us.backedge ] %u.187.us = phi i32 [ undef, %while.cond.us.preheader ], [ %u.2.us, %for.body7.us.backedge ] %arrayidx9.us = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv131 %9 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %cmp10.us = icmp sgt i32 %minv.088.us, %9 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.iv131 %10 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %cmp13.not.us = icmp eq i32 %10, 1 %11 = trunc i64 %indvars.iv131 to i32 %spec.select.us = select i1 %cmp13.not.us, i32 %u.187.us, i32 %11 %spec.select83.us = select i1 %cmp13.not.us, i32 %minv.088.us, i32 %9 br label %for.inc16.us for.inc16.us: ; preds = %land.lhs.true.us, %for.body7.us %u.2.us = phi i32 [ %u.187.us, %for.body7.us ], [ %spec.select.us, %land.lhs.true.us ] %minv.1.us = phi i32 [ %minv.088.us, %for.body7.us ], [ %spec.select83.us, %land.lhs.true.us ] %indvars.iv.next132 = add nuw nsw i64 %indvars.iv131, 1 %exitcond135.not = icmp eq i64 %indvars.iv.next132, %wide.trip.count134 br i1 %exitcond135.not, label %for.end18.us, label %for.body7.us.backedge for.body7.us.backedge: ; preds = %for.inc55.us, %for.inc16.us %indvars.iv131.be = phi i64 [ %indvars.iv.next132, %for.inc16.us ], [ 0, %for.inc55.us ] %minv.088.us.be = phi i32 [ %minv.1.us, %for.inc16.us ], [ 2001, %for.inc55.us ] br label %for.body7.us, !llvm.loop !17 while.end: ; preds = %for.end18.us, %for.end, %for.end.thread ret void } ; 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !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 MAX 100 #define INFTY 2000000 #define White 0 #define Gray 1 #define Black 2 int G[MAX][MAX],n; int prim(){ int color[MAX],d[MAX],p[MAX]; int min,u,v,sum=0; int i; for(i = 0; i < n; i++){ color[i] = White; d[i] = INFTY; p[i] = -1; } d[0] = 0; p[0] = -1; while(1){ min = INFTY; for(i = 0; i < n; i++){ if(color[i] != Black && d[i] < min){ min = d[i]; u = i; } } if(min == INFTY) break; color[u] = Black; for(v = 0; v < n; v++){ if(color[v] != Black && G[u][v] != INFTY){ if(G[u][v] < d[v]){ d[v] = G[u][v]; p[v] = u; color[v] = Gray; } } } } for(i = 0; i < n; i++){ if(p[i] != -1) sum += G[i][p[i]]; } return sum; } int main(){ int i,j; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&G[i][j]); if(G[i][j] == -1) G[i][j] = INFTY; } } printf("%d\n",prim()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199220/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199220/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i32 0, align 4 @G = dso_local 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 [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #0 { entry: %color = alloca [100 x i32], align 16 %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #6 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp112 = icmp sgt i32 %.fr, 0 br i1 %cmp112, label %for.body.preheader, label %for.end78 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 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p, i8 -1, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader179, 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 2000000, i32 2000000, i32 2000000, i32 2000000>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2000000, i32 2000000, i32 2000000, i32 2000000>, 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 !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader179 for.body.preheader179: ; 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.preheader179, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader179 ] %arrayidx2 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 2000000, ptr %arrayidx2, 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 !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 store i32 -1, ptr %p, align 16, !tbaa !5 br i1 %cmp112, label %while.cond.us.preheader, label %for.end78 while.cond.us.preheader: ; preds = %for.end %wide.trip.count167 = zext i32 %.fr to i64 %wide.trip.count172 = zext i32 %.fr to i64 br label %for.body9.us for.end20.us: ; preds = %for.inc18.us %cmp21.us = icmp eq i32 %min.1.us, 2000000 br i1 %cmp21.us, label %for.cond62.preheader, 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 2, ptr %arrayidx25.us, align 4, !tbaa !5 br label %for.body28.us for.body28.us: ; preds = %if.end23.us, %for.inc59.us %indvars.iv169 = phi i64 [ 0, %if.end23.us ], [ %indvars.iv.next170, %for.inc59.us ] %arrayidx30.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv169 %6 = load i32, ptr %arrayidx30.us, align 4, !tbaa !5 %cmp31.not.us = icmp eq i32 %6, 2 br i1 %cmp31.not.us, label %for.inc59.us, label %land.lhs.true32.us land.lhs.true32.us: ; preds = %for.body28.us %arrayidx36.us = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom24.us, i64 %indvars.iv169 %7 = load i32, ptr %arrayidx36.us, align 4, !tbaa !5 %cmp37.not.us = icmp eq i32 %7, 2000000 br i1 %cmp37.not.us, label %for.inc59.us, label %if.then38.us if.then38.us: ; preds = %land.lhs.true32.us %arrayidx44.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv169 %8 = load i32, ptr %arrayidx44.us, align 4, !tbaa !5 %cmp45.us = icmp slt i32 %7, %8 br i1 %cmp45.us, label %if.then46.us, label %for.inc59.us if.then46.us: ; preds = %if.then38.us store i32 %7, ptr %arrayidx44.us, align 4, !tbaa !5 %arrayidx54.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv169 store i32 %u.2.us, ptr %arrayidx54.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx30.us, align 4, !tbaa !5 br label %for.inc59.us for.inc59.us: ; preds = %if.then46.us, %if.then38.us, %land.lhs.true32.us, %for.body28.us %indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1 %exitcond173.not = icmp eq i64 %indvars.iv.next170, %wide.trip.count172 br i1 %exitcond173.not, label %for.body9.us.backedge, label %for.body28.us, !llvm.loop !14 for.body9.us: ; preds = %for.body9.us.backedge, %while.cond.us.preheader %indvars.iv164 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv164.be, %for.body9.us.backedge ] %u.1116.us = phi i32 [ undef, %while.cond.us.preheader ], [ %u.2.us, %for.body9.us.backedge ] %min.0115.us = phi i32 [ 2000000, %while.cond.us.preheader ], [ %min.0115.us.be, %for.body9.us.backedge ] %arrayidx11.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv164 %9 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5 %cmp12.not.us = icmp eq i32 %9, 2 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.iv164 %10 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %cmp15.us = icmp slt i32 %10, %min.0115.us %spec.select.us = tail call i32 @llvm.smin.i32(i32 %10, i32 %min.0115.us) %11 = trunc i64 %indvars.iv164 to i32 %spec.select111.us = select i1 %cmp15.us, i32 %11, i32 %u.1116.us br label %for.inc18.us for.inc18.us: ; preds = %land.lhs.true.us, %for.body9.us %min.1.us = phi i32 [ %min.0115.us, %for.body9.us ], [ %spec.select.us, %land.lhs.true.us ] %u.2.us = phi i32 [ %u.1116.us, %for.body9.us ], [ %spec.select111.us, %land.lhs.true.us ] %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1 %exitcond168.not = icmp eq i64 %indvars.iv.next165, %wide.trip.count167 br i1 %exitcond168.not, label %for.end20.us, label %for.body9.us.backedge for.body9.us.backedge: ; preds = %for.inc59.us, %for.inc18.us %indvars.iv164.be = phi i64 [ %indvars.iv.next165, %for.inc18.us ], [ 0, %for.inc59.us ] %min.0115.us.be = phi i32 [ %min.1.us, %for.inc18.us ], [ 2000000, %for.inc59.us ] br label %for.body9.us, !llvm.loop !14 for.cond62.preheader: ; preds = %for.end20.us br i1 %cmp112, label %for.body64.preheader, label %for.end78 for.body64.preheader: ; preds = %for.cond62.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end78.loopexit.unr-lcssa, label %for.body64.preheader.new for.body64.preheader.new: ; preds = %for.body64.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body64 for.body64: ; preds = %for.inc76.1, %for.body64.preheader.new %indvars.iv174 = phi i64 [ 0, %for.body64.preheader.new ], [ %indvars.iv.next175.1, %for.inc76.1 ] %sum.0154 = phi i32 [ 0, %for.body64.preheader.new ], [ %sum.1.1, %for.inc76.1 ] %niter = phi i64 [ 0, %for.body64.preheader.new ], [ %niter.next.1, %for.inc76.1 ] %arrayidx66 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv174 %13 = load i32, ptr %arrayidx66, align 8, !tbaa !5 %cmp67.not = icmp eq i32 %13, -1 br i1 %cmp67.not, label %for.inc76, label %if.then68 if.then68: ; preds = %for.body64 %idxprom73 = sext i32 %13 to i64 %arrayidx74 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv174, i64 %idxprom73 %14 = load i32, ptr %arrayidx74, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0154 br label %for.inc76 for.inc76: ; preds = %for.body64, %if.then68 %sum.1 = phi i32 [ %add, %if.then68 ], [ %sum.0154, %for.body64 ] %indvars.iv.next175 = or i64 %indvars.iv174, 1 %arrayidx66.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next175 %15 = load i32, ptr %arrayidx66.1, align 4, !tbaa !5 %cmp67.not.1 = icmp eq i32 %15, -1 br i1 %cmp67.not.1, label %for.inc76.1, label %if.then68.1 if.then68.1: ; preds = %for.inc76 %idxprom73.1 = sext i32 %15 to i64 %arrayidx74.1 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv.next175, i64 %idxprom73.1 %16 = load i32, ptr %arrayidx74.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc76.1 for.inc76.1: ; preds = %if.then68.1, %for.inc76 %sum.1.1 = phi i32 [ %add.1, %if.then68.1 ], [ %sum.1, %for.inc76 ] %indvars.iv.next175.1 = add nuw nsw i64 %indvars.iv174, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end78.loopexit.unr-lcssa, label %for.body64, !llvm.loop !15 for.end78.loopexit.unr-lcssa: ; preds = %for.inc76.1, %for.body64.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body64.preheader ], [ %sum.1.1, %for.inc76.1 ] %indvars.iv174.unr = phi i64 [ 0, %for.body64.preheader ], [ %indvars.iv.next175.1, %for.inc76.1 ] %sum.0154.unr = phi i32 [ 0, %for.body64.preheader ], [ %sum.1.1, %for.inc76.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end78, label %for.body64.epil for.body64.epil: ; preds = %for.end78.loopexit.unr-lcssa %arrayidx66.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv174.unr %17 = load i32, ptr %arrayidx66.epil, align 4, !tbaa !5 %cmp67.not.epil = icmp eq i32 %17, -1 br i1 %cmp67.not.epil, label %for.end78, label %if.then68.epil if.then68.epil: ; preds = %for.body64.epil %idxprom73.epil = sext i32 %17 to i64 %arrayidx74.epil = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv174.unr, i64 %idxprom73.epil %18 = load i32, ptr %arrayidx74.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0154.unr br label %for.end78 for.end78: ; preds = %for.end78.loopexit.unr-lcssa, %if.then68.epil, %for.body64.epil, %entry, %for.end, %for.cond62.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond62.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end78.loopexit.unr-lcssa ], [ %add.epil, %if.then68.epil ], [ %sum.0154.unr, %for.body64.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #6 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #6 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #6 ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp31 = icmp sgt i32 %0, 0 br i1 %cmp31, label %for.cond1.preheader, label %for.end18 for.cond1.preheader: ; preds = %entry, %for.inc16 %1 = phi i32 [ %5, %for.inc16 ], [ %0, %entry ] %indvars.iv35 = phi i64 [ %indvars.iv.next36, %for.inc16 ], [ 0, %entry ] %cmp229 = icmp sgt i32 %1, 0 br i1 %cmp229, label %for.body3, label %for.cond1.preheader.for.inc16_crit_edge for.cond1.preheader.for.inc16_crit_edge: ; preds = %for.cond1.preheader %.pre = sext i32 %1 to i64 br label %for.inc16 for.body3: ; preds = %for.cond1.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv35, i64 %indvars.iv %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %2 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp11 = icmp eq i32 %2, -1 br i1 %cmp11, label %if.then, label %for.inc if.then: ; preds = %for.body3 store i32 2000000, ptr %arrayidx5, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %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 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc16, !llvm.loop !16 for.inc16: ; preds = %for.inc, %for.cond1.preheader.for.inc16_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc16_crit_edge ], [ %4, %for.inc ] %5 = phi i32 [ %1, %for.cond1.preheader.for.inc16_crit_edge ], [ %3, %for.inc ] %indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1 %cmp = icmp slt i64 %indvars.iv.next36, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.end18, !llvm.loop !17 for.end18: ; preds = %for.inc16, %entry %call19 = tail call i32 @prim() %call20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call19) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; 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 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { 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, !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, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"}
#include <stdio.h> #define WHITE 1 #define BLACK 0 #define INF 1000000 #define NIL 1000000 int n; int G[100][100]; int prim(int); int main() { int w=0; int s; int i,j; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&G[i][j]); } } s=0; w=prim(s); printf("%d\n",w); return 0; } int prim(int s){ int i,j,k,l; int u,v,a=0; int d[100]; int pi[100]; int color[100]; int mincost=0; for(u=0;u<n;u++){ d[u]=INF; pi[u]=NIL; color[u]=WHITE; } d[s]=0; while(1){ mincost=INF; for(i=0;i<n;i++){ if(color[i]!=BLACK && d[i]<mincost){ mincost=d[i]; u=i; } } if(mincost==INF) break; color[u]=BLACK; for(j=0;j<n;j++){ v=G[u][j]; if(v!=-1){ if(color[j]!=BLACK && G[u][j]<d[j]){ pi[j]=u; d[j]=G[u][j]; } } } } for(i=0;i<n;i++){ a+=d[i]; } return a; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199264/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199264/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @G = dso_local global [100 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d.i = alloca [100 x i32], align 16 %color.i = alloca [100 x i32], align 16 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i18 = freeze i32 %0 %cmp19 = icmp sgt i32 %.fr.i18, 0 br i1 %cmp19, label %for.cond1.preheader, label %for.end9.thread for.end9.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 br label %prim.exit for.cond1.preheader: ; preds = %entry, %for.inc7 %1 = phi i32 [ %.fr.i, %for.inc7 ], [ %.fr.i18, %entry ] %indvars.iv24 = phi i64 [ %indvars.iv.next25, %for.inc7 ], [ 0, %entry ] %cmp216 = icmp sgt i32 %1, 0 br i1 %cmp216, label %for.body3, label %for.inc7 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %indvars.iv24, i64 %indvars.iv %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %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 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !9 for.inc7: ; preds = %for.body3, %for.cond1.preheader %4 = phi i32 [ %1, %for.cond1.preheader ], [ %2, %for.body3 ] %.fr.i = freeze i32 %4 %indvars.iv.next25 = add nuw nsw i64 %indvars.iv24, 1 %5 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next25, %5 br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !11 for.end9: ; preds = %for.inc7 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 %cmp97.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp97.i, label %for.body.preheader.i, label %prim.exit for.body.preheader.i: ; preds = %for.end9 %wide.trip.count.i = zext i32 %.fr.i to i64 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %wide.trip.count.i, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %6 = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %index store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %6, align 16, !tbaa !5 %7 = getelementptr inbounds i32, ptr %6, i64 4 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %7, align 16, !tbaa !5 %8 = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %9, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i 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.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv.i store i32 1000000, ptr %arrayidx.i, align 4, !tbaa !5 %arrayidx4.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv.i store i32 1, ptr %arrayidx4.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, %wide.trip.count.i 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.block store i32 0, ptr %d.i, 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, 1000000 br i1 %cmp21.us.i, label %for.body62.i.preheader, label %if.end23.us.i for.body62.i.preheader: ; preds = %for.end20.us.i %min.iters.check31 = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check31, label %for.body62.i.preheader42, label %vector.ph32 vector.ph32: ; preds = %for.body62.i.preheader %n.vec34 = and i64 %wide.trip.count.i, 4294967288 br label %vector.body37 vector.body37: ; preds = %vector.body37, %vector.ph32 %index38 = phi i64 [ 0, %vector.ph32 ], [ %index.next41, %vector.body37 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph32 ], [ %13, %vector.body37 ] %vec.phi39 = phi <4 x i32> [ zeroinitializer, %vector.ph32 ], [ %14, %vector.body37 ] %11 = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %index38 %wide.load = load <4 x i32>, ptr %11, align 16, !tbaa !5 %12 = getelementptr inbounds i32, ptr %11, i64 4 %wide.load40 = load <4 x i32>, ptr %12, align 16, !tbaa !5 %13 = add <4 x i32> %wide.load, %vec.phi %14 = add <4 x i32> %wide.load40, %vec.phi39 %index.next41 = add nuw i64 %index38, 8 %15 = icmp eq i64 %index.next41, %n.vec34 br i1 %15, label %middle.block29, label %vector.body37, !llvm.loop !17 middle.block29: ; preds = %vector.body37 %bin.rdx = add <4 x i32> %14, %13 %16 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n36 = icmp eq i64 %n.vec34, %wide.trip.count.i br i1 %cmp.n36, label %prim.exit, label %for.body62.i.preheader42 for.body62.i.preheader42: ; preds = %for.body62.i.preheader, %middle.block29 %indvars.iv159.i.ph = phi i64 [ 0, %for.body62.i.preheader ], [ %n.vec34, %middle.block29 ] %a.0140.i.ph = phi i32 [ 0, %for.body62.i.preheader ], [ %16, %middle.block29 ] br label %for.body62.i if.end23.us.i: ; preds = %for.end20.us.i %idxprom24.us.i = sext i32 %u.3.us.i to i64 %arrayidx25.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %idxprom24.us.i store i32 0, ptr %arrayidx25.us.i, align 4, !tbaa !5 br label %for.body28.us.i for.body28.us.i: ; preds = %for.inc57.us.i, %if.end23.us.i %indvars.iv154.i = phi i64 [ 0, %if.end23.us.i ], [ %indvars.iv.next155.i, %for.inc57.us.i ] %arrayidx32.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom24.us.i, i64 %indvars.iv154.i %17 = load i32, ptr %arrayidx32.us.i, align 4, !tbaa !5 %cmp33.not.us.i = icmp eq i32 %17, -1 br i1 %cmp33.not.us.i, label %for.inc57.us.i, label %if.then34.us.i if.then34.us.i: ; preds = %for.body28.us.i %arrayidx36.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv154.i %18 = load i32, ptr %arrayidx36.us.i, align 4, !tbaa !5 %cmp37.not.us.i = icmp eq i32 %18, 0 br i1 %cmp37.not.us.i, label %for.inc57.us.i, label %land.lhs.true38.us.i land.lhs.true38.us.i: ; preds = %if.then34.us.i %arrayidx44.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv154.i %19 = load i32, ptr %arrayidx44.us.i, align 4, !tbaa !5 %spec.store.select.us.i = tail call i32 @llvm.smin.i32(i32 %17, i32 %19) store i32 %spec.store.select.us.i, ptr %arrayidx44.us.i, align 4 br label %for.inc57.us.i for.inc57.us.i: ; preds = %land.lhs.true38.us.i, %if.then34.us.i, %for.body28.us.i %indvars.iv.next155.i = add nuw nsw i64 %indvars.iv154.i, 1 %exitcond158.not.i = icmp eq i64 %indvars.iv.next155.i, %wide.trip.count.i br i1 %exitcond158.not.i, label %for.body9.us.i.backedge, label %for.body28.us.i, !llvm.loop !18 for.body9.us.i: ; preds = %for.body9.us.i.backedge, %while.cond.us.preheader.i %indvars.iv149.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv149.i.be, %for.body9.us.i.backedge ] %mincost.0103.us.i = phi i32 [ 1000000, %while.cond.us.preheader.i ], [ %mincost.0103.us.i.be, %for.body9.us.i.backedge ] %u.2101.us.i = phi i32 [ %.fr.i, %while.cond.us.preheader.i ], [ %u.3.us.i, %for.body9.us.i.backedge ] %arrayidx11.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv149.i %20 = load i32, ptr %arrayidx11.us.i, align 4, !tbaa !5 %cmp12.not.us.i = icmp eq i32 %20, 0 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.i, i64 0, i64 %indvars.iv149.i %21 = load i32, ptr %arrayidx14.us.i, align 4, !tbaa !5 %cmp15.us.i = icmp slt i32 %21, %mincost.0103.us.i %22 = trunc i64 %indvars.iv149.i to i32 %spec.select.us.i = select i1 %cmp15.us.i, i32 %22, i32 %u.2101.us.i %spec.select96.us.i = tail call i32 @llvm.smin.i32(i32 %21, i32 %mincost.0103.us.i) br label %for.inc18.us.i for.inc18.us.i: ; preds = %land.lhs.true.us.i, %for.body9.us.i %u.3.us.i = phi i32 [ %u.2101.us.i, %for.body9.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %mincost.1.us.i = phi i32 [ %mincost.0103.us.i, %for.body9.us.i ], [ %spec.select96.us.i, %land.lhs.true.us.i ] %indvars.iv.next150.i = add nuw nsw i64 %indvars.iv149.i, 1 %exitcond153.not.i = icmp eq i64 %indvars.iv.next150.i, %wide.trip.count.i br i1 %exitcond153.not.i, label %for.end20.us.i, label %for.body9.us.i.backedge for.body9.us.i.backedge: ; preds = %for.inc57.us.i, %for.inc18.us.i %indvars.iv149.i.be = phi i64 [ %indvars.iv.next150.i, %for.inc18.us.i ], [ 0, %for.inc57.us.i ] %mincost.0103.us.i.be = phi i32 [ %mincost.1.us.i, %for.inc18.us.i ], [ 1000000, %for.inc57.us.i ] br label %for.body9.us.i, !llvm.loop !18 for.body62.i: ; preds = %for.body62.i.preheader42, %for.body62.i %indvars.iv159.i = phi i64 [ %indvars.iv.next160.i, %for.body62.i ], [ %indvars.iv159.i.ph, %for.body62.i.preheader42 ] %a.0140.i = phi i32 [ %add.i, %for.body62.i ], [ %a.0140.i.ph, %for.body62.i.preheader42 ] %arrayidx64.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv159.i %23 = load i32, ptr %arrayidx64.i, align 4, !tbaa !5 %add.i = add nsw i32 %23, %a.0140.i %indvars.iv.next160.i = add nuw nsw i64 %indvars.iv159.i, 1 %exitcond163.not.i = icmp eq i64 %indvars.iv.next160.i, %wide.trip.count.i br i1 %exitcond163.not.i, label %prim.exit, label %for.body62.i, !llvm.loop !19 prim.exit: ; preds = %for.body62.i, %middle.block29, %for.end9.thread, %for.end9 %a.0.lcssa.i = phi i32 [ 0, %for.end9 ], [ 0, %for.end9.thread ], [ %16, %middle.block29 ], [ %add.i, %for.body62.i ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d.i) #5 %call11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.0.lcssa.i) ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 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(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim(i32 noundef %s) local_unnamed_addr #3 { 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) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp97 = icmp sgt i32 %.fr, 0 br i1 %cmp97, label %for.body.preheader, label %for.end67 for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %.fr to i64 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader182, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %1 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %index store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %1, align 16, !tbaa !5 %2 = getelementptr inbounds i32, ptr %1, i64 4 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %4, align 16, !tbaa !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 !20 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %for.body.preheader182 for.body.preheader182: ; 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.preheader182, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader182 ] %arrayidx = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 1000000, ptr %arrayidx, align 4, !tbaa !5 %arrayidx4 = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx4, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !21 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 %cmp97, label %while.cond.us.preheader, label %for.end67 while.cond.us.preheader: ; preds = %for.end %wide.trip.count152 = zext i32 %.fr to i64 %wide.trip.count157 = zext i32 %.fr to i64 br label %for.body9.us for.end20.us: ; preds = %for.inc18.us %cmp21.us = icmp eq i32 %mincost.1.us, 1000000 br i1 %cmp21.us, label %for.cond60.preheader, label %if.end23.us if.end23.us: ; preds = %for.end20.us %idxprom24.us = sext i32 %u.3.us to i64 %arrayidx25.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom24.us store i32 0, ptr %arrayidx25.us, align 4, !tbaa !5 br label %for.body28.us for.body28.us: ; preds = %if.end23.us, %for.inc57.us %indvars.iv154 = phi i64 [ 0, %if.end23.us ], [ %indvars.iv.next155, %for.inc57.us ] %arrayidx32.us = getelementptr inbounds [100 x [100 x i32]], ptr @G, i64 0, i64 %idxprom24.us, i64 %indvars.iv154 %6 = load i32, ptr %arrayidx32.us, align 4, !tbaa !5 %cmp33.not.us = icmp eq i32 %6, -1 br i1 %cmp33.not.us, label %for.inc57.us, label %if.then34.us if.then34.us: ; preds = %for.body28.us %arrayidx36.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv154 %7 = load i32, ptr %arrayidx36.us, align 4, !tbaa !5 %cmp37.not.us = icmp eq i32 %7, 0 br i1 %cmp37.not.us, label %for.inc57.us, label %land.lhs.true38.us land.lhs.true38.us: ; preds = %if.then34.us %arrayidx44.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv154 %8 = load i32, ptr %arrayidx44.us, align 4, !tbaa !5 %spec.store.select.us = tail call i32 @llvm.smin.i32(i32 %6, i32 %8) store i32 %spec.store.select.us, ptr %arrayidx44.us, align 4 br label %for.inc57.us for.inc57.us: ; preds = %land.lhs.true38.us, %if.then34.us, %for.body28.us %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1 %exitcond158.not = icmp eq i64 %indvars.iv.next155, %wide.trip.count157 br i1 %exitcond158.not, label %for.body9.us.backedge, label %for.body28.us, !llvm.loop !18 for.body9.us: ; preds = %for.body9.us.backedge, %while.cond.us.preheader %indvars.iv149 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv149.be, %for.body9.us.backedge ] %mincost.0103.us = phi i32 [ 1000000, %while.cond.us.preheader ], [ %mincost.0103.us.be, %for.body9.us.backedge ] %u.2101.us = phi i32 [ %.fr, %while.cond.us.preheader ], [ %u.3.us, %for.body9.us.backedge ] %arrayidx11.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv149 %9 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5 %cmp12.not.us = icmp eq i32 %9, 0 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.iv149 %10 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %cmp15.us = icmp slt i32 %10, %mincost.0103.us %11 = trunc i64 %indvars.iv149 to i32 %spec.select.us = select i1 %cmp15.us, i32 %11, i32 %u.2101.us %spec.select96.us = tail call i32 @llvm.smin.i32(i32 %10, i32 %mincost.0103.us) br label %for.inc18.us for.inc18.us: ; preds = %land.lhs.true.us, %for.body9.us %u.3.us = phi i32 [ %u.2101.us, %for.body9.us ], [ %spec.select.us, %land.lhs.true.us ] %mincost.1.us = phi i32 [ %mincost.0103.us, %for.body9.us ], [ %spec.select96.us, %land.lhs.true.us ] %indvars.iv.next150 = add nuw nsw i64 %indvars.iv149, 1 %exitcond153.not = icmp eq i64 %indvars.iv.next150, %wide.trip.count152 br i1 %exitcond153.not, label %for.end20.us, label %for.body9.us.backedge for.body9.us.backedge: ; preds = %for.inc57.us, %for.inc18.us %indvars.iv149.be = phi i64 [ %indvars.iv.next150, %for.inc18.us ], [ 0, %for.inc57.us ] %mincost.0103.us.be = phi i32 [ %mincost.1.us, %for.inc18.us ], [ 1000000, %for.inc57.us ] br label %for.body9.us, !llvm.loop !18 for.cond60.preheader: ; preds = %for.end20.us br i1 %cmp97, label %for.body62.preheader, label %for.end67 for.body62.preheader: ; preds = %for.cond60.preheader %wide.trip.count162 = zext i32 %.fr to i64 %min.iters.check169 = icmp ult i32 %.fr, 8 br i1 %min.iters.check169, label %for.body62.preheader180, label %vector.ph170 vector.ph170: ; preds = %for.body62.preheader %n.vec172 = and i64 %wide.trip.count, 4294967288 br label %vector.body175 vector.body175: ; preds = %vector.body175, %vector.ph170 %index176 = phi i64 [ 0, %vector.ph170 ], [ %index.next179, %vector.body175 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph170 ], [ %14, %vector.body175 ] %vec.phi177 = phi <4 x i32> [ zeroinitializer, %vector.ph170 ], [ %15, %vector.body175 ] %12 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %index176 %wide.load = load <4 x i32>, ptr %12, align 16, !tbaa !5 %13 = getelementptr inbounds i32, ptr %12, i64 4 %wide.load178 = load <4 x i32>, ptr %13, align 16, !tbaa !5 %14 = add <4 x i32> %wide.load, %vec.phi %15 = add <4 x i32> %wide.load178, %vec.phi177 %index.next179 = add nuw i64 %index176, 8 %16 = icmp eq i64 %index.next179, %n.vec172 br i1 %16, label %middle.block167, label %vector.body175, !llvm.loop !22 middle.block167: ; preds = %vector.body175 %bin.rdx = add <4 x i32> %15, %14 %17 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n174 = icmp eq i64 %n.vec172, %wide.trip.count br i1 %cmp.n174, label %for.end67, label %for.body62.preheader180 for.body62.preheader180: ; preds = %for.body62.preheader, %middle.block167 %indvars.iv159.ph = phi i64 [ 0, %for.body62.preheader ], [ %n.vec172, %middle.block167 ] %a.0140.ph = phi i32 [ 0, %for.body62.preheader ], [ %17, %middle.block167 ] br label %for.body62 for.body62: ; preds = %for.body62.preheader180, %for.body62 %indvars.iv159 = phi i64 [ %indvars.iv.next160, %for.body62 ], [ %indvars.iv159.ph, %for.body62.preheader180 ] %a.0140 = phi i32 [ %add, %for.body62 ], [ %a.0140.ph, %for.body62.preheader180 ] %arrayidx64 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv159 %18 = load i32, ptr %arrayidx64, align 4, !tbaa !5 %add = add nsw i32 %18, %a.0140 %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1 %exitcond163.not = icmp eq i64 %indvars.iv.next160, %wide.trip.count162 br i1 %exitcond163.not, label %for.end67, label %for.body62, !llvm.loop !23 for.end67: ; preds = %for.body62, %middle.block167, %entry, %for.end, %for.cond60.preheader %a.0.lcssa = phi i32 [ 0, %for.cond60.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %17, %middle.block167 ], [ %add, %for.body62 ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 ret i32 %a.0.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !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, !14, !15} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !15, !14} !20 = distinct !{!20, !10, !14, !15} !21 = distinct !{!21, !10, !15, !14} !22 = distinct !{!22, !10, !14, !15} !23 = distinct !{!23, !10, !15, !14}
#include <stdio.h> int n,u,w[100][100],color[100],d[100]; int main(){ int i,j,mincost,sum=0; scanf("%d",&n); for(i=0;i<n;i++) for(j=0;j<n;j++){ scanf("%d",&w[i][j]); if(w[i][j]==-1)w[i][j]=2001; } for(i=0;i<n;i++){ d[i] =2001; color[i] =0; } d[0]=0; while (1){ mincost=2001; for(i=0;i<n;i++){ if (color[i] != 1 && d[i] < mincost){ mincost = d[i]; u = i; } } if (mincost ==2001) break; color[u] = 1; for (i=0;i<n;i++){ if (color[i] != 1 && w[u][i] < d[i]){ d[i] = w[u][i]; } } } for (i=0;i<n;i++){ sum+=d[i]; } printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199307/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199307/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @w = dso_local global [100 x [100 x i32]] zeroinitializer, align 16 @d = 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 @u = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp117 = icmp sgt i32 %0, 0 br i1 %cmp117, label %for.cond1.preheader, label %for.cond19.preheader for.cond1.preheader: ; preds = %entry, %for.inc16 %1 = phi i32 [ %10, %for.inc16 ], [ %0, %entry ] %indvars.iv163 = phi i64 [ %indvars.iv.next164, %for.inc16 ], [ 0, %entry ] %cmp2115 = icmp sgt i32 %1, 0 br i1 %cmp2115, label %for.body3, label %for.cond1.preheader.for.inc16_crit_edge for.cond1.preheader.for.inc16_crit_edge: ; preds = %for.cond1.preheader %.pre = sext i32 %1 to i64 br label %for.inc16 for.cond19.preheader: ; preds = %for.inc16, %entry %.lcssa = phi i32 [ %0, %entry ], [ %10, %for.inc16 ] %.lcssa.fr = freeze i32 %.lcssa %cmp20119 = icmp sgt i32 %.lcssa.fr, 0 br i1 %cmp20119, label %for.body21.preheader, label %for.end28.thread for.end28.thread: ; preds = %for.cond19.preheader store i32 0, ptr @d, align 16, !tbaa !5 br label %for.end82 for.body21.preheader: ; preds = %for.cond19.preheader %2 = zext i32 %.lcssa.fr to i64 %3 = shl nuw nsw i64 %2, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @color, i8 0, i64 %3, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.lcssa.fr, 8 br i1 %min.iters.check, label %for.body21.preheader213, label %vector.ph vector.ph: ; preds = %for.body21.preheader %n.vec = and i64 %2, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %4 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %index store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %5, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %2 br i1 %cmp.n, label %for.end28, label %for.body21.preheader213 for.body21.preheader213: ; preds = %for.body21.preheader, %middle.block %indvars.iv166.ph = phi i64 [ 0, %for.body21.preheader ], [ %n.vec, %middle.block ] br label %for.body21 for.body3: ; preds = %for.cond1.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr @w, i64 0, i64 %indvars.iv163, i64 %indvars.iv %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %7 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %cmp11 = icmp eq i32 %7, -1 br i1 %cmp11, label %if.then, label %for.inc if.then: ; preds = %for.body3 store i32 2001, ptr %arrayidx5, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body3, %if.then %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 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc16, !llvm.loop !13 for.inc16: ; preds = %for.inc, %for.cond1.preheader.for.inc16_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc16_crit_edge ], [ %9, %for.inc ] %10 = phi i32 [ %1, %for.cond1.preheader.for.inc16_crit_edge ], [ %8, %for.inc ] %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %cmp = icmp slt i64 %indvars.iv.next164, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.cond19.preheader, !llvm.loop !14 for.body21: ; preds = %for.body21.preheader213, %for.body21 %indvars.iv166 = phi i64 [ %indvars.iv.next167, %for.body21 ], [ %indvars.iv166.ph, %for.body21.preheader213 ] %arrayidx23 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv166 store i32 2001, ptr %arrayidx23, align 4, !tbaa !5 %indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1 %exitcond.not = icmp eq i64 %indvars.iv.next167, %2 br i1 %exitcond.not, label %for.end28, label %for.body21, !llvm.loop !16 for.end28: ; preds = %for.body21, %middle.block store i32 0, ptr @d, align 16, !tbaa !5 br i1 %cmp20119, label %while.cond.us.preheader, label %for.end82 while.cond.us.preheader: ; preds = %for.end28 %u.promoted = load i32, ptr @u, align 4, !tbaa !5 %wide.trip.count177 = zext i32 %.lcssa.fr to i64 %wide.trip.count182 = zext i32 %.lcssa.fr to i64 br label %for.body31.us for.end44.us: ; preds = %for.inc42.us %cmp45.us = icmp eq i32 %mincost.1.us, 2001 br i1 %cmp45.us, label %for.cond75.preheader, label %if.end47.us if.end47.us: ; preds = %for.end44.us %idxprom48.us = sext i32 %18 to i64 %arrayidx49.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %idxprom48.us store i32 1, ptr %arrayidx49.us, align 4, !tbaa !5 br label %for.body52.us for.body52.us: ; preds = %if.end47.us, %for.inc72.us %indvars.iv179 = phi i64 [ 0, %if.end47.us ], [ %indvars.iv.next180, %for.inc72.us ] %arrayidx54.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv179 %11 = load i32, ptr %arrayidx54.us, align 4, !tbaa !5 %cmp55.not.us = icmp eq i32 %11, 1 br i1 %cmp55.not.us, label %for.inc72.us, label %land.lhs.true56.us land.lhs.true56.us: ; preds = %for.body52.us %arrayidx60.us = getelementptr inbounds [100 x [100 x i32]], ptr @w, i64 0, i64 %idxprom48.us, i64 %indvars.iv179 %12 = load i32, ptr %arrayidx60.us, align 4, !tbaa !5 %arrayidx62.us = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv179 %13 = load i32, ptr %arrayidx62.us, align 4, !tbaa !5 %cmp63.us = icmp slt i32 %12, %13 br i1 %cmp63.us, label %if.then64.us, label %for.inc72.us if.then64.us: ; preds = %land.lhs.true56.us store i32 %12, ptr %arrayidx62.us, align 4, !tbaa !5 br label %for.inc72.us for.inc72.us: ; preds = %if.then64.us, %land.lhs.true56.us, %for.body52.us %indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1 %exitcond183.not = icmp eq i64 %indvars.iv.next180, %wide.trip.count182 br i1 %exitcond183.not, label %for.body31.us.backedge, label %for.body52.us, !llvm.loop !17 for.body31.us: ; preds = %for.body31.us.backedge, %while.cond.us.preheader %indvars.iv174 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv174.be, %for.body31.us.backedge ] %14 = phi i32 [ %u.promoted, %while.cond.us.preheader ], [ %18, %for.body31.us.backedge ] %mincost.0123.us = phi i32 [ 2001, %while.cond.us.preheader ], [ %mincost.0123.us.be, %for.body31.us.backedge ] %arrayidx33.us = getelementptr inbounds [100 x i32], ptr @color, i64 0, i64 %indvars.iv174 %15 = load i32, ptr %arrayidx33.us, align 4, !tbaa !5 %cmp34.not.us = icmp eq i32 %15, 1 br i1 %cmp34.not.us, label %for.inc42.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body31.us %arrayidx36.us = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv174 %16 = load i32, ptr %arrayidx36.us, align 4, !tbaa !5 %cmp37.us = icmp slt i32 %16, %mincost.0123.us br i1 %cmp37.us, label %if.then38.us, label %for.inc42.us if.then38.us: ; preds = %land.lhs.true.us %17 = trunc i64 %indvars.iv174 to i32 store i32 %17, ptr @u, align 4, !tbaa !5 br label %for.inc42.us for.inc42.us: ; preds = %if.then38.us, %land.lhs.true.us, %for.body31.us %18 = phi i32 [ %17, %if.then38.us ], [ %14, %land.lhs.true.us ], [ %14, %for.body31.us ] %mincost.1.us = phi i32 [ %16, %if.then38.us ], [ %mincost.0123.us, %land.lhs.true.us ], [ %mincost.0123.us, %for.body31.us ] %indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1 %exitcond178.not = icmp eq i64 %indvars.iv.next175, %wide.trip.count177 br i1 %exitcond178.not, label %for.end44.us, label %for.body31.us.backedge for.body31.us.backedge: ; preds = %for.inc72.us, %for.inc42.us %indvars.iv174.be = phi i64 [ %indvars.iv.next175, %for.inc42.us ], [ 0, %for.inc72.us ] %mincost.0123.us.be = phi i32 [ %mincost.1.us, %for.inc42.us ], [ 2001, %for.inc72.us ] br label %for.body31.us, !llvm.loop !17 for.cond75.preheader: ; preds = %for.end44.us br i1 %cmp20119, label %for.body77.preheader, label %for.end82 for.body77.preheader: ; preds = %for.cond75.preheader %wide.trip.count187 = zext i32 %.lcssa.fr to i64 %min.iters.check199 = icmp ult i32 %.lcssa.fr, 8 br i1 %min.iters.check199, label %for.body77.preheader210, label %vector.ph200 vector.ph200: ; preds = %for.body77.preheader %n.vec202 = and i64 %2, 4294967288 br label %vector.body205 vector.body205: ; preds = %vector.body205, %vector.ph200 %index206 = phi i64 [ 0, %vector.ph200 ], [ %index.next209, %vector.body205 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph200 ], [ %21, %vector.body205 ] %vec.phi207 = phi <4 x i32> [ zeroinitializer, %vector.ph200 ], [ %22, %vector.body205 ] %19 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %index206 %wide.load = load <4 x i32>, ptr %19, align 16, !tbaa !5 %20 = getelementptr inbounds i32, ptr %19, i64 4 %wide.load208 = load <4 x i32>, ptr %20, align 16, !tbaa !5 %21 = add <4 x i32> %wide.load, %vec.phi %22 = add <4 x i32> %wide.load208, %vec.phi207 %index.next209 = add nuw i64 %index206, 8 %23 = icmp eq i64 %index.next209, %n.vec202 br i1 %23, label %middle.block197, label %vector.body205, !llvm.loop !18 middle.block197: ; preds = %vector.body205 %bin.rdx = add <4 x i32> %22, %21 %24 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n204 = icmp eq i64 %n.vec202, %2 br i1 %cmp.n204, label %for.end82, label %for.body77.preheader210 for.body77.preheader210: ; preds = %for.body77.preheader, %middle.block197 %indvars.iv184.ph = phi i64 [ 0, %for.body77.preheader ], [ %n.vec202, %middle.block197 ] %sum.0155.ph = phi i32 [ 0, %for.body77.preheader ], [ %24, %middle.block197 ] br label %for.body77 for.body77: ; preds = %for.body77.preheader210, %for.body77 %indvars.iv184 = phi i64 [ %indvars.iv.next185, %for.body77 ], [ %indvars.iv184.ph, %for.body77.preheader210 ] %sum.0155 = phi i32 [ %add, %for.body77 ], [ %sum.0155.ph, %for.body77.preheader210 ] %arrayidx79 = getelementptr inbounds [100 x i32], ptr @d, i64 0, i64 %indvars.iv184 %25 = load i32, ptr %arrayidx79, align 4, !tbaa !5 %add = add nsw i32 %25, %sum.0155 %indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1 %exitcond188.not = icmp eq i64 %indvars.iv.next185, %wide.trip.count187 br i1 %exitcond188.not, label %for.end82, label %for.body77, !llvm.loop !19 for.end82: ; preds = %for.body77, %middle.block197, %for.end28.thread, %for.end28, %for.cond75.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond75.preheader ], [ 0, %for.end28 ], [ 0, %for.end28.thread ], [ %24, %middle.block197 ], [ %add, %for.body77 ] %call83 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-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 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !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} !15 = !{!"llvm.loop.unswitch.partial.disable"} !16 = distinct !{!16, !10, !12, !11} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !11, !12} !19 = distinct !{!19, !10, !12, !11}
#include <stdio.h> int main() { int i, j, s, t, n, min, sum = 0; int x[1000], y[1000], z[1000][1000]; scanf("%d", &n); for( i = 0; i < n; i++) { x[i] = 0; y[i] = 1000; for( j = 0; j < n; j++) { scanf("%d", &z[i][j]); } } y[0] = 0; for( i = 1; i < n; i++) { min = 1000; for( j = 0; j < n; j++) { if( y[j] < min && x[j] == 0) { min = y[j]; s = j; } } x[s] = 1; for( t = 0; t < n; t++) { if(z[s][t] < y[t] && z[s][t] != -1 && x[t] == 0) { y[t] = z[s][t]; } } } for( i = 0; i < n; i++) { sum += y[i]; } printf("%d\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199350/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199350/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %x = alloca [1000 x i32], align 16 %y = alloca [1000 x i32], align 16 %z = alloca [1000 x [1000 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %y) #4 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %z) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp109 = icmp sgt i32 %0, 0 br i1 %cmp109, label %for.body, label %for.end75 for.body: ; preds = %entry, %for.inc11 %1 = phi i32 [ %4, %for.inc11 ], [ %0, %entry ] %indvars.iv162 = phi i64 [ %indvars.iv.next163, %for.inc11 ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv162 store i32 0, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv162 store i32 1000, ptr %arrayidx2, align 4, !tbaa !5 %cmp4107 = icmp sgt i32 %1, 0 br i1 %cmp4107, label %for.body5, label %for.body.for.inc11_crit_edge for.body.for.inc11_crit_edge: ; preds = %for.body %.pre181 = sext i32 %1 to i64 br label %for.inc11 for.body5: ; preds = %for.body, %for.body5 %indvars.iv159 = phi i64 [ %indvars.iv.next160, %for.body5 ], [ 0, %for.body ] %arrayidx9 = getelementptr inbounds [1000 x [1000 x i32]], ptr %z, i64 0, i64 %indvars.iv162, i64 %indvars.iv159 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx9) %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp4 = icmp slt i64 %indvars.iv.next160, %3 br i1 %cmp4, label %for.body5, label %for.inc11, !llvm.loop !9 for.inc11: ; preds = %for.body5, %for.body.for.inc11_crit_edge %.pre-phi = phi i64 [ %.pre181, %for.body.for.inc11_crit_edge ], [ %3, %for.body5 ] %4 = phi i32 [ %1, %for.body.for.inc11_crit_edge ], [ %2, %for.body5 ] %indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1 %cmp = icmp slt i64 %indvars.iv.next163, %.pre-phi br i1 %cmp, label %for.body, label %for.end13, !llvm.loop !11 for.end13: ; preds = %for.inc11 store i32 0, ptr %y, align 16, !tbaa !5 %cmp16118 = icmp sgt i32 %4, 1 br i1 %cmp16118, label %for.cond18.preheader.us.preheader, label %for.cond68.preheader for.cond18.preheader.us.preheader: ; preds = %for.end13 %wide.trip.count168 = zext i32 %4 to i64 %xtraiter = and i64 %wide.trip.count168, 1 %unroll_iter = and i64 %wide.trip.count168, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.body20.us.preheader for.body20.us.preheader: ; preds = %for.cond34.for.inc65_crit_edge.us, %for.cond18.preheader.us.preheader %s.0120.us = phi i32 [ %s.2.us.lcssa, %for.cond34.for.inc65_crit_edge.us ], [ undef, %for.cond18.preheader.us.preheader ] %i.1119.us = phi i32 [ %inc66.us, %for.cond34.for.inc65_crit_edge.us ], [ 1, %for.cond18.preheader.us.preheader ] br label %for.body20.us for.end31.us.unr-lcssa: ; preds = %for.inc29.us.1 br i1 %lcmp.mod.not, label %for.end31.us, label %for.body20.us.epil for.body20.us.epil: ; preds = %for.end31.us.unr-lcssa %arrayidx22.us.epil = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv.next166.1 %5 = load i32, ptr %arrayidx22.us.epil, align 4, !tbaa !5 %cmp23.us.epil = icmp slt i32 %5, %min.1.us.1 br i1 %cmp23.us.epil, label %land.lhs.true.us.epil, label %for.end31.us land.lhs.true.us.epil: ; preds = %for.body20.us.epil %arrayidx25.us.epil = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv.next166.1 %6 = load i32, ptr %arrayidx25.us.epil, align 4, !tbaa !5 %cmp26.us.epil = icmp eq i32 %6, 0 %7 = trunc i64 %indvars.iv.next166.1 to i32 %spec.select.us.epil = select i1 %cmp26.us.epil, i32 %7, i32 %s.2.us.1 br label %for.end31.us for.end31.us: ; preds = %for.body20.us.epil, %land.lhs.true.us.epil, %for.end31.us.unr-lcssa %s.2.us.lcssa = phi i32 [ %s.2.us.1, %for.end31.us.unr-lcssa ], [ %s.2.us.1, %for.body20.us.epil ], [ %spec.select.us.epil, %land.lhs.true.us.epil ] %idxprom32.us = sext i32 %s.2.us.lcssa to i64 %arrayidx33.us = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %idxprom32.us store i32 1, ptr %arrayidx33.us, align 4, !tbaa !5 br label %for.body36.us for.body36.us: ; preds = %for.end31.us, %for.inc62.us %indvars.iv170 = phi i64 [ 0, %for.end31.us ], [ %indvars.iv.next171, %for.inc62.us ] %arrayidx40.us = getelementptr inbounds [1000 x [1000 x i32]], ptr %z, i64 0, i64 %idxprom32.us, i64 %indvars.iv170 %8 = load i32, ptr %arrayidx40.us, align 4, !tbaa !5 %arrayidx42.us = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv170 %9 = load i32, ptr %arrayidx42.us, align 4, !tbaa !5 %cmp43.us = icmp sge i32 %8, %9 %cmp49.not.us = icmp eq i32 %8, -1 %or.cond.us = or i1 %cmp49.not.us, %cmp43.us br i1 %or.cond.us, label %for.inc62.us, label %land.lhs.true50.us land.lhs.true50.us: ; preds = %for.body36.us %arrayidx52.us = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv170 %10 = load i32, ptr %arrayidx52.us, align 4, !tbaa !5 %cmp53.us = icmp eq i32 %10, 0 br i1 %cmp53.us, label %if.then54.us, label %for.inc62.us if.then54.us: ; preds = %land.lhs.true50.us store i32 %8, ptr %arrayidx42.us, align 4, !tbaa !5 br label %for.inc62.us for.inc62.us: ; preds = %if.then54.us, %land.lhs.true50.us, %for.body36.us %indvars.iv.next171 = add nuw nsw i64 %indvars.iv170, 1 %exitcond174.not = icmp eq i64 %indvars.iv.next171, %wide.trip.count168 br i1 %exitcond174.not, label %for.cond34.for.inc65_crit_edge.us, label %for.body36.us, !llvm.loop !13 for.body20.us: ; preds = %for.inc29.us.1, %for.body20.us.preheader %indvars.iv165 = phi i64 [ 0, %for.body20.us.preheader ], [ %indvars.iv.next166.1, %for.inc29.us.1 ] %min.0114.us = phi i32 [ 1000, %for.body20.us.preheader ], [ %min.1.us.1, %for.inc29.us.1 ] %s.1113.us = phi i32 [ %s.0120.us, %for.body20.us.preheader ], [ %s.2.us.1, %for.inc29.us.1 ] %niter = phi i64 [ 0, %for.body20.us.preheader ], [ %niter.next.1, %for.inc29.us.1 ] %arrayidx22.us = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv165 %11 = load i32, ptr %arrayidx22.us, align 8, !tbaa !5 %cmp23.us = icmp slt i32 %11, %min.0114.us br i1 %cmp23.us, label %land.lhs.true.us, label %for.inc29.us land.lhs.true.us: ; preds = %for.body20.us %arrayidx25.us = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv165 %12 = load i32, ptr %arrayidx25.us, align 8, !tbaa !5 %cmp26.us = icmp eq i32 %12, 0 %13 = trunc i64 %indvars.iv165 to i32 %spec.select.us = select i1 %cmp26.us, i32 %13, i32 %s.1113.us %spec.select106.us = select i1 %cmp26.us, i32 %11, i32 %min.0114.us br label %for.inc29.us for.inc29.us: ; preds = %land.lhs.true.us, %for.body20.us %s.2.us = phi i32 [ %s.1113.us, %for.body20.us ], [ %spec.select.us, %land.lhs.true.us ] %min.1.us = phi i32 [ %min.0114.us, %for.body20.us ], [ %spec.select106.us, %land.lhs.true.us ] %indvars.iv.next166 = or i64 %indvars.iv165, 1 %arrayidx22.us.1 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv.next166 %14 = load i32, ptr %arrayidx22.us.1, align 4, !tbaa !5 %cmp23.us.1 = icmp slt i32 %14, %min.1.us br i1 %cmp23.us.1, label %land.lhs.true.us.1, label %for.inc29.us.1 land.lhs.true.us.1: ; preds = %for.inc29.us %arrayidx25.us.1 = getelementptr inbounds [1000 x i32], ptr %x, i64 0, i64 %indvars.iv.next166 %15 = load i32, ptr %arrayidx25.us.1, align 4, !tbaa !5 %cmp26.us.1 = icmp eq i32 %15, 0 %16 = trunc i64 %indvars.iv.next166 to i32 %spec.select.us.1 = select i1 %cmp26.us.1, i32 %16, i32 %s.2.us %spec.select106.us.1 = select i1 %cmp26.us.1, i32 %14, i32 %min.1.us br label %for.inc29.us.1 for.inc29.us.1: ; preds = %land.lhs.true.us.1, %for.inc29.us %s.2.us.1 = phi i32 [ %s.2.us, %for.inc29.us ], [ %spec.select.us.1, %land.lhs.true.us.1 ] %min.1.us.1 = phi i32 [ %min.1.us, %for.inc29.us ], [ %spec.select106.us.1, %land.lhs.true.us.1 ] %indvars.iv.next166.1 = add nuw nsw i64 %indvars.iv165, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end31.us.unr-lcssa, label %for.body20.us, !llvm.loop !14 for.cond34.for.inc65_crit_edge.us: ; preds = %for.inc62.us %inc66.us = add nuw nsw i32 %i.1119.us, 1 %exitcond175.not = icmp eq i32 %inc66.us, %4 br i1 %exitcond175.not, label %for.cond68.preheader, label %for.body20.us.preheader, !llvm.loop !15 for.cond68.preheader: ; preds = %for.cond34.for.inc65_crit_edge.us, %for.end13 %cmp69150 = icmp sgt i32 %4, 0 br i1 %cmp69150, label %for.body70.preheader, label %for.end75 for.body70.preheader: ; preds = %for.cond68.preheader %wide.trip.count179 = zext i32 %4 to i64 %min.iters.check = icmp ult i32 %4, 8 br i1 %min.iters.check, label %for.body70.preheader193, label %vector.ph vector.ph: ; preds = %for.body70.preheader %n.vec = and i64 %wide.trip.count179, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ] %vec.phi191 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %20, %vector.body ] %17 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %17, align 16, !tbaa !5 %18 = getelementptr inbounds i32, ptr %17, i64 4 %wide.load192 = load <4 x i32>, ptr %18, align 16, !tbaa !5 %19 = add <4 x i32> %wide.load, %vec.phi %20 = add <4 x i32> %wide.load192, %vec.phi191 %index.next = add nuw i64 %index, 8 %21 = icmp eq i64 %index.next, %n.vec br i1 %21, label %middle.block, label %vector.body, !llvm.loop !16 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %20, %19 %22 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count179 br i1 %cmp.n, label %for.end75, label %for.body70.preheader193 for.body70.preheader193: ; preds = %for.body70.preheader, %middle.block %indvars.iv176.ph = phi i64 [ 0, %for.body70.preheader ], [ %n.vec, %middle.block ] %sum.0152.ph = phi i32 [ 0, %for.body70.preheader ], [ %22, %middle.block ] br label %for.body70 for.body70: ; preds = %for.body70.preheader193, %for.body70 %indvars.iv176 = phi i64 [ %indvars.iv.next177, %for.body70 ], [ %indvars.iv176.ph, %for.body70.preheader193 ] %sum.0152 = phi i32 [ %add, %for.body70 ], [ %sum.0152.ph, %for.body70.preheader193 ] %arrayidx72 = getelementptr inbounds [1000 x i32], ptr %y, i64 0, i64 %indvars.iv176 %23 = load i32, ptr %arrayidx72, align 4, !tbaa !5 %add = add nsw i32 %23, %sum.0152 %indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1 %exitcond180.not = icmp eq i64 %indvars.iv.next177, %wide.trip.count179 br i1 %exitcond180.not, label %for.end75, label %for.body70, !llvm.loop !19 for.end75: ; preds = %for.body70, %middle.block, %entry, %for.cond68.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond68.preheader ], [ 0, %entry ], [ %22, %middle.block ], [ %add, %for.body70 ] %call76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %z) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !17, !18} !17 = !{!"llvm.loop.isvectorized", i32 1} !18 = !{!"llvm.loop.unroll.runtime.disable"} !19 = distinct !{!19, !10, !18, !17}
#include <stdio.h> #define INF 2001 #define GRAY 0 #define WHITE 1 #define BLACK -1 #define N 100 void prim( int ); int n, color[N+1], d[N+1], adj[N+1][N+1], p[N+1]; int main(){ int i, j, sum = 0, m; //input scanf("%d", &n); for( i=0; i<n; i++ ){ for( j=0; j<n; j++){ scanf("%d", &m); if( m == -1 ) adj[i][j] = INF; else adj[i][j] = m; } } //calculate prim( 0 ); //calculate sum for( i=0; i<n; i++ ){ if( p[i] != -1 ) sum += adj[i][p[i]]; } //print printf("%d\n", sum); return 0; } void prim( int start ){//1-origin int i, j, k, l, mincost; //initialize for(i = 0; i<n; i++){ d[i] = INF; color[i] = WHITE; p[i] = -1; } d[start] = 0; //calculate while (1){ mincost = INF; for(i = 0; i<n; i++){ if( color[i] != BLACK && d[i] < mincost ){ mincost = d[i]; k = i; } } if( mincost == INF ) break; color[k] = BLACK; for( i=0; i<n; i++){ if( color[i] != BLACK && adj[k][i] != INF ){ if( d[i] > adj[k][i] ){ d[i] = adj[k][i]; p[i] = k; color[i] = GRAY; } } } } return ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199394/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199394/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @adj = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16 @p = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @color = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i48 = freeze i32 %0 %cmp49 = icmp sgt i32 %.fr.i48, 0 br i1 %cmp49, label %for.cond1.preheader, label %prim.exit.thread for.cond1.preheader: ; preds = %entry, %for.inc12 %1 = phi i32 [ %.fr.i, %for.inc12 ], [ %.fr.i48, %entry ] %indvars.iv58 = phi i64 [ %indvars.iv.next59, %for.inc12 ], [ 0, %entry ] %cmp246 = icmp sgt i32 %1, 0 br i1 %cmp246, label %for.body3, label %for.inc12 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp5 = icmp eq i32 %2, -1 %spec.select = select i1 %cmp5, i32 2001, i32 %2 %3 = getelementptr inbounds [101 x [101 x i32]], ptr @adj, i64 0, i64 %indvars.iv58, i64 %indvars.iv store i32 %spec.select, ptr %3, align 4 %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.inc12, !llvm.loop !9 for.inc12: ; preds = %for.body3, %for.cond1.preheader %6 = phi i32 [ %1, %for.cond1.preheader ], [ %4, %for.body3 ] %.fr.i = freeze i32 %6 %indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1 %7 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next59, %7 br i1 %cmp, label %for.cond1.preheader, label %for.end14, !llvm.loop !11 for.end14: ; preds = %for.inc12 %cmp89.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp89.i, label %for.body.preheader.i, label %prim.exit.thread prim.exit.thread: ; preds = %for.end14, %entry store i32 0, ptr @d, align 16, !tbaa !5 br label %for.end31 for.body.preheader.i: ; preds = %for.end14 %8 = zext i32 %.fr.i to i64 %9 = shl nuw nsw i64 %8, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 @p, i8 -1, i64 %9, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %8, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %10 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %index store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %11, align 16, !tbaa !5 %12 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %12, align 16, !tbaa !5 %13 = getelementptr inbounds i32, ptr %12, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %13, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %14 = icmp eq i64 %index.next, %n.vec br i1 %14, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %8 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.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv.i store i32 2001, ptr %arrayidx.i, align 4, !tbaa !5 %arrayidx2.i = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv.i store i32 1, ptr %arrayidx2.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, %8 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.block 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, 2001 br i1 %cmp21.us.i, label %prim.exit, label %if.end23.us.i if.end23.us.i: ; preds = %for.end20.us.i %idxprom24.us.i = sext i32 %k.2.us.i to i64 %arrayidx25.us.i = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %idxprom24.us.i store i32 -1, ptr %arrayidx25.us.i, align 4, !tbaa !5 br label %for.body28.us.i for.body28.us.i: ; preds = %for.inc59.us.i, %if.end23.us.i %indvars.iv141.i = phi i64 [ 0, %if.end23.us.i ], [ %indvars.iv.next142.i, %for.inc59.us.i ] %arrayidx30.us.i = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv141.i %15 = load i32, ptr %arrayidx30.us.i, align 4, !tbaa !5 %cmp31.not.us.i = icmp eq i32 %15, -1 br i1 %cmp31.not.us.i, label %for.inc59.us.i, label %land.lhs.true32.us.i land.lhs.true32.us.i: ; preds = %for.body28.us.i %arrayidx36.us.i = getelementptr inbounds [101 x [101 x i32]], ptr @adj, i64 0, i64 %idxprom24.us.i, i64 %indvars.iv141.i %16 = load i32, ptr %arrayidx36.us.i, align 4, !tbaa !5 %cmp37.not.us.i = icmp eq i32 %16, 2001 br i1 %cmp37.not.us.i, label %for.inc59.us.i, label %if.then38.us.i if.then38.us.i: ; preds = %land.lhs.true32.us.i %arrayidx40.us.i = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv141.i %17 = load i32, ptr %arrayidx40.us.i, align 4, !tbaa !5 %cmp45.us.i = icmp sgt i32 %17, %16 br i1 %cmp45.us.i, label %if.then46.us.i, label %for.inc59.us.i if.then46.us.i: ; preds = %if.then38.us.i store i32 %16, ptr %arrayidx40.us.i, align 4, !tbaa !5 %arrayidx54.us.i = getelementptr inbounds [101 x i32], ptr @p, i64 0, i64 %indvars.iv141.i store i32 %k.2.us.i, ptr %arrayidx54.us.i, align 4, !tbaa !5 store i32 0, ptr %arrayidx30.us.i, align 4, !tbaa !5 br label %for.inc59.us.i for.inc59.us.i: ; preds = %if.then46.us.i, %if.then38.us.i, %land.lhs.true32.us.i, %for.body28.us.i %indvars.iv.next142.i = add nuw nsw i64 %indvars.iv141.i, 1 %exitcond145.not.i = icmp eq i64 %indvars.iv.next142.i, %8 br i1 %exitcond145.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.iv136.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv136.i.be, %for.body9.us.i.backedge ] %mincost.094.us.i = phi i32 [ 2001, %while.cond.us.preheader.i ], [ %mincost.094.us.i.be, %for.body9.us.i.backedge ] %k.192.us.i = phi i32 [ undef, %while.cond.us.preheader.i ], [ %k.2.us.i, %for.body9.us.i.backedge ] %arrayidx11.us.i = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv136.i %18 = load i32, ptr %arrayidx11.us.i, align 4, !tbaa !5 %cmp12.not.us.i = icmp eq i32 %18, -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 [101 x i32], ptr @d, i64 0, i64 %indvars.iv136.i %19 = load i32, ptr %arrayidx14.us.i, align 4, !tbaa !5 %cmp15.us.i = icmp slt i32 %19, %mincost.094.us.i %20 = trunc i64 %indvars.iv136.i to i32 %spec.select.us.i = select i1 %cmp15.us.i, i32 %20, i32 %k.192.us.i %spec.select88.us.i = call i32 @llvm.smin.i32(i32 %19, i32 %mincost.094.us.i) br label %for.inc18.us.i for.inc18.us.i: ; preds = %land.lhs.true.us.i, %for.body9.us.i %k.2.us.i = phi i32 [ %k.192.us.i, %for.body9.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %mincost.1.us.i = phi i32 [ %mincost.094.us.i, %for.body9.us.i ], [ %spec.select88.us.i, %land.lhs.true.us.i ] %indvars.iv.next137.i = add nuw nsw i64 %indvars.iv136.i, 1 %exitcond140.not.i = icmp eq i64 %indvars.iv.next137.i, %8 br i1 %exitcond140.not.i, label %for.end20.us.i, label %for.body9.us.i.backedge for.body9.us.i.backedge: ; preds = %for.inc59.us.i, %for.inc18.us.i %indvars.iv136.i.be = phi i64 [ %indvars.iv.next137.i, %for.inc18.us.i ], [ 0, %for.inc59.us.i ] %mincost.094.us.i.be = phi i32 [ %mincost.1.us.i, %for.inc18.us.i ], [ 2001, %for.inc59.us.i ] br label %for.body9.us.i, !llvm.loop !17 prim.exit: ; preds = %for.end20.us.i br i1 %cmp89.i, label %for.body17.preheader, label %for.end31 for.body17.preheader: ; preds = %prim.exit %xtraiter = and i64 %8, 1 %21 = icmp eq i32 %.fr.i, 1 br i1 %21, label %for.end31.loopexit.unr-lcssa, label %for.body17.preheader.new for.body17.preheader.new: ; preds = %for.body17.preheader %unroll_iter = and i64 %8, 4294967294 br label %for.body17 for.body17: ; preds = %for.inc29.1, %for.body17.preheader.new %indvars.iv61 = phi i64 [ 0, %for.body17.preheader.new ], [ %indvars.iv.next62.1, %for.inc29.1 ] %sum.053 = phi i32 [ 0, %for.body17.preheader.new ], [ %sum.1.1, %for.inc29.1 ] %niter = phi i64 [ 0, %for.body17.preheader.new ], [ %niter.next.1, %for.inc29.1 ] %arrayidx19 = getelementptr inbounds [101 x i32], ptr @p, i64 0, i64 %indvars.iv61 %22 = load i32, ptr %arrayidx19, align 8, !tbaa !5 %cmp20.not = icmp eq i32 %22, -1 br i1 %cmp20.not, label %for.inc29, label %if.then21 if.then21: ; preds = %for.body17 %idxprom26 = sext i32 %22 to i64 %arrayidx27 = getelementptr inbounds [101 x [101 x i32]], ptr @adj, i64 0, i64 %indvars.iv61, i64 %idxprom26 %23 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %add = add nsw i32 %23, %sum.053 br label %for.inc29 for.inc29: ; preds = %for.body17, %if.then21 %sum.1 = phi i32 [ %add, %if.then21 ], [ %sum.053, %for.body17 ] %indvars.iv.next62 = or i64 %indvars.iv61, 1 %arrayidx19.1 = getelementptr inbounds [101 x i32], ptr @p, i64 0, i64 %indvars.iv.next62 %24 = load i32, ptr %arrayidx19.1, align 4, !tbaa !5 %cmp20.not.1 = icmp eq i32 %24, -1 br i1 %cmp20.not.1, label %for.inc29.1, label %if.then21.1 if.then21.1: ; preds = %for.inc29 %idxprom26.1 = sext i32 %24 to i64 %arrayidx27.1 = getelementptr inbounds [101 x [101 x i32]], ptr @adj, i64 0, i64 %indvars.iv.next62, i64 %idxprom26.1 %25 = load i32, ptr %arrayidx27.1, align 4, !tbaa !5 %add.1 = add nsw i32 %25, %sum.1 br label %for.inc29.1 for.inc29.1: ; preds = %if.then21.1, %for.inc29 %sum.1.1 = phi i32 [ %add.1, %if.then21.1 ], [ %sum.1, %for.inc29 ] %indvars.iv.next62.1 = add nuw nsw i64 %indvars.iv61, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end31.loopexit.unr-lcssa, label %for.body17, !llvm.loop !18 for.end31.loopexit.unr-lcssa: ; preds = %for.inc29.1, %for.body17.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body17.preheader ], [ %sum.1.1, %for.inc29.1 ] %indvars.iv61.unr = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next62.1, %for.inc29.1 ] %sum.053.unr = phi i32 [ 0, %for.body17.preheader ], [ %sum.1.1, %for.inc29.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end31, label %for.body17.epil for.body17.epil: ; preds = %for.end31.loopexit.unr-lcssa %arrayidx19.epil = getelementptr inbounds [101 x i32], ptr @p, i64 0, i64 %indvars.iv61.unr %26 = load i32, ptr %arrayidx19.epil, align 4, !tbaa !5 %cmp20.not.epil = icmp eq i32 %26, -1 br i1 %cmp20.not.epil, label %for.end31, label %if.then21.epil if.then21.epil: ; preds = %for.body17.epil %idxprom26.epil = sext i32 %26 to i64 %arrayidx27.epil = getelementptr inbounds [101 x [101 x i32]], ptr @adj, i64 0, i64 %indvars.iv61.unr, i64 %idxprom26.epil %27 = load i32, ptr %arrayidx27.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %27, %sum.053.unr br label %for.end31 for.end31: ; preds = %for.end31.loopexit.unr-lcssa, %if.then21.epil, %for.body17.epil, %prim.exit.thread, %prim.exit %sum.0.lcssa = phi i32 [ 0, %prim.exit ], [ 0, %prim.exit.thread ], [ %sum.1.lcssa.ph, %for.end31.loopexit.unr-lcssa ], [ %add.epil, %if.then21.epil ], [ %sum.053.unr, %for.body17.epil ] %call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 @prim(i32 noundef %start) local_unnamed_addr #3 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp89 = icmp sgt i32 %.fr, 0 br i1 %cmp89, label %for.body.preheader, label %for.end.thread for.end.thread: ; preds = %entry %idxprom5146 = sext i32 %start to i64 %arrayidx6147 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom5146 store i32 0, ptr %arrayidx6147, align 4, !tbaa !5 br label %while.end for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @p, i8 -1, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader148, 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 [101 x i32], ptr @d, i64 0, i64 %index store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %index store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %5, align 16, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 store <4 x i32> <i32 1, i32 1, i32 1, i32 1>, ptr %6, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %7 = icmp eq i64 %index.next, %n.vec br i1 %7, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader148 for.body.preheader148: ; 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.preheader148, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader148 ] %arrayidx = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv store i32 2001, ptr %arrayidx, align 4, !tbaa !5 %arrayidx2 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx2, 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 !20 for.end: ; preds = %for.body, %middle.block %idxprom5 = sext i32 %start to i64 %arrayidx6 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom5 store i32 0, ptr %arrayidx6, align 4, !tbaa !5 br i1 %cmp89, label %while.cond.us.preheader, label %while.end while.cond.us.preheader: ; preds = %for.end %wide.trip.count139 = zext i32 %.fr to i64 %wide.trip.count144 = zext i32 %.fr to i64 br label %for.body9.us for.end20.us: ; preds = %for.inc18.us %cmp21.us = icmp eq i32 %mincost.1.us, 2001 br i1 %cmp21.us, label %while.end, label %if.end23.us if.end23.us: ; preds = %for.end20.us %idxprom24.us = sext i32 %k.2.us to i64 %arrayidx25.us = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %idxprom24.us store i32 -1, ptr %arrayidx25.us, align 4, !tbaa !5 br label %for.body28.us for.body28.us: ; preds = %if.end23.us, %for.inc59.us %indvars.iv141 = phi i64 [ 0, %if.end23.us ], [ %indvars.iv.next142, %for.inc59.us ] %arrayidx30.us = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv141 %8 = load i32, ptr %arrayidx30.us, align 4, !tbaa !5 %cmp31.not.us = icmp eq i32 %8, -1 br i1 %cmp31.not.us, label %for.inc59.us, label %land.lhs.true32.us land.lhs.true32.us: ; preds = %for.body28.us %arrayidx36.us = getelementptr inbounds [101 x [101 x i32]], ptr @adj, i64 0, i64 %idxprom24.us, i64 %indvars.iv141 %9 = load i32, ptr %arrayidx36.us, align 4, !tbaa !5 %cmp37.not.us = icmp eq i32 %9, 2001 br i1 %cmp37.not.us, label %for.inc59.us, label %if.then38.us if.then38.us: ; preds = %land.lhs.true32.us %arrayidx40.us = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv141 %10 = load i32, ptr %arrayidx40.us, align 4, !tbaa !5 %cmp45.us = icmp sgt i32 %10, %9 br i1 %cmp45.us, label %if.then46.us, label %for.inc59.us if.then46.us: ; preds = %if.then38.us store i32 %9, ptr %arrayidx40.us, align 4, !tbaa !5 %arrayidx54.us = getelementptr inbounds [101 x i32], ptr @p, i64 0, i64 %indvars.iv141 store i32 %k.2.us, ptr %arrayidx54.us, align 4, !tbaa !5 store i32 0, ptr %arrayidx30.us, align 4, !tbaa !5 br label %for.inc59.us for.inc59.us: ; preds = %if.then46.us, %if.then38.us, %land.lhs.true32.us, %for.body28.us %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1 %exitcond145.not = icmp eq i64 %indvars.iv.next142, %wide.trip.count144 br i1 %exitcond145.not, label %for.body9.us.backedge, label %for.body28.us, !llvm.loop !17 for.body9.us: ; preds = %for.body9.us.backedge, %while.cond.us.preheader %indvars.iv136 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv136.be, %for.body9.us.backedge ] %mincost.094.us = phi i32 [ 2001, %while.cond.us.preheader ], [ %mincost.094.us.be, %for.body9.us.backedge ] %k.192.us = phi i32 [ undef, %while.cond.us.preheader ], [ %k.2.us, %for.body9.us.backedge ] %arrayidx11.us = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv136 %11 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5 %cmp12.not.us = icmp eq i32 %11, -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 [101 x i32], ptr @d, i64 0, i64 %indvars.iv136 %12 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %cmp15.us = icmp slt i32 %12, %mincost.094.us %13 = trunc i64 %indvars.iv136 to i32 %spec.select.us = select i1 %cmp15.us, i32 %13, i32 %k.192.us %spec.select88.us = tail call i32 @llvm.smin.i32(i32 %12, i32 %mincost.094.us) br label %for.inc18.us for.inc18.us: ; preds = %land.lhs.true.us, %for.body9.us %k.2.us = phi i32 [ %k.192.us, %for.body9.us ], [ %spec.select.us, %land.lhs.true.us ] %mincost.1.us = phi i32 [ %mincost.094.us, %for.body9.us ], [ %spec.select88.us, %land.lhs.true.us ] %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %exitcond140.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count139 br i1 %exitcond140.not, label %for.end20.us, label %for.body9.us.backedge for.body9.us.backedge: ; preds = %for.inc59.us, %for.inc18.us %indvars.iv136.be = phi i64 [ %indvars.iv.next137, %for.inc18.us ], [ 0, %for.inc59.us ] %mincost.094.us.be = phi i32 [ %mincost.1.us, %for.inc18.us ], [ 2001, %for.inc59.us ] br label %for.body9.us, !llvm.loop !17 while.end: ; preds = %for.end20.us, %for.end, %for.end.thread 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} !12 = !{!"llvm.loop.unswitch.partial.disable"} !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 MAX 100 #define INFTY (1<<21) #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[MAX][MAX]; int prim() { int u,minv,d[MAX],p[MAX],color[MAX],i,v,sum=0; for( i=0 ; i<n ; i++ ){ d[i] = INFTY; p[i] = -1; color[i] = WHITE; } d[0] = 0; while(1){ minv = INFTY; u = -1; for( i=0 ; i<n ; i++ ){ if( (minv>d[i])&&(color[i]!=BLACK) ){ u = i; minv = d[i]; } } if( u==-1 ) break; color[u]=BLACK; for( v=0 ; v<n ; v++ ){ if( color[v]!=BLACK&&M[u][v]!=INFTY ){ if( d[v]>M[u][v] ){ d[v] = M[u][v]; p[v] = u; color[v] = GRAY; } } } } for( i=0 ; i<n ; i++ ){ if( p[i]!=-1 ) sum += M[i][p[i]]; } return sum; } int main() { int i,j,a; scanf("%d",&n); for( i=0 ; i<n ; i++ ){ for( j=0 ; j<n ; j++ ){ scanf("%d",&a); M[i][j] = ( a==-1 ) ? INFTY : a; } } printf("%d\n",prim()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199437/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199437/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i32 0, align 4 @M = 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 [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #0 { entry: %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp111 = icmp sgt i32 %.fr, 0 br i1 %cmp111, label %for.body.preheader, label %for.end77 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 %p, i8 -1, i64 %2, i1 false), !tbaa !5 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.preheader173, 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 !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader173 for.body.preheader173: ; 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.preheader173, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader173 ] %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 !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp111, label %while.cond.us.preheader, label %for.end77 while.cond.us.preheader: ; preds = %for.end %wide.trip.count161 = zext i32 %.fr to i64 %wide.trip.count166 = zext i32 %.fr to i64 br label %for.body8.us for.end19.us: ; preds = %for.inc17.us %cmp20.us = icmp eq i32 %u.1.us, -1 br i1 %cmp20.us, label %for.cond61.preheader, label %if.end22.us if.end22.us: ; preds = %for.end19.us %idxprom23.us = sext i32 %u.1.us to i64 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom23.us store i32 2, ptr %arrayidx24.us, align 4, !tbaa !5 br label %for.body27.us for.body27.us: ; preds = %if.end22.us, %for.inc58.us %indvars.iv163 = phi i64 [ 0, %if.end22.us ], [ %indvars.iv.next164, %for.inc58.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv163 %6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30.not.us = icmp eq i32 %6, 2 br i1 %cmp30.not.us, label %for.inc58.us, label %land.lhs.true31.us land.lhs.true31.us: ; preds = %for.body27.us %arrayidx35.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us, i64 %indvars.iv163 %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %cmp36.not.us = icmp eq i32 %7, 2097152 br i1 %cmp36.not.us, label %for.inc58.us, label %if.then37.us if.then37.us: ; preds = %land.lhs.true31.us %arrayidx39.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv163 %8 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp44.us = icmp sgt i32 %8, %7 br i1 %cmp44.us, label %if.then45.us, label %for.inc58.us if.then45.us: ; preds = %if.then37.us store i32 %7, ptr %arrayidx39.us, align 4, !tbaa !5 %arrayidx53.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv163 store i32 %u.1.us, ptr %arrayidx53.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc58.us for.inc58.us: ; preds = %if.then45.us, %if.then37.us, %land.lhs.true31.us, %for.body27.us %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166 br i1 %exitcond167.not, label %for.body8.us.backedge, label %for.body27.us, !llvm.loop !14 for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader %indvars.iv158 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv158.be, %for.body8.us.backedge ] %minv.0115.us = phi i32 [ 2097152, %while.cond.us.preheader ], [ %minv.0115.us.be, %for.body8.us.backedge ] %u.0114.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0114.us.be, %for.body8.us.backedge ] %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv158 %9 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.us = icmp sgt i32 %minv.0115.us, %9 br i1 %cmp11.us, label %land.lhs.true.us, label %for.inc17.us land.lhs.true.us: ; preds = %for.body8.us %arrayidx13.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv158 %10 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.not.us = icmp eq i32 %10, 2 %11 = trunc i64 %indvars.iv158 to i32 %spec.select.us = select i1 %cmp14.not.us, i32 %u.0114.us, i32 %11 %spec.select110.us = select i1 %cmp14.not.us, i32 %minv.0115.us, i32 %9 br label %for.inc17.us for.inc17.us: ; preds = %land.lhs.true.us, %for.body8.us %u.1.us = phi i32 [ %u.0114.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ] %minv.1.us = phi i32 [ %minv.0115.us, %for.body8.us ], [ %spec.select110.us, %land.lhs.true.us ] %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %exitcond162.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count161 br i1 %exitcond162.not, label %for.end19.us, label %for.body8.us.backedge for.body8.us.backedge: ; preds = %for.inc58.us, %for.inc17.us %indvars.iv158.be = phi i64 [ %indvars.iv.next159, %for.inc17.us ], [ 0, %for.inc58.us ] %minv.0115.us.be = phi i32 [ %minv.1.us, %for.inc17.us ], [ 2097152, %for.inc58.us ] %u.0114.us.be = phi i32 [ %u.1.us, %for.inc17.us ], [ -1, %for.inc58.us ] br label %for.body8.us, !llvm.loop !14 for.cond61.preheader: ; preds = %for.end19.us br i1 %cmp111, label %for.body63.preheader, label %for.end77 for.body63.preheader: ; preds = %for.cond61.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end77.loopexit.unr-lcssa, label %for.body63.preheader.new for.body63.preheader.new: ; preds = %for.body63.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body63 for.body63: ; preds = %for.inc75.1, %for.body63.preheader.new %indvars.iv168 = phi i64 [ 0, %for.body63.preheader.new ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149 = phi i32 [ 0, %for.body63.preheader.new ], [ %sum.1.1, %for.inc75.1 ] %niter = phi i64 [ 0, %for.body63.preheader.new ], [ %niter.next.1, %for.inc75.1 ] %arrayidx65 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168 %13 = load i32, ptr %arrayidx65, align 8, !tbaa !5 %cmp66.not = icmp eq i32 %13, -1 br i1 %cmp66.not, label %for.inc75, label %if.then67 if.then67: ; preds = %for.body63 %idxprom72 = sext i32 %13 to i64 %arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168, i64 %idxprom72 %14 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0149 br label %for.inc75 for.inc75: ; preds = %for.body63, %if.then67 %sum.1 = phi i32 [ %add, %if.then67 ], [ %sum.0149, %for.body63 ] %indvars.iv.next169 = or i64 %indvars.iv168, 1 %arrayidx65.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next169 %15 = load i32, ptr %arrayidx65.1, align 4, !tbaa !5 %cmp66.not.1 = icmp eq i32 %15, -1 br i1 %cmp66.not.1, label %for.inc75.1, label %if.then67.1 if.then67.1: ; preds = %for.inc75 %idxprom72.1 = sext i32 %15 to i64 %arrayidx73.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next169, i64 %idxprom72.1 %16 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc75.1 for.inc75.1: ; preds = %if.then67.1, %for.inc75 %sum.1.1 = phi i32 [ %add.1, %if.then67.1 ], [ %sum.1, %for.inc75 ] %indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end77.loopexit.unr-lcssa, label %for.body63, !llvm.loop !15 for.end77.loopexit.unr-lcssa: ; preds = %for.inc75.1, %for.body63.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %indvars.iv168.unr = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149.unr = phi i32 [ 0, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end77, label %for.body63.epil for.body63.epil: ; preds = %for.end77.loopexit.unr-lcssa %arrayidx65.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168.unr %17 = load i32, ptr %arrayidx65.epil, align 4, !tbaa !5 %cmp66.not.epil = icmp eq i32 %17, -1 br i1 %cmp66.not.epil, label %for.end77, label %if.then67.epil if.then67.epil: ; preds = %for.body63.epil %idxprom72.epil = sext i32 %17 to i64 %arrayidx73.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.unr, i64 %idxprom72.epil %18 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0149.unr br label %for.end77 for.end77: ; preds = %for.end77.loopexit.unr-lcssa, %if.then67.epil, %for.body63.epil, %entry, %for.end, %for.cond61.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %add.epil, %if.then67.epil ], [ %sum.0149.unr, %for.body63.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: %d.i = alloca [100 x i32], align 16 %p.i = alloca [100 x i32], align 16 %color.i = alloca [100 x i32], align 16 %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i19 = freeze i32 %0 %cmp20 = icmp sgt i32 %.fr.i19, 0 br i1 %cmp20, label %for.cond1.preheader, label %for.end10.thread for.end10.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 br label %prim.exit for.cond1.preheader: ; preds = %entry, %for.inc8 %1 = phi i32 [ %.fr.i, %for.inc8 ], [ %.fr.i19, %entry ] %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.inc8 ], [ 0, %entry ] %cmp217 = icmp sgt i32 %1, 0 br i1 %cmp217, label %for.body3, label %for.inc8 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %2 = load i32, ptr %a, align 4 %cmp5 = icmp eq i32 %2, -1 %cond = select i1 %cmp5, i32 2097152, i32 %2 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv25, i64 %indvars.iv store i32 %cond, ptr %arrayidx7, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc8, !llvm.loop !16 for.inc8: ; preds = %for.body3, %for.cond1.preheader %5 = phi i32 [ %1, %for.cond1.preheader ], [ %3, %for.body3 ] %.fr.i = freeze i32 %5 %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %6 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next26, %6 br i1 %cmp, label %for.cond1.preheader, label %for.end10, !llvm.loop !17 for.end10: ; preds = %for.inc8 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 %cmp111.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp111.i, label %for.body.preheader.i, label %prim.exit for.body.preheader.i: ; preds = %for.end10 %7 = zext i32 %.fr.i to i64 %8 = shl nuw nsw i64 %7, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p.i, i8 -1, i64 %8, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color.i, i8 0, i64 %8, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %7, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %9 = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %10, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %7 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.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv.i store i32 2097152, 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, %7 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !20 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr %d.i, align 16, !tbaa !5 br label %for.body8.us.i for.end19.us.i: ; preds = %for.inc17.us.i %cmp20.us.i = icmp eq i32 %u.1.us.i, -1 br i1 %cmp20.us.i, label %for.body63.i.preheader, label %if.end22.us.i for.body63.i.preheader: ; preds = %for.end19.us.i %xtraiter = and i64 %7, 1 %12 = icmp eq i32 %.fr.i, 1 br i1 %12, label %prim.exit.loopexit.unr-lcssa, label %for.body63.i.preheader.new for.body63.i.preheader.new: ; preds = %for.body63.i.preheader %unroll_iter = and i64 %7, 4294967294 br label %for.body63.i if.end22.us.i: ; preds = %for.end19.us.i %idxprom23.us.i = sext i32 %u.1.us.i to i64 %arrayidx24.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %idxprom23.us.i store i32 2, ptr %arrayidx24.us.i, align 4, !tbaa !5 br label %for.body27.us.i for.body27.us.i: ; preds = %for.inc58.us.i, %if.end22.us.i %indvars.iv163.i = phi i64 [ 0, %if.end22.us.i ], [ %indvars.iv.next164.i, %for.inc58.us.i ] %arrayidx29.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv163.i %13 = load i32, ptr %arrayidx29.us.i, align 4, !tbaa !5 %cmp30.not.us.i = icmp eq i32 %13, 2 br i1 %cmp30.not.us.i, label %for.inc58.us.i, label %land.lhs.true31.us.i land.lhs.true31.us.i: ; preds = %for.body27.us.i %arrayidx35.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us.i, i64 %indvars.iv163.i %14 = load i32, ptr %arrayidx35.us.i, align 4, !tbaa !5 %cmp36.not.us.i = icmp eq i32 %14, 2097152 br i1 %cmp36.not.us.i, label %for.inc58.us.i, label %if.then37.us.i if.then37.us.i: ; preds = %land.lhs.true31.us.i %arrayidx39.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv163.i %15 = load i32, ptr %arrayidx39.us.i, align 4, !tbaa !5 %cmp44.us.i = icmp sgt i32 %15, %14 br i1 %cmp44.us.i, label %if.then45.us.i, label %for.inc58.us.i if.then45.us.i: ; preds = %if.then37.us.i store i32 %14, ptr %arrayidx39.us.i, align 4, !tbaa !5 %arrayidx53.us.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv163.i store i32 %u.1.us.i, ptr %arrayidx53.us.i, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us.i, align 4, !tbaa !5 br label %for.inc58.us.i for.inc58.us.i: ; preds = %if.then45.us.i, %if.then37.us.i, %land.lhs.true31.us.i, %for.body27.us.i %indvars.iv.next164.i = add nuw nsw i64 %indvars.iv163.i, 1 %exitcond167.not.i = icmp eq i64 %indvars.iv.next164.i, %7 br i1 %exitcond167.not.i, label %for.body8.us.i.backedge, label %for.body27.us.i, !llvm.loop !14 for.body8.us.i: ; preds = %for.body8.us.i.backedge, %while.cond.us.preheader.i %indvars.iv158.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv158.i.be, %for.body8.us.i.backedge ] %minv.0115.us.i = phi i32 [ 2097152, %while.cond.us.preheader.i ], [ %minv.0115.us.i.be, %for.body8.us.i.backedge ] %u.0114.us.i = phi i32 [ -1, %while.cond.us.preheader.i ], [ %u.0114.us.i.be, %for.body8.us.i.backedge ] %arrayidx10.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv158.i %16 = load i32, ptr %arrayidx10.us.i, align 4, !tbaa !5 %cmp11.us.i = icmp sgt i32 %minv.0115.us.i, %16 br i1 %cmp11.us.i, label %land.lhs.true.us.i, label %for.inc17.us.i land.lhs.true.us.i: ; preds = %for.body8.us.i %arrayidx13.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv158.i %17 = load i32, ptr %arrayidx13.us.i, align 4, !tbaa !5 %cmp14.not.us.i = icmp eq i32 %17, 2 %18 = trunc i64 %indvars.iv158.i to i32 %spec.select.us.i = select i1 %cmp14.not.us.i, i32 %u.0114.us.i, i32 %18 %spec.select110.us.i = select i1 %cmp14.not.us.i, i32 %minv.0115.us.i, i32 %16 br label %for.inc17.us.i for.inc17.us.i: ; preds = %land.lhs.true.us.i, %for.body8.us.i %u.1.us.i = phi i32 [ %u.0114.us.i, %for.body8.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %minv.1.us.i = phi i32 [ %minv.0115.us.i, %for.body8.us.i ], [ %spec.select110.us.i, %land.lhs.true.us.i ] %indvars.iv.next159.i = add nuw nsw i64 %indvars.iv158.i, 1 %exitcond162.not.i = icmp eq i64 %indvars.iv.next159.i, %7 br i1 %exitcond162.not.i, label %for.end19.us.i, label %for.body8.us.i.backedge for.body8.us.i.backedge: ; preds = %for.inc58.us.i, %for.inc17.us.i %indvars.iv158.i.be = phi i64 [ %indvars.iv.next159.i, %for.inc17.us.i ], [ 0, %for.inc58.us.i ] %minv.0115.us.i.be = phi i32 [ %minv.1.us.i, %for.inc17.us.i ], [ 2097152, %for.inc58.us.i ] %u.0114.us.i.be = phi i32 [ %u.1.us.i, %for.inc17.us.i ], [ -1, %for.inc58.us.i ] br label %for.body8.us.i, !llvm.loop !14 for.body63.i: ; preds = %for.inc75.i.1, %for.body63.i.preheader.new %indvars.iv168.i = phi i64 [ 0, %for.body63.i.preheader.new ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0149.i = phi i32 [ 0, %for.body63.i.preheader.new ], [ %sum.1.i.1, %for.inc75.i.1 ] %niter = phi i64 [ 0, %for.body63.i.preheader.new ], [ %niter.next.1, %for.inc75.i.1 ] %arrayidx65.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv168.i %19 = load i32, ptr %arrayidx65.i, align 8, !tbaa !5 %cmp66.not.i = icmp eq i32 %19, -1 br i1 %cmp66.not.i, label %for.inc75.i, label %if.then67.i if.then67.i: ; preds = %for.body63.i %idxprom72.i = sext i32 %19 to i64 %arrayidx73.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.i, i64 %idxprom72.i %20 = load i32, ptr %arrayidx73.i, align 4, !tbaa !5 %add.i = add nsw i32 %20, %sum.0149.i br label %for.inc75.i for.inc75.i: ; preds = %if.then67.i, %for.body63.i %sum.1.i = phi i32 [ %add.i, %if.then67.i ], [ %sum.0149.i, %for.body63.i ] %indvars.iv.next169.i = or i64 %indvars.iv168.i, 1 %arrayidx65.i.1 = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv.next169.i %21 = load i32, ptr %arrayidx65.i.1, align 4, !tbaa !5 %cmp66.not.i.1 = icmp eq i32 %21, -1 br i1 %cmp66.not.i.1, label %for.inc75.i.1, label %if.then67.i.1 if.then67.i.1: ; preds = %for.inc75.i %idxprom72.i.1 = sext i32 %21 to i64 %arrayidx73.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next169.i, i64 %idxprom72.i.1 %22 = load i32, ptr %arrayidx73.i.1, align 4, !tbaa !5 %add.i.1 = add nsw i32 %22, %sum.1.i br label %for.inc75.i.1 for.inc75.i.1: ; preds = %if.then67.i.1, %for.inc75.i %sum.1.i.1 = phi i32 [ %add.i.1, %if.then67.i.1 ], [ %sum.1.i, %for.inc75.i ] %indvars.iv.next169.i.1 = add nuw nsw i64 %indvars.iv168.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %prim.exit.loopexit.unr-lcssa, label %for.body63.i, !llvm.loop !15 prim.exit.loopexit.unr-lcssa: ; preds = %for.inc75.i.1, %for.body63.i.preheader %sum.1.i.lcssa.ph = phi i32 [ undef, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %indvars.iv168.i.unr = phi i64 [ 0, %for.body63.i.preheader ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0149.i.unr = phi i32 [ 0, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %prim.exit, label %for.body63.i.epil for.body63.i.epil: ; preds = %prim.exit.loopexit.unr-lcssa %arrayidx65.i.epil = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv168.i.unr %23 = load i32, ptr %arrayidx65.i.epil, align 4, !tbaa !5 %cmp66.not.i.epil = icmp eq i32 %23, -1 br i1 %cmp66.not.i.epil, label %prim.exit, label %if.then67.i.epil if.then67.i.epil: ; preds = %for.body63.i.epil %idxprom72.i.epil = sext i32 %23 to i64 %arrayidx73.i.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.i.unr, i64 %idxprom72.i.epil %24 = load i32, ptr %arrayidx73.i.epil, align 4, !tbaa !5 %add.i.epil = add nsw i32 %24, %sum.0149.i.unr br label %prim.exit prim.exit: ; preds = %prim.exit.loopexit.unr-lcssa, %if.then67.i.epil, %for.body63.i.epil, %for.end10.thread, %for.end10 %sum.0.lcssa.i = phi i32 [ 0, %for.end10 ], [ 0, %for.end10.thread ], [ %sum.1.i.lcssa.ph, %prim.exit.loopexit.unr-lcssa ], [ %add.i.epil, %if.then67.i.epil ], [ %sum.0149.i.unr, %for.body63.i.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d.i) #5 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(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 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !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, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"} !19 = distinct !{!19, !10, !11, !12} !20 = distinct !{!20, !10, !12, !11}
#include<stdio.h> #define MAX 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 #define INFTY 1000000 int n,M[MAX][MAX]; int prim(){ int u,j,i,min; int omomi[MAX],oya[MAX],color[MAX]; for(i=0;i<n;i++){ omomi[i]=INFTY; oya[i]=-1; color[i]=WHITE; } omomi[0]=0; while(1){ min=INFTY; u=-1; for(i=0;i<n;i++){ if(min>omomi[i]&&color[i]!=BLACK){ u=i; min=omomi[i]; } } if(u==-1)break; color[u]=BLACK; for(j=0;j<n;j++){ if(color[j]!=BLACK&&M[u][j]!=INFTY){ if(omomi[j]>M[u][j]){ omomi[j]=M[u][j]; oya[j]=u; color[j]=GRAY; } } } } int sum=0; for(i=0;i<n;i++){ if(oya[i]!=-1)sum+=M[i][oya[i]]; } return sum; } int main(){ int i,j,k; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&k); M[i][j]=(k==-1)?INFTY:k; } } printf("%d\n",prim()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199488/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199488/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i32 0, align 4 @M = 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 [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #0 { entry: %omomi = alloca [100 x i32], align 16 %oya = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %omomi) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %oya) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp111 = icmp sgt i32 %.fr, 0 br i1 %cmp111, label %for.body.preheader, label %for.end77 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 %oya, i8 -1, i64 %2, i1 false), !tbaa !5 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.preheader173, 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 %omomi, i64 0, i64 %index store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, 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 !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader173 for.body.preheader173: ; 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.preheader173, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader173 ] %arrayidx = getelementptr inbounds [100 x i32], ptr %omomi, i64 0, i64 %indvars.iv store i32 1000000, 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 !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %omomi, align 16, !tbaa !5 br i1 %cmp111, label %while.cond.us.preheader, label %for.end77 while.cond.us.preheader: ; preds = %for.end %wide.trip.count161 = zext i32 %.fr to i64 %wide.trip.count166 = zext i32 %.fr to i64 br label %for.body8.us for.end19.us: ; preds = %for.inc17.us %cmp20.us = icmp eq i32 %u.1.us, -1 br i1 %cmp20.us, label %for.cond61.preheader, label %if.end22.us if.end22.us: ; preds = %for.end19.us %idxprom23.us = sext i32 %u.1.us to i64 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom23.us store i32 2, ptr %arrayidx24.us, align 4, !tbaa !5 br label %for.body27.us for.body27.us: ; preds = %if.end22.us, %for.inc58.us %indvars.iv163 = phi i64 [ 0, %if.end22.us ], [ %indvars.iv.next164, %for.inc58.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv163 %6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30.not.us = icmp eq i32 %6, 2 br i1 %cmp30.not.us, label %for.inc58.us, label %land.lhs.true31.us land.lhs.true31.us: ; preds = %for.body27.us %arrayidx35.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us, i64 %indvars.iv163 %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %cmp36.not.us = icmp eq i32 %7, 1000000 br i1 %cmp36.not.us, label %for.inc58.us, label %if.then37.us if.then37.us: ; preds = %land.lhs.true31.us %arrayidx39.us = getelementptr inbounds [100 x i32], ptr %omomi, i64 0, i64 %indvars.iv163 %8 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp44.us = icmp sgt i32 %8, %7 br i1 %cmp44.us, label %if.then45.us, label %for.inc58.us if.then45.us: ; preds = %if.then37.us store i32 %7, ptr %arrayidx39.us, align 4, !tbaa !5 %arrayidx53.us = getelementptr inbounds [100 x i32], ptr %oya, i64 0, i64 %indvars.iv163 store i32 %u.1.us, ptr %arrayidx53.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc58.us for.inc58.us: ; preds = %if.then45.us, %if.then37.us, %land.lhs.true31.us, %for.body27.us %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166 br i1 %exitcond167.not, label %for.body8.us.backedge, label %for.body27.us, !llvm.loop !14 for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader %indvars.iv158 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv158.be, %for.body8.us.backedge ] %min.0116.us = phi i32 [ 1000000, %while.cond.us.preheader ], [ %min.0116.us.be, %for.body8.us.backedge ] %u.0114.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0114.us.be, %for.body8.us.backedge ] %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %omomi, i64 0, i64 %indvars.iv158 %9 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.us = icmp sgt i32 %min.0116.us, %9 br i1 %cmp11.us, label %land.lhs.true.us, label %for.inc17.us land.lhs.true.us: ; preds = %for.body8.us %arrayidx13.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv158 %10 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.not.us = icmp eq i32 %10, 2 %11 = trunc i64 %indvars.iv158 to i32 %spec.select.us = select i1 %cmp14.not.us, i32 %u.0114.us, i32 %11 %spec.select110.us = select i1 %cmp14.not.us, i32 %min.0116.us, i32 %9 br label %for.inc17.us for.inc17.us: ; preds = %land.lhs.true.us, %for.body8.us %u.1.us = phi i32 [ %u.0114.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ] %min.1.us = phi i32 [ %min.0116.us, %for.body8.us ], [ %spec.select110.us, %land.lhs.true.us ] %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %exitcond162.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count161 br i1 %exitcond162.not, label %for.end19.us, label %for.body8.us.backedge for.body8.us.backedge: ; preds = %for.inc58.us, %for.inc17.us %indvars.iv158.be = phi i64 [ %indvars.iv.next159, %for.inc17.us ], [ 0, %for.inc58.us ] %min.0116.us.be = phi i32 [ %min.1.us, %for.inc17.us ], [ 1000000, %for.inc58.us ] %u.0114.us.be = phi i32 [ %u.1.us, %for.inc17.us ], [ -1, %for.inc58.us ] br label %for.body8.us, !llvm.loop !14 for.cond61.preheader: ; preds = %for.end19.us br i1 %cmp111, label %for.body63.preheader, label %for.end77 for.body63.preheader: ; preds = %for.cond61.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end77.loopexit.unr-lcssa, label %for.body63.preheader.new for.body63.preheader.new: ; preds = %for.body63.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body63 for.body63: ; preds = %for.inc75.1, %for.body63.preheader.new %indvars.iv168 = phi i64 [ 0, %for.body63.preheader.new ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149 = phi i32 [ 0, %for.body63.preheader.new ], [ %sum.1.1, %for.inc75.1 ] %niter = phi i64 [ 0, %for.body63.preheader.new ], [ %niter.next.1, %for.inc75.1 ] %arrayidx65 = getelementptr inbounds [100 x i32], ptr %oya, i64 0, i64 %indvars.iv168 %13 = load i32, ptr %arrayidx65, align 8, !tbaa !5 %cmp66.not = icmp eq i32 %13, -1 br i1 %cmp66.not, label %for.inc75, label %if.then67 if.then67: ; preds = %for.body63 %idxprom72 = sext i32 %13 to i64 %arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168, i64 %idxprom72 %14 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0149 br label %for.inc75 for.inc75: ; preds = %for.body63, %if.then67 %sum.1 = phi i32 [ %add, %if.then67 ], [ %sum.0149, %for.body63 ] %indvars.iv.next169 = or i64 %indvars.iv168, 1 %arrayidx65.1 = getelementptr inbounds [100 x i32], ptr %oya, i64 0, i64 %indvars.iv.next169 %15 = load i32, ptr %arrayidx65.1, align 4, !tbaa !5 %cmp66.not.1 = icmp eq i32 %15, -1 br i1 %cmp66.not.1, label %for.inc75.1, label %if.then67.1 if.then67.1: ; preds = %for.inc75 %idxprom72.1 = sext i32 %15 to i64 %arrayidx73.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next169, i64 %idxprom72.1 %16 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc75.1 for.inc75.1: ; preds = %if.then67.1, %for.inc75 %sum.1.1 = phi i32 [ %add.1, %if.then67.1 ], [ %sum.1, %for.inc75 ] %indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end77.loopexit.unr-lcssa, label %for.body63, !llvm.loop !15 for.end77.loopexit.unr-lcssa: ; preds = %for.inc75.1, %for.body63.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %indvars.iv168.unr = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149.unr = phi i32 [ 0, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end77, label %for.body63.epil for.body63.epil: ; preds = %for.end77.loopexit.unr-lcssa %arrayidx65.epil = getelementptr inbounds [100 x i32], ptr %oya, i64 0, i64 %indvars.iv168.unr %17 = load i32, ptr %arrayidx65.epil, align 4, !tbaa !5 %cmp66.not.epil = icmp eq i32 %17, -1 br i1 %cmp66.not.epil, label %for.end77, label %if.then67.epil if.then67.epil: ; preds = %for.body63.epil %idxprom72.epil = sext i32 %17 to i64 %arrayidx73.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.unr, i64 %idxprom72.epil %18 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0149.unr br label %for.end77 for.end77: ; preds = %for.end77.loopexit.unr-lcssa, %if.then67.epil, %for.body63.epil, %entry, %for.end, %for.cond61.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %add.epil, %if.then67.epil ], [ %sum.0149.unr, %for.body63.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %oya) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %omomi) #5 ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: %omomi.i = alloca [100 x i32], align 16 %oya.i = alloca [100 x i32], align 16 %color.i = alloca [100 x i32], align 16 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i19 = freeze i32 %0 %cmp20 = icmp sgt i32 %.fr.i19, 0 br i1 %cmp20, label %for.cond1.preheader, label %for.end10.thread for.end10.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %omomi.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %oya.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 br label %prim.exit for.cond1.preheader: ; preds = %entry, %for.inc8 %1 = phi i32 [ %.fr.i, %for.inc8 ], [ %.fr.i19, %entry ] %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.inc8 ], [ 0, %entry ] %cmp217 = icmp sgt i32 %1, 0 br i1 %cmp217, label %for.body3, label %for.inc8 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k) %2 = load i32, ptr %k, align 4 %cmp5 = icmp eq i32 %2, -1 %cond = select i1 %cmp5, i32 1000000, i32 %2 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv25, i64 %indvars.iv store i32 %cond, ptr %arrayidx7, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc8, !llvm.loop !16 for.inc8: ; preds = %for.body3, %for.cond1.preheader %5 = phi i32 [ %1, %for.cond1.preheader ], [ %3, %for.body3 ] %.fr.i = freeze i32 %5 %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %6 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next26, %6 br i1 %cmp, label %for.cond1.preheader, label %for.end10, !llvm.loop !17 for.end10: ; preds = %for.inc8 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %omomi.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %oya.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 %cmp111.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp111.i, label %for.body.preheader.i, label %prim.exit for.body.preheader.i: ; preds = %for.end10 %7 = zext i32 %.fr.i to i64 %8 = shl nuw nsw i64 %7, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %oya.i, i8 -1, i64 %8, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color.i, i8 0, i64 %8, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %7, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %9 = getelementptr inbounds [100 x i32], ptr %omomi.i, i64 0, i64 %index store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %10, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %7 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.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr %omomi.i, i64 0, i64 %indvars.iv.i store i32 1000000, 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, %7 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !20 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr %omomi.i, align 16, !tbaa !5 br label %for.body8.us.i for.end19.us.i: ; preds = %for.inc17.us.i %cmp20.us.i = icmp eq i32 %u.1.us.i, -1 br i1 %cmp20.us.i, label %for.body63.i.preheader, label %if.end22.us.i for.body63.i.preheader: ; preds = %for.end19.us.i %xtraiter = and i64 %7, 1 %12 = icmp eq i32 %.fr.i, 1 br i1 %12, label %prim.exit.loopexit.unr-lcssa, label %for.body63.i.preheader.new for.body63.i.preheader.new: ; preds = %for.body63.i.preheader %unroll_iter = and i64 %7, 4294967294 br label %for.body63.i if.end22.us.i: ; preds = %for.end19.us.i %idxprom23.us.i = sext i32 %u.1.us.i to i64 %arrayidx24.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %idxprom23.us.i store i32 2, ptr %arrayidx24.us.i, align 4, !tbaa !5 br label %for.body27.us.i for.body27.us.i: ; preds = %for.inc58.us.i, %if.end22.us.i %indvars.iv163.i = phi i64 [ 0, %if.end22.us.i ], [ %indvars.iv.next164.i, %for.inc58.us.i ] %arrayidx29.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv163.i %13 = load i32, ptr %arrayidx29.us.i, align 4, !tbaa !5 %cmp30.not.us.i = icmp eq i32 %13, 2 br i1 %cmp30.not.us.i, label %for.inc58.us.i, label %land.lhs.true31.us.i land.lhs.true31.us.i: ; preds = %for.body27.us.i %arrayidx35.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us.i, i64 %indvars.iv163.i %14 = load i32, ptr %arrayidx35.us.i, align 4, !tbaa !5 %cmp36.not.us.i = icmp eq i32 %14, 1000000 br i1 %cmp36.not.us.i, label %for.inc58.us.i, label %if.then37.us.i if.then37.us.i: ; preds = %land.lhs.true31.us.i %arrayidx39.us.i = getelementptr inbounds [100 x i32], ptr %omomi.i, i64 0, i64 %indvars.iv163.i %15 = load i32, ptr %arrayidx39.us.i, align 4, !tbaa !5 %cmp44.us.i = icmp sgt i32 %15, %14 br i1 %cmp44.us.i, label %if.then45.us.i, label %for.inc58.us.i if.then45.us.i: ; preds = %if.then37.us.i store i32 %14, ptr %arrayidx39.us.i, align 4, !tbaa !5 %arrayidx53.us.i = getelementptr inbounds [100 x i32], ptr %oya.i, i64 0, i64 %indvars.iv163.i store i32 %u.1.us.i, ptr %arrayidx53.us.i, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us.i, align 4, !tbaa !5 br label %for.inc58.us.i for.inc58.us.i: ; preds = %if.then45.us.i, %if.then37.us.i, %land.lhs.true31.us.i, %for.body27.us.i %indvars.iv.next164.i = add nuw nsw i64 %indvars.iv163.i, 1 %exitcond167.not.i = icmp eq i64 %indvars.iv.next164.i, %7 br i1 %exitcond167.not.i, label %for.body8.us.i.backedge, label %for.body27.us.i, !llvm.loop !14 for.body8.us.i: ; preds = %for.body8.us.i.backedge, %while.cond.us.preheader.i %indvars.iv158.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv158.i.be, %for.body8.us.i.backedge ] %min.0116.us.i = phi i32 [ 1000000, %while.cond.us.preheader.i ], [ %min.0116.us.i.be, %for.body8.us.i.backedge ] %u.0114.us.i = phi i32 [ -1, %while.cond.us.preheader.i ], [ %u.0114.us.i.be, %for.body8.us.i.backedge ] %arrayidx10.us.i = getelementptr inbounds [100 x i32], ptr %omomi.i, i64 0, i64 %indvars.iv158.i %16 = load i32, ptr %arrayidx10.us.i, align 4, !tbaa !5 %cmp11.us.i = icmp sgt i32 %min.0116.us.i, %16 br i1 %cmp11.us.i, label %land.lhs.true.us.i, label %for.inc17.us.i land.lhs.true.us.i: ; preds = %for.body8.us.i %arrayidx13.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv158.i %17 = load i32, ptr %arrayidx13.us.i, align 4, !tbaa !5 %cmp14.not.us.i = icmp eq i32 %17, 2 %18 = trunc i64 %indvars.iv158.i to i32 %spec.select.us.i = select i1 %cmp14.not.us.i, i32 %u.0114.us.i, i32 %18 %spec.select110.us.i = select i1 %cmp14.not.us.i, i32 %min.0116.us.i, i32 %16 br label %for.inc17.us.i for.inc17.us.i: ; preds = %land.lhs.true.us.i, %for.body8.us.i %u.1.us.i = phi i32 [ %u.0114.us.i, %for.body8.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %min.1.us.i = phi i32 [ %min.0116.us.i, %for.body8.us.i ], [ %spec.select110.us.i, %land.lhs.true.us.i ] %indvars.iv.next159.i = add nuw nsw i64 %indvars.iv158.i, 1 %exitcond162.not.i = icmp eq i64 %indvars.iv.next159.i, %7 br i1 %exitcond162.not.i, label %for.end19.us.i, label %for.body8.us.i.backedge for.body8.us.i.backedge: ; preds = %for.inc58.us.i, %for.inc17.us.i %indvars.iv158.i.be = phi i64 [ %indvars.iv.next159.i, %for.inc17.us.i ], [ 0, %for.inc58.us.i ] %min.0116.us.i.be = phi i32 [ %min.1.us.i, %for.inc17.us.i ], [ 1000000, %for.inc58.us.i ] %u.0114.us.i.be = phi i32 [ %u.1.us.i, %for.inc17.us.i ], [ -1, %for.inc58.us.i ] br label %for.body8.us.i, !llvm.loop !14 for.body63.i: ; preds = %for.inc75.i.1, %for.body63.i.preheader.new %indvars.iv168.i = phi i64 [ 0, %for.body63.i.preheader.new ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0149.i = phi i32 [ 0, %for.body63.i.preheader.new ], [ %sum.1.i.1, %for.inc75.i.1 ] %niter = phi i64 [ 0, %for.body63.i.preheader.new ], [ %niter.next.1, %for.inc75.i.1 ] %arrayidx65.i = getelementptr inbounds [100 x i32], ptr %oya.i, i64 0, i64 %indvars.iv168.i %19 = load i32, ptr %arrayidx65.i, align 8, !tbaa !5 %cmp66.not.i = icmp eq i32 %19, -1 br i1 %cmp66.not.i, label %for.inc75.i, label %if.then67.i if.then67.i: ; preds = %for.body63.i %idxprom72.i = sext i32 %19 to i64 %arrayidx73.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.i, i64 %idxprom72.i %20 = load i32, ptr %arrayidx73.i, align 4, !tbaa !5 %add.i = add nsw i32 %20, %sum.0149.i br label %for.inc75.i for.inc75.i: ; preds = %if.then67.i, %for.body63.i %sum.1.i = phi i32 [ %add.i, %if.then67.i ], [ %sum.0149.i, %for.body63.i ] %indvars.iv.next169.i = or i64 %indvars.iv168.i, 1 %arrayidx65.i.1 = getelementptr inbounds [100 x i32], ptr %oya.i, i64 0, i64 %indvars.iv.next169.i %21 = load i32, ptr %arrayidx65.i.1, align 4, !tbaa !5 %cmp66.not.i.1 = icmp eq i32 %21, -1 br i1 %cmp66.not.i.1, label %for.inc75.i.1, label %if.then67.i.1 if.then67.i.1: ; preds = %for.inc75.i %idxprom72.i.1 = sext i32 %21 to i64 %arrayidx73.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next169.i, i64 %idxprom72.i.1 %22 = load i32, ptr %arrayidx73.i.1, align 4, !tbaa !5 %add.i.1 = add nsw i32 %22, %sum.1.i br label %for.inc75.i.1 for.inc75.i.1: ; preds = %if.then67.i.1, %for.inc75.i %sum.1.i.1 = phi i32 [ %add.i.1, %if.then67.i.1 ], [ %sum.1.i, %for.inc75.i ] %indvars.iv.next169.i.1 = add nuw nsw i64 %indvars.iv168.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %prim.exit.loopexit.unr-lcssa, label %for.body63.i, !llvm.loop !15 prim.exit.loopexit.unr-lcssa: ; preds = %for.inc75.i.1, %for.body63.i.preheader %sum.1.i.lcssa.ph = phi i32 [ undef, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %indvars.iv168.i.unr = phi i64 [ 0, %for.body63.i.preheader ], [ %indvars.iv.next169.i.1, %for.inc75.i.1 ] %sum.0149.i.unr = phi i32 [ 0, %for.body63.i.preheader ], [ %sum.1.i.1, %for.inc75.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %prim.exit, label %for.body63.i.epil for.body63.i.epil: ; preds = %prim.exit.loopexit.unr-lcssa %arrayidx65.i.epil = getelementptr inbounds [100 x i32], ptr %oya.i, i64 0, i64 %indvars.iv168.i.unr %23 = load i32, ptr %arrayidx65.i.epil, align 4, !tbaa !5 %cmp66.not.i.epil = icmp eq i32 %23, -1 br i1 %cmp66.not.i.epil, label %prim.exit, label %if.then67.i.epil if.then67.i.epil: ; preds = %for.body63.i.epil %idxprom72.i.epil = sext i32 %23 to i64 %arrayidx73.i.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv168.i.unr, i64 %idxprom72.i.epil %24 = load i32, ptr %arrayidx73.i.epil, align 4, !tbaa !5 %add.i.epil = add nsw i32 %24, %sum.0149.i.unr br label %prim.exit prim.exit: ; preds = %prim.exit.loopexit.unr-lcssa, %if.then67.i.epil, %for.body63.i.epil, %for.end10.thread, %for.end10 %sum.0.lcssa.i = phi i32 [ 0, %for.end10 ], [ 0, %for.end10.thread ], [ %sum.1.i.lcssa.ph, %prim.exit.loopexit.unr-lcssa ], [ %add.i.epil, %if.then67.i.epil ], [ %sum.0149.i.unr, %for.body63.i.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %oya.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %omomi.i) #5 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(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 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !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, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"} !19 = distinct !{!19, !10, !11, !12} !20 = distinct !{!20, !10, !12, !11}
#include<stdio.h> #include<limits.h> #define N 100 #define WHITE 0 #define GRAY 1 #define BLACK 2 int prim(void); int n, m, sum, M[N][N]; int main() { int i, j, e; scanf("%d",&n); for(i = 0; i < n; i++) { for(j = 0; j < n; j++) { scanf("%d",&e); if(e == -1)M[i][j] = INT_MAX; else M[i][j] = e; } } m = prim(); printf("%d\n",m); return 0; } int prim(void) { int i, u, v, mincost, d[N], p[N], color[N]; for(u = 0; u < n; u++) { color[u] = WHITE; d[u] = INT_MAX; p[u] = -1; } d[0] = 0; while(1) { mincost = INT_MAX; for(i = 0; i < n; i++) { if(color[i] != BLACK && d[i] < mincost) { mincost = d[i]; u = i; } } if(mincost == INT_MAX)break; color[u] = BLACK; for(v = 0; v < n; v++) { if(color[v] != BLACK && M[u][v] != INT_MAX) { if(M[u][v] < d[v]) { d[v] = M[u][v]; p[v] = u; color[v] = GRAY; } } } } for(i = 0; i < n; i++) { if(p[i] != -1)sum += M[i][p[i]]; } return sum; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199530/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199530/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @m = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @sum = 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: %e = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #6 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %0, 0 br i1 %cmp25, label %for.cond1.preheader, label %for.end14 for.cond1.preheader: ; preds = %entry, %for.inc12 %1 = phi i32 [ %6, %for.inc12 ], [ %0, %entry ] %indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.inc12 ], [ 0, %entry ] %cmp223 = icmp sgt i32 %1, 0 br i1 %cmp223, label %for.body3, label %for.cond1.preheader.for.inc12_crit_edge for.cond1.preheader.for.inc12_crit_edge: ; preds = %for.cond1.preheader %.pre = sext i32 %1 to i64 br label %for.inc12 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %2 = load i32, ptr %e, align 4, !tbaa !5 %cmp5 = icmp eq i32 %2, -1 %spec.select = select i1 %cmp5, i32 2147483647, i32 %2 %3 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv29, i64 %indvars.iv store i32 %spec.select, ptr %3, align 4 %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.inc12, !llvm.loop !9 for.inc12: ; preds = %for.body3, %for.cond1.preheader.for.inc12_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc12_crit_edge ], [ %5, %for.body3 ] %6 = phi i32 [ %1, %for.cond1.preheader.for.inc12_crit_edge ], [ %4, %for.body3 ] %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1 %cmp = icmp slt i64 %indvars.iv.next30, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.end14, !llvm.loop !11 for.end14: ; preds = %for.inc12, %entry %call15 = call i32 @prim() store i32 %call15, ptr @m, align 4, !tbaa !5 %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call15) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #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 i32 @prim() local_unnamed_addr #3 { entry: %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #6 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp110 = icmp sgt i32 %.fr, 0 br i1 %cmp110, label %for.body.preheader, label %for.cond61.preheader.thread 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 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p, i8 -1, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader180, 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 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, 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 !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader180 for.body.preheader180: ; 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.preheader180, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader180 ] %arrayidx2 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 2147483647, ptr %arrayidx2, 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 !16 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp110, label %while.cond.us.preheader, label %for.cond61.preheader.thread while.cond.us.preheader: ; preds = %for.end %wide.trip.count166 = zext i32 %.fr to i64 %wide.trip.count171 = zext i32 %.fr to i64 br label %for.body8.us for.end19.us: ; preds = %for.inc17.us %cmp20.us = icmp eq i32 %mincost.1.us, 2147483647 br i1 %cmp20.us, label %for.cond61.preheader, label %if.end22.us if.end22.us: ; preds = %for.end19.us %idxprom23.us = sext i32 %u.3.us to i64 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom23.us store i32 2, ptr %arrayidx24.us, align 4, !tbaa !5 br label %for.body27.us for.body27.us: ; preds = %if.end22.us, %for.inc58.us %indvars.iv168 = phi i64 [ 0, %if.end22.us ], [ %indvars.iv.next169, %for.inc58.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv168 %6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30.not.us = icmp eq i32 %6, 2 br i1 %cmp30.not.us, label %for.inc58.us, label %land.lhs.true31.us land.lhs.true31.us: ; preds = %for.body27.us %arrayidx35.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us, i64 %indvars.iv168 %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %cmp36.not.us = icmp eq i32 %7, 2147483647 br i1 %cmp36.not.us, label %for.inc58.us, label %if.then37.us if.then37.us: ; preds = %land.lhs.true31.us %arrayidx43.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv168 %8 = load i32, ptr %arrayidx43.us, align 4, !tbaa !5 %cmp44.us = icmp slt i32 %7, %8 br i1 %cmp44.us, label %if.then45.us, label %for.inc58.us if.then45.us: ; preds = %if.then37.us store i32 %7, ptr %arrayidx43.us, align 4, !tbaa !5 %arrayidx53.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168 store i32 %u.3.us, ptr %arrayidx53.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc58.us for.inc58.us: ; preds = %if.then45.us, %if.then37.us, %land.lhs.true31.us, %for.body27.us %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1 %exitcond172.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count171 br i1 %exitcond172.not, label %for.body8.us.backedge, label %for.body27.us, !llvm.loop !17 for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader %indvars.iv163 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv163.be, %for.body8.us.backedge ] %mincost.0116.us = phi i32 [ 2147483647, %while.cond.us.preheader ], [ %mincost.0116.us.be, %for.body8.us.backedge ] %u.2115.us = phi i32 [ %.fr, %while.cond.us.preheader ], [ %u.3.us, %for.body8.us.backedge ] %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv163 %9 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.not.us = icmp eq i32 %9, 2 br i1 %cmp11.not.us, label %for.inc17.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body8.us %arrayidx13.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv163 %10 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.us = icmp slt i32 %10, %mincost.0116.us %11 = trunc i64 %indvars.iv163 to i32 %spec.select.us = select i1 %cmp14.us, i32 %11, i32 %u.2115.us %spec.select109.us = tail call i32 @llvm.smin.i32(i32 %10, i32 %mincost.0116.us) br label %for.inc17.us for.inc17.us: ; preds = %land.lhs.true.us, %for.body8.us %u.3.us = phi i32 [ %u.2115.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ] %mincost.1.us = phi i32 [ %mincost.0116.us, %for.body8.us ], [ %spec.select109.us, %land.lhs.true.us ] %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166 br i1 %exitcond167.not, label %for.end19.us, label %for.body8.us.backedge for.body8.us.backedge: ; preds = %for.inc58.us, %for.inc17.us %indvars.iv163.be = phi i64 [ %indvars.iv.next164, %for.inc17.us ], [ 0, %for.inc58.us ] %mincost.0116.us.be = phi i32 [ %mincost.1.us, %for.inc17.us ], [ 2147483647, %for.inc58.us ] br label %for.body8.us, !llvm.loop !17 for.cond61.preheader.thread: ; preds = %entry, %for.end %sum.promoted179 = load i32, ptr @sum, align 4, !tbaa !5 br label %for.end77 for.cond61.preheader: ; preds = %for.end19.us %sum.promoted = load i32, ptr @sum, align 4, !tbaa !5 br i1 %cmp110, label %for.body63.preheader, label %for.end77 for.body63.preheader: ; preds = %for.cond61.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end77.loopexit.unr-lcssa, label %for.body63.preheader.new for.body63.preheader.new: ; preds = %for.body63.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body63 for.body63: ; preds = %for.inc75.1, %for.body63.preheader.new %indvars.iv173 = phi i64 [ 0, %for.body63.preheader.new ], [ %indvars.iv.next174.1, %for.inc75.1 ] %add152154 = phi i32 [ %sum.promoted, %for.body63.preheader.new ], [ %add151.1, %for.inc75.1 ] %niter = phi i64 [ 0, %for.body63.preheader.new ], [ %niter.next.1, %for.inc75.1 ] %arrayidx65 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv173 %13 = load i32, ptr %arrayidx65, align 8, !tbaa !5 %cmp66.not = icmp eq i32 %13, -1 br i1 %cmp66.not, label %for.inc75, label %if.then67 if.then67: ; preds = %for.body63 %idxprom72 = sext i32 %13 to i64 %arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv173, i64 %idxprom72 %14 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %add = add nsw i32 %add152154, %14 store i32 %add, ptr @sum, align 4, !tbaa !5 br label %for.inc75 for.inc75: ; preds = %for.body63, %if.then67 %add151 = phi i32 [ %add152154, %for.body63 ], [ %add, %if.then67 ] %indvars.iv.next174 = or i64 %indvars.iv173, 1 %arrayidx65.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next174 %15 = load i32, ptr %arrayidx65.1, align 4, !tbaa !5 %cmp66.not.1 = icmp eq i32 %15, -1 br i1 %cmp66.not.1, label %for.inc75.1, label %if.then67.1 if.then67.1: ; preds = %for.inc75 %idxprom72.1 = sext i32 %15 to i64 %arrayidx73.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next174, i64 %idxprom72.1 %16 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5 %add.1 = add nsw i32 %add151, %16 store i32 %add.1, ptr @sum, align 4, !tbaa !5 br label %for.inc75.1 for.inc75.1: ; preds = %if.then67.1, %for.inc75 %add151.1 = phi i32 [ %add151, %for.inc75 ], [ %add.1, %if.then67.1 ] %indvars.iv.next174.1 = add nuw nsw i64 %indvars.iv173, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end77.loopexit.unr-lcssa, label %for.body63, !llvm.loop !18 for.end77.loopexit.unr-lcssa: ; preds = %for.inc75.1, %for.body63.preheader %add151.lcssa.ph = phi i32 [ undef, %for.body63.preheader ], [ %add151.1, %for.inc75.1 ] %indvars.iv173.unr = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next174.1, %for.inc75.1 ] %add152154.unr = phi i32 [ %sum.promoted, %for.body63.preheader ], [ %add151.1, %for.inc75.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end77, label %for.body63.epil for.body63.epil: ; preds = %for.end77.loopexit.unr-lcssa %arrayidx65.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv173.unr %17 = load i32, ptr %arrayidx65.epil, align 4, !tbaa !5 %cmp66.not.epil = icmp eq i32 %17, -1 br i1 %cmp66.not.epil, label %for.end77, label %if.then67.epil if.then67.epil: ; preds = %for.body63.epil %idxprom72.epil = sext i32 %17 to i64 %arrayidx73.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv173.unr, i64 %idxprom72.epil %18 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %add152154.unr, %18 store i32 %add.epil, ptr @sum, align 4, !tbaa !5 br label %for.end77 for.end77: ; preds = %for.end77.loopexit.unr-lcssa, %if.then67.epil, %for.body63.epil, %for.cond61.preheader.thread, %for.cond61.preheader %19 = phi i32 [ %sum.promoted, %for.cond61.preheader ], [ %sum.promoted179, %for.cond61.preheader.thread ], [ %add151.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %add152154.unr, %for.body63.epil ], [ %add.epil, %if.then67.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #6 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #6 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #6 ret i32 %19 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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} !12 = !{!"llvm.loop.unswitch.partial.disable"} !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}
#include <stdio.h> #include <stdlib.h> int *PAR; // 親の番号 typedef struct{ int cost; int from; int to; }SIDE_T; int Ans_pivot(SIDE_T *box, int l, int r) { int center; center = (l + r) / 2; if(box[l].cost < box[center].cost && box[center].cost < box[r].cost || box[r].cost < box[center].cost && box[center].cost < box[l].cost) return center; else if(box[center].cost < box[l].cost && box[l].cost < box[r].cost || box[r].cost < box[l].cost && box[l].cost < box[center].cost) return l; else return r; } int Partition(SIDE_T *box, int l, int r) { int soeji, pivot; SIDE_T bk; int i = l - 1; int j = r; // 枢軸の決定 soeji = Ans_pivot(box, l, r); bk = box[r]; box[r] = box[soeji]; box[soeji] = bk; pivot = box[r].cost; while(1){ while(box[++i].cost < pivot); while(i < --j && pivot < box[j].cost); if(j <= i) break; bk = box[i]; box[i] = box[j]; box[j] = bk; } bk = box[i]; box[i] = box[r]; box[r] = bk; return i; } void Quick_sort(SIDE_T *box, int left, int right) { int pivot; int i; if(right <= left) return; pivot = Partition(box, left, right); Quick_sort(box, left, pivot - 1); Quick_sort(box, pivot + 1, right); } // 配列の初期化 void Init(int n) { int i; // 全ての要素は初めは自分自身が親 for(i = 0; i < n; i++) PAR[i] = i; } // 親をみつける int Find(int x) { if(PAR[x] == x) return x; else{ PAR[x] = Find(PAR[x]); // 経路圧縮 return PAR[x]; } } // 親が同じか否か int Same(int x, int y) { if(Find(x) == Find(y)) return 1; return 0; } // 違うグループ同士をくっつける void Union(int x, int y) { x = Find(x); y = Find(y); if(x == y) return; PAR[x] = y; } int Mark_check(int *box, int n) { int i; for(i = 0; i < n; i++) if(box[i] == -1) return 0; return 1; } int main() { int n; int in_data; int **graph, *_graph; int *mark; SIDE_T *side; int sum, count; int i, j; scanf("%d", &n); PAR = (int *)malloc(sizeof(int) * n); mark = (int *)malloc(sizeof(int) * n); for(i = 0; i < n; i++) mark[i] = -1; Init(n); side = (SIDE_T *)malloc(sizeof(SIDE_T) * n * n); _graph = (int *)malloc(sizeof(int) * n * n); graph = (int **)malloc(sizeof(int *) * n); for(i = 0; i < n; i++) graph[i] = _graph + (i * n); for(i = 0; i < n; i++) for(j = 0; j < n; j++) scanf("%d", &graph[i][j]); // 辺として取り出す count = 0; for(i = 0; i < n; i++){ for(j = 0; j < n; j++){ if(i <= j && graph[i][j] != -1){ side[count].cost = graph[i][j]; side[count].from = i; side[count++].to = j; } } } Quick_sort(side, 0, count - 1); /* for(i = 0; i < count; i++) printf("from:%2d to%2d cost:%2d\n", side[i].from, side[i].to, side[i].cost); */ sum = 0; for(i = 0; i < count; i++){ if(Same(side[i].from, side[i].to) != 1){ Union(side[i].from, side[i].to); sum += side[i].cost; } if(Mark_check(mark, n)) break; } printf("%d\n", sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199574/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199574/source.c" target datalayout = "e-m:e-p270: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.SIDE_T = type { i32, i32, i32 } @PAR = dso_local local_unnamed_addr global ptr null, align 8 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @Ans_pivot(ptr nocapture noundef readonly %box, i32 noundef %l, i32 noundef %r) local_unnamed_addr #0 { entry: %add = add nsw i32 %r, %l %div = sdiv i32 %add, 2 %idxprom = sext i32 %l to i64 %arrayidx = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom1 = sext i32 %div to i64 %arrayidx2 = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom1 %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp = icmp sge i32 %0, %1 %idxprom11.phi.trans.insert = sext i32 %r to i64 %arrayidx12.phi.trans.insert = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom11.phi.trans.insert %.pre = load i32, ptr %arrayidx12.phi.trans.insert, align 4, !tbaa !5 %cmp10 = icmp sge i32 %1, %.pre %or.cond96.not = select i1 %cmp, i1 true, i1 %cmp10 br i1 %or.cond96.not, label %lor.lhs.false, label %cleanup lor.lhs.false: ; preds = %entry %cmp17 = icmp slt i32 %.pre, %1 %cmp25 = icmp slt i32 %1, %0 %or.cond = and i1 %cmp25, %cmp17 br i1 %or.cond, label %cleanup, label %if.else if.else: ; preds = %lor.lhs.false %cmp40 = icmp slt i32 %0, %.pre %or.cond95 = and i1 %cmp25, %cmp40 br i1 %or.cond95, label %cleanup, label %lor.lhs.false41 lor.lhs.false41: ; preds = %if.else %cmp48 = icmp sge i32 %.pre, %0 %brmerge = or i1 %cmp, %cmp48 %spec.select = select i1 %brmerge, i32 %r, i32 %l br label %cleanup cleanup: ; preds = %entry, %lor.lhs.false41, %if.else, %lor.lhs.false %retval.0 = phi i32 [ %div, %lor.lhs.false ], [ %l, %if.else ], [ %spec.select, %lor.lhs.false41 ], [ %div, %entry ] 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 nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @Partition(ptr nocapture noundef %box, i32 noundef %l, i32 noundef %r) local_unnamed_addr #2 { entry: %bk = alloca %struct.SIDE_T, align 4 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %bk) %sub = add nsw i32 %l, -1 %add.i = add nsw i32 %r, %l %div.i = sdiv i32 %add.i, 2 %idxprom.i = sext i32 %l to i64 %arrayidx.i = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom.i %0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %idxprom1.i = sext i32 %div.i to i64 %arrayidx2.i = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom1.i %1 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %cmp.i = icmp sge i32 %0, %1 %idxprom11.phi.trans.insert.i = sext i32 %r to i64 %arrayidx12.phi.trans.insert.i = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom11.phi.trans.insert.i %.pre.i = load i32, ptr %arrayidx12.phi.trans.insert.i, align 4, !tbaa !5 %cmp10.i = icmp sge i32 %1, %.pre.i %or.cond96.not.i = select i1 %cmp.i, i1 true, i1 %cmp10.i br i1 %or.cond96.not.i, label %lor.lhs.false.i, label %Ans_pivot.exit lor.lhs.false.i: ; preds = %entry %cmp17.i = icmp slt i32 %.pre.i, %1 %cmp25.i = icmp slt i32 %1, %0 %or.cond.i = and i1 %cmp25.i, %cmp17.i br i1 %or.cond.i, label %Ans_pivot.exit, label %if.else.i if.else.i: ; preds = %lor.lhs.false.i %cmp40.i = icmp slt i32 %0, %.pre.i %or.cond95.i = and i1 %cmp25.i, %cmp40.i br i1 %or.cond95.i, label %Ans_pivot.exit, label %lor.lhs.false41.i lor.lhs.false41.i: ; preds = %if.else.i %cmp48.i = icmp sge i32 %.pre.i, %0 %brmerge.i = or i1 %cmp.i, %cmp48.i %spec.select.i = select i1 %brmerge.i, i32 %r, i32 %l %.pre = sext i32 %spec.select.i to i64 br label %Ans_pivot.exit Ans_pivot.exit: ; preds = %entry, %lor.lhs.false.i, %if.else.i, %lor.lhs.false41.i %idxprom3.pre-phi = phi i64 [ %idxprom1.i, %entry ], [ %idxprom1.i, %lor.lhs.false.i ], [ %idxprom.i, %if.else.i ], [ %.pre, %lor.lhs.false41.i ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %bk, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx12.phi.trans.insert.i, i64 12, i1 false), !tbaa.struct !10 %arrayidx4 = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom3.pre-phi tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx12.phi.trans.insert.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4, i64 12, i1 false), !tbaa.struct !10 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4, ptr noundef nonnull align 4 dereferenceable(12) %bk, i64 12, i1 false), !tbaa.struct !10 %2 = load i32, ptr %arrayidx12.phi.trans.insert.i, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %if.end, %Ans_pivot.exit %i.0 = phi i32 [ %sub, %Ans_pivot.exit ], [ %5, %if.end ] %j.0 = phi i32 [ %r, %Ans_pivot.exit ], [ %9, %if.end ] %3 = sext i32 %i.0 to i64 br label %while.cond9 while.cond9: ; preds = %while.cond9, %while.cond %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond9 ], [ %3, %while.cond ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx11 = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %indvars.iv.next %4 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp = icmp slt i32 %4, %2 br i1 %cmp, label %while.cond9, label %while.cond14.preheader, !llvm.loop !12 while.cond14.preheader: ; preds = %while.cond9 %5 = trunc i64 %indvars.iv.next to i32 %6 = sext i32 %j.0 to i64 %sext = shl i64 %indvars.iv.next, 32 %7 = ashr exact i64 %sext, 32 br label %while.cond14 while.cond14: ; preds = %while.cond14.preheader, %land.rhs %indvars.iv78 = phi i64 [ %6, %while.cond14.preheader ], [ %indvars.iv.next79, %land.rhs ] %indvars.iv.next79 = add nsw i64 %indvars.iv78, -1 %cmp15 = icmp slt i64 %7, %indvars.iv.next79 br i1 %cmp15, label %land.rhs, label %while.end31 land.rhs: ; preds = %while.cond14 %arrayidx17 = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %indvars.iv.next79 %8 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %cmp19 = icmp slt i32 %2, %8 br i1 %cmp19, label %while.cond14, label %if.end, !llvm.loop !14 if.end: ; preds = %land.rhs %9 = trunc i64 %indvars.iv.next79 to i32 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %bk, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, i64 12, i1 false), !tbaa.struct !10 %sext81 = shl i64 %indvars.iv.next79, 32 %idxprom27 = ashr exact i64 %sext81, 32 %arrayidx28 = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom27 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx28, i64 12, i1 false), !tbaa.struct !10 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx28, ptr noundef nonnull align 4 dereferenceable(12) %bk, i64 12, i1 false), !tbaa.struct !10 br label %while.cond while.end31: ; preds = %while.cond14 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %bk, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, i64 12, i1 false), !tbaa.struct !10 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx12.phi.trans.insert.i, i64 12, i1 false), !tbaa.struct !10 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx12.phi.trans.insert.i, ptr noundef nonnull align 4 dereferenceable(12) %bk, i64 12, i1 false), !tbaa.struct !10 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %bk) ret i32 %5 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3 ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @Quick_sort(ptr nocapture noundef %box, i32 noundef %left, i32 noundef %right) local_unnamed_addr #2 { entry: %bk.i = alloca %struct.SIDE_T, align 4 %cmp.not10 = icmp sgt i32 %right, %left br i1 %cmp.not10, label %if.end.lr.ph, label %cleanup if.end.lr.ph: ; preds = %entry %idxprom11.phi.trans.insert.i.i = sext i32 %right to i64 %arrayidx12.phi.trans.insert.i.i = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom11.phi.trans.insert.i.i br label %if.end if.end: ; preds = %if.end.lr.ph, %Partition.exit %left.tr11 = phi i32 [ %left, %if.end.lr.ph ], [ %add, %Partition.exit ] call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %bk.i) %sub.i = add nsw i32 %left.tr11, -1 %add.i.i = add nsw i32 %left.tr11, %right %div.i.i = sdiv i32 %add.i.i, 2 %idxprom.i.i = sext i32 %left.tr11 to i64 %arrayidx.i.i = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom.i.i %0 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5 %idxprom1.i.i = sext i32 %div.i.i to i64 %arrayidx2.i.i = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom1.i.i %1 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5 %cmp.i.i = icmp sge i32 %0, %1 %.pre.i.i = load i32, ptr %arrayidx12.phi.trans.insert.i.i, align 4, !tbaa !5 %cmp10.i.i = icmp sge i32 %1, %.pre.i.i %or.cond96.not.i.i = select i1 %cmp.i.i, i1 true, i1 %cmp10.i.i br i1 %or.cond96.not.i.i, label %lor.lhs.false.i.i, label %Ans_pivot.exit.i lor.lhs.false.i.i: ; preds = %if.end %cmp17.i.i = icmp slt i32 %.pre.i.i, %1 %cmp25.i.i = icmp slt i32 %1, %0 %or.cond.i.i = and i1 %cmp25.i.i, %cmp17.i.i br i1 %or.cond.i.i, label %Ans_pivot.exit.i, label %if.else.i.i if.else.i.i: ; preds = %lor.lhs.false.i.i %cmp40.i.i = icmp slt i32 %0, %.pre.i.i %or.cond95.i.i = and i1 %cmp25.i.i, %cmp40.i.i br i1 %or.cond95.i.i, label %Ans_pivot.exit.i, label %lor.lhs.false41.i.i lor.lhs.false41.i.i: ; preds = %if.else.i.i %cmp48.i.i = icmp sge i32 %.pre.i.i, %0 %brmerge.i.i = or i1 %cmp.i.i, %cmp48.i.i %spec.select.i.i = select i1 %brmerge.i.i, i32 %right, i32 %left.tr11 %.pre.i = sext i32 %spec.select.i.i to i64 br label %Ans_pivot.exit.i Ans_pivot.exit.i: ; preds = %lor.lhs.false41.i.i, %if.else.i.i, %lor.lhs.false.i.i, %if.end %idxprom3.pre-phi.i = phi i64 [ %idxprom1.i.i, %if.end ], [ %idxprom1.i.i, %lor.lhs.false.i.i ], [ %idxprom.i.i, %if.else.i.i ], [ %.pre.i, %lor.lhs.false41.i.i ] call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %bk.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx12.phi.trans.insert.i.i, i64 12, i1 false), !tbaa.struct !10 %arrayidx4.i = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom3.pre-phi.i tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx12.phi.trans.insert.i.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4.i, i64 12, i1 false), !tbaa.struct !10 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx4.i, ptr noundef nonnull align 4 dereferenceable(12) %bk.i, i64 12, i1 false), !tbaa.struct !10 %2 = load i32, ptr %arrayidx12.phi.trans.insert.i.i, align 4, !tbaa !5 br label %while.cond.i while.cond.i: ; preds = %if.end.i, %Ans_pivot.exit.i %i.0.i = phi i32 [ %sub.i, %Ans_pivot.exit.i ], [ %5, %if.end.i ] %j.0.i = phi i32 [ %right, %Ans_pivot.exit.i ], [ %9, %if.end.i ] %3 = sext i32 %i.0.i to i64 br label %while.cond9.i while.cond9.i: ; preds = %while.cond9.i, %while.cond.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.cond9.i ], [ %3, %while.cond.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %arrayidx11.i = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %indvars.iv.next.i %4 = load i32, ptr %arrayidx11.i, align 4, !tbaa !5 %cmp.i = icmp slt i32 %4, %2 br i1 %cmp.i, label %while.cond9.i, label %while.cond14.preheader.i, !llvm.loop !12 while.cond14.preheader.i: ; preds = %while.cond9.i %5 = trunc i64 %indvars.iv.next.i to i32 %6 = sext i32 %j.0.i to i64 %sext.i = shl i64 %indvars.iv.next.i, 32 %7 = ashr exact i64 %sext.i, 32 br label %while.cond14.i while.cond14.i: ; preds = %land.rhs.i, %while.cond14.preheader.i %indvars.iv78.i = phi i64 [ %6, %while.cond14.preheader.i ], [ %indvars.iv.next79.i, %land.rhs.i ] %indvars.iv.next79.i = add nsw i64 %indvars.iv78.i, -1 %cmp15.i = icmp slt i64 %7, %indvars.iv.next79.i br i1 %cmp15.i, label %land.rhs.i, label %Partition.exit land.rhs.i: ; preds = %while.cond14.i %arrayidx17.i = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %indvars.iv.next79.i %8 = load i32, ptr %arrayidx17.i, align 4, !tbaa !5 %cmp19.i = icmp slt i32 %2, %8 br i1 %cmp19.i, label %while.cond14.i, label %if.end.i, !llvm.loop !14 if.end.i: ; preds = %land.rhs.i %9 = trunc i64 %indvars.iv.next79.i to i32 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %bk.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i, i64 12, i1 false), !tbaa.struct !10 %sext81.i = shl i64 %indvars.iv.next79.i, 32 %idxprom27.i = ashr exact i64 %sext81.i, 32 %arrayidx28.i = getelementptr inbounds %struct.SIDE_T, ptr %box, i64 %idxprom27.i tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx28.i, i64 12, i1 false), !tbaa.struct !10 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx28.i, ptr noundef nonnull align 4 dereferenceable(12) %bk.i, i64 12, i1 false), !tbaa.struct !10 br label %while.cond.i Partition.exit: ; preds = %while.cond14.i call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %bk.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i, i64 12, i1 false), !tbaa.struct !10 tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx11.i, ptr noundef nonnull align 4 dereferenceable(12) %arrayidx12.phi.trans.insert.i.i, i64 12, i1 false), !tbaa.struct !10 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %arrayidx12.phi.trans.insert.i.i, ptr noundef nonnull align 4 dereferenceable(12) %bk.i, i64 12, i1 false), !tbaa.struct !10 call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %bk.i) %sub = add nsw i32 %5, -1 tail call void @Quick_sort(ptr noundef nonnull %box, i32 noundef %left.tr11, i32 noundef %sub) %add = add nsw i32 %5, 1 %cmp.not = icmp slt i32 %add, %right br i1 %cmp.not, label %if.end, label %cleanup cleanup: ; preds = %Partition.exit, %entry ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: write, inaccessiblemem: none) uwtable define dso_local void @Init(i32 noundef %n) local_unnamed_addr #4 { entry: %cmp4 = icmp sgt i32 %n, 0 br i1 %cmp4, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %0 = load ptr, ptr @PAR, align 8, !tbaa !15 %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader, label %vector.ph vector.ph: ; preds = %for.body.lr.ph %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %1 = getelementptr inbounds i32, ptr %0, i64 %index store <4 x i32> %vec.ind, ptr %1, align 4, !tbaa !11 %2 = getelementptr inbounds i32, ptr %1, i64 4 store <4 x i32> %step.add, ptr %2, align 4, !tbaa !11 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %3 = icmp eq i64 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !17 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.body.lr.ph, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.lr.ph ], [ %n.vec, %middle.block ] br label %for.body 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 i32, ptr %0, i64 %indvars.iv %4 = trunc i64 %indvars.iv to i32 store i32 %4, ptr %arrayidx, align 4, !tbaa !11 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !20 for.end: ; preds = %for.body, %middle.block, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @Find(i32 noundef %x) local_unnamed_addr #5 { entry: %0 = load ptr, ptr @PAR, align 8, !tbaa !15 %idxprom = sext i32 %x to i64 %arrayidx = getelementptr inbounds i32, ptr %0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !11 %cmp = icmp eq i32 %1, %x br i1 %cmp, label %common.ret12, label %if.else common.ret12: ; preds = %entry, %if.else %common.ret12.op = phi i32 [ %call, %if.else ], [ %x, %entry ] ret i32 %common.ret12.op if.else: ; preds = %entry %call = tail call i32 @Find(i32 noundef %1) %2 = load ptr, ptr @PAR, align 8, !tbaa !15 %arrayidx4 = getelementptr inbounds i32, ptr %2, i64 %idxprom store i32 %call, ptr %arrayidx4, align 4, !tbaa !11 br label %common.ret12 } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i32 @Same(i32 noundef %x, i32 noundef %y) local_unnamed_addr #5 { entry: %call = tail call i32 @Find(i32 noundef %x) %call1 = tail call i32 @Find(i32 noundef %y) %cmp = icmp eq i32 %call, %call1 %. = zext i1 %cmp to i32 ret i32 %. } ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @Union(i32 noundef %x, i32 noundef %y) local_unnamed_addr #5 { entry: %call = tail call i32 @Find(i32 noundef %x) %call1 = tail call i32 @Find(i32 noundef %y) %cmp = icmp eq i32 %call, %call1 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %0 = load ptr, ptr @PAR, align 8, !tbaa !15 %idxprom = sext i32 %call to i64 %arrayidx = getelementptr inbounds i32, ptr %0, i64 %idxprom store i32 %call1, ptr %arrayidx, align 4, !tbaa !11 br label %return return: ; preds = %entry, %if.end ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @Mark_check(ptr nocapture noundef readonly %box, i32 noundef %n) local_unnamed_addr #6 { entry: %cmp4 = icmp sgt i32 %n, 0 br i1 %cmp4, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !21 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds i32, ptr %box, i64 %indvars.iv %0 = load i32, ptr %arrayidx, align 4, !tbaa !11 %cmp1 = icmp eq i32 %0, -1 br i1 %cmp1, label %cleanup, label %for.cond cleanup: ; preds = %for.body, %for.cond, %entry %retval.0 = phi i32 [ 1, %entry ], [ 1, %for.cond ], [ 0, %for.body ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { 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 !11 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #12 store ptr %call1, ptr @PAR, align 8, !tbaa !15 %call4 = call noalias ptr @malloc(i64 noundef %mul) #12 %cmp175 = icmp sgt i32 %0, 0 br i1 %cmp175, label %for.body.lr.ph.i, label %Init.exit for.body.lr.ph.i: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr align 4 %call4, i8 -1, i64 %2, i1 false), !tbaa !11 %wide.trip.count.i = zext i32 %0 to i64 %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.lr.ph.i %n.vec = and i64 %wide.trip.count.i, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %3 = getelementptr inbounds i32, ptr %call1, i64 %index store <4 x i32> %vec.ind, ptr %3, align 4, !tbaa !11 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> %step.add, ptr %4, align 4, !tbaa !11 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !22 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i br i1 %cmp.n, label %Init.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.lr.ph.i, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.lr.ph.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i %6 = trunc i64 %indvars.iv.i to i32 store i32 %6, ptr %arrayidx.i, align 4, !tbaa !11 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %Init.exit, label %for.body.i, !llvm.loop !23 Init.exit: ; preds = %for.body.i, %middle.block, %entry %mul7 = mul nsw i64 %conv, 12 %mul9 = mul i64 %mul7, %conv %call10 = call noalias ptr @malloc(i64 noundef %mul9) #12 %mul14 = mul i64 %mul, %conv %call15 = call noalias ptr @malloc(i64 noundef %mul14) #12 %mul17 = shl nsw i64 %conv, 3 %call18 = call noalias ptr @malloc(i64 noundef %mul17) #12 br i1 %cmp175, label %for.body22.preheader, label %for.end80.thread for.body22.preheader: ; preds = %Init.exit %wide.trip.count = zext i32 %0 to i64 %xtraiter = and i64 %wide.trip.count, 3 %7 = icmp ult i32 %0, 4 br i1 %7, label %for.cond29.preheader.unr-lcssa, label %for.body22.preheader.new for.body22.preheader.new: ; preds = %for.body22.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body22 for.cond29.preheader.unr-lcssa: ; preds = %for.body22, %for.body22.preheader %indvars.iv.unr = phi i64 [ 0, %for.body22.preheader ], [ %indvars.iv.next.3, %for.body22 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond29.preheader, label %for.body22.epil for.body22.epil: ; preds = %for.cond29.preheader.unr-lcssa, %for.body22.epil %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body22.epil ], [ %indvars.iv.unr, %for.cond29.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body22.epil ], [ 0, %for.cond29.preheader.unr-lcssa ] %8 = mul nsw i64 %indvars.iv.epil, %conv %add.ptr.epil = getelementptr inbounds i32, ptr %call15, i64 %8 %arrayidx25.epil = getelementptr inbounds ptr, ptr %call18, i64 %indvars.iv.epil store ptr %add.ptr.epil, ptr %arrayidx25.epil, align 8, !tbaa !15 %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond29.preheader, label %for.body22.epil, !llvm.loop !24 for.cond29.preheader: ; preds = %for.body22.epil, %for.cond29.preheader.unr-lcssa br i1 %cmp175, label %for.cond33.preheader, label %for.end80.thread for.body22: ; preds = %for.body22, %for.body22.preheader.new %indvars.iv = phi i64 [ 0, %for.body22.preheader.new ], [ %indvars.iv.next.3, %for.body22 ] %niter = phi i64 [ 0, %for.body22.preheader.new ], [ %niter.next.3, %for.body22 ] %9 = mul nsw i64 %indvars.iv, %conv %add.ptr = getelementptr inbounds i32, ptr %call15, i64 %9 %arrayidx25 = getelementptr inbounds ptr, ptr %call18, i64 %indvars.iv store ptr %add.ptr, ptr %arrayidx25, align 8, !tbaa !15 %indvars.iv.next = or i64 %indvars.iv, 1 %10 = mul nsw i64 %indvars.iv.next, %conv %add.ptr.1 = getelementptr inbounds i32, ptr %call15, i64 %10 %arrayidx25.1 = getelementptr inbounds ptr, ptr %call18, i64 %indvars.iv.next store ptr %add.ptr.1, ptr %arrayidx25.1, align 8, !tbaa !15 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %11 = mul nsw i64 %indvars.iv.next.1, %conv %add.ptr.2 = getelementptr inbounds i32, ptr %call15, i64 %11 %arrayidx25.2 = getelementptr inbounds ptr, ptr %call18, i64 %indvars.iv.next.1 store ptr %add.ptr.2, ptr %arrayidx25.2, align 8, !tbaa !15 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %12 = mul nsw i64 %indvars.iv.next.2, %conv %add.ptr.3 = getelementptr inbounds i32, ptr %call15, i64 %12 %arrayidx25.3 = getelementptr inbounds ptr, ptr %call18, i64 %indvars.iv.next.2 store ptr %add.ptr.3, ptr %arrayidx25.3, align 8, !tbaa !15 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond29.preheader.unr-lcssa, label %for.body22, !llvm.loop !26 for.cond33.preheader: ; preds = %for.cond29.preheader, %for.inc45 %13 = phi i32 [ %21, %for.inc45 ], [ %0, %for.cond29.preheader ] %indvars.iv207 = phi i64 [ %indvars.iv.next208, %for.inc45 ], [ 0, %for.cond29.preheader ] %cmp34179 = icmp sgt i32 %13, 0 br i1 %cmp34179, label %for.body36.lr.ph, label %for.cond33.preheader.for.inc45_crit_edge for.cond33.preheader.for.inc45_crit_edge: ; preds = %for.cond33.preheader %.pre = sext i32 %13 to i64 br label %for.inc45 for.body36.lr.ph: ; preds = %for.cond33.preheader %arrayidx38 = getelementptr inbounds ptr, ptr %call18, i64 %indvars.iv207 %14 = load ptr, ptr %arrayidx38, align 8, !tbaa !15 br label %for.body36 for.cond48.preheader: ; preds = %for.inc45 %cmp49187 = icmp sgt i32 %21, 0 br i1 %cmp49187, label %for.cond52.preheader.us.preheader, label %for.end80.thread for.cond52.preheader.us.preheader: ; preds = %for.cond48.preheader %wide.trip.count218 = zext i32 %21 to i64 br label %for.cond52.preheader.us for.cond52.preheader.us: ; preds = %for.cond52.preheader.us.preheader, %for.cond52.for.inc78_crit_edge.us %indvars.iv215 = phi i64 [ 0, %for.cond52.preheader.us.preheader ], [ %indvars.iv.next216, %for.cond52.for.inc78_crit_edge.us ] %count.0188.us = phi i32 [ 0, %for.cond52.preheader.us.preheader ], [ %count.2.us, %for.cond52.for.inc78_crit_edge.us ] %arrayidx59.us = getelementptr inbounds ptr, ptr %call18, i64 %indvars.iv215 %15 = trunc i64 %indvars.iv215 to i32 br label %for.body55.us for.body55.us: ; preds = %for.cond52.preheader.us, %for.inc75.us %indvars.iv210 = phi i64 [ 0, %for.cond52.preheader.us ], [ %indvars.iv.next211, %for.inc75.us ] %count.1184.us = phi i32 [ %count.0188.us, %for.cond52.preheader.us ], [ %count.2.us, %for.inc75.us ] %cmp56.not.us = icmp ugt i64 %indvars.iv215, %indvars.iv210 br i1 %cmp56.not.us, label %for.inc75.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body55.us %16 = load ptr, ptr %arrayidx59.us, align 8, !tbaa !15 %arrayidx61.us = getelementptr inbounds i32, ptr %16, i64 %indvars.iv210 %17 = load i32, ptr %arrayidx61.us, align 4, !tbaa !11 %cmp62.not.us = icmp eq i32 %17, -1 br i1 %cmp62.not.us, label %for.inc75.us, label %if.then.us if.then.us: ; preds = %land.lhs.true.us %idxprom68.us = sext i32 %count.1184.us to i64 %arrayidx69.us = getelementptr inbounds %struct.SIDE_T, ptr %call10, i64 %idxprom68.us store i32 %17, ptr %arrayidx69.us, align 4, !tbaa !5 %from.us = getelementptr inbounds %struct.SIDE_T, ptr %call10, i64 %idxprom68.us, i32 1 store i32 %15, ptr %from.us, align 4, !tbaa !27 %inc72.us = add nsw i32 %count.1184.us, 1 %to.us = getelementptr inbounds %struct.SIDE_T, ptr %call10, i64 %idxprom68.us, i32 2 %18 = trunc i64 %indvars.iv210 to i32 store i32 %18, ptr %to.us, align 4, !tbaa !28 br label %for.inc75.us for.inc75.us: ; preds = %if.then.us, %land.lhs.true.us, %for.body55.us %count.2.us = phi i32 [ %inc72.us, %if.then.us ], [ %count.1184.us, %land.lhs.true.us ], [ %count.1184.us, %for.body55.us ] %indvars.iv.next211 = add nuw nsw i64 %indvars.iv210, 1 %exitcond214.not = icmp eq i64 %indvars.iv.next211, %wide.trip.count218 br i1 %exitcond214.not, label %for.cond52.for.inc78_crit_edge.us, label %for.body55.us, !llvm.loop !29 for.cond52.for.inc78_crit_edge.us: ; preds = %for.inc75.us %indvars.iv.next216 = add nuw nsw i64 %indvars.iv215, 1 %exitcond219.not = icmp eq i64 %indvars.iv.next216, %wide.trip.count218 br i1 %exitcond219.not, label %for.end80, label %for.cond52.preheader.us, !llvm.loop !30 for.body36: ; preds = %for.body36.lr.ph, %for.body36 %indvars.iv204 = phi i64 [ 0, %for.body36.lr.ph ], [ %indvars.iv.next205, %for.body36 ] %arrayidx40 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv204 %call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx40) %indvars.iv.next205 = add nuw nsw i64 %indvars.iv204, 1 %19 = load i32, ptr %n, align 4, !tbaa !11 %20 = sext i32 %19 to i64 %cmp34 = icmp slt i64 %indvars.iv.next205, %20 br i1 %cmp34, label %for.body36, label %for.inc45, !llvm.loop !31 for.inc45: ; preds = %for.body36, %for.cond33.preheader.for.inc45_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond33.preheader.for.inc45_crit_edge ], [ %20, %for.body36 ] %21 = phi i32 [ %13, %for.cond33.preheader.for.inc45_crit_edge ], [ %19, %for.body36 ] %indvars.iv.next208 = add nuw nsw i64 %indvars.iv207, 1 %cmp30 = icmp slt i64 %indvars.iv.next208, %.pre-phi br i1 %cmp30, label %for.cond33.preheader, label %for.cond48.preheader, !llvm.loop !32 for.end80.thread: ; preds = %for.cond48.preheader, %for.cond29.preheader, %Init.exit call void @Quick_sort(ptr noundef %call10, i32 noundef 0, i32 noundef -1) br label %for.end110 for.end80: ; preds = %for.cond52.for.inc78_crit_edge.us %sub = add nsw i32 %count.2.us, -1 call void @Quick_sort(ptr noundef %call10, i32 noundef 0, i32 noundef %sub) %cmp82192 = icmp sgt i32 %count.2.us, 0 br i1 %cmp82192, label %for.body84.preheader, label %for.end110 for.body84.preheader: ; preds = %for.end80 %wide.trip.count223 = zext i32 %count.2.us to i64 br label %for.body84 for.body84: ; preds = %for.body84.preheader, %for.inc108 %indvars.iv220 = phi i64 [ 0, %for.body84.preheader ], [ %indvars.iv.next221, %for.inc108 ] %sum.0193 = phi i32 [ 0, %for.body84.preheader ], [ %sum.1, %for.inc108 ] %from87 = getelementptr inbounds %struct.SIDE_T, ptr %call10, i64 %indvars.iv220, i32 1 %22 = load i32, ptr %from87, align 4, !tbaa !27 %to90 = getelementptr inbounds %struct.SIDE_T, ptr %call10, i64 %indvars.iv220, i32 2 %23 = load i32, ptr %to90, align 4, !tbaa !28 %call.i = call i32 @Find(i32 noundef %22) %call1.i = call i32 @Find(i32 noundef %23) %cmp.i.not = icmp eq i32 %call.i, %call1.i br i1 %cmp.i.not, label %if.end104, label %if.then94 if.then94: ; preds = %for.body84 %arrayidx86 = getelementptr inbounds %struct.SIDE_T, ptr %call10, i64 %indvars.iv220 %call.i161 = call i32 @Find(i32 noundef %22) %call1.i162 = call i32 @Find(i32 noundef %23) %cmp.i163 = icmp eq i32 %call.i161, %call1.i162 br i1 %cmp.i163, label %Union.exit, label %if.end.i if.end.i: ; preds = %if.then94 %24 = load ptr, ptr @PAR, align 8, !tbaa !15 %idxprom.i = sext i32 %call.i161 to i64 %arrayidx.i164 = getelementptr inbounds i32, ptr %24, i64 %idxprom.i store i32 %call1.i162, ptr %arrayidx.i164, align 4, !tbaa !11 br label %Union.exit Union.exit: ; preds = %if.then94, %if.end.i %25 = load i32, ptr %arrayidx86, align 4, !tbaa !5 %add = add nsw i32 %25, %sum.0193 br label %if.end104 if.end104: ; preds = %Union.exit, %for.body84 %sum.1 = phi i32 [ %add, %Union.exit ], [ %sum.0193, %for.body84 ] %26 = load i32, ptr %n, align 4, !tbaa !11 %cmp4.i165 = icmp sgt i32 %26, 0 br i1 %cmp4.i165, label %for.body.preheader.i, label %for.end110 for.body.preheader.i: ; preds = %if.end104 %wide.trip.count.i166 = zext i32 %26 to i64 br label %for.body.i167 for.cond.i: ; preds = %for.body.i167 %indvars.iv.next.i170 = add nuw nsw i64 %indvars.iv.i168, 1 %exitcond.not.i171 = icmp eq i64 %indvars.iv.next.i170, %wide.trip.count.i166 br i1 %exitcond.not.i171, label %for.end110, label %for.body.i167, !llvm.loop !21 for.body.i167: ; preds = %for.cond.i, %for.body.preheader.i %indvars.iv.i168 = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i170, %for.cond.i ] %arrayidx.i169 = getelementptr inbounds i32, ptr %call4, i64 %indvars.iv.i168 %27 = load i32, ptr %arrayidx.i169, align 4, !tbaa !11 %cmp1.i = icmp eq i32 %27, -1 br i1 %cmp1.i, label %for.inc108, label %for.cond.i for.inc108: ; preds = %for.body.i167 %indvars.iv.next221 = add nuw nsw i64 %indvars.iv220, 1 %exitcond224.not = icmp eq i64 %indvars.iv.next221, %wide.trip.count223 br i1 %exitcond224.not, label %for.end110, label %for.body84, !llvm.loop !34 for.end110: ; preds = %for.inc108, %if.end104, %for.cond.i, %for.end80.thread, %for.end80 %sum.2 = phi i32 [ 0, %for.end80 ], [ 0, %for.end80.thread ], [ %sum.1, %for.cond.i ], [ %sum.1, %if.end104 ], [ %sum.1, %for.inc108 ] %call111 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #9 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #10 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 nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree norecurse nosync nounwind memory(readwrite, argmem: write, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 #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 nounwind "no-trapping-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 = { 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 #10 = { nocallback nofree nounwind willreturn memory(argmem: write) } 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, !7, i64 0} !6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{i64 0, i64 4, !11, i64 4, i64 4, !11, i64 8, i64 4, !11} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13} !15 = !{!16, !16, i64 0} !16 = !{!"any pointer", !8, i64 0} !17 = distinct !{!17, !13, !18, !19} !18 = !{!"llvm.loop.isvectorized", i32 1} !19 = !{!"llvm.loop.unroll.runtime.disable"} !20 = distinct !{!20, !13, !19, !18} !21 = distinct !{!21, !13} !22 = distinct !{!22, !13, !18, !19} !23 = distinct !{!23, !13, !19, !18} !24 = distinct !{!24, !25} !25 = !{!"llvm.loop.unroll.disable"} !26 = distinct !{!26, !13} !27 = !{!6, !7, i64 4} !28 = !{!6, !7, i64 8} !29 = distinct !{!29, !13} !30 = distinct !{!30, !13} !31 = distinct !{!31, !13} !32 = distinct !{!32, !13, !33} !33 = !{!"llvm.loop.unswitch.partial.disable"} !34 = distinct !{!34, !13}
#include<stdio.h> #define MAX 100 static const int INFTY =(1<<21); static const int WHITE = 0; static const int GRAY = 1; static const int BLACK = 2; int n, M[MAX][MAX]; int prim(){ int u, minv; int d[MAX], p[MAX], color[MAX]; for( int i=0; i<n; i++){ d[i] = INFTY; p[i] = -1; color[i] = WHITE; } d[0] = 0; while( 1 ){ minv = INFTY; u = -1; for(int i=0; i<n; i++){ if( minv > d[i] && color[i] != BLACK){ u = i; minv = d[i]; } } if( u== -1) break; color[u] = BLACK; for(int v=0; v<n; v++){ if(color[v] != BLACK && M[u][v] != INFTY){ if(d[v] > M[u][v] ){ d[v] = M[u][v]; p[v] = u; color[v] = GRAY; } } } } int sum = 0; for(int i=0; i<n;i++){ if(p[i] != -1) sum += M[i][p[i]]; } return sum; } int main(){ scanf("%d", &n); for(int i=0; i<n; i++){ for(int j=0; j<n; j++){ int e; scanf("%d", &e); if(e == -1) M[i][j] = INFTY; else M[i][j] = e; } } printf("%d\n",prim()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199624/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199624/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i32 0, align 4 @M = 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 [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #0 { entry: %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp114 = icmp sgt i32 %.fr, 0 br i1 %cmp114, label %for.body.preheader, label %for.cond.cleanup67 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 %p, i8 -1, i64 %2, i1 false), !tbaa !5 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.preheader176, 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 !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader176 for.body.preheader176: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp114, label %while.cond.us.preheader, label %for.cond.cleanup67 while.cond.us.preheader: ; preds = %for.cond.cleanup %wide.trip.count164 = zext i32 %.fr to i64 %wide.trip.count169 = zext i32 %.fr to i64 br label %for.body10.us for.cond.cleanup9.us: ; preds = %for.inc19.us %cmp22.us = icmp eq i32 %u.1.us, -1 br i1 %cmp22.us, label %for.cond65.preheader, label %if.end24.us if.end24.us: ; preds = %for.cond.cleanup9.us %idxprom25.us = sext i32 %u.1.us to i64 %arrayidx26.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom25.us store i32 2, ptr %arrayidx26.us, align 4, !tbaa !5 br label %for.body30.us for.body30.us: ; preds = %if.end24.us, %for.inc61.us %indvars.iv166 = phi i64 [ 0, %if.end24.us ], [ %indvars.iv.next167, %for.inc61.us ] %arrayidx32.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv166 %6 = load i32, ptr %arrayidx32.us, align 4, !tbaa !5 %cmp33.not.us = icmp eq i32 %6, 2 br i1 %cmp33.not.us, label %for.inc61.us, label %land.lhs.true34.us land.lhs.true34.us: ; preds = %for.body30.us %arrayidx38.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom25.us, i64 %indvars.iv166 %7 = load i32, ptr %arrayidx38.us, align 4, !tbaa !5 %cmp39.not.us = icmp eq i32 %7, 2097152 br i1 %cmp39.not.us, label %for.inc61.us, label %if.then40.us if.then40.us: ; preds = %land.lhs.true34.us %arrayidx42.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv166 %8 = load i32, ptr %arrayidx42.us, align 4, !tbaa !5 %cmp47.us = icmp sgt i32 %8, %7 br i1 %cmp47.us, label %if.then48.us, label %for.inc61.us if.then48.us: ; preds = %if.then40.us store i32 %7, ptr %arrayidx42.us, align 4, !tbaa !5 %arrayidx56.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv166 store i32 %u.1.us, ptr %arrayidx56.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx32.us, align 4, !tbaa !5 br label %for.inc61.us for.inc61.us: ; preds = %if.then48.us, %if.then40.us, %land.lhs.true34.us, %for.body30.us %indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1 %exitcond170.not = icmp eq i64 %indvars.iv.next167, %wide.trip.count169 br i1 %exitcond170.not, label %for.body10.us.backedge, label %for.body30.us, !llvm.loop !13 for.body10.us: ; preds = %for.body10.us.backedge, %while.cond.us.preheader %indvars.iv161 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv161.be, %for.body10.us.backedge ] %minv.0118.us = phi i32 [ 2097152, %while.cond.us.preheader ], [ %minv.0118.us.be, %for.body10.us.backedge ] %u.0117.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0117.us.be, %for.body10.us.backedge ] %arrayidx12.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv161 %9 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %cmp13.us = icmp sgt i32 %minv.0118.us, %9 br i1 %cmp13.us, label %land.lhs.true.us, label %for.inc19.us land.lhs.true.us: ; preds = %for.body10.us %arrayidx15.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv161 %10 = load i32, ptr %arrayidx15.us, align 4, !tbaa !5 %cmp16.not.us = icmp eq i32 %10, 2 %11 = trunc i64 %indvars.iv161 to i32 %spec.select.us = select i1 %cmp16.not.us, i32 %u.0117.us, i32 %11 %spec.select113.us = select i1 %cmp16.not.us, i32 %minv.0118.us, i32 %9 br label %for.inc19.us for.inc19.us: ; preds = %land.lhs.true.us, %for.body10.us %u.1.us = phi i32 [ %u.0117.us, %for.body10.us ], [ %spec.select.us, %land.lhs.true.us ] %minv.1.us = phi i32 [ %minv.0118.us, %for.body10.us ], [ %spec.select113.us, %land.lhs.true.us ] %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1 %exitcond165.not = icmp eq i64 %indvars.iv.next162, %wide.trip.count164 br i1 %exitcond165.not, label %for.cond.cleanup9.us, label %for.body10.us.backedge for.body10.us.backedge: ; preds = %for.inc61.us, %for.inc19.us %indvars.iv161.be = phi i64 [ %indvars.iv.next162, %for.inc19.us ], [ 0, %for.inc61.us ] %minv.0118.us.be = phi i32 [ %minv.1.us, %for.inc19.us ], [ 2097152, %for.inc61.us ] %u.0117.us.be = phi i32 [ %u.1.us, %for.inc19.us ], [ -1, %for.inc61.us ] br label %for.body10.us, !llvm.loop !13 for.body: ; preds = %for.body.preheader176, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader176 ] %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.cond.cleanup, label %for.body, !llvm.loop !14 for.cond65.preheader: ; preds = %for.cond.cleanup9.us br i1 %cmp114, label %for.body68.preheader, label %for.cond.cleanup67 for.body68.preheader: ; preds = %for.cond65.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.cond.cleanup67.loopexit.unr-lcssa, label %for.body68.preheader.new for.body68.preheader.new: ; preds = %for.body68.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body68 for.cond.cleanup67.loopexit.unr-lcssa: ; preds = %for.inc80.1, %for.body68.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body68.preheader ], [ %sum.1.1, %for.inc80.1 ] %indvars.iv171.unr = phi i64 [ 0, %for.body68.preheader ], [ %indvars.iv.next172.1, %for.inc80.1 ] %sum.0151.unr = phi i32 [ 0, %for.body68.preheader ], [ %sum.1.1, %for.inc80.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup67, label %for.body68.epil for.body68.epil: ; preds = %for.cond.cleanup67.loopexit.unr-lcssa %arrayidx70.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv171.unr %13 = load i32, ptr %arrayidx70.epil, align 4, !tbaa !5 %cmp71.not.epil = icmp eq i32 %13, -1 br i1 %cmp71.not.epil, label %for.cond.cleanup67, label %if.then72.epil if.then72.epil: ; preds = %for.body68.epil %idxprom77.epil = sext i32 %13 to i64 %arrayidx78.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv171.unr, i64 %idxprom77.epil %14 = load i32, ptr %arrayidx78.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %14, %sum.0151.unr br label %for.cond.cleanup67 for.cond.cleanup67: ; preds = %for.cond.cleanup67.loopexit.unr-lcssa, %if.then72.epil, %for.body68.epil, %entry, %for.cond.cleanup, %for.cond65.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond65.preheader ], [ 0, %for.cond.cleanup ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.cond.cleanup67.loopexit.unr-lcssa ], [ %add.epil, %if.then72.epil ], [ %sum.0151.unr, %for.body68.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 ret i32 %sum.0.lcssa for.body68: ; preds = %for.inc80.1, %for.body68.preheader.new %indvars.iv171 = phi i64 [ 0, %for.body68.preheader.new ], [ %indvars.iv.next172.1, %for.inc80.1 ] %sum.0151 = phi i32 [ 0, %for.body68.preheader.new ], [ %sum.1.1, %for.inc80.1 ] %niter = phi i64 [ 0, %for.body68.preheader.new ], [ %niter.next.1, %for.inc80.1 ] %arrayidx70 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv171 %15 = load i32, ptr %arrayidx70, align 8, !tbaa !5 %cmp71.not = icmp eq i32 %15, -1 br i1 %cmp71.not, label %for.inc80, label %if.then72 if.then72: ; preds = %for.body68 %idxprom77 = sext i32 %15 to i64 %arrayidx78 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv171, i64 %idxprom77 %16 = load i32, ptr %arrayidx78, align 4, !tbaa !5 %add = add nsw i32 %16, %sum.0151 br label %for.inc80 for.inc80: ; preds = %for.body68, %if.then72 %sum.1 = phi i32 [ %add, %if.then72 ], [ %sum.0151, %for.body68 ] %indvars.iv.next172 = or i64 %indvars.iv171, 1 %arrayidx70.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next172 %17 = load i32, ptr %arrayidx70.1, align 4, !tbaa !5 %cmp71.not.1 = icmp eq i32 %17, -1 br i1 %cmp71.not.1, label %for.inc80.1, label %if.then72.1 if.then72.1: ; preds = %for.inc80 %idxprom77.1 = sext i32 %17 to i64 %arrayidx78.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next172, i64 %idxprom77.1 %18 = load i32, ptr %arrayidx78.1, align 4, !tbaa !5 %add.1 = add nsw i32 %18, %sum.1 br label %for.inc80.1 for.inc80.1: ; preds = %if.then72.1, %for.inc80 %sum.1.1 = phi i32 [ %add.1, %if.then72.1 ], [ %sum.1, %for.inc80 ] %indvars.iv.next172.1 = add nuw nsw i64 %indvars.iv171, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup67.loopexit.unr-lcssa, label %for.body68, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree 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: %d.i = alloca [100 x i32], align 16 %p.i = alloca [100 x i32], align 16 %color.i = alloca [100 x i32], align 16 %e = alloca i32, align 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 %.fr.i26 = freeze i32 %0 %cmp27 = icmp sgt i32 %.fr.i26, 0 br i1 %cmp27, label %for.cond1.preheader, label %for.cond.cleanup.thread for.cond.cleanup.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 br label %prim.exit for.cond1.preheader: ; preds = %entry, %for.cond.cleanup3 %1 = phi i32 [ %.fr.i, %for.cond.cleanup3 ], [ %.fr.i26, %entry ] %indvars.iv32 = phi i64 [ %indvars.iv.next33, %for.cond.cleanup3 ], [ 0, %entry ] %cmp224 = icmp sgt i32 %1, 0 br i1 %cmp224, label %for.body4, label %for.cond.cleanup3 for.cond.cleanup: ; preds = %for.cond.cleanup3 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 %cmp114.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp114.i, label %for.body.preheader.i, label %prim.exit for.body.preheader.i: ; preds = %for.cond.cleanup %2 = zext i32 %.fr.i to i64 %3 = shl nuw nsw i64 %2, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p.i, i8 -1, i64 %3, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color.i, i8 0, i64 %3, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %2, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %4 = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %5, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !16 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %2 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.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr %d.i, align 16, !tbaa !5 br label %for.body10.us.i for.cond.cleanup9.us.i: ; preds = %for.inc19.us.i %cmp22.us.i = icmp eq i32 %u.1.us.i, -1 br i1 %cmp22.us.i, label %for.body68.i.preheader, label %if.end24.us.i for.body68.i.preheader: ; preds = %for.cond.cleanup9.us.i %xtraiter = and i64 %2, 1 %7 = icmp eq i32 %.fr.i, 1 br i1 %7, label %prim.exit.loopexit.unr-lcssa, label %for.body68.i.preheader.new for.body68.i.preheader.new: ; preds = %for.body68.i.preheader %unroll_iter = and i64 %2, 4294967294 br label %for.body68.i if.end24.us.i: ; preds = %for.cond.cleanup9.us.i %idxprom25.us.i = sext i32 %u.1.us.i to i64 %arrayidx26.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %idxprom25.us.i store i32 2, ptr %arrayidx26.us.i, align 4, !tbaa !5 br label %for.body30.us.i for.body30.us.i: ; preds = %for.inc61.us.i, %if.end24.us.i %indvars.iv166.i = phi i64 [ 0, %if.end24.us.i ], [ %indvars.iv.next167.i, %for.inc61.us.i ] %arrayidx32.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv166.i %8 = load i32, ptr %arrayidx32.us.i, align 4, !tbaa !5 %cmp33.not.us.i = icmp eq i32 %8, 2 br i1 %cmp33.not.us.i, label %for.inc61.us.i, label %land.lhs.true34.us.i land.lhs.true34.us.i: ; preds = %for.body30.us.i %arrayidx38.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom25.us.i, i64 %indvars.iv166.i %9 = load i32, ptr %arrayidx38.us.i, align 4, !tbaa !5 %cmp39.not.us.i = icmp eq i32 %9, 2097152 br i1 %cmp39.not.us.i, label %for.inc61.us.i, label %if.then40.us.i if.then40.us.i: ; preds = %land.lhs.true34.us.i %arrayidx42.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv166.i %10 = load i32, ptr %arrayidx42.us.i, align 4, !tbaa !5 %cmp47.us.i = icmp sgt i32 %10, %9 br i1 %cmp47.us.i, label %if.then48.us.i, label %for.inc61.us.i if.then48.us.i: ; preds = %if.then40.us.i store i32 %9, ptr %arrayidx42.us.i, align 4, !tbaa !5 %arrayidx56.us.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv166.i store i32 %u.1.us.i, ptr %arrayidx56.us.i, align 4, !tbaa !5 store i32 1, ptr %arrayidx32.us.i, align 4, !tbaa !5 br label %for.inc61.us.i for.inc61.us.i: ; preds = %if.then48.us.i, %if.then40.us.i, %land.lhs.true34.us.i, %for.body30.us.i %indvars.iv.next167.i = add nuw nsw i64 %indvars.iv166.i, 1 %exitcond170.not.i = icmp eq i64 %indvars.iv.next167.i, %2 br i1 %exitcond170.not.i, label %for.body10.us.i.backedge, label %for.body30.us.i, !llvm.loop !13 for.body10.us.i: ; preds = %for.body10.us.i.backedge, %while.cond.us.preheader.i %indvars.iv161.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv161.i.be, %for.body10.us.i.backedge ] %minv.0118.us.i = phi i32 [ 2097152, %while.cond.us.preheader.i ], [ %minv.0118.us.i.be, %for.body10.us.i.backedge ] %u.0117.us.i = phi i32 [ -1, %while.cond.us.preheader.i ], [ %u.0117.us.i.be, %for.body10.us.i.backedge ] %arrayidx12.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv161.i %11 = load i32, ptr %arrayidx12.us.i, align 4, !tbaa !5 %cmp13.us.i = icmp sgt i32 %minv.0118.us.i, %11 br i1 %cmp13.us.i, label %land.lhs.true.us.i, label %for.inc19.us.i land.lhs.true.us.i: ; preds = %for.body10.us.i %arrayidx15.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv161.i %12 = load i32, ptr %arrayidx15.us.i, align 4, !tbaa !5 %cmp16.not.us.i = icmp eq i32 %12, 2 %13 = trunc i64 %indvars.iv161.i to i32 %spec.select.us.i = select i1 %cmp16.not.us.i, i32 %u.0117.us.i, i32 %13 %spec.select113.us.i = select i1 %cmp16.not.us.i, i32 %minv.0118.us.i, i32 %11 br label %for.inc19.us.i for.inc19.us.i: ; preds = %land.lhs.true.us.i, %for.body10.us.i %u.1.us.i = phi i32 [ %u.0117.us.i, %for.body10.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %minv.1.us.i = phi i32 [ %minv.0118.us.i, %for.body10.us.i ], [ %spec.select113.us.i, %land.lhs.true.us.i ] %indvars.iv.next162.i = add nuw nsw i64 %indvars.iv161.i, 1 %exitcond165.not.i = icmp eq i64 %indvars.iv.next162.i, %2 br i1 %exitcond165.not.i, label %for.cond.cleanup9.us.i, label %for.body10.us.i.backedge for.body10.us.i.backedge: ; preds = %for.inc61.us.i, %for.inc19.us.i %indvars.iv161.i.be = phi i64 [ %indvars.iv.next162.i, %for.inc19.us.i ], [ 0, %for.inc61.us.i ] %minv.0118.us.i.be = phi i32 [ %minv.1.us.i, %for.inc19.us.i ], [ 2097152, %for.inc61.us.i ] %u.0117.us.i.be = phi i32 [ %u.1.us.i, %for.inc19.us.i ], [ -1, %for.inc61.us.i ] br label %for.body10.us.i, !llvm.loop !13 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.i, i64 0, i64 %indvars.iv.i store i32 2097152, 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, %2 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !17 for.body68.i: ; preds = %for.inc80.i.1, %for.body68.i.preheader.new %indvars.iv171.i = phi i64 [ 0, %for.body68.i.preheader.new ], [ %indvars.iv.next172.i.1, %for.inc80.i.1 ] %sum.0151.i = phi i32 [ 0, %for.body68.i.preheader.new ], [ %sum.1.i.1, %for.inc80.i.1 ] %niter = phi i64 [ 0, %for.body68.i.preheader.new ], [ %niter.next.1, %for.inc80.i.1 ] %arrayidx70.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv171.i %14 = load i32, ptr %arrayidx70.i, align 8, !tbaa !5 %cmp71.not.i = icmp eq i32 %14, -1 br i1 %cmp71.not.i, label %for.inc80.i, label %if.then72.i if.then72.i: ; preds = %for.body68.i %idxprom77.i = sext i32 %14 to i64 %arrayidx78.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv171.i, i64 %idxprom77.i %15 = load i32, ptr %arrayidx78.i, align 4, !tbaa !5 %add.i = add nsw i32 %15, %sum.0151.i br label %for.inc80.i for.inc80.i: ; preds = %if.then72.i, %for.body68.i %sum.1.i = phi i32 [ %add.i, %if.then72.i ], [ %sum.0151.i, %for.body68.i ] %indvars.iv.next172.i = or i64 %indvars.iv171.i, 1 %arrayidx70.i.1 = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv.next172.i %16 = load i32, ptr %arrayidx70.i.1, align 4, !tbaa !5 %cmp71.not.i.1 = icmp eq i32 %16, -1 br i1 %cmp71.not.i.1, label %for.inc80.i.1, label %if.then72.i.1 if.then72.i.1: ; preds = %for.inc80.i %idxprom77.i.1 = sext i32 %16 to i64 %arrayidx78.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next172.i, i64 %idxprom77.i.1 %17 = load i32, ptr %arrayidx78.i.1, align 4, !tbaa !5 %add.i.1 = add nsw i32 %17, %sum.1.i br label %for.inc80.i.1 for.inc80.i.1: ; preds = %if.then72.i.1, %for.inc80.i %sum.1.i.1 = phi i32 [ %add.i.1, %if.then72.i.1 ], [ %sum.1.i, %for.inc80.i ] %indvars.iv.next172.i.1 = add nuw nsw i64 %indvars.iv171.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %prim.exit.loopexit.unr-lcssa, label %for.body68.i, !llvm.loop !15 prim.exit.loopexit.unr-lcssa: ; preds = %for.inc80.i.1, %for.body68.i.preheader %sum.1.i.lcssa.ph = phi i32 [ undef, %for.body68.i.preheader ], [ %sum.1.i.1, %for.inc80.i.1 ] %indvars.iv171.i.unr = phi i64 [ 0, %for.body68.i.preheader ], [ %indvars.iv.next172.i.1, %for.inc80.i.1 ] %sum.0151.i.unr = phi i32 [ 0, %for.body68.i.preheader ], [ %sum.1.i.1, %for.inc80.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %prim.exit, label %for.body68.i.epil for.body68.i.epil: ; preds = %prim.exit.loopexit.unr-lcssa %arrayidx70.i.epil = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv171.i.unr %18 = load i32, ptr %arrayidx70.i.epil, align 4, !tbaa !5 %cmp71.not.i.epil = icmp eq i32 %18, -1 br i1 %cmp71.not.i.epil, label %prim.exit, label %if.then72.i.epil if.then72.i.epil: ; preds = %for.body68.i.epil %idxprom77.i.epil = sext i32 %18 to i64 %arrayidx78.i.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv171.i.unr, i64 %idxprom77.i.epil %19 = load i32, ptr %arrayidx78.i.epil, align 4, !tbaa !5 %add.i.epil = add nsw i32 %19, %sum.0151.i.unr br label %prim.exit prim.exit: ; preds = %prim.exit.loopexit.unr-lcssa, %if.then72.i.epil, %for.body68.i.epil, %for.cond.cleanup.thread, %for.cond.cleanup %sum.0.lcssa.i = phi i32 [ 0, %for.cond.cleanup ], [ 0, %for.cond.cleanup.thread ], [ %sum.1.i.lcssa.ph, %prim.exit.loopexit.unr-lcssa ], [ %add.i.epil, %if.then72.i.epil ], [ %sum.0151.i.unr, %for.body68.i.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d.i) #5 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa.i) ret i32 0 for.cond.cleanup3: ; preds = %for.body4, %for.cond1.preheader %20 = phi i32 [ %1, %for.cond1.preheader ], [ %24, %for.body4 ] %.fr.i = freeze i32 %20 %indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1 %21 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next33, %21 br i1 %cmp, label %for.cond1.preheader, label %for.cond.cleanup, !llvm.loop !18 for.body4: ; preds = %for.cond1.preheader, %for.body4 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond1.preheader ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %22 = load i32, ptr %e, align 4, !tbaa !5 %cmp6 = icmp eq i32 %22, -1 %spec.select = select i1 %cmp6, i32 2097152, i32 %22 %23 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv32, i64 %indvars.iv store i32 %spec.select, ptr %23, align 4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %24 = load i32, ptr @n, align 4, !tbaa !5 %25 = sext i32 %24 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %25 br i1 %cmp2, label %for.body4, label %for.cond.cleanup3, !llvm.loop !20 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10, !11, !12} !17 = distinct !{!17, !10, !12, !11} !18 = distinct !{!18, !10, !19} !19 = !{!"llvm.loop.unswitch.partial.disable"} !20 = distinct !{!20, !10}
#include<stdio.h> #define MAX 101 #define WHITE 0 #define BLACK 1 #define INF 2001 #define NIL -1 int G[MAX][MAX],n,d[MAX],pi[MAX],color[MAX]; void Prim(int r){ int i; for(i=1;i<=n;i++){ d[i]=INF; pi[i]=NIL; } d[r]=0; while(1){ int u,mincost = INF; for(i=1;i<=n;i++){ if(color[i]!=BLACK && d[i]<mincost){ mincost = d[i]; u = i; } } if(mincost==INF)break; //printf("min:%d\n",mincost); color[u]=BLACK; for(i=1;i<=n;i++){ if(color[i]!=BLACK && G[u][i]<d[i] && G[u][i]!=-1){ pi[i] = u; d[i] = G[u][i]; } } } } int main(){ int i,j,sum=0; scanf("%d",&n); for(i=1;i<=n;i++){ for(j=1;j<=n;j++){ scanf("%d",&G[i][j]); } } Prim(1); for(i=1;i<=n;i++){ //printf("%d %d %d\n",G[i][pi[i]],d[i],pi[i]); sum+=d[i]; } printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199668/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199668/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i32 0, align 4 @d = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @pi = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @color = dso_local local_unnamed_addr global [101 x i32] zeroinitializer, align 16 @G = dso_local global [101 x [101 x i32]] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @Prim(i32 noundef %r) local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp.not85 = icmp slt i32 %.fr, 1 br i1 %cmp.not85, label %for.end.thread, label %for.body.preheader for.end.thread: ; preds = %entry %idxprom3121 = sext i32 %r to i64 %arrayidx4122 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom3121 store i32 0, ptr %arrayidx4122, align 4, !tbaa !5 br label %while.end for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([101 x i32], ptr @pi, i64 0, i64 1), i8 -1, i64 %2, i1 false), !tbaa !5 %3 = add nuw i32 %.fr, 1 %wide.trip.count = zext i32 %3 to i64 %4 = add nsw i64 %wide.trip.count, -1 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader123, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %4, -8 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = or i64 %index, 1 %5 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %offset.idx store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %5, align 4, !tbaa !5 %6 = getelementptr inbounds i32, ptr %5, i64 4 store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %6, align 4, !tbaa !5 %index.next = add nuw i64 %index, 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 %4, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader123 for.body.preheader123: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader123, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader123 ] %arrayidx = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv store i32 2001, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block %idxprom3 = sext i32 %r to i64 %arrayidx4 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %idxprom3 store i32 0, ptr %arrayidx4, align 4, !tbaa !5 br i1 %cmp.not85, label %while.end, label %while.cond.preheader while.cond.preheader: ; preds = %for.end %8 = add nuw i32 %.fr, 1 %wide.trip.count109 = zext i32 %8 to i64 br label %for.body7 for.body7: ; preds = %for.body7.backedge, %while.cond.preheader %indvars.iv106 = phi i64 [ 1, %while.cond.preheader ], [ %indvars.iv106.be, %for.body7.backedge ] %mincost.090 = phi i32 [ 2001, %while.cond.preheader ], [ %mincost.090.be, %for.body7.backedge ] %u.189 = phi i32 [ undef, %while.cond.preheader ], [ %u.2, %for.body7.backedge ] %arrayidx9 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv106 %9 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10.not = icmp eq i32 %9, 1 br i1 %cmp10.not, label %for.inc16, label %land.lhs.true land.lhs.true: ; preds = %for.body7 %arrayidx12 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv106 %10 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp13 = icmp slt i32 %10, %mincost.090 %11 = trunc i64 %indvars.iv106 to i32 %spec.select = select i1 %cmp13, i32 %11, i32 %u.189 %spec.select82 = tail call i32 @llvm.smin.i32(i32 %10, i32 %mincost.090) br label %for.inc16 for.inc16: ; preds = %land.lhs.true, %for.body7 %u.2 = phi i32 [ %u.189, %for.body7 ], [ %spec.select, %land.lhs.true ] %mincost.1 = phi i32 [ %mincost.090, %for.body7 ], [ %spec.select82, %land.lhs.true ] %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1 %exitcond110.not = icmp eq i64 %indvars.iv.next107, %wide.trip.count109 br i1 %exitcond110.not, label %for.cond5.for.end18_crit_edge, label %for.body7.backedge for.body7.backedge: ; preds = %for.inc54, %for.inc16 %indvars.iv106.be = phi i64 [ %indvars.iv.next107, %for.inc16 ], [ 1, %for.inc54 ] %mincost.090.be = phi i32 [ %mincost.1, %for.inc16 ], [ 2001, %for.inc54 ] br label %for.body7, !llvm.loop !14 for.cond5.for.end18_crit_edge: ; preds = %for.inc16 %cmp19 = icmp eq i32 %mincost.1, 2001 br i1 %cmp19, label %while.end, label %if.end21 if.end21: ; preds = %for.cond5.for.end18_crit_edge %idxprom22 = sext i32 %u.2 to i64 %arrayidx23 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %idxprom22 store i32 1, ptr %arrayidx23, align 4, !tbaa !5 br label %for.body26 for.body26: ; preds = %if.end21, %for.inc54 %indvars.iv111 = phi i64 [ 1, %if.end21 ], [ %indvars.iv.next112, %for.inc54 ] %arrayidx28 = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv111 %12 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29.not = icmp eq i32 %12, 1 br i1 %cmp29.not, label %for.inc54, label %land.lhs.true30 land.lhs.true30: ; preds = %for.body26 %arrayidx34 = getelementptr inbounds [101 x [101 x i32]], ptr @G, i64 0, i64 %idxprom22, i64 %indvars.iv111 %13 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %arrayidx36 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv111 %14 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %cmp37 = icmp sge i32 %13, %14 %cmp43.not = icmp eq i32 %13, -1 %or.cond = or i1 %cmp43.not, %cmp37 br i1 %or.cond, label %for.inc54, label %if.then44 if.then44: ; preds = %land.lhs.true30 %arrayidx46 = getelementptr inbounds [101 x i32], ptr @pi, i64 0, i64 %indvars.iv111 store i32 %u.2, ptr %arrayidx46, align 4, !tbaa !5 store i32 %13, ptr %arrayidx36, align 4, !tbaa !5 br label %for.inc54 for.inc54: ; preds = %for.body26, %land.lhs.true30, %if.then44 %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %exitcond115.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count109 br i1 %exitcond115.not, label %for.body7.backedge, label %for.body26, !llvm.loop !14 while.end: ; preds = %for.cond5.for.end18_crit_edge, %for.end, %for.end.thread ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i29 = freeze i32 %0 %cmp.not30 = icmp slt i32 %.fr.i29, 1 br i1 %cmp.not30, label %Prim.exit.thread, label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc7 %1 = phi i32 [ %.fr.i, %for.inc7 ], [ %.fr.i29, %entry ] %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.inc7 ], [ 1, %entry ] %cmp2.not27 = icmp slt i32 %1, 1 br i1 %cmp2.not27, label %for.inc7, label %for.body3 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 1, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [101 x [101 x i32]], ptr @G, i64 0, i64 %indvars.iv39, i64 %indvars.iv %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %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 %cmp2.not.not = icmp slt i64 %indvars.iv, %3 br i1 %cmp2.not.not, label %for.body3, label %for.inc7, !llvm.loop !15 for.inc7: ; preds = %for.body3, %for.cond1.preheader %4 = phi i32 [ %1, %for.cond1.preheader ], [ %2, %for.body3 ] %.fr.i = freeze i32 %4 %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %5 = sext i32 %.fr.i to i64 %cmp.not.not = icmp slt i64 %indvars.iv39, %5 br i1 %cmp.not.not, label %for.cond1.preheader, label %for.end9, !llvm.loop !16 for.end9: ; preds = %for.inc7 %cmp.not85.i = icmp slt i32 %.fr.i, 1 br i1 %cmp.not85.i, label %Prim.exit.thread, label %for.body.preheader.i Prim.exit.thread: ; preds = %for.end9, %entry store i32 0, ptr getelementptr inbounds ([101 x i32], ptr @d, i64 0, i64 1), align 4, !tbaa !5 br label %for.end17 for.body.preheader.i: ; preds = %for.end9 %6 = zext i32 %.fr.i to i64 %7 = shl nuw nsw i64 %6, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds ([101 x i32], ptr @pi, i64 0, i64 1), i8 -1, i64 %7, i1 false), !tbaa !5 %8 = add nuw i32 %.fr.i, 1 %wide.trip.count.i = zext i32 %8 to i64 %9 = add nsw i64 %wide.trip.count.i, -1 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %9, -8 %ind.end = or i64 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = or i64 %index, 1 %10 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %offset.idx store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %10, align 4, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 store <4 x i32> <i32 2001, i32 2001, i32 2001, i32 2001>, ptr %11, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !18 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %9, %n.vec br i1 %cmp.n, label %while.cond.preheader.i, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i, %middle.block %indvars.iv.i.ph = phi i64 [ 1, %for.body.preheader.i ], [ %ind.end, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv.i store i32 2001, 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, %wide.trip.count.i br i1 %exitcond.not.i, label %while.cond.preheader.i, label %for.body.i, !llvm.loop !19 while.cond.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr getelementptr inbounds ([101 x i32], ptr @d, i64 0, i64 1), align 4, !tbaa !5 br label %for.body7.i for.body7.i: ; preds = %for.body7.i.backedge, %while.cond.preheader.i %indvars.iv106.i = phi i64 [ 1, %while.cond.preheader.i ], [ %indvars.iv106.i.be, %for.body7.i.backedge ] %mincost.090.i = phi i32 [ 2001, %while.cond.preheader.i ], [ %mincost.090.i.be, %for.body7.i.backedge ] %u.189.i = phi i32 [ undef, %while.cond.preheader.i ], [ %u.2.i, %for.body7.i.backedge ] %arrayidx9.i = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv106.i %13 = load i32, ptr %arrayidx9.i, align 4, !tbaa !5 %cmp10.not.i = icmp eq i32 %13, 1 br i1 %cmp10.not.i, label %for.inc16.i, label %land.lhs.true.i land.lhs.true.i: ; preds = %for.body7.i %arrayidx12.i = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv106.i %14 = load i32, ptr %arrayidx12.i, align 4, !tbaa !5 %cmp13.i = icmp slt i32 %14, %mincost.090.i %15 = trunc i64 %indvars.iv106.i to i32 %spec.select.i = select i1 %cmp13.i, i32 %15, i32 %u.189.i %spec.select82.i = tail call i32 @llvm.smin.i32(i32 %14, i32 %mincost.090.i) br label %for.inc16.i for.inc16.i: ; preds = %land.lhs.true.i, %for.body7.i %u.2.i = phi i32 [ %u.189.i, %for.body7.i ], [ %spec.select.i, %land.lhs.true.i ] %mincost.1.i = phi i32 [ %mincost.090.i, %for.body7.i ], [ %spec.select82.i, %land.lhs.true.i ] %indvars.iv.next107.i = add nuw nsw i64 %indvars.iv106.i, 1 %exitcond110.not.i = icmp eq i64 %indvars.iv.next107.i, %wide.trip.count.i br i1 %exitcond110.not.i, label %for.cond5.for.end18_crit_edge.i, label %for.body7.i.backedge for.body7.i.backedge: ; preds = %for.inc54.i, %for.inc16.i %indvars.iv106.i.be = phi i64 [ %indvars.iv.next107.i, %for.inc16.i ], [ 1, %for.inc54.i ] %mincost.090.i.be = phi i32 [ %mincost.1.i, %for.inc16.i ], [ 2001, %for.inc54.i ] br label %for.body7.i, !llvm.loop !14 for.cond5.for.end18_crit_edge.i: ; preds = %for.inc16.i %cmp19.i = icmp eq i32 %mincost.1.i, 2001 br i1 %cmp19.i, label %Prim.exit, label %if.end21.i if.end21.i: ; preds = %for.cond5.for.end18_crit_edge.i %idxprom22.i = sext i32 %u.2.i to i64 %arrayidx23.i = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %idxprom22.i store i32 1, ptr %arrayidx23.i, align 4, !tbaa !5 br label %for.body26.i for.body26.i: ; preds = %for.inc54.i, %if.end21.i %indvars.iv111.i = phi i64 [ 1, %if.end21.i ], [ %indvars.iv.next112.i, %for.inc54.i ] %arrayidx28.i = getelementptr inbounds [101 x i32], ptr @color, i64 0, i64 %indvars.iv111.i %16 = load i32, ptr %arrayidx28.i, align 4, !tbaa !5 %cmp29.not.i = icmp eq i32 %16, 1 br i1 %cmp29.not.i, label %for.inc54.i, label %land.lhs.true30.i land.lhs.true30.i: ; preds = %for.body26.i %arrayidx34.i = getelementptr inbounds [101 x [101 x i32]], ptr @G, i64 0, i64 %idxprom22.i, i64 %indvars.iv111.i %17 = load i32, ptr %arrayidx34.i, align 4, !tbaa !5 %arrayidx36.i = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv111.i %18 = load i32, ptr %arrayidx36.i, align 4, !tbaa !5 %cmp37.i = icmp sge i32 %17, %18 %cmp43.not.i = icmp eq i32 %17, -1 %or.cond.i = or i1 %cmp43.not.i, %cmp37.i br i1 %or.cond.i, label %for.inc54.i, label %if.then44.i if.then44.i: ; preds = %land.lhs.true30.i %arrayidx46.i = getelementptr inbounds [101 x i32], ptr @pi, i64 0, i64 %indvars.iv111.i store i32 %u.2.i, ptr %arrayidx46.i, align 4, !tbaa !5 store i32 %17, ptr %arrayidx36.i, align 4, !tbaa !5 br label %for.inc54.i for.inc54.i: ; preds = %if.then44.i, %land.lhs.true30.i, %for.body26.i %indvars.iv.next112.i = add nuw nsw i64 %indvars.iv111.i, 1 %exitcond115.not.i = icmp eq i64 %indvars.iv.next112.i, %wide.trip.count.i br i1 %exitcond115.not.i, label %for.body7.i.backedge, label %for.body26.i, !llvm.loop !14 Prim.exit: ; preds = %for.cond5.for.end18_crit_edge.i br i1 %cmp.not85.i, label %for.end17, label %for.body12.preheader for.body12.preheader: ; preds = %Prim.exit %19 = add nuw i32 %.fr.i, 1 %wide.trip.count = zext i32 %19 to i64 %20 = add nsw i64 %wide.trip.count.i, -1 %min.iters.check55 = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check55, label %for.body12.preheader68, label %vector.ph56 vector.ph56: ; preds = %for.body12.preheader %n.vec58 = and i64 %20, -8 %ind.end59 = or i64 %n.vec58, 1 br label %vector.body62 vector.body62: ; preds = %vector.body62, %vector.ph56 %index63 = phi i64 [ 0, %vector.ph56 ], [ %index.next67, %vector.body62 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph56 ], [ %23, %vector.body62 ] %vec.phi64 = phi <4 x i32> [ zeroinitializer, %vector.ph56 ], [ %24, %vector.body62 ] %offset.idx65 = or i64 %index63, 1 %21 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %offset.idx65 %wide.load = load <4 x i32>, ptr %21, align 4, !tbaa !5 %22 = getelementptr inbounds i32, ptr %21, i64 4 %wide.load66 = load <4 x i32>, ptr %22, align 4, !tbaa !5 %23 = add <4 x i32> %wide.load, %vec.phi %24 = add <4 x i32> %wide.load66, %vec.phi64 %index.next67 = add nuw i64 %index63, 8 %25 = icmp eq i64 %index.next67, %n.vec58 br i1 %25, label %middle.block53, label %vector.body62, !llvm.loop !20 middle.block53: ; preds = %vector.body62 %bin.rdx = add <4 x i32> %24, %23 %26 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n61 = icmp eq i64 %20, %n.vec58 br i1 %cmp.n61, label %for.end17, label %for.body12.preheader68 for.body12.preheader68: ; preds = %for.body12.preheader, %middle.block53 %indvars.iv42.ph = phi i64 [ 1, %for.body12.preheader ], [ %ind.end59, %middle.block53 ] %sum.034.ph = phi i32 [ 0, %for.body12.preheader ], [ %26, %middle.block53 ] br label %for.body12 for.body12: ; preds = %for.body12.preheader68, %for.body12 %indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body12 ], [ %indvars.iv42.ph, %for.body12.preheader68 ] %sum.034 = phi i32 [ %add, %for.body12 ], [ %sum.034.ph, %for.body12.preheader68 ] %arrayidx14 = getelementptr inbounds [101 x i32], ptr @d, i64 0, i64 %indvars.iv42 %27 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %add = add nsw i32 %27, %sum.034 %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count br i1 %exitcond.not, label %for.end17, label %for.body12, !llvm.loop !21 for.end17: ; preds = %for.body12, %middle.block53, %Prim.exit.thread, %Prim.exit %sum.0.lcssa = phi i32 [ 0, %Prim.exit ], [ 0, %Prim.exit.thread ], [ %26, %middle.block53 ], [ %add, %for.body12 ] %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !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} !17 = !{!"llvm.loop.unswitch.partial.disable"} !18 = distinct !{!18, !10, !11, !12} !19 = distinct !{!19, !10, !12, !11} !20 = distinct !{!20, !10, !11, !12} !21 = distinct !{!21, !10, !12, !11}
#include<stdio.h> #define MAX 100 #define INFTY 9999999 #define WHITE 0 #define GRAY 1 #define BLACK 2 int n,M[MAX][MAX]; int i,v,j,e,b; int prim(){ int u,minv; int d[MAX],p[MAX],color[MAX]; int sum; for(i=0;i<n;i++){ d[i]=INFTY; p[i]=-1; color[i]=WHITE; } d[0] = 0; while(1){ minv = INFTY; u = -1; for(i=0;i<n;i++){ if(minv>d[i] && color[i] != BLACK){ u=i; minv=d[i]; } } if(u==-1)break; color[u]=BLACK; for(v=0;v<n;v++){ if(color[v]!=BLACK && M[u][v]!=INFTY){ if(d[v]>M[u][v]){ d[v]=M[u][v]; p[v]=u; color[v]=GRAY; } } } } sum = 0; for(i=0;i<n;i++){ if(p[i]!=-1)sum+=M[i][p[i]]; } return sum; } int main() { scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&e); M[i][j] = (e == -1) ? INFTY : e; } } printf("%d\n",prim()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199718/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199718/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @i = dso_local local_unnamed_addr global i32 0, align 4 @n = dso_local global i32 0, align 4 @v = dso_local local_unnamed_addr global i32 0, align 4 @M = 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 @j = dso_local local_unnamed_addr global i32 0, align 4 @e = dso_local global i32 0, align 4 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @b = dso_local local_unnamed_addr global i32 0, align 4 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #0 { entry: %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp94 = icmp sgt i32 %.fr, 0 br i1 %cmp94, label %for.body.preheader, label %for.end77 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 %p, i8 -1, i64 %2, i1 false), !tbaa !5 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.preheader167, 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 9999999, i32 9999999, i32 9999999, i32 9999999>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 9999999, i32 9999999, i32 9999999, i32 9999999>, 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 !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader167 for.body.preheader167: ; 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.preheader167, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader167 ] %arrayidx = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 9999999, 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 !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp94, label %while.cond.us.preheader, label %for.end77 while.cond.us.preheader: ; preds = %for.end %wide.trip.count153 = zext i32 %.fr to i64 %wide.trip.count158 = zext i32 %.fr to i64 br label %for.body8.us for.end19.us: ; preds = %for.inc17.us %cmp20.us = icmp eq i32 %u.1.us, -1 br i1 %cmp20.us, label %for.cond61.preheader, label %if.end22.us if.end22.us: ; preds = %for.end19.us %idxprom23.us = sext i32 %u.1.us to i64 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom23.us store i32 2, ptr %arrayidx24.us, align 4, !tbaa !5 br label %for.body27.us for.body27.us: ; preds = %if.end22.us, %for.inc58.us %indvars.iv155 = phi i64 [ 0, %if.end22.us ], [ %indvars.iv.next156, %for.inc58.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv155 %6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30.not.us = icmp eq i32 %6, 2 br i1 %cmp30.not.us, label %for.inc58.us, label %land.lhs.true31.us land.lhs.true31.us: ; preds = %for.body27.us %arrayidx35.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom23.us, i64 %indvars.iv155 %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %cmp36.not.us = icmp eq i32 %7, 9999999 br i1 %cmp36.not.us, label %for.inc58.us, label %if.then37.us if.then37.us: ; preds = %land.lhs.true31.us %arrayidx39.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv155 %8 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp44.us = icmp sgt i32 %8, %7 br i1 %cmp44.us, label %if.then45.us, label %for.inc58.us if.then45.us: ; preds = %if.then37.us store i32 %7, ptr %arrayidx39.us, align 4, !tbaa !5 %arrayidx53.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv155 store i32 %u.1.us, ptr %arrayidx53.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc58.us for.inc58.us: ; preds = %if.then45.us, %if.then37.us, %land.lhs.true31.us, %for.body27.us %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1 %exitcond159.not = icmp eq i64 %indvars.iv.next156, %wide.trip.count158 br i1 %exitcond159.not, label %for.cond25.while.cond.loopexit_crit_edge.us, label %for.body27.us, !llvm.loop !14 for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader %indvars.iv150 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv150.be, %for.body8.us.backedge ] %minv.0100.us = phi i32 [ 9999999, %while.cond.us.preheader ], [ %minv.0100.us.be, %for.body8.us.backedge ] %u.099.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.099.us.be, %for.body8.us.backedge ] %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv150 %9 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.us = icmp sgt i32 %minv.0100.us, %9 br i1 %cmp11.us, label %land.lhs.true.us, label %for.inc17.us land.lhs.true.us: ; preds = %for.body8.us %arrayidx13.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv150 %10 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.not.us = icmp eq i32 %10, 2 %11 = trunc i64 %indvars.iv150 to i32 %spec.select.us = select i1 %cmp14.not.us, i32 %u.099.us, i32 %11 %spec.select93.us = select i1 %cmp14.not.us, i32 %minv.0100.us, i32 %9 br label %for.inc17.us for.inc17.us: ; preds = %land.lhs.true.us, %for.body8.us %u.1.us = phi i32 [ %u.099.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ] %minv.1.us = phi i32 [ %minv.0100.us, %for.body8.us ], [ %spec.select93.us, %land.lhs.true.us ] %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1 %exitcond154.not = icmp eq i64 %indvars.iv.next151, %wide.trip.count153 br i1 %exitcond154.not, label %for.end19.us, label %for.body8.us.backedge for.body8.us.backedge: ; preds = %for.inc17.us, %for.cond25.while.cond.loopexit_crit_edge.us %indvars.iv150.be = phi i64 [ %indvars.iv.next151, %for.inc17.us ], [ 0, %for.cond25.while.cond.loopexit_crit_edge.us ] %minv.0100.us.be = phi i32 [ %minv.1.us, %for.inc17.us ], [ 9999999, %for.cond25.while.cond.loopexit_crit_edge.us ] %u.099.us.be = phi i32 [ %u.1.us, %for.inc17.us ], [ -1, %for.cond25.while.cond.loopexit_crit_edge.us ] br label %for.body8.us, !llvm.loop !15 for.cond25.while.cond.loopexit_crit_edge.us: ; preds = %for.inc58.us store i32 %.fr, ptr @v, align 4, !tbaa !5 br label %for.body8.us.backedge for.cond61.preheader: ; preds = %for.end19.us br i1 %cmp94, label %for.body63.preheader, label %for.end77 for.body63.preheader: ; preds = %for.cond61.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end77.loopexit.unr-lcssa, label %for.body63.preheader.new for.body63.preheader.new: ; preds = %for.body63.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body63 for.body63: ; preds = %for.inc75.1, %for.body63.preheader.new %indvars.iv160 = phi i64 [ 0, %for.body63.preheader.new ], [ %indvars.iv.next161.1, %for.inc75.1 ] %sum.0140 = phi i32 [ 0, %for.body63.preheader.new ], [ %sum.1.1, %for.inc75.1 ] %niter = phi i64 [ 0, %for.body63.preheader.new ], [ %niter.next.1, %for.inc75.1 ] %arrayidx65 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv160 %13 = load i32, ptr %arrayidx65, align 8, !tbaa !5 %cmp66.not = icmp eq i32 %13, -1 br i1 %cmp66.not, label %for.inc75, label %if.then67 if.then67: ; preds = %for.body63 %idxprom72 = sext i32 %13 to i64 %arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv160, i64 %idxprom72 %14 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0140 br label %for.inc75 for.inc75: ; preds = %for.body63, %if.then67 %sum.1 = phi i32 [ %add, %if.then67 ], [ %sum.0140, %for.body63 ] %indvars.iv.next161 = or i64 %indvars.iv160, 1 %arrayidx65.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next161 %15 = load i32, ptr %arrayidx65.1, align 4, !tbaa !5 %cmp66.not.1 = icmp eq i32 %15, -1 br i1 %cmp66.not.1, label %for.inc75.1, label %if.then67.1 if.then67.1: ; preds = %for.inc75 %idxprom72.1 = sext i32 %15 to i64 %arrayidx73.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next161, i64 %idxprom72.1 %16 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc75.1 for.inc75.1: ; preds = %if.then67.1, %for.inc75 %sum.1.1 = phi i32 [ %add.1, %if.then67.1 ], [ %sum.1, %for.inc75 ] %indvars.iv.next161.1 = add nuw nsw i64 %indvars.iv160, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end77.loopexit.unr-lcssa, label %for.body63, !llvm.loop !16 for.end77.loopexit.unr-lcssa: ; preds = %for.inc75.1, %for.body63.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %indvars.iv160.unr = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next161.1, %for.inc75.1 ] %sum.0140.unr = phi i32 [ 0, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end77, label %for.body63.epil for.body63.epil: ; preds = %for.end77.loopexit.unr-lcssa %arrayidx65.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv160.unr %17 = load i32, ptr %arrayidx65.epil, align 4, !tbaa !5 %cmp66.not.epil = icmp eq i32 %17, -1 br i1 %cmp66.not.epil, label %for.end77, label %if.then67.epil if.then67.epil: ; preds = %for.body63.epil %idxprom72.epil = sext i32 %17 to i64 %arrayidx73.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv160.unr, i64 %idxprom72.epil %18 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0140.unr br label %for.end77 for.end77: ; preds = %for.end77.loopexit.unr-lcssa, %if.then67.epil, %for.body63.epil, %for.end, %entry, %for.cond61.preheader %storemerge92.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %entry ], [ 0, %for.end ], [ %.fr, %for.body63.epil ], [ %.fr, %if.then67.epil ], [ %.fr, %for.end77.loopexit.unr-lcssa ] %sum.0.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %entry ], [ 0, %for.end ], [ %sum.1.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %add.epil, %if.then67.epil ], [ %sum.0140.unr, %for.body63.epil ] store i32 %storemerge92.lcssa, ptr @i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) store i32 0, ptr @i, align 4, !tbaa !5 %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %0, 0 br i1 %cmp15, label %for.cond1.preheader, label %for.end10 for.cond1.preheader: ; preds = %entry, %for.inc8 %1 = phi i32 [ %7, %for.inc8 ], [ %0, %entry ] %2 = phi i32 [ %inc9, %for.inc8 ], [ 0, %entry ] store i32 0, ptr @j, align 4, !tbaa !5 %cmp214 = icmp sgt i32 %1, 0 br i1 %cmp214, label %for.body3, label %for.inc8 for.body3: ; preds = %for.cond1.preheader, %for.body3 %call4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @e) %3 = load i32, ptr @e, align 4 %cmp5 = icmp eq i32 %3, -1 %cond = select i1 %cmp5, i32 9999999, i32 %3 %4 = load i32, ptr @i, align 4, !tbaa !5 %idxprom = sext i32 %4 to i64 %5 = load i32, ptr @j, align 4, !tbaa !5 %idxprom6 = sext i32 %5 to i64 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom, i64 %idxprom6 store i32 %cond, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nsw i32 %5, 1 store i32 %inc, ptr @j, align 4, !tbaa !5 %6 = load i32, ptr @n, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc, %6 br i1 %cmp2, label %for.body3, label %for.inc8, !llvm.loop !17 for.inc8: ; preds = %for.body3, %for.cond1.preheader %7 = phi i32 [ %1, %for.cond1.preheader ], [ %6, %for.body3 ] %8 = phi i32 [ %2, %for.cond1.preheader ], [ %4, %for.body3 ] %inc9 = add nsw i32 %8, 1 store i32 %inc9, ptr @i, align 4, !tbaa !5 %cmp = icmp slt i32 %inc9, %7 br i1 %cmp, label %for.cond1.preheader, label %for.end10, !llvm.loop !18 for.end10: ; preds = %for.inc8, %entry %call11 = tail call i32 @prim() %call12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call11) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; 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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !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} !18 = distinct !{!18, !10, !19} !19 = !{!"llvm.loop.unswitch.partial.disable"}
#include <stdio.h> #define N 100 #define MAX 10000000 #define W 0 #define B 1 int n,c[N],A[N][N],X[N],Y[N]; void prim(){ int m,i,j; for(i=0;i<n;i++){ X[i]=MAX; Y[i]=-1; c[i]=W; } X[0]=0; while(1){ m=MAX; for(i=0;i<n;i++){ if(c[i]!=B && X[i]<m){ m=X[i]; j=i; } } if(m==MAX) break; c[j]=B; for(i=0;i<n;i++){ if(c[i]!=B && A[j][i]<X[i] && A[j][i]>=0){ Y[i]=j; X[i]=A[j][i]; } } } } int main(){ int i,j,count=0; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&A[i][j]); } } prim(); for(i=0;i<n;i++)count+=X[i]; printf("%d\n",count); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199761/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199761/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @n = dso_local global i32 0, align 4 @X = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @Y = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @c = dso_local local_unnamed_addr global [100 x i32] zeroinitializer, align 16 @A = dso_local 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 [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @prim() local_unnamed_addr #0 { entry: %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp83 = icmp sgt i32 %.fr, 0 br i1 %cmp83, label %for.body.preheader, label %for.end.thread for.end.thread: ; preds = %entry store i32 0, ptr @X, align 16, !tbaa !5 br label %while.end for.body.preheader: ; preds = %entry %1 = zext i32 %.fr to i64 %2 = shl nuw nsw i64 %1, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @Y, i8 -1, i64 %2, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @c, i8 0, i64 %2, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr, 8 br i1 %min.iters.check, label %for.body.preheader140, 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 @X, i64 0, i64 %index store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, 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 !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader140 for.body.preheader140: ; 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.preheader140, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader140 ] %arrayidx = getelementptr inbounds [100 x i32], ptr @X, i64 0, i64 %indvars.iv store i32 10000000, 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 !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr @X, align 16, !tbaa !5 br i1 %cmp83, label %while.cond.us.preheader, label %while.end while.cond.us.preheader: ; preds = %for.end %wide.trip.count133 = zext i32 %.fr to i64 %wide.trip.count138 = zext i32 %.fr to i64 br label %for.body7.us for.end18.us: ; preds = %for.inc16.us %cmp19.us = icmp eq i32 %m.1.us, 10000000 br i1 %cmp19.us, label %while.end, label %if.end21.us if.end21.us: ; preds = %for.end18.us %idxprom22.us = sext i32 %j.2.us to i64 %arrayidx23.us = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %idxprom22.us store i32 1, ptr %arrayidx23.us, align 4, !tbaa !5 br label %for.body26.us for.body26.us: ; preds = %if.end21.us, %for.inc54.us %indvars.iv135 = phi i64 [ 0, %if.end21.us ], [ %indvars.iv.next136, %for.inc54.us ] %arrayidx28.us = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv135 %6 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5 %cmp29.not.us = icmp eq i32 %6, 1 br i1 %cmp29.not.us, label %for.inc54.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.iv135 %7 = load i32, ptr %arrayidx34.us, align 4, !tbaa !5 %arrayidx36.us = getelementptr inbounds [100 x i32], ptr @X, i64 0, i64 %indvars.iv135 %8 = load i32, ptr %arrayidx36.us, align 4, !tbaa !5 %cmp37.us = icmp slt i32 %7, %8 %cmp43.us = icmp sgt i32 %7, -1 %or.cond.us = and i1 %cmp43.us, %cmp37.us br i1 %or.cond.us, label %if.then44.us, label %for.inc54.us if.then44.us: ; preds = %land.lhs.true30.us %arrayidx46.us = getelementptr inbounds [100 x i32], ptr @Y, i64 0, i64 %indvars.iv135 store i32 %j.2.us, ptr %arrayidx46.us, align 4, !tbaa !5 store i32 %7, ptr %arrayidx36.us, align 4, !tbaa !5 br label %for.inc54.us for.inc54.us: ; preds = %if.then44.us, %land.lhs.true30.us, %for.body26.us %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1 %exitcond139.not = icmp eq i64 %indvars.iv.next136, %wide.trip.count138 br i1 %exitcond139.not, label %for.body7.us.backedge, label %for.body26.us, !llvm.loop !14 for.body7.us: ; preds = %for.body7.us.backedge, %while.cond.us.preheader %indvars.iv130 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv130.be, %for.body7.us.backedge ] %j.188.us = phi i32 [ undef, %while.cond.us.preheader ], [ %j.2.us, %for.body7.us.backedge ] %m.086.us = phi i32 [ 10000000, %while.cond.us.preheader ], [ %m.086.us.be, %for.body7.us.backedge ] %arrayidx9.us = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv130 %9 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5 %cmp10.not.us = icmp eq i32 %9, 1 br i1 %cmp10.not.us, label %for.inc16.us, label %land.lhs.true.us land.lhs.true.us: ; preds = %for.body7.us %arrayidx12.us = getelementptr inbounds [100 x i32], ptr @X, i64 0, i64 %indvars.iv130 %10 = load i32, ptr %arrayidx12.us, align 4, !tbaa !5 %cmp13.us = icmp slt i32 %10, %m.086.us %spec.select.us = tail call i32 @llvm.smin.i32(i32 %10, i32 %m.086.us) %11 = trunc i64 %indvars.iv130 to i32 %spec.select82.us = select i1 %cmp13.us, i32 %11, i32 %j.188.us br label %for.inc16.us for.inc16.us: ; preds = %land.lhs.true.us, %for.body7.us %m.1.us = phi i32 [ %m.086.us, %for.body7.us ], [ %spec.select.us, %land.lhs.true.us ] %j.2.us = phi i32 [ %j.188.us, %for.body7.us ], [ %spec.select82.us, %land.lhs.true.us ] %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1 %exitcond134.not = icmp eq i64 %indvars.iv.next131, %wide.trip.count133 br i1 %exitcond134.not, label %for.end18.us, label %for.body7.us.backedge for.body7.us.backedge: ; preds = %for.inc54.us, %for.inc16.us %indvars.iv130.be = phi i64 [ %indvars.iv.next131, %for.inc16.us ], [ 0, %for.inc54.us ] %m.086.us.be = phi i32 [ %m.1.us, %for.inc16.us ], [ 10000000, %for.inc54.us ] br label %for.body7.us, !llvm.loop !14 while.end: ; preds = %for.end18.us, %for.end, %for.end.thread ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i29 = freeze i32 %0 %cmp30 = icmp sgt i32 %.fr.i29, 0 br i1 %cmp30, label %for.cond1.preheader, label %prim.exit.thread for.cond1.preheader: ; preds = %entry, %for.inc7 %1 = phi i32 [ %.fr.i, %for.inc7 ], [ %.fr.i29, %entry ] %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.inc7 ], [ 0, %entry ] %cmp227 = icmp sgt i32 %1, 0 br i1 %cmp227, label %for.body3, label %for.inc7 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv39, i64 %indvars.iv %call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %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 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body3, label %for.inc7, !llvm.loop !15 for.inc7: ; preds = %for.body3, %for.cond1.preheader %4 = phi i32 [ %1, %for.cond1.preheader ], [ %2, %for.body3 ] %.fr.i = freeze i32 %4 %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %5 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next40, %5 br i1 %cmp, label %for.cond1.preheader, label %for.end9, !llvm.loop !16 for.end9: ; preds = %for.inc7 %cmp83.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp83.i, label %for.body.preheader.i, label %prim.exit.thread prim.exit.thread: ; preds = %for.end9, %entry store i32 0, ptr @X, align 16, !tbaa !5 br label %for.end17 for.body.preheader.i: ; preds = %for.end9 %6 = zext i32 %.fr.i to i64 %7 = shl nuw nsw i64 %6, 2 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @Y, i8 -1, i64 %7, i1 false), !tbaa !5 tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @c, i8 0, i64 %7, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %6, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %8 = getelementptr inbounds [100 x i32], ptr @X, i64 0, i64 %index store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr %8, align 16, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 store <4 x i32> <i32 10000000, i32 10000000, i32 10000000, i32 10000000>, ptr %9, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %10 = icmp eq i64 %index.next, %n.vec br i1 %10, label %middle.block, label %vector.body, !llvm.loop !18 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %6 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.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr @X, i64 0, i64 %indvars.iv.i store i32 10000000, 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, %6 br i1 %exitcond.not.i, label %while.cond.us.preheader.i, label %for.body.i, !llvm.loop !19 while.cond.us.preheader.i: ; preds = %for.body.i, %middle.block store i32 0, ptr @X, align 16, !tbaa !5 br label %for.body7.us.i for.end18.us.i: ; preds = %for.inc16.us.i %cmp19.us.i = icmp eq i32 %m.1.us.i, 10000000 br i1 %cmp19.us.i, label %prim.exit, label %if.end21.us.i if.end21.us.i: ; preds = %for.end18.us.i %idxprom22.us.i = sext i32 %j.2.us.i to i64 %arrayidx23.us.i = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %idxprom22.us.i store i32 1, ptr %arrayidx23.us.i, align 4, !tbaa !5 br label %for.body26.us.i for.body26.us.i: ; preds = %for.inc54.us.i, %if.end21.us.i %indvars.iv135.i = phi i64 [ 0, %if.end21.us.i ], [ %indvars.iv.next136.i, %for.inc54.us.i ] %arrayidx28.us.i = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv135.i %11 = load i32, ptr %arrayidx28.us.i, align 4, !tbaa !5 %cmp29.not.us.i = icmp eq i32 %11, 1 br i1 %cmp29.not.us.i, label %for.inc54.us.i, label %land.lhs.true30.us.i land.lhs.true30.us.i: ; preds = %for.body26.us.i %arrayidx34.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom22.us.i, i64 %indvars.iv135.i %12 = load i32, ptr %arrayidx34.us.i, align 4, !tbaa !5 %arrayidx36.us.i = getelementptr inbounds [100 x i32], ptr @X, i64 0, i64 %indvars.iv135.i %13 = load i32, ptr %arrayidx36.us.i, align 4, !tbaa !5 %cmp37.us.i = icmp slt i32 %12, %13 %cmp43.us.i = icmp sgt i32 %12, -1 %or.cond.us.i = and i1 %cmp43.us.i, %cmp37.us.i br i1 %or.cond.us.i, label %if.then44.us.i, label %for.inc54.us.i if.then44.us.i: ; preds = %land.lhs.true30.us.i %arrayidx46.us.i = getelementptr inbounds [100 x i32], ptr @Y, i64 0, i64 %indvars.iv135.i store i32 %j.2.us.i, ptr %arrayidx46.us.i, align 4, !tbaa !5 store i32 %12, ptr %arrayidx36.us.i, align 4, !tbaa !5 br label %for.inc54.us.i for.inc54.us.i: ; preds = %if.then44.us.i, %land.lhs.true30.us.i, %for.body26.us.i %indvars.iv.next136.i = add nuw nsw i64 %indvars.iv135.i, 1 %exitcond139.not.i = icmp eq i64 %indvars.iv.next136.i, %6 br i1 %exitcond139.not.i, label %for.body7.us.i.backedge, label %for.body26.us.i, !llvm.loop !14 for.body7.us.i: ; preds = %for.body7.us.i.backedge, %while.cond.us.preheader.i %indvars.iv130.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv130.i.be, %for.body7.us.i.backedge ] %j.188.us.i = phi i32 [ undef, %while.cond.us.preheader.i ], [ %j.2.us.i, %for.body7.us.i.backedge ] %m.086.us.i = phi i32 [ 10000000, %while.cond.us.preheader.i ], [ %m.086.us.i.be, %for.body7.us.i.backedge ] %arrayidx9.us.i = getelementptr inbounds [100 x i32], ptr @c, i64 0, i64 %indvars.iv130.i %14 = load i32, ptr %arrayidx9.us.i, align 4, !tbaa !5 %cmp10.not.us.i = icmp eq i32 %14, 1 br i1 %cmp10.not.us.i, label %for.inc16.us.i, label %land.lhs.true.us.i land.lhs.true.us.i: ; preds = %for.body7.us.i %arrayidx12.us.i = getelementptr inbounds [100 x i32], ptr @X, i64 0, i64 %indvars.iv130.i %15 = load i32, ptr %arrayidx12.us.i, align 4, !tbaa !5 %cmp13.us.i = icmp slt i32 %15, %m.086.us.i %spec.select.us.i = tail call i32 @llvm.smin.i32(i32 %15, i32 %m.086.us.i) %16 = trunc i64 %indvars.iv130.i to i32 %spec.select82.us.i = select i1 %cmp13.us.i, i32 %16, i32 %j.188.us.i br label %for.inc16.us.i for.inc16.us.i: ; preds = %land.lhs.true.us.i, %for.body7.us.i %m.1.us.i = phi i32 [ %m.086.us.i, %for.body7.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %j.2.us.i = phi i32 [ %j.188.us.i, %for.body7.us.i ], [ %spec.select82.us.i, %land.lhs.true.us.i ] %indvars.iv.next131.i = add nuw nsw i64 %indvars.iv130.i, 1 %exitcond134.not.i = icmp eq i64 %indvars.iv.next131.i, %6 br i1 %exitcond134.not.i, label %for.end18.us.i, label %for.body7.us.i.backedge for.body7.us.i.backedge: ; preds = %for.inc54.us.i, %for.inc16.us.i %indvars.iv130.i.be = phi i64 [ %indvars.iv.next131.i, %for.inc16.us.i ], [ 0, %for.inc54.us.i ] %m.086.us.i.be = phi i32 [ %m.1.us.i, %for.inc16.us.i ], [ 10000000, %for.inc54.us.i ] br label %for.body7.us.i, !llvm.loop !14 prim.exit: ; preds = %for.end18.us.i br i1 %cmp83.i, label %for.body12.preheader, label %for.end17 for.body12.preheader: ; preds = %prim.exit %wide.trip.count = zext i32 %.fr.i to i64 %min.iters.check55 = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check55, label %for.body12.preheader66, label %vector.ph56 vector.ph56: ; preds = %for.body12.preheader %n.vec58 = and i64 %6, 4294967288 br label %vector.body61 vector.body61: ; preds = %vector.body61, %vector.ph56 %index62 = phi i64 [ 0, %vector.ph56 ], [ %index.next65, %vector.body61 ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph56 ], [ %19, %vector.body61 ] %vec.phi63 = phi <4 x i32> [ zeroinitializer, %vector.ph56 ], [ %20, %vector.body61 ] %17 = getelementptr inbounds [100 x i32], ptr @X, i64 0, i64 %index62 %wide.load = load <4 x i32>, ptr %17, align 16, !tbaa !5 %18 = getelementptr inbounds i32, ptr %17, i64 4 %wide.load64 = load <4 x i32>, ptr %18, align 16, !tbaa !5 %19 = add <4 x i32> %wide.load, %vec.phi %20 = add <4 x i32> %wide.load64, %vec.phi63 %index.next65 = add nuw i64 %index62, 8 %21 = icmp eq i64 %index.next65, %n.vec58 br i1 %21, label %middle.block53, label %vector.body61, !llvm.loop !20 middle.block53: ; preds = %vector.body61 %bin.rdx = add <4 x i32> %20, %19 %22 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n60 = icmp eq i64 %n.vec58, %6 br i1 %cmp.n60, label %for.end17, label %for.body12.preheader66 for.body12.preheader66: ; preds = %for.body12.preheader, %middle.block53 %indvars.iv42.ph = phi i64 [ 0, %for.body12.preheader ], [ %n.vec58, %middle.block53 ] %count.034.ph = phi i32 [ 0, %for.body12.preheader ], [ %22, %middle.block53 ] br label %for.body12 for.body12: ; preds = %for.body12.preheader66, %for.body12 %indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body12 ], [ %indvars.iv42.ph, %for.body12.preheader66 ] %count.034 = phi i32 [ %add, %for.body12 ], [ %count.034.ph, %for.body12.preheader66 ] %arrayidx14 = getelementptr inbounds [100 x i32], ptr @X, i64 0, i64 %indvars.iv42 %23 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %add = add nsw i32 %23, %count.034 %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %exitcond.not = icmp eq i64 %indvars.iv.next43, %wide.trip.count br i1 %exitcond.not, label %for.end17, label %for.body12, !llvm.loop !21 for.end17: ; preds = %for.body12, %middle.block53, %prim.exit.thread, %prim.exit %count.0.lcssa = phi i32 [ 0, %prim.exit ], [ 0, %prim.exit.thread ], [ %22, %middle.block53 ], [ %add, %for.body12 ] %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !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} !17 = !{!"llvm.loop.unswitch.partial.disable"} !18 = distinct !{!18, !10, !11, !12} !19 = distinct !{!19, !10, !12, !11} !20 = distinct !{!20, !10, !11, !12} !21 = distinct !{!21, !10, !12, !11}
#include<stdio.h> #define N 500 static const int INFTY = (1<<21); int main(){ int t,i,j,f,l,q,sum,minv; int A[N][N],d[N],h[N],w[N]; scanf("%d",&t); for(i=0;i<t;i++){ for(j=0;j<t;j++){ scanf("%d", &q); A[i][j] = (q==-1)?INFTY:q; } } for(i=0; i<t; i++){ d[i]=INFTY; h[i]=-1; w[i]=0; } d[0]=0; while(1){ minv=INFTY; f=-1; for(i=0; i<t; i++){ if(minv>d[i] && !w[i]){ f=i; minv=d[i]; } } if(f==-1) break; w[f]=1; for(l=0;l<t;l++){ if(!w[l]&&A[f][l] != INFTY ){ if(d[l]>A[f][l]){ d[l]= A[f][l]; h[l]=f; } } } } sum=0; for(i=0;i<t;i++){ if(h[i]!=-1){ sum += A[i][h[i]]; } } printf("%d\n",sum); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199804/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199804/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %q = alloca i32, align 4 %A = alloca [500 x [500 x i32]], align 16 %d = alloca [500 x i32], align 16 %h = alloca [500 x i32], align 16 %w = alloca [500 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.start.p0(i64 1000000, ptr nonnull %A) #4 call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %d) #4 call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %h) #4 call void @llvm.lifetime.start.p0(i64 2000, ptr nonnull %w) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %cmp133 = icmp sgt i32 %0, 0 br i1 %cmp133, label %for.cond1.preheader, label %for.cond11.preheader for.cond1.preheader: ; preds = %entry, %for.inc8 %1 = phi i32 [ %10, %for.inc8 ], [ %0, %entry ] %indvars.iv179 = phi i64 [ %indvars.iv.next180, %for.inc8 ], [ 0, %entry ] %cmp2131 = icmp sgt i32 %1, 0 br i1 %cmp2131, label %for.body3, label %for.cond1.preheader.for.inc8_crit_edge for.cond1.preheader.for.inc8_crit_edge: ; preds = %for.cond1.preheader %.pre = sext i32 %1 to i64 br label %for.inc8 for.cond11.preheader: ; preds = %for.inc8, %entry %.lcssa = phi i32 [ %0, %entry ], [ %10, %for.inc8 ] %.lcssa.fr = freeze i32 %.lcssa %cmp12135 = icmp sgt i32 %.lcssa.fr, 0 br i1 %cmp12135, label %for.body13.preheader, label %for.end92 for.body13.preheader: ; preds = %for.cond11.preheader %2 = zext i32 %.lcssa.fr to i64 %3 = shl nuw nsw i64 %2, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %h, i8 -1, i64 %3, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %w, i8 0, i64 %3, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.lcssa.fr, 8 br i1 %min.iters.check, label %for.body13.preheader211, label %vector.ph vector.ph: ; preds = %for.body13.preheader %n.vec = and i64 %2, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %4 = getelementptr inbounds [500 x i32], ptr %d, i64 0, i64 %index store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %4, align 16, !tbaa !5 %5 = getelementptr inbounds i32, ptr %4, i64 4 store <4 x i32> <i32 2097152, i32 2097152, i32 2097152, i32 2097152>, ptr %5, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %2 br i1 %cmp.n, label %for.end22, label %for.body13.preheader211 for.body13.preheader211: ; preds = %for.body13.preheader, %middle.block %indvars.iv182.ph = phi i64 [ 0, %for.body13.preheader ], [ %n.vec, %middle.block ] br label %for.body13 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q) %7 = load i32, ptr %q, align 4 %cmp5 = icmp eq i32 %7, -1 %cond = select i1 %cmp5, i32 2097152, i32 %7 %arrayidx7 = getelementptr inbounds [500 x [500 x i32]], ptr %A, i64 0, i64 %indvars.iv179, i64 %indvars.iv store i32 %cond, ptr %arrayidx7, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %t, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc8, !llvm.loop !13 for.inc8: ; preds = %for.body3, %for.cond1.preheader.for.inc8_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc8_crit_edge ], [ %9, %for.body3 ] %10 = phi i32 [ %1, %for.cond1.preheader.for.inc8_crit_edge ], [ %8, %for.body3 ] %indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1 %cmp = icmp slt i64 %indvars.iv.next180, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.cond11.preheader, !llvm.loop !14 for.body13: ; preds = %for.body13.preheader211, %for.body13 %indvars.iv182 = phi i64 [ %indvars.iv.next183, %for.body13 ], [ %indvars.iv182.ph, %for.body13.preheader211 ] %arrayidx15 = getelementptr inbounds [500 x i32], ptr %d, i64 0, i64 %indvars.iv182 store i32 2097152, ptr %arrayidx15, align 4, !tbaa !5 %indvars.iv.next183 = add nuw nsw i64 %indvars.iv182, 1 %exitcond.not = icmp eq i64 %indvars.iv.next183, %2 br i1 %exitcond.not, label %for.end22, label %for.body13, !llvm.loop !16 for.end22: ; preds = %for.body13, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp12135, label %while.cond.us.preheader, label %for.end92 while.cond.us.preheader: ; preds = %for.end22 %wide.trip.count193 = zext i32 %.lcssa.fr to i64 %wide.trip.count198 = zext i32 %.lcssa.fr to i64 br label %for.body26.us for.end36.us: ; preds = %for.inc34.us %cmp37.us = icmp eq i32 %f.1.us, -1 br i1 %cmp37.us, label %for.cond76.preheader, label %if.end39.us if.end39.us: ; preds = %for.end36.us %idxprom40.us = sext i32 %f.1.us to i64 %arrayidx41.us = getelementptr inbounds [500 x i32], ptr %w, i64 0, i64 %idxprom40.us store i32 1, ptr %arrayidx41.us, align 4, !tbaa !5 br label %for.body44.us for.body44.us: ; preds = %if.end39.us, %for.inc73.us %indvars.iv195 = phi i64 [ 0, %if.end39.us ], [ %indvars.iv.next196, %for.inc73.us ] %arrayidx46.us = getelementptr inbounds [500 x i32], ptr %w, i64 0, i64 %indvars.iv195 %11 = load i32, ptr %arrayidx46.us, align 4, !tbaa !5 %tobool47.not.us = icmp eq i32 %11, 0 br i1 %tobool47.not.us, label %land.lhs.true48.us, label %for.inc73.us land.lhs.true48.us: ; preds = %for.body44.us %arrayidx52.us = getelementptr inbounds [500 x [500 x i32]], ptr %A, i64 0, i64 %idxprom40.us, i64 %indvars.iv195 %12 = load i32, ptr %arrayidx52.us, align 4, !tbaa !5 %cmp53.not.us = icmp eq i32 %12, 2097152 br i1 %cmp53.not.us, label %for.inc73.us, label %if.then54.us if.then54.us: ; preds = %land.lhs.true48.us %arrayidx56.us = getelementptr inbounds [500 x i32], ptr %d, i64 0, i64 %indvars.iv195 %13 = load i32, ptr %arrayidx56.us, align 4, !tbaa !5 %cmp61.us = icmp sgt i32 %13, %12 br i1 %cmp61.us, label %if.then62.us, label %for.inc73.us if.then62.us: ; preds = %if.then54.us store i32 %12, ptr %arrayidx56.us, align 4, !tbaa !5 %arrayidx70.us = getelementptr inbounds [500 x i32], ptr %h, i64 0, i64 %indvars.iv195 store i32 %f.1.us, ptr %arrayidx70.us, align 4, !tbaa !5 br label %for.inc73.us for.inc73.us: ; preds = %if.then62.us, %if.then54.us, %land.lhs.true48.us, %for.body44.us %indvars.iv.next196 = add nuw nsw i64 %indvars.iv195, 1 %exitcond199.not = icmp eq i64 %indvars.iv.next196, %wide.trip.count198 br i1 %exitcond199.not, label %for.body26.us.backedge, label %for.body44.us, !llvm.loop !17 for.body26.us: ; preds = %for.body26.us.backedge, %while.cond.us.preheader %indvars.iv190 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv190.be, %for.body26.us.backedge ] %minv.0140.us = phi i32 [ 2097152, %while.cond.us.preheader ], [ %minv.0140.us.be, %for.body26.us.backedge ] %f.0139.us = phi i32 [ -1, %while.cond.us.preheader ], [ %f.0139.us.be, %for.body26.us.backedge ] %arrayidx28.us = getelementptr inbounds [500 x i32], ptr %d, i64 0, i64 %indvars.iv190 %14 = load i32, ptr %arrayidx28.us, align 4, !tbaa !5 %cmp29.us = icmp sgt i32 %minv.0140.us, %14 br i1 %cmp29.us, label %land.lhs.true.us, label %for.inc34.us land.lhs.true.us: ; preds = %for.body26.us %arrayidx31.us = getelementptr inbounds [500 x i32], ptr %w, i64 0, i64 %indvars.iv190 %15 = load i32, ptr %arrayidx31.us, align 4, !tbaa !5 %tobool.not.us = icmp eq i32 %15, 0 %16 = trunc i64 %indvars.iv190 to i32 %spec.select.us = select i1 %tobool.not.us, i32 %16, i32 %f.0139.us %spec.select130.us = select i1 %tobool.not.us, i32 %14, i32 %minv.0140.us br label %for.inc34.us for.inc34.us: ; preds = %land.lhs.true.us, %for.body26.us %f.1.us = phi i32 [ %f.0139.us, %for.body26.us ], [ %spec.select.us, %land.lhs.true.us ] %minv.1.us = phi i32 [ %minv.0140.us, %for.body26.us ], [ %spec.select130.us, %land.lhs.true.us ] %indvars.iv.next191 = add nuw nsw i64 %indvars.iv190, 1 %exitcond194.not = icmp eq i64 %indvars.iv.next191, %wide.trip.count193 br i1 %exitcond194.not, label %for.end36.us, label %for.body26.us.backedge for.body26.us.backedge: ; preds = %for.inc73.us, %for.inc34.us %indvars.iv190.be = phi i64 [ %indvars.iv.next191, %for.inc34.us ], [ 0, %for.inc73.us ] %minv.0140.us.be = phi i32 [ %minv.1.us, %for.inc34.us ], [ 2097152, %for.inc73.us ] %f.0139.us.be = phi i32 [ %f.1.us, %for.inc34.us ], [ -1, %for.inc73.us ] br label %for.body26.us, !llvm.loop !17 for.cond76.preheader: ; preds = %for.end36.us br i1 %cmp12135, label %for.body78.preheader, label %for.end92 for.body78.preheader: ; preds = %for.cond76.preheader %xtraiter = and i64 %2, 1 %17 = icmp eq i32 %.lcssa.fr, 1 br i1 %17, label %for.end92.loopexit.unr-lcssa, label %for.body78.preheader.new for.body78.preheader.new: ; preds = %for.body78.preheader %unroll_iter = and i64 %2, 4294967294 br label %for.body78 for.body78: ; preds = %for.inc90.1, %for.body78.preheader.new %indvars.iv200 = phi i64 [ 0, %for.body78.preheader.new ], [ %indvars.iv.next201.1, %for.inc90.1 ] %sum.0173 = phi i32 [ 0, %for.body78.preheader.new ], [ %sum.1.1, %for.inc90.1 ] %niter = phi i64 [ 0, %for.body78.preheader.new ], [ %niter.next.1, %for.inc90.1 ] %arrayidx80 = getelementptr inbounds [500 x i32], ptr %h, i64 0, i64 %indvars.iv200 %18 = load i32, ptr %arrayidx80, align 8, !tbaa !5 %cmp81.not = icmp eq i32 %18, -1 br i1 %cmp81.not, label %for.inc90, label %if.then82 if.then82: ; preds = %for.body78 %idxprom87 = sext i32 %18 to i64 %arrayidx88 = getelementptr inbounds [500 x [500 x i32]], ptr %A, i64 0, i64 %indvars.iv200, i64 %idxprom87 %19 = load i32, ptr %arrayidx88, align 4, !tbaa !5 %add = add nsw i32 %19, %sum.0173 br label %for.inc90 for.inc90: ; preds = %for.body78, %if.then82 %sum.1 = phi i32 [ %add, %if.then82 ], [ %sum.0173, %for.body78 ] %indvars.iv.next201 = or i64 %indvars.iv200, 1 %arrayidx80.1 = getelementptr inbounds [500 x i32], ptr %h, i64 0, i64 %indvars.iv.next201 %20 = load i32, ptr %arrayidx80.1, align 4, !tbaa !5 %cmp81.not.1 = icmp eq i32 %20, -1 br i1 %cmp81.not.1, label %for.inc90.1, label %if.then82.1 if.then82.1: ; preds = %for.inc90 %idxprom87.1 = sext i32 %20 to i64 %arrayidx88.1 = getelementptr inbounds [500 x [500 x i32]], ptr %A, i64 0, i64 %indvars.iv.next201, i64 %idxprom87.1 %21 = load i32, ptr %arrayidx88.1, align 4, !tbaa !5 %add.1 = add nsw i32 %21, %sum.1 br label %for.inc90.1 for.inc90.1: ; preds = %if.then82.1, %for.inc90 %sum.1.1 = phi i32 [ %add.1, %if.then82.1 ], [ %sum.1, %for.inc90 ] %indvars.iv.next201.1 = add nuw nsw i64 %indvars.iv200, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end92.loopexit.unr-lcssa, label %for.body78, !llvm.loop !18 for.end92.loopexit.unr-lcssa: ; preds = %for.inc90.1, %for.body78.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body78.preheader ], [ %sum.1.1, %for.inc90.1 ] %indvars.iv200.unr = phi i64 [ 0, %for.body78.preheader ], [ %indvars.iv.next201.1, %for.inc90.1 ] %sum.0173.unr = phi i32 [ 0, %for.body78.preheader ], [ %sum.1.1, %for.inc90.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end92, label %for.body78.epil for.body78.epil: ; preds = %for.end92.loopexit.unr-lcssa %arrayidx80.epil = getelementptr inbounds [500 x i32], ptr %h, i64 0, i64 %indvars.iv200.unr %22 = load i32, ptr %arrayidx80.epil, align 4, !tbaa !5 %cmp81.not.epil = icmp eq i32 %22, -1 br i1 %cmp81.not.epil, label %for.end92, label %if.then82.epil if.then82.epil: ; preds = %for.body78.epil %idxprom87.epil = sext i32 %22 to i64 %arrayidx88.epil = getelementptr inbounds [500 x [500 x i32]], ptr %A, i64 0, i64 %indvars.iv200.unr, i64 %idxprom87.epil %23 = load i32, ptr %arrayidx88.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %23, %sum.0173.unr br label %for.end92 for.end92: ; preds = %for.end92.loopexit.unr-lcssa, %if.then82.epil, %for.body78.epil, %for.cond11.preheader, %for.end22, %for.cond76.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond76.preheader ], [ 0, %for.end22 ], [ 0, %for.cond11.preheader ], [ %sum.1.lcssa.ph, %for.end92.loopexit.unr-lcssa ], [ %add.epil, %if.then82.epil ], [ %sum.0173.unr, %for.body78.epil ] %call93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %w) #4 call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %h) #4 call void @llvm.lifetime.end.p0(i64 2000, ptr nonnull %d) #4 call void @llvm.lifetime.end.p0(i64 1000000, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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, !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} !15 = !{!"llvm.loop.unswitch.partial.disable"} !16 = distinct !{!16, !10, !12, !11} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include<stdio.h> #define INFTY 1000000 #define WHITE 0 #define GRAY 1 #define BLACK 2 int prim(); int n,M[100][100]; int main(void){ int i,j,e; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&e); M[i][j]=(e==-1) ? INFTY :e; } } printf("%d\n",prim()); return 0; } int prim(){ int u,minv,i; int d[100],p[100],color[100]; for(i=0;i<n;i++){ d[i]=INFTY; p[i]=-1; color[i]=WHITE; } d[0]=0; while(1){ minv=INFTY; u=-1; for(int i=0;i<n;i++){ if(minv>d[i]&&color[i]!=BLACK){ u=i; minv=d[i]; } } if(u==-1) break; color[u]=BLACK; for(int v=0;v<n;v++){ if(color[v]!=BLACK&&M[u][v]!=INFTY){ if(d[v]>M[u][v]){ d[v]=M[u][v]; p[v]=u; color[v]=GRAY; } } } } int sum=0; for(i=0;i<n;i++){ if(p[i]!=-1) sum+=M[i][p[i]]; } return sum; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199855/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199855/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @M = dso_local local_unnamed_addr global [100 x [100 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d.i = alloca [100 x i32], align 16 %p.i = alloca [100 x i32], align 16 %color.i = alloca [100 x i32], align 16 %e = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr.i19 = freeze i32 %0 %cmp20 = icmp sgt i32 %.fr.i19, 0 br i1 %cmp20, label %for.cond1.preheader, label %for.end10.thread for.end10.thread: ; preds = %entry call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 br label %prim.exit for.cond1.preheader: ; preds = %entry, %for.inc8 %1 = phi i32 [ %.fr.i, %for.inc8 ], [ %.fr.i19, %entry ] %indvars.iv25 = phi i64 [ %indvars.iv.next26, %for.inc8 ], [ 0, %entry ] %cmp217 = icmp sgt i32 %1, 0 br i1 %cmp217, label %for.body3, label %for.inc8 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %2 = load i32, ptr %e, align 4 %cmp5 = icmp eq i32 %2, -1 %cond = select i1 %cmp5, i32 1000000, i32 %2 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv25, i64 %indvars.iv store i32 %cond, ptr %arrayidx7, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp2, label %for.body3, label %for.inc8, !llvm.loop !9 for.inc8: ; preds = %for.body3, %for.cond1.preheader %5 = phi i32 [ %1, %for.cond1.preheader ], [ %3, %for.body3 ] %.fr.i = freeze i32 %5 %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1 %6 = sext i32 %.fr.i to i64 %cmp = icmp slt i64 %indvars.iv.next26, %6 br i1 %cmp, label %for.cond1.preheader, label %for.end10, !llvm.loop !11 for.end10: ; preds = %for.inc8 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color.i) #5 %cmp112.i = icmp sgt i32 %.fr.i, 0 br i1 %cmp112.i, label %for.body.preheader.i, label %prim.exit for.body.preheader.i: ; preds = %for.end10 %7 = zext i32 %.fr.i to i64 %8 = shl nuw nsw i64 %7, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %p.i, i8 -1, i64 %8, i1 false), !tbaa !5 call void @llvm.memset.p0.i64(ptr nonnull align 16 %color.i, i8 0, i64 %8, i1 false), !tbaa !5 %min.iters.check = icmp ult i32 %.fr.i, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i %n.vec = and i64 %7, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %9 = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %index store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %10, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %7 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.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i ], [ %n.vec, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv.i store i32 1000000, 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, %7 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.block store i32 0, ptr %d.i, align 16, !tbaa !5 br label %for.body9.us.i for.cond.cleanup.us.i: ; preds = %for.inc18.us.i %cmp21.us.i = icmp eq i32 %u.1.us.i, -1 br i1 %cmp21.us.i, label %for.body65.i.preheader, label %if.end23.us.i for.body65.i.preheader: ; preds = %for.cond.cleanup.us.i %xtraiter = and i64 %7, 1 %12 = icmp eq i32 %.fr.i, 1 br i1 %12, label %prim.exit.loopexit.unr-lcssa, label %for.body65.i.preheader.new for.body65.i.preheader.new: ; preds = %for.body65.i.preheader %unroll_iter = and i64 %7, 4294967294 br label %for.body65.i if.end23.us.i: ; preds = %for.cond.cleanup.us.i %idxprom24.us.i = sext i32 %u.1.us.i to i64 %arrayidx25.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %idxprom24.us.i store i32 2, ptr %arrayidx25.us.i, align 4, !tbaa !5 br label %for.body29.us.i for.body29.us.i: ; preds = %for.inc60.us.i, %if.end23.us.i %indvars.iv164.i = phi i64 [ 0, %if.end23.us.i ], [ %indvars.iv.next165.i, %for.inc60.us.i ] %arrayidx31.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv164.i %13 = load i32, ptr %arrayidx31.us.i, align 4, !tbaa !5 %cmp32.not.us.i = icmp eq i32 %13, 2 br i1 %cmp32.not.us.i, label %for.inc60.us.i, label %land.lhs.true33.us.i land.lhs.true33.us.i: ; preds = %for.body29.us.i %arrayidx37.us.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom24.us.i, i64 %indvars.iv164.i %14 = load i32, ptr %arrayidx37.us.i, align 4, !tbaa !5 %cmp38.not.us.i = icmp eq i32 %14, 1000000 br i1 %cmp38.not.us.i, label %for.inc60.us.i, label %if.then39.us.i if.then39.us.i: ; preds = %land.lhs.true33.us.i %arrayidx41.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv164.i %15 = load i32, ptr %arrayidx41.us.i, align 4, !tbaa !5 %cmp46.us.i = icmp sgt i32 %15, %14 br i1 %cmp46.us.i, label %if.then47.us.i, label %for.inc60.us.i if.then47.us.i: ; preds = %if.then39.us.i store i32 %14, ptr %arrayidx41.us.i, align 4, !tbaa !5 %arrayidx55.us.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv164.i store i32 %u.1.us.i, ptr %arrayidx55.us.i, align 4, !tbaa !5 store i32 1, ptr %arrayidx31.us.i, align 4, !tbaa !5 br label %for.inc60.us.i for.inc60.us.i: ; preds = %if.then47.us.i, %if.then39.us.i, %land.lhs.true33.us.i, %for.body29.us.i %indvars.iv.next165.i = add nuw nsw i64 %indvars.iv164.i, 1 %exitcond168.not.i = icmp eq i64 %indvars.iv.next165.i, %7 br i1 %exitcond168.not.i, label %for.body9.us.i.backedge, label %for.body29.us.i, !llvm.loop !17 for.body9.us.i: ; preds = %for.body9.us.i.backedge, %while.cond.us.preheader.i %indvars.iv159.i = phi i64 [ 0, %while.cond.us.preheader.i ], [ %indvars.iv159.i.be, %for.body9.us.i.backedge ] %minv.0116.us.i = phi i32 [ 1000000, %while.cond.us.preheader.i ], [ %minv.0116.us.i.be, %for.body9.us.i.backedge ] %u.0115.us.i = phi i32 [ -1, %while.cond.us.preheader.i ], [ %u.0115.us.i.be, %for.body9.us.i.backedge ] %arrayidx11.us.i = getelementptr inbounds [100 x i32], ptr %d.i, i64 0, i64 %indvars.iv159.i %16 = load i32, ptr %arrayidx11.us.i, align 4, !tbaa !5 %cmp12.us.i = icmp sgt i32 %minv.0116.us.i, %16 br i1 %cmp12.us.i, label %land.lhs.true.us.i, label %for.inc18.us.i land.lhs.true.us.i: ; preds = %for.body9.us.i %arrayidx14.us.i = getelementptr inbounds [100 x i32], ptr %color.i, i64 0, i64 %indvars.iv159.i %17 = load i32, ptr %arrayidx14.us.i, align 4, !tbaa !5 %cmp15.not.us.i = icmp eq i32 %17, 2 %18 = trunc i64 %indvars.iv159.i to i32 %spec.select.us.i = select i1 %cmp15.not.us.i, i32 %u.0115.us.i, i32 %18 %spec.select111.us.i = select i1 %cmp15.not.us.i, i32 %minv.0116.us.i, i32 %16 br label %for.inc18.us.i for.inc18.us.i: ; preds = %land.lhs.true.us.i, %for.body9.us.i %u.1.us.i = phi i32 [ %u.0115.us.i, %for.body9.us.i ], [ %spec.select.us.i, %land.lhs.true.us.i ] %minv.1.us.i = phi i32 [ %minv.0116.us.i, %for.body9.us.i ], [ %spec.select111.us.i, %land.lhs.true.us.i ] %indvars.iv.next160.i = add nuw nsw i64 %indvars.iv159.i, 1 %exitcond163.not.i = icmp eq i64 %indvars.iv.next160.i, %7 br i1 %exitcond163.not.i, label %for.cond.cleanup.us.i, label %for.body9.us.i.backedge for.body9.us.i.backedge: ; preds = %for.inc60.us.i, %for.inc18.us.i %indvars.iv159.i.be = phi i64 [ %indvars.iv.next160.i, %for.inc18.us.i ], [ 0, %for.inc60.us.i ] %minv.0116.us.i.be = phi i32 [ %minv.1.us.i, %for.inc18.us.i ], [ 1000000, %for.inc60.us.i ] %u.0115.us.i.be = phi i32 [ %u.1.us.i, %for.inc18.us.i ], [ -1, %for.inc60.us.i ] br label %for.body9.us.i, !llvm.loop !17 for.body65.i: ; preds = %for.inc77.i.1, %for.body65.i.preheader.new %indvars.iv169.i = phi i64 [ 0, %for.body65.i.preheader.new ], [ %indvars.iv.next170.i.1, %for.inc77.i.1 ] %sum.0150.i = phi i32 [ 0, %for.body65.i.preheader.new ], [ %sum.1.i.1, %for.inc77.i.1 ] %niter = phi i64 [ 0, %for.body65.i.preheader.new ], [ %niter.next.1, %for.inc77.i.1 ] %arrayidx67.i = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv169.i %19 = load i32, ptr %arrayidx67.i, align 8, !tbaa !5 %cmp68.not.i = icmp eq i32 %19, -1 br i1 %cmp68.not.i, label %for.inc77.i, label %if.then69.i if.then69.i: ; preds = %for.body65.i %idxprom74.i = sext i32 %19 to i64 %arrayidx75.i = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv169.i, i64 %idxprom74.i %20 = load i32, ptr %arrayidx75.i, align 4, !tbaa !5 %add.i = add nsw i32 %20, %sum.0150.i br label %for.inc77.i for.inc77.i: ; preds = %if.then69.i, %for.body65.i %sum.1.i = phi i32 [ %add.i, %if.then69.i ], [ %sum.0150.i, %for.body65.i ] %indvars.iv.next170.i = or i64 %indvars.iv169.i, 1 %arrayidx67.i.1 = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv.next170.i %21 = load i32, ptr %arrayidx67.i.1, align 4, !tbaa !5 %cmp68.not.i.1 = icmp eq i32 %21, -1 br i1 %cmp68.not.i.1, label %for.inc77.i.1, label %if.then69.i.1 if.then69.i.1: ; preds = %for.inc77.i %idxprom74.i.1 = sext i32 %21 to i64 %arrayidx75.i.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next170.i, i64 %idxprom74.i.1 %22 = load i32, ptr %arrayidx75.i.1, align 4, !tbaa !5 %add.i.1 = add nsw i32 %22, %sum.1.i br label %for.inc77.i.1 for.inc77.i.1: ; preds = %if.then69.i.1, %for.inc77.i %sum.1.i.1 = phi i32 [ %add.i.1, %if.then69.i.1 ], [ %sum.1.i, %for.inc77.i ] %indvars.iv.next170.i.1 = add nuw nsw i64 %indvars.iv169.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %prim.exit.loopexit.unr-lcssa, label %for.body65.i, !llvm.loop !18 prim.exit.loopexit.unr-lcssa: ; preds = %for.inc77.i.1, %for.body65.i.preheader %sum.1.i.lcssa.ph = phi i32 [ undef, %for.body65.i.preheader ], [ %sum.1.i.1, %for.inc77.i.1 ] %indvars.iv169.i.unr = phi i64 [ 0, %for.body65.i.preheader ], [ %indvars.iv.next170.i.1, %for.inc77.i.1 ] %sum.0150.i.unr = phi i32 [ 0, %for.body65.i.preheader ], [ %sum.1.i.1, %for.inc77.i.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %prim.exit, label %for.body65.i.epil for.body65.i.epil: ; preds = %prim.exit.loopexit.unr-lcssa %arrayidx67.i.epil = getelementptr inbounds [100 x i32], ptr %p.i, i64 0, i64 %indvars.iv169.i.unr %23 = load i32, ptr %arrayidx67.i.epil, align 4, !tbaa !5 %cmp68.not.i.epil = icmp eq i32 %23, -1 br i1 %cmp68.not.i.epil, label %prim.exit, label %if.then69.i.epil if.then69.i.epil: ; preds = %for.body65.i.epil %idxprom74.i.epil = sext i32 %23 to i64 %arrayidx75.i.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv169.i.unr, i64 %idxprom74.i.epil %24 = load i32, ptr %arrayidx75.i.epil, align 4, !tbaa !5 %add.i.epil = add nsw i32 %24, %sum.0150.i.unr br label %prim.exit prim.exit: ; preds = %prim.exit.loopexit.unr-lcssa, %if.then69.i.epil, %for.body65.i.epil, %for.end10.thread, %for.end10 %sum.0.lcssa.i = phi i32 [ 0, %for.end10 ], [ 0, %for.end10.thread ], [ %sum.1.i.lcssa.ph, %prim.exit.loopexit.unr-lcssa ], [ %add.i.epil, %if.then69.i.epil ], [ %sum.0150.i.unr, %for.body65.i.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p.i) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d.i) #5 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_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 nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #3 { entry: %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp112 = icmp sgt i32 %.fr, 0 br i1 %cmp112, label %for.body.preheader, label %for.end79 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 %p, i8 -1, i64 %2, i1 false), !tbaa !5 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.preheader174, 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 1000000, i32 1000000, i32 1000000, i32 1000000>, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> <i32 1000000, i32 1000000, i32 1000000, i32 1000000>, 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 !19 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader174 for.body.preheader174: ; 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.preheader174, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader174 ] %arrayidx = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 1000000, 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 !20 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp112, label %while.cond.us.preheader, label %for.end79 while.cond.us.preheader: ; preds = %for.end %wide.trip.count162 = zext i32 %.fr to i64 %wide.trip.count167 = zext i32 %.fr to i64 br label %for.body9.us for.cond.cleanup.us: ; preds = %for.inc18.us %cmp21.us = icmp eq i32 %u.1.us, -1 br i1 %cmp21.us, label %for.cond63.preheader, label %if.end23.us if.end23.us: ; preds = %for.cond.cleanup.us %idxprom24.us = sext i32 %u.1.us to i64 %arrayidx25.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom24.us store i32 2, ptr %arrayidx25.us, align 4, !tbaa !5 br label %for.body29.us for.body29.us: ; preds = %if.end23.us, %for.inc60.us %indvars.iv164 = phi i64 [ 0, %if.end23.us ], [ %indvars.iv.next165, %for.inc60.us ] %arrayidx31.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv164 %6 = load i32, ptr %arrayidx31.us, align 4, !tbaa !5 %cmp32.not.us = icmp eq i32 %6, 2 br i1 %cmp32.not.us, label %for.inc60.us, label %land.lhs.true33.us land.lhs.true33.us: ; preds = %for.body29.us %arrayidx37.us = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %idxprom24.us, i64 %indvars.iv164 %7 = load i32, ptr %arrayidx37.us, align 4, !tbaa !5 %cmp38.not.us = icmp eq i32 %7, 1000000 br i1 %cmp38.not.us, label %for.inc60.us, label %if.then39.us if.then39.us: ; preds = %land.lhs.true33.us %arrayidx41.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv164 %8 = load i32, ptr %arrayidx41.us, align 4, !tbaa !5 %cmp46.us = icmp sgt i32 %8, %7 br i1 %cmp46.us, label %if.then47.us, label %for.inc60.us if.then47.us: ; preds = %if.then39.us store i32 %7, ptr %arrayidx41.us, align 4, !tbaa !5 %arrayidx55.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv164 store i32 %u.1.us, ptr %arrayidx55.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx31.us, align 4, !tbaa !5 br label %for.inc60.us for.inc60.us: ; preds = %if.then47.us, %if.then39.us, %land.lhs.true33.us, %for.body29.us %indvars.iv.next165 = add nuw nsw i64 %indvars.iv164, 1 %exitcond168.not = icmp eq i64 %indvars.iv.next165, %wide.trip.count167 br i1 %exitcond168.not, label %for.body9.us.backedge, label %for.body29.us, !llvm.loop !17 for.body9.us: ; preds = %for.body9.us.backedge, %while.cond.us.preheader %indvars.iv159 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv159.be, %for.body9.us.backedge ] %minv.0116.us = phi i32 [ 1000000, %while.cond.us.preheader ], [ %minv.0116.us.be, %for.body9.us.backedge ] %u.0115.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0115.us.be, %for.body9.us.backedge ] %arrayidx11.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv159 %9 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5 %cmp12.us = icmp sgt i32 %minv.0116.us, %9 br i1 %cmp12.us, label %land.lhs.true.us, label %for.inc18.us land.lhs.true.us: ; preds = %for.body9.us %arrayidx14.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv159 %10 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %cmp15.not.us = icmp eq i32 %10, 2 %11 = trunc i64 %indvars.iv159 to i32 %spec.select.us = select i1 %cmp15.not.us, i32 %u.0115.us, i32 %11 %spec.select111.us = select i1 %cmp15.not.us, i32 %minv.0116.us, i32 %9 br label %for.inc18.us for.inc18.us: ; preds = %land.lhs.true.us, %for.body9.us %u.1.us = phi i32 [ %u.0115.us, %for.body9.us ], [ %spec.select.us, %land.lhs.true.us ] %minv.1.us = phi i32 [ %minv.0116.us, %for.body9.us ], [ %spec.select111.us, %land.lhs.true.us ] %indvars.iv.next160 = add nuw nsw i64 %indvars.iv159, 1 %exitcond163.not = icmp eq i64 %indvars.iv.next160, %wide.trip.count162 br i1 %exitcond163.not, label %for.cond.cleanup.us, label %for.body9.us.backedge for.body9.us.backedge: ; preds = %for.inc60.us, %for.inc18.us %indvars.iv159.be = phi i64 [ %indvars.iv.next160, %for.inc18.us ], [ 0, %for.inc60.us ] %minv.0116.us.be = phi i32 [ %minv.1.us, %for.inc18.us ], [ 1000000, %for.inc60.us ] %u.0115.us.be = phi i32 [ %u.1.us, %for.inc18.us ], [ -1, %for.inc60.us ] br label %for.body9.us, !llvm.loop !17 for.cond63.preheader: ; preds = %for.cond.cleanup.us br i1 %cmp112, label %for.body65.preheader, label %for.end79 for.body65.preheader: ; preds = %for.cond63.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end79.loopexit.unr-lcssa, label %for.body65.preheader.new for.body65.preheader.new: ; preds = %for.body65.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body65 for.body65: ; preds = %for.inc77.1, %for.body65.preheader.new %indvars.iv169 = phi i64 [ 0, %for.body65.preheader.new ], [ %indvars.iv.next170.1, %for.inc77.1 ] %sum.0150 = phi i32 [ 0, %for.body65.preheader.new ], [ %sum.1.1, %for.inc77.1 ] %niter = phi i64 [ 0, %for.body65.preheader.new ], [ %niter.next.1, %for.inc77.1 ] %arrayidx67 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv169 %13 = load i32, ptr %arrayidx67, align 8, !tbaa !5 %cmp68.not = icmp eq i32 %13, -1 br i1 %cmp68.not, label %for.inc77, label %if.then69 if.then69: ; preds = %for.body65 %idxprom74 = sext i32 %13 to i64 %arrayidx75 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv169, i64 %idxprom74 %14 = load i32, ptr %arrayidx75, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0150 br label %for.inc77 for.inc77: ; preds = %for.body65, %if.then69 %sum.1 = phi i32 [ %add, %if.then69 ], [ %sum.0150, %for.body65 ] %indvars.iv.next170 = or i64 %indvars.iv169, 1 %arrayidx67.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next170 %15 = load i32, ptr %arrayidx67.1, align 4, !tbaa !5 %cmp68.not.1 = icmp eq i32 %15, -1 br i1 %cmp68.not.1, label %for.inc77.1, label %if.then69.1 if.then69.1: ; preds = %for.inc77 %idxprom74.1 = sext i32 %15 to i64 %arrayidx75.1 = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv.next170, i64 %idxprom74.1 %16 = load i32, ptr %arrayidx75.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc77.1 for.inc77.1: ; preds = %if.then69.1, %for.inc77 %sum.1.1 = phi i32 [ %add.1, %if.then69.1 ], [ %sum.1, %for.inc77 ] %indvars.iv.next170.1 = add nuw nsw i64 %indvars.iv169, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end79.loopexit.unr-lcssa, label %for.body65, !llvm.loop !18 for.end79.loopexit.unr-lcssa: ; preds = %for.inc77.1, %for.body65.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body65.preheader ], [ %sum.1.1, %for.inc77.1 ] %indvars.iv169.unr = phi i64 [ 0, %for.body65.preheader ], [ %indvars.iv.next170.1, %for.inc77.1 ] %sum.0150.unr = phi i32 [ 0, %for.body65.preheader ], [ %sum.1.1, %for.inc77.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end79, label %for.body65.epil for.body65.epil: ; preds = %for.end79.loopexit.unr-lcssa %arrayidx67.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv169.unr %17 = load i32, ptr %arrayidx67.epil, align 4, !tbaa !5 %cmp68.not.epil = icmp eq i32 %17, -1 br i1 %cmp68.not.epil, label %for.end79, label %if.then69.epil if.then69.epil: ; preds = %for.body65.epil %idxprom74.epil = sext i32 %17 to i64 %arrayidx75.epil = getelementptr inbounds [100 x [100 x i32]], ptr @M, i64 0, i64 %indvars.iv169.unr, i64 %idxprom74.epil %18 = load i32, ptr %arrayidx75.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0150.unr br label %for.end79 for.end79: ; preds = %for.end79.loopexit.unr-lcssa, %if.then69.epil, %for.body65.epil, %entry, %for.end, %for.cond63.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond63.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end79.loopexit.unr-lcssa ], [ %add.epil, %if.then69.epil ], [ %sum.0150.unr, %for.body65.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 ret i32 %sum.0.lcssa } ; 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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !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 MAX 100 #define W 0 #define G 1 #define B 2 int INFTY = 1<<21; int n,A[MAX][MAX]; int prim(){ int i,v,u,min; int d[MAX],p[MAX],color[MAX]; for(i=0;i<n;i++){ d[i]=INFTY; p[i]=-1; color[i]=W; } d[0]=0; while(1){ min = INFTY; u=-1; for(i=0;i<n;i++){ if(min>d[i]&&color[i]!=B){ u=i; min= d[i]; } } if(u==-1) break; color[u]=B; for(v=0;v<n;v++){ if(color[v]!=B&&A[u][v]!=INFTY){ if(d[v]>A[u][v]){ d[v]=A[u][v]; p[v]=u; color[v]=G; } } } } int sum=0; for(i=0;i<n;i++){ if(p[i]!=-1) sum+=A[i][p[i]]; } return sum; } int main(){ int i,j,e; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<n;j++){ scanf("%d",&e); if(e==-1){ A[i][j]=INFTY; }else{ A[i][j]=e; } } } printf("%d\n",prim()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199899/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199899/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @INFTY = dso_local local_unnamed_addr global i32 2097152, align 4 @n = dso_local global i32 0, align 4 @A = 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 [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @prim() local_unnamed_addr #0 { entry: %d = alloca [100 x i32], align 16 %p = alloca [100 x i32], align 16 %color = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %color) #5 %0 = load i32, ptr @n, align 4, !tbaa !5 %.fr = freeze i32 %0 %cmp111 = icmp sgt i32 %.fr, 0 %.pre = load i32, ptr @INFTY, align 4, !tbaa !5 br i1 %cmp111, label %for.body.lr.ph, label %for.end77 for.body.lr.ph: ; 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 %p, i8 -1, i64 %2, i1 false), !tbaa !5 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.preheader, label %vector.ph vector.ph: ; preds = %for.body.lr.ph %n.vec = and i64 %1, 4294967288 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %3 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %index store <4 x i32> %broadcast.splat, ptr %3, align 16, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 store <4 x i32> %broadcast.splat, 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 !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %1 br i1 %cmp.n, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.body.lr.ph, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.lr.ph ], [ %n.vec, %middle.block ] br label %for.body 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 [100 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 %.pre, 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 !13 for.end: ; preds = %for.body, %middle.block store i32 0, ptr %d, align 16, !tbaa !5 br i1 %cmp111, label %while.cond.us.preheader, label %for.end77 while.cond.us.preheader: ; preds = %for.end %wide.trip.count161 = zext i32 %.fr to i64 %wide.trip.count166 = zext i32 %.fr to i64 br label %for.body8.us for.end19.us: ; preds = %for.inc17.us %cmp20.us = icmp eq i32 %u.1.us, -1 br i1 %cmp20.us, label %for.cond61.preheader, label %if.end22.us if.end22.us: ; preds = %for.end19.us %idxprom23.us = sext i32 %u.1.us to i64 %arrayidx24.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %idxprom23.us store i32 2, ptr %arrayidx24.us, align 4, !tbaa !5 br label %for.body27.us for.body27.us: ; preds = %if.end22.us, %for.inc58.us %indvars.iv163 = phi i64 [ 0, %if.end22.us ], [ %indvars.iv.next164, %for.inc58.us ] %arrayidx29.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv163 %6 = load i32, ptr %arrayidx29.us, align 4, !tbaa !5 %cmp30.not.us = icmp eq i32 %6, 2 br i1 %cmp30.not.us, label %for.inc58.us, label %land.lhs.true31.us land.lhs.true31.us: ; preds = %for.body27.us %arrayidx35.us = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %idxprom23.us, i64 %indvars.iv163 %7 = load i32, ptr %arrayidx35.us, align 4, !tbaa !5 %cmp36.not.us = icmp eq i32 %7, %.pre br i1 %cmp36.not.us, label %for.inc58.us, label %if.then37.us if.then37.us: ; preds = %land.lhs.true31.us %arrayidx39.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv163 %8 = load i32, ptr %arrayidx39.us, align 4, !tbaa !5 %cmp44.us = icmp sgt i32 %8, %7 br i1 %cmp44.us, label %if.then45.us, label %for.inc58.us if.then45.us: ; preds = %if.then37.us store i32 %7, ptr %arrayidx39.us, align 4, !tbaa !5 %arrayidx53.us = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv163 store i32 %u.1.us, ptr %arrayidx53.us, align 4, !tbaa !5 store i32 1, ptr %arrayidx29.us, align 4, !tbaa !5 br label %for.inc58.us for.inc58.us: ; preds = %if.then45.us, %if.then37.us, %land.lhs.true31.us, %for.body27.us %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %exitcond167.not = icmp eq i64 %indvars.iv.next164, %wide.trip.count166 br i1 %exitcond167.not, label %for.body8.us.backedge, label %for.body27.us, !llvm.loop !14 for.body8.us: ; preds = %for.body8.us.backedge, %while.cond.us.preheader %indvars.iv158 = phi i64 [ 0, %while.cond.us.preheader ], [ %indvars.iv158.be, %for.body8.us.backedge ] %min.0116.us = phi i32 [ %.pre, %while.cond.us.preheader ], [ %min.0116.us.be, %for.body8.us.backedge ] %u.0115.us = phi i32 [ -1, %while.cond.us.preheader ], [ %u.0115.us.be, %for.body8.us.backedge ] %arrayidx10.us = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv158 %9 = load i32, ptr %arrayidx10.us, align 4, !tbaa !5 %cmp11.us = icmp sgt i32 %min.0116.us, %9 br i1 %cmp11.us, label %land.lhs.true.us, label %for.inc17.us land.lhs.true.us: ; preds = %for.body8.us %arrayidx13.us = getelementptr inbounds [100 x i32], ptr %color, i64 0, i64 %indvars.iv158 %10 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %cmp14.not.us = icmp eq i32 %10, 2 %11 = trunc i64 %indvars.iv158 to i32 %spec.select.us = select i1 %cmp14.not.us, i32 %u.0115.us, i32 %11 %spec.select110.us = select i1 %cmp14.not.us, i32 %min.0116.us, i32 %9 br label %for.inc17.us for.inc17.us: ; preds = %land.lhs.true.us, %for.body8.us %u.1.us = phi i32 [ %u.0115.us, %for.body8.us ], [ %spec.select.us, %land.lhs.true.us ] %min.1.us = phi i32 [ %min.0116.us, %for.body8.us ], [ %spec.select110.us, %land.lhs.true.us ] %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1 %exitcond162.not = icmp eq i64 %indvars.iv.next159, %wide.trip.count161 br i1 %exitcond162.not, label %for.end19.us, label %for.body8.us.backedge for.body8.us.backedge: ; preds = %for.inc58.us, %for.inc17.us %indvars.iv158.be = phi i64 [ %indvars.iv.next159, %for.inc17.us ], [ 0, %for.inc58.us ] %min.0116.us.be = phi i32 [ %min.1.us, %for.inc17.us ], [ %.pre, %for.inc58.us ] %u.0115.us.be = phi i32 [ %u.1.us, %for.inc17.us ], [ -1, %for.inc58.us ] br label %for.body8.us, !llvm.loop !14 for.cond61.preheader: ; preds = %for.end19.us br i1 %cmp111, label %for.body63.preheader, label %for.end77 for.body63.preheader: ; preds = %for.cond61.preheader %xtraiter = and i64 %1, 1 %12 = icmp eq i32 %.fr, 1 br i1 %12, label %for.end77.loopexit.unr-lcssa, label %for.body63.preheader.new for.body63.preheader.new: ; preds = %for.body63.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body63 for.body63: ; preds = %for.inc75.1, %for.body63.preheader.new %indvars.iv168 = phi i64 [ 0, %for.body63.preheader.new ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149 = phi i32 [ 0, %for.body63.preheader.new ], [ %sum.1.1, %for.inc75.1 ] %niter = phi i64 [ 0, %for.body63.preheader.new ], [ %niter.next.1, %for.inc75.1 ] %arrayidx65 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168 %13 = load i32, ptr %arrayidx65, align 8, !tbaa !5 %cmp66.not = icmp eq i32 %13, -1 br i1 %cmp66.not, label %for.inc75, label %if.then67 if.then67: ; preds = %for.body63 %idxprom72 = sext i32 %13 to i64 %arrayidx73 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv168, i64 %idxprom72 %14 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %add = add nsw i32 %14, %sum.0149 br label %for.inc75 for.inc75: ; preds = %for.body63, %if.then67 %sum.1 = phi i32 [ %add, %if.then67 ], [ %sum.0149, %for.body63 ] %indvars.iv.next169 = or i64 %indvars.iv168, 1 %arrayidx65.1 = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv.next169 %15 = load i32, ptr %arrayidx65.1, align 4, !tbaa !5 %cmp66.not.1 = icmp eq i32 %15, -1 br i1 %cmp66.not.1, label %for.inc75.1, label %if.then67.1 if.then67.1: ; preds = %for.inc75 %idxprom72.1 = sext i32 %15 to i64 %arrayidx73.1 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv.next169, i64 %idxprom72.1 %16 = load i32, ptr %arrayidx73.1, align 4, !tbaa !5 %add.1 = add nsw i32 %16, %sum.1 br label %for.inc75.1 for.inc75.1: ; preds = %if.then67.1, %for.inc75 %sum.1.1 = phi i32 [ %add.1, %if.then67.1 ], [ %sum.1, %for.inc75 ] %indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end77.loopexit.unr-lcssa, label %for.body63, !llvm.loop !15 for.end77.loopexit.unr-lcssa: ; preds = %for.inc75.1, %for.body63.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %indvars.iv168.unr = phi i64 [ 0, %for.body63.preheader ], [ %indvars.iv.next169.1, %for.inc75.1 ] %sum.0149.unr = phi i32 [ 0, %for.body63.preheader ], [ %sum.1.1, %for.inc75.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end77, label %for.body63.epil for.body63.epil: ; preds = %for.end77.loopexit.unr-lcssa %arrayidx65.epil = getelementptr inbounds [100 x i32], ptr %p, i64 0, i64 %indvars.iv168.unr %17 = load i32, ptr %arrayidx65.epil, align 4, !tbaa !5 %cmp66.not.epil = icmp eq i32 %17, -1 br i1 %cmp66.not.epil, label %for.end77, label %if.then67.epil if.then67.epil: ; preds = %for.body63.epil %idxprom72.epil = sext i32 %17 to i64 %arrayidx73.epil = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv168.unr, i64 %idxprom72.epil %18 = load i32, ptr %arrayidx73.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %18, %sum.0149.unr br label %for.end77 for.end77: ; preds = %for.end77.loopexit.unr-lcssa, %if.then67.epil, %for.body63.epil, %entry, %for.end, %for.cond61.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond61.preheader ], [ 0, %for.end ], [ 0, %entry ], [ %sum.1.lcssa.ph, %for.end77.loopexit.unr-lcssa ], [ %add.epil, %if.then67.epil ], [ %sum.0149.unr, %for.body63.epil ] call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %color) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %p) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 ret i32 %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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: %e = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #5 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp25 = icmp sgt i32 %0, 0 br i1 %cmp25, label %for.cond1.preheader, label %for.end14 for.cond1.preheader: ; preds = %entry, %for.inc12 %1 = phi i32 [ %7, %for.inc12 ], [ %0, %entry ] %indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.inc12 ], [ 0, %entry ] %cmp223 = icmp sgt i32 %1, 0 br i1 %cmp223, label %for.body3, label %for.cond1.preheader.for.inc12_crit_edge for.cond1.preheader.for.inc12_crit_edge: ; preds = %for.cond1.preheader %.pre = sext i32 %1 to i64 br label %for.inc12 for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e) %2 = load i32, ptr %e, align 4, !tbaa !5 %cmp5 = icmp eq i32 %2, -1 %3 = load i32, ptr @INFTY, align 4 %spec.select = select i1 %cmp5, i32 %3, i32 %2 %4 = getelementptr inbounds [100 x [100 x i32]], ptr @A, i64 0, i64 %indvars.iv29, i64 %indvars.iv store i32 %spec.select, ptr %4, align 4 %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 %cmp2 = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp2, label %for.body3, label %for.inc12, !llvm.loop !16 for.inc12: ; preds = %for.body3, %for.cond1.preheader.for.inc12_crit_edge %.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc12_crit_edge ], [ %6, %for.body3 ] %7 = phi i32 [ %1, %for.cond1.preheader.for.inc12_crit_edge ], [ %5, %for.body3 ] %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1 %cmp = icmp slt i64 %indvars.iv.next30, %.pre-phi br i1 %cmp, label %for.cond1.preheader, label %for.end14, !llvm.loop !17 for.end14: ; preds = %for.inc12, %entry %call15 = call i32 @prim() %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call15) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #5 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(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 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !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, !18} !18 = !{!"llvm.loop.unswitch.partial.disable"}
#include<stdio.h> int main(void) { int n,m; scanf("%d%d",&n,&m); printf("%d\n",(n - 1) * (m - 1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199941/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199941/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call = 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 %sub = add nsw i32 %0, -1 %1 = load i32, ptr %m, align 4, !tbaa !5 %sub1 = add nsw i32 %1, -1 %mul = mul nsw i32 %sub1, %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int n,m; scanf("%d %d", &n, &m); int block=(n-1)*(m-1); printf("%d", block); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_199985/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_199985/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call = 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 %sub = add nsw i32 %0, -1 %1 = load i32, ptr %m, align 4, !tbaa !5 %sub1 = add nsw i32 %1, -1 %mul = mul nsw i32 %sub1, %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int n,m; scanf("%d%d",&n,&m); printf("%d",(n-1)*(m-1)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200025/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200025/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call = 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 %sub = add nsw i32 %0, -1 %1 = load i32, ptr %m, align 4, !tbaa !5 %sub1 = add nsw i32 %1, -1 %mul = mul nsw i32 %sub1, %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int n, m, ans; scanf("%d%d", &n, &m); ans = (n - 1) * (m - 1); printf("%d", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_200076/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_200076/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 %call = 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 %sub = add nsw i32 %0, -1 %1 = load i32, ptr %m, align 4, !tbaa !5 %sub1 = add nsw i32 %1, -1 %mul = mul nsw i32 %sub1, %sub %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}