Source_Code
stringlengths 69
484k
| IR_Original
stringlengths 2.05k
17.9M
|
---|---|
#include <stdio.h>
int main(){
int n,F[44],i;
scanf("%d",&n);
F[0] = 1;
F[1] = 1;
for(i=2;i<=n;i++){
F[i] = F[i-2] + F[i-1];
}
printf("%d\n",F[n]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_316989/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_316989/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%F = alloca [44 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 176, ptr nonnull %F) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
store i32 1, ptr %F, align 16, !tbaa !5
%arrayidx1 = getelementptr inbounds [44 x i32], ptr %F, i64 0, i64 1
store i32 1, ptr %arrayidx1, align 4, !tbaa !5
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not15 = icmp slt i32 %0, 2
br i1 %cmp.not15, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add nuw i32 %0, 1
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -2
%3 = add nsw i64 %wide.trip.count, -3
%xtraiter = and i64 %2, 3
%4 = icmp ult i64 %3, 3
br i1 %4, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %2, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%5 = phi i32 [ 1, %for.body.preheader.new ], [ %add.3, %for.body ]
%6 = phi i32 [ 1, %for.body.preheader.new ], [ %add.2, %for.body ]
%indvars.iv = phi i64 [ 2, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%add = add nsw i32 %5, %6
%arrayidx7 = getelementptr inbounds [44 x i32], ptr %F, i64 0, i64 %indvars.iv
store i32 %add, ptr %arrayidx7, align 8, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%add.1 = add nsw i32 %add, %5
%arrayidx7.1 = getelementptr inbounds [44 x i32], ptr %F, i64 0, i64 %indvars.iv.next
store i32 %add.1, ptr %arrayidx7.1, align 4, !tbaa !5
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%add.2 = add nsw i32 %add.1, %add
%arrayidx7.2 = getelementptr inbounds [44 x i32], ptr %F, i64 0, i64 %indvars.iv.next.1
store i32 %add.2, ptr %arrayidx7.2, align 8, !tbaa !5
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
%add.3 = add nsw i32 %add.2, %add.1
%arrayidx7.3 = getelementptr inbounds [44 x i32], ptr %F, i64 0, i64 %indvars.iv.next.2
store i32 %add.3, ptr %arrayidx7.3, align 4, !tbaa !5
%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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%.unr = phi i32 [ 1, %for.body.preheader ], [ %add.3, %for.body ]
%.unr20 = phi i32 [ 1, %for.body.preheader ], [ %add.2, %for.body ]
%indvars.iv.unr = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%7 = phi i32 [ %add.epil, %for.body.epil ], [ %.unr, %for.end.loopexit.unr-lcssa ]
%8 = phi i32 [ %7, %for.body.epil ], [ %.unr20, %for.end.loopexit.unr-lcssa ]
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%add.epil = add nsw i32 %7, %8
%arrayidx7.epil = getelementptr inbounds [44 x i32], ptr %F, i64 0, i64 %indvars.iv.epil
store i32 %add.epil, ptr %arrayidx7.epil, align 4, !tbaa !5
%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.end, label %for.body.epil, !llvm.loop !11
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%idxprom8 = sext i32 %0 to i64
%arrayidx9 = getelementptr inbounds [44 x i32], ptr %F, i64 0, i64 %idxprom8
%9 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9)
call void @llvm.lifetime.end.p0(i64 176, ptr nonnull %F) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
|
#include <stdio.h>
#define NMAX 100
#define AMAX 4
#define MOD 10007
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int main(void)
{
int i, j, k, l, m, J, K, L, M, x, n, a, prea = 0, s = 0;
int binom[NMAX*AMAX+1][NMAX*AMAX+1] = {0}, dp[NMAX+1][NMAX*AMAX+1][AMAX*2][AMAX] = {0};
for (i = 0; i <= NMAX * AMAX; i++) {
binom[i][0] = binom[i][i] = 1;
for (j = 1; j < i; j++) {
binom[i][j] = (binom[i-1][j] + binom[i-1][j-1]) % MOD;
}
}
scanf("%d", &n);
dp[0][0][0][0] = 1;
for (i = 0; i < n; i++) {
scanf("%d", &a);
long long dupli = 1;
for (j = 1; j <= a; j++) dupli *= j;
for (j = 0; j <= s + 1; j++) {
for (k = 0; k <= 7; k++) {
for (l = 0; l <= 3; l++) {
for (x = 1; x <= MIN(s + 1, a); x++) {
if (dp[i][j][k][l]) {
m = 2 * (prea - l) - k;
for(J = 0; J <= MIN(x, j); J++) {
for(K = 0; K <= MIN(x - J, k); K++) {
for(L = 0; L <= MIN(x - J - K, l); L++) {
for(M = 0; M <= MIN(x - J - K - L, m); M++) {
dp[i+1][j+k+l-J-K-L][K+2*L+M][a-x] = (dp[i+1][j+k+l-J-K-L][K+2*L+M][a-x] + dupli * binom[a-1][x-1] * binom[j][J] * binom[k][K] * binom[l][L] * binom[m][M] * binom[s-j-k-l-m+1][x-J-K-L-M] * dp[i][j][k][l]) % MOD;
}
}
}
}
}
}
}
}
}
s += a;
prea = a;
}
printf("%d\n", dp[n][0][0][0]);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317038/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317038/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca i32, align 4
%binom = alloca [401 x [401 x i32]], align 16
%dp = alloca [101 x [401 x [8 x [4 x i32]]]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 643204, ptr nonnull %binom) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(643204) %binom, i8 0, i64 643204, i1 false)
call void @llvm.lifetime.start.p0(i64 5184128, ptr nonnull %dp) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(5184128) %dp, i8 0, i64 5184128, i1 false)
br label %for.body
for.body: ; preds = %entry, %for.inc23
%indvars.iv396 = phi i64 [ 0, %entry ], [ %indvars.iv.next397, %for.inc23 ]
%0 = add nsw i64 %indvars.iv396, -1
%arrayidx = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %indvars.iv396
%arrayidx2 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %indvars.iv396, i64 %indvars.iv396
store i32 1, ptr %arrayidx2, align 4, !tbaa !5
store i32 1, ptr %arrayidx, align 4, !tbaa !5
%cmp7366 = icmp ugt i64 %indvars.iv396, 1
br i1 %cmp7366, label %for.body8.lr.ph, label %for.inc23
for.body8.lr.ph: ; preds = %for.body
%1 = add nsw i64 %indvars.iv396, -1
%arrayidx18.phi.trans.insert = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %1, i64 0
%.pre = load i32, ptr %arrayidx18.phi.trans.insert, align 4, !tbaa !5
%min.iters.check = icmp ult i64 %indvars.iv396, 9
br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph
vector.ph: ; preds = %for.body8.lr.ph
%n.vec = and i64 %0, -8
%ind.end = or i64 %n.vec, 1
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load457, %vector.body ]
%offset.idx = or i64 %index, 1
%2 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %1, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %2, align 4, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load457 = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%5 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load457, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%6 = add nsw <4 x i32> %4, %wide.load
%7 = add nsw <4 x i32> %5, %wide.load457
%8 = srem <4 x i32> %6, <i32 10007, i32 10007, i32 10007, i32 10007>
%9 = srem <4 x i32> %7, <i32 10007, i32 10007, i32 10007, i32 10007>
%10 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %indvars.iv396, i64 %offset.idx
store <4 x i32> %8, ptr %10, align 4, !tbaa !5
%11 = getelementptr inbounds i32, ptr %10, i64 4
store <4 x i32> %9, 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 !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %0, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load457, i64 3
br i1 %cmp.n, label %for.inc23, label %for.body8.preheader
for.body8.preheader: ; preds = %for.body8.lr.ph, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body8.lr.ph ]
%indvars.iv.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body8.lr.ph ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.body8
%scalar.recur = phi i32 [ %13, %for.body8 ], [ %scalar.recur.ph, %for.body8.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body8 ], [ %indvars.iv.ph, %for.body8.preheader ]
%arrayidx12 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %1, i64 %indvars.iv
%13 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%add = add nsw i32 %scalar.recur, %13
%rem = srem i32 %add, 10007
%arrayidx22 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %indvars.iv396, i64 %indvars.iv
store i32 %rem, ptr %arrayidx22, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv396
br i1 %exitcond.not, label %for.inc23, label %for.body8, !llvm.loop !13
for.inc23: ; preds = %for.body8, %middle.block, %for.body
%indvars.iv.next397 = add nuw nsw i64 %indvars.iv396, 1
%exitcond400.not = icmp eq i64 %indvars.iv.next397, 401
br i1 %exitcond400.not, label %for.end25, label %for.body, !llvm.loop !14
for.end25: ; preds = %for.inc23
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
store i32 1, ptr %dp, align 16, !tbaa !5
%14 = load i32, ptr %n, align 4, !tbaa !5
%cmp31387 = icmp sgt i32 %14, 0
br i1 %cmp31387, label %for.body32, label %for.end25.for.end248_crit_edge
for.end25.for.end248_crit_edge: ; preds = %for.end25
%.pre455 = sext i32 %14 to i64
br label %for.end248
for.body32: ; preds = %for.end25, %for.end244
%indvars.iv450 = phi i64 [ %indvars.iv.next451.pre-phi, %for.end244 ], [ 0, %for.end25 ]
%s.0390 = phi i32 [ %add245, %for.end244 ], [ 0, %for.end25 ]
%prea.0389 = phi i32 [ %15, %for.end244 ], [ 0, %for.end25 ]
%call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%15 = load i32, ptr %a, align 4
%cmp35.not369 = icmp slt i32 %15, 1
br i1 %cmp35.not369, label %for.cond40.preheader, label %for.body36.preheader
for.body36.preheader: ; preds = %for.body32
%16 = add nuw i32 %15, 1
%wide.trip.count = zext i32 %16 to i64
%17 = add nsw i64 %wide.trip.count, -1
%18 = add nsw i64 %wide.trip.count, -2
%xtraiter = and i64 %17, 7
%19 = icmp ult i64 %18, 7
br i1 %19, label %for.cond40.preheader.loopexit.unr-lcssa, label %for.body36.preheader.new
for.body36.preheader.new: ; preds = %for.body36.preheader
%unroll_iter = and i64 %17, -8
br label %for.body36
for.cond40.preheader.loopexit.unr-lcssa: ; preds = %for.body36, %for.body36.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body36.preheader ], [ %mul.7, %for.body36 ]
%indvars.iv401.unr = phi i64 [ 1, %for.body36.preheader ], [ %indvars.iv.next402.7, %for.body36 ]
%dupli.0371.unr = phi i64 [ 1, %for.body36.preheader ], [ %mul.7, %for.body36 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond40.preheader, label %for.body36.epil
for.body36.epil: ; preds = %for.cond40.preheader.loopexit.unr-lcssa, %for.body36.epil
%indvars.iv401.epil = phi i64 [ %indvars.iv.next402.epil, %for.body36.epil ], [ %indvars.iv401.unr, %for.cond40.preheader.loopexit.unr-lcssa ]
%dupli.0371.epil = phi i64 [ %mul.epil, %for.body36.epil ], [ %dupli.0371.unr, %for.cond40.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body36.epil ], [ 0, %for.cond40.preheader.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %dupli.0371.epil, %indvars.iv401.epil
%indvars.iv.next402.epil = add nuw nsw i64 %indvars.iv401.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.cond40.preheader, label %for.body36.epil, !llvm.loop !15
for.cond40.preheader: ; preds = %for.cond40.preheader.loopexit.unr-lcssa, %for.body36.epil, %for.body32
%dupli.0.lcssa = phi i64 [ 1, %for.body32 ], [ %mul.lcssa.ph, %for.cond40.preheader.loopexit.unr-lcssa ], [ %mul.epil, %for.body36.epil ]
%cmp42.not385 = icmp slt i32 %s.0390, -1
br i1 %cmp42.not385, label %for.cond40.preheader.for.end244_crit_edge, label %for.cond45.preheader.lr.ph
for.cond40.preheader.for.end244_crit_edge: ; preds = %for.cond40.preheader
%.pre454 = add nuw nsw i64 %indvars.iv450, 1
br label %for.end244
for.cond45.preheader.lr.ph: ; preds = %for.cond40.preheader
%add41 = add i32 %s.0390, 1
%cond = call i32 @llvm.smin.i32(i32 %add41, i32 %15)
%cmp58.not380 = icmp slt i32 %cond, 1
%20 = add nuw nsw i64 %indvars.iv450, 1
%sub143 = add nsw i32 %15, -1
%idxprom144 = sext i32 %sub143 to i64
br i1 %cmp58.not380, label %for.end244, label %for.cond45.preheader.preheader
for.cond45.preheader.preheader: ; preds = %for.cond45.preheader.lr.ph
%21 = sext i32 %15 to i64
%22 = add nuw i32 %cond, 1
%23 = add i32 %s.0390, 2
%wide.trip.count448 = zext i32 %23 to i64
%wide.trip.count432 = zext i32 %22 to i64
br label %for.cond45.preheader
for.body36: ; preds = %for.body36, %for.body36.preheader.new
%indvars.iv401 = phi i64 [ 1, %for.body36.preheader.new ], [ %indvars.iv.next402.7, %for.body36 ]
%dupli.0371 = phi i64 [ 1, %for.body36.preheader.new ], [ %mul.7, %for.body36 ]
%niter = phi i64 [ 0, %for.body36.preheader.new ], [ %niter.next.7, %for.body36 ]
%mul = mul nsw i64 %dupli.0371, %indvars.iv401
%indvars.iv.next402 = add nuw nsw i64 %indvars.iv401, 1
%mul.1 = mul nsw i64 %mul, %indvars.iv.next402
%indvars.iv.next402.1 = add nuw nsw i64 %indvars.iv401, 2
%mul.2 = mul nsw i64 %mul.1, %indvars.iv.next402.1
%indvars.iv.next402.2 = add nuw nsw i64 %indvars.iv401, 3
%mul.3 = mul nsw i64 %mul.2, %indvars.iv.next402.2
%indvars.iv.next402.3 = add nuw nsw i64 %indvars.iv401, 4
%mul.4 = mul nsw i64 %mul.3, %indvars.iv.next402.3
%indvars.iv.next402.4 = add nuw nsw i64 %indvars.iv401, 5
%mul.5 = mul nsw i64 %mul.4, %indvars.iv.next402.4
%indvars.iv.next402.5 = add nuw nsw i64 %indvars.iv401, 6
%mul.6 = mul nsw i64 %mul.5, %indvars.iv.next402.5
%indvars.iv.next402.6 = add nuw nsw i64 %indvars.iv401, 7
%mul.7 = mul nsw i64 %mul.6, %indvars.iv.next402.6
%indvars.iv.next402.7 = add nuw nsw i64 %indvars.iv401, 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.cond40.preheader.loopexit.unr-lcssa, label %for.body36, !llvm.loop !17
for.cond45.preheader: ; preds = %for.cond45.preheader.preheader, %for.inc242.split
%indvars.iv445 = phi i64 [ 0, %for.cond45.preheader.preheader ], [ %indvars.iv.next446, %for.inc242.split ]
%24 = trunc i64 %indvars.iv445 to i32
br label %for.cond49.preheader
for.cond49.preheader: ; preds = %for.cond45.preheader, %for.inc239.split
%indvars.iv440 = phi i64 [ 0, %for.cond45.preheader ], [ %indvars.iv.next441, %for.inc239.split ]
%25 = add nuw nsw i64 %indvars.iv440, %indvars.iv445
%26 = trunc i64 %indvars.iv440 to i32
br label %for.cond53.preheader
for.cond53.preheader: ; preds = %for.cond49.preheader, %for.cond53.for.inc236_crit_edge
%indvars.iv434 = phi i64 [ 0, %for.cond49.preheader ], [ %indvars.iv.next435, %for.cond53.for.inc236_crit_edge ]
%arrayidx68 = getelementptr inbounds [101 x [401 x [8 x [4 x i32]]]], ptr %dp, i64 0, i64 %indvars.iv450, i64 %indvars.iv445, i64 %indvars.iv440, i64 %indvars.iv434
%27 = trunc i64 %indvars.iv434 to i32
%28 = sub i32 %prea.0389, %27
%mul70 = shl nsw i32 %28, 1
%sub71 = sub nsw i32 %mul70, %26
%29 = add nuw nsw i64 %25, %indvars.iv434
%idxprom169 = sext i32 %sub71 to i64
%30 = trunc i64 %29 to i32
%31 = add i32 %sub71, %30
%add179 = sub i32 %add41, %31
%idxprom180 = sext i32 %add179 to i64
%32 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%33 = icmp eq i32 %32, 0
br i1 %33, label %for.cond53.for.inc236_crit_edge, label %for.body60.preheader
for.body60.preheader: ; preds = %for.cond53.preheader
%34 = trunc i64 %indvars.iv434 to i32
%arrayidx166 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %indvars.iv434, i64 0
%arrayidx166.1 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %indvars.iv434, i64 1
%arrayidx166.2 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %indvars.iv434, i64 2
%arrayidx166.3 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %indvars.iv434, i64 3
br label %for.body60
for.body60thread-pre-split: ; preds = %for.inc233
%.pr = load i32, ptr %arrayidx68, align 4, !tbaa !5
br label %for.body60
for.body60: ; preds = %for.body60thread-pre-split, %for.body60.preheader
%35 = phi i32 [ %.pr, %for.body60thread-pre-split ], [ 1, %for.body60.preheader ]
%indvars.iv427 = phi i64 [ %indvars.iv.next428, %for.body60thread-pre-split ], [ 1, %for.body60.preheader ]
%tobool.not = icmp eq i32 %35, 0
br i1 %tobool.not, label %for.inc233, label %if.then
if.then: ; preds = %for.body60
%36 = trunc i64 %indvars.iv427 to i32
%umin = call i32 @llvm.umin.i32(i32 %24, i32 %36)
%37 = add nuw i32 %umin, 1
%38 = sub nsw i64 %21, %indvars.iv427
%39 = add nsw i64 %indvars.iv427, -1
%arrayidx148 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %idxprom144, i64 %39
%wide.trip.count425 = zext i32 %37 to i64
br label %for.cond82.preheader
for.cond82.preheader: ; preds = %if.then, %for.inc230
%indvars.iv421 = phi i64 [ 0, %if.then ], [ %indvars.iv.next422, %for.inc230 ]
%40 = sub nsw i64 %indvars.iv427, %indvars.iv421
%cmp91.not377 = icmp slt i64 %40, 0
br i1 %cmp91.not377, label %for.inc230, label %for.cond94.preheader.lr.ph
for.cond94.preheader.lr.ph: ; preds = %for.cond82.preheader
%41 = trunc i64 %40 to i32
%cond90 = call i32 @llvm.smin.i32(i32 %41, i32 %26)
%arrayidx154 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %indvars.iv445, i64 %indvars.iv421
%42 = sext i32 %cond90 to i64
br label %for.cond94.preheader
for.cond94.preheader: ; preds = %for.cond94.preheader.lr.ph, %for.inc227
%indvars.iv417 = phi i64 [ 0, %for.cond94.preheader.lr.ph ], [ %indvars.iv.next418, %for.inc227 ]
%43 = sub nsw i64 %40, %indvars.iv417
%cmp105.not375 = icmp slt i64 %43, 0
br i1 %cmp105.not375, label %for.inc227, label %for.cond108.preheader.lr.ph
for.cond108.preheader.lr.ph: ; preds = %for.cond94.preheader
%44 = trunc i64 %43 to i32
%sub96.l.0 = call i32 @llvm.smin.i32(i32 %44, i32 %34)
%45 = add nuw nsw i64 %indvars.iv421, %indvars.iv417
%arrayidx160 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %indvars.iv440, i64 %indvars.iv417
%46 = trunc i64 %43 to i32
%sub111.sub71 = call i32 @llvm.smin.i32(i32 %46, i32 %sub71)
%cmp121.not373 = icmp slt i32 %sub111.sub71, 0
br i1 %cmp121.not373, label %for.inc224, label %for.body123.lr.ph
for.body123.lr.ph: ; preds = %for.cond108.preheader.lr.ph
%sub131 = sub nsw i64 %29, %45
%sext = shl i64 %sub131, 32
%idxprom132 = ashr exact i64 %sext, 32
%47 = load i32, ptr %arrayidx148, align 4, !tbaa !5
%conv149 = sext i32 %47 to i64
%mul150 = mul nsw i64 %dupli.0.lcssa, %conv149
%48 = load i32, ptr %arrayidx154, align 4, !tbaa !5
%conv155 = sext i32 %48 to i64
%mul156 = mul nsw i64 %mul150, %conv155
%49 = load i32, ptr %arrayidx160, align 4, !tbaa !5
%conv161 = sext i32 %49 to i64
%mul162 = mul nsw i64 %mul156, %conv161
%50 = load i32, ptr %arrayidx166, align 4, !tbaa !5
%conv167 = sext i32 %50 to i64
%mul168 = mul nsw i64 %mul162, %conv167
%51 = zext i32 %sub111.sub71 to i64
br label %for.body123
for.body123: ; preds = %for.body123.lr.ph, %for.body123
%indvars.iv405 = phi i64 [ 0, %for.body123.lr.ph ], [ %indvars.iv.next406, %for.body123 ]
%52 = add nuw nsw i64 %indvars.iv417, %indvars.iv405
%arrayidx141 = getelementptr inbounds [101 x [401 x [8 x [4 x i32]]]], ptr %dp, i64 0, i64 %20, i64 %idxprom132, i64 %52, i64 %38
%53 = load i32, ptr %arrayidx141, align 4, !tbaa !5
%conv142 = sext i32 %53 to i64
%arrayidx172 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %idxprom169, i64 %indvars.iv405
%54 = load i32, ptr %arrayidx172, align 4, !tbaa !5
%conv173 = sext i32 %54 to i64
%mul174 = mul nsw i64 %mul168, %conv173
%sext456 = shl i64 %indvars.iv405, 32
%55 = ashr exact i64 %sext456, 32
%56 = sub nsw i64 %43, %55
%arrayidx187 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %idxprom180, i64 %56
%57 = load i32, ptr %arrayidx187, align 4, !tbaa !5
%conv188 = sext i32 %57 to i64
%mul189 = mul nsw i64 %mul174, %conv188
%58 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%conv198 = sext i32 %58 to i64
%mul199 = mul nsw i64 %mul189, %conv198
%add200 = add nsw i64 %mul199, %conv142
%rem201 = srem i64 %add200, 10007
%conv202 = trunc i64 %rem201 to i32
store i32 %conv202, ptr %arrayidx141, align 4, !tbaa !5
%indvars.iv.next406 = add nuw nsw i64 %indvars.iv405, 1
%cmp121.not.not = icmp ult i64 %indvars.iv405, %51
br i1 %cmp121.not.not, label %for.body123, label %for.inc224, !llvm.loop !18
for.inc224: ; preds = %for.body123, %for.cond108.preheader.lr.ph
%cmp105.not.not = icmp sgt i32 %sub96.l.0, 0
br i1 %cmp105.not.not, label %for.cond108.preheader.1, label %for.inc227, !llvm.loop !19
for.cond108.preheader.1: ; preds = %for.inc224
%59 = add nsw i64 %43, -1
%60 = trunc i64 %59 to i32
%sub111.sub71.1 = call i32 @llvm.smin.i32(i32 %60, i32 %sub71)
%cmp121.not373.1 = icmp slt i32 %sub111.sub71.1, 0
br i1 %cmp121.not373.1, label %for.inc224.1, label %for.body123.lr.ph.1
for.body123.lr.ph.1: ; preds = %for.cond108.preheader.1
%.neg = xor i64 %45, -1
%sub131.1 = add nsw i64 %29, %.neg
%sext.1 = shl i64 %sub131.1, 32
%idxprom132.1 = ashr exact i64 %sext.1, 32
%61 = add nuw nsw i64 %indvars.iv417, 2
%62 = load i32, ptr %arrayidx148, align 4, !tbaa !5
%conv149.1 = sext i32 %62 to i64
%mul150.1 = mul nsw i64 %dupli.0.lcssa, %conv149.1
%63 = load i32, ptr %arrayidx154, align 4, !tbaa !5
%conv155.1 = sext i32 %63 to i64
%mul156.1 = mul nsw i64 %mul150.1, %conv155.1
%64 = load i32, ptr %arrayidx160, align 4, !tbaa !5
%conv161.1 = sext i32 %64 to i64
%mul162.1 = mul nsw i64 %mul156.1, %conv161.1
%65 = load i32, ptr %arrayidx166.1, align 4, !tbaa !5
%conv167.1 = sext i32 %65 to i64
%mul168.1 = mul nsw i64 %mul162.1, %conv167.1
%66 = zext i32 %sub111.sub71.1 to i64
br label %for.body123.1
for.body123.1: ; preds = %for.body123.1, %for.body123.lr.ph.1
%indvars.iv405.1 = phi i64 [ 0, %for.body123.lr.ph.1 ], [ %indvars.iv.next406.1, %for.body123.1 ]
%67 = add nuw nsw i64 %61, %indvars.iv405.1
%arrayidx141.1 = getelementptr inbounds [101 x [401 x [8 x [4 x i32]]]], ptr %dp, i64 0, i64 %20, i64 %idxprom132.1, i64 %67, i64 %38
%68 = load i32, ptr %arrayidx141.1, align 4, !tbaa !5
%conv142.1 = sext i32 %68 to i64
%arrayidx172.1 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %idxprom169, i64 %indvars.iv405.1
%69 = load i32, ptr %arrayidx172.1, align 4, !tbaa !5
%conv173.1 = sext i32 %69 to i64
%mul174.1 = mul nsw i64 %mul168.1, %conv173.1
%sext456.1 = shl i64 %indvars.iv405.1, 32
%70 = ashr exact i64 %sext456.1, 32
%71 = sub nsw i64 %59, %70
%arrayidx187.1 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %idxprom180, i64 %71
%72 = load i32, ptr %arrayidx187.1, align 4, !tbaa !5
%conv188.1 = sext i32 %72 to i64
%mul189.1 = mul nsw i64 %mul174.1, %conv188.1
%73 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%conv198.1 = sext i32 %73 to i64
%mul199.1 = mul nsw i64 %mul189.1, %conv198.1
%add200.1 = add nsw i64 %mul199.1, %conv142.1
%rem201.1 = srem i64 %add200.1, 10007
%conv202.1 = trunc i64 %rem201.1 to i32
store i32 %conv202.1, ptr %arrayidx141.1, align 4, !tbaa !5
%indvars.iv.next406.1 = add nuw nsw i64 %indvars.iv405.1, 1
%cmp121.not.not.1 = icmp ult i64 %indvars.iv405.1, %66
br i1 %cmp121.not.not.1, label %for.body123.1, label %for.inc224.1, !llvm.loop !18
for.inc224.1: ; preds = %for.body123.1, %for.cond108.preheader.1
%cmp105.not.not.1 = icmp sgt i32 %sub96.l.0, 1
br i1 %cmp105.not.not.1, label %for.cond108.preheader.2, label %for.inc227, !llvm.loop !19
for.cond108.preheader.2: ; preds = %for.inc224.1
%74 = add nsw i64 %43, -2
%75 = trunc i64 %74 to i32
%sub111.sub71.2 = call i32 @llvm.smin.i32(i32 %75, i32 %sub71)
%cmp121.not373.2 = icmp slt i32 %sub111.sub71.2, 0
br i1 %cmp121.not373.2, label %for.inc224.2, label %for.body123.lr.ph.2
for.body123.lr.ph.2: ; preds = %for.cond108.preheader.2
%76 = add nuw nsw i64 %45, 2
%sub131.2 = sub nsw i64 %29, %76
%sext.2 = shl i64 %sub131.2, 32
%idxprom132.2 = ashr exact i64 %sext.2, 32
%77 = add nuw nsw i64 %indvars.iv417, 4
%78 = load i32, ptr %arrayidx148, align 4, !tbaa !5
%conv149.2 = sext i32 %78 to i64
%mul150.2 = mul nsw i64 %dupli.0.lcssa, %conv149.2
%79 = load i32, ptr %arrayidx154, align 4, !tbaa !5
%conv155.2 = sext i32 %79 to i64
%mul156.2 = mul nsw i64 %mul150.2, %conv155.2
%80 = load i32, ptr %arrayidx160, align 4, !tbaa !5
%conv161.2 = sext i32 %80 to i64
%mul162.2 = mul nsw i64 %mul156.2, %conv161.2
%81 = load i32, ptr %arrayidx166.2, align 4, !tbaa !5
%conv167.2 = sext i32 %81 to i64
%mul168.2 = mul nsw i64 %mul162.2, %conv167.2
%82 = zext i32 %sub111.sub71.2 to i64
br label %for.body123.2
for.body123.2: ; preds = %for.body123.2, %for.body123.lr.ph.2
%indvars.iv405.2 = phi i64 [ 0, %for.body123.lr.ph.2 ], [ %indvars.iv.next406.2, %for.body123.2 ]
%83 = add nuw nsw i64 %77, %indvars.iv405.2
%arrayidx141.2 = getelementptr inbounds [101 x [401 x [8 x [4 x i32]]]], ptr %dp, i64 0, i64 %20, i64 %idxprom132.2, i64 %83, i64 %38
%84 = load i32, ptr %arrayidx141.2, align 4, !tbaa !5
%conv142.2 = sext i32 %84 to i64
%arrayidx172.2 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %idxprom169, i64 %indvars.iv405.2
%85 = load i32, ptr %arrayidx172.2, align 4, !tbaa !5
%conv173.2 = sext i32 %85 to i64
%mul174.2 = mul nsw i64 %mul168.2, %conv173.2
%sext456.2 = shl i64 %indvars.iv405.2, 32
%86 = ashr exact i64 %sext456.2, 32
%87 = sub nsw i64 %74, %86
%arrayidx187.2 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %idxprom180, i64 %87
%88 = load i32, ptr %arrayidx187.2, align 4, !tbaa !5
%conv188.2 = sext i32 %88 to i64
%mul189.2 = mul nsw i64 %mul174.2, %conv188.2
%89 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%conv198.2 = sext i32 %89 to i64
%mul199.2 = mul nsw i64 %mul189.2, %conv198.2
%add200.2 = add nsw i64 %mul199.2, %conv142.2
%rem201.2 = srem i64 %add200.2, 10007
%conv202.2 = trunc i64 %rem201.2 to i32
store i32 %conv202.2, ptr %arrayidx141.2, align 4, !tbaa !5
%indvars.iv.next406.2 = add nuw nsw i64 %indvars.iv405.2, 1
%cmp121.not.not.2 = icmp ult i64 %indvars.iv405.2, %82
br i1 %cmp121.not.not.2, label %for.body123.2, label %for.inc224.2, !llvm.loop !18
for.inc224.2: ; preds = %for.body123.2, %for.cond108.preheader.2
%cmp105.not.not.2 = icmp sgt i32 %sub96.l.0, 2
br i1 %cmp105.not.not.2, label %for.cond108.preheader.3, label %for.inc227, !llvm.loop !19
for.cond108.preheader.3: ; preds = %for.inc224.2
%90 = add nsw i64 %43, -3
%91 = trunc i64 %90 to i32
%sub111.sub71.3 = call i32 @llvm.smin.i32(i32 %91, i32 %sub71)
%cmp121.not373.3 = icmp slt i32 %sub111.sub71.3, 0
br i1 %cmp121.not373.3, label %for.inc227, label %for.body123.lr.ph.3
for.body123.lr.ph.3: ; preds = %for.cond108.preheader.3
%92 = add nuw nsw i64 %45, 3
%sub131.3 = sub nsw i64 %29, %92
%sext.3 = shl i64 %sub131.3, 32
%idxprom132.3 = ashr exact i64 %sext.3, 32
%93 = add nuw nsw i64 %indvars.iv417, 6
%94 = load i32, ptr %arrayidx148, align 4, !tbaa !5
%conv149.3 = sext i32 %94 to i64
%mul150.3 = mul nsw i64 %dupli.0.lcssa, %conv149.3
%95 = load i32, ptr %arrayidx154, align 4, !tbaa !5
%conv155.3 = sext i32 %95 to i64
%mul156.3 = mul nsw i64 %mul150.3, %conv155.3
%96 = load i32, ptr %arrayidx160, align 4, !tbaa !5
%conv161.3 = sext i32 %96 to i64
%mul162.3 = mul nsw i64 %mul156.3, %conv161.3
%97 = load i32, ptr %arrayidx166.3, align 4, !tbaa !5
%conv167.3 = sext i32 %97 to i64
%mul168.3 = mul nsw i64 %mul162.3, %conv167.3
%98 = zext i32 %sub111.sub71.3 to i64
br label %for.body123.3
for.body123.3: ; preds = %for.body123.3, %for.body123.lr.ph.3
%indvars.iv405.3 = phi i64 [ 0, %for.body123.lr.ph.3 ], [ %indvars.iv.next406.3, %for.body123.3 ]
%99 = add nuw nsw i64 %93, %indvars.iv405.3
%arrayidx141.3 = getelementptr inbounds [101 x [401 x [8 x [4 x i32]]]], ptr %dp, i64 0, i64 %20, i64 %idxprom132.3, i64 %99, i64 %38
%100 = load i32, ptr %arrayidx141.3, align 4, !tbaa !5
%conv142.3 = sext i32 %100 to i64
%arrayidx172.3 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %idxprom169, i64 %indvars.iv405.3
%101 = load i32, ptr %arrayidx172.3, align 4, !tbaa !5
%conv173.3 = sext i32 %101 to i64
%mul174.3 = mul nsw i64 %mul168.3, %conv173.3
%sext456.3 = shl i64 %indvars.iv405.3, 32
%102 = ashr exact i64 %sext456.3, 32
%103 = sub nsw i64 %90, %102
%arrayidx187.3 = getelementptr inbounds [401 x [401 x i32]], ptr %binom, i64 0, i64 %idxprom180, i64 %103
%104 = load i32, ptr %arrayidx187.3, align 4, !tbaa !5
%conv188.3 = sext i32 %104 to i64
%mul189.3 = mul nsw i64 %mul174.3, %conv188.3
%105 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%conv198.3 = sext i32 %105 to i64
%mul199.3 = mul nsw i64 %mul189.3, %conv198.3
%add200.3 = add nsw i64 %mul199.3, %conv142.3
%rem201.3 = srem i64 %add200.3, 10007
%conv202.3 = trunc i64 %rem201.3 to i32
store i32 %conv202.3, ptr %arrayidx141.3, align 4, !tbaa !5
%indvars.iv.next406.3 = add nuw nsw i64 %indvars.iv405.3, 1
%cmp121.not.not.3 = icmp ult i64 %indvars.iv405.3, %98
br i1 %cmp121.not.not.3, label %for.body123.3, label %for.inc227, !llvm.loop !18
for.inc227: ; preds = %for.inc224, %for.inc224.1, %for.inc224.2, %for.body123.3, %for.cond108.preheader.3, %for.cond94.preheader
%indvars.iv.next418 = add nuw nsw i64 %indvars.iv417, 1
%cmp91.not.not = icmp slt i64 %indvars.iv417, %42
br i1 %cmp91.not.not, label %for.cond94.preheader, label %for.inc230, !llvm.loop !20
for.inc230: ; preds = %for.inc227, %for.cond82.preheader
%indvars.iv.next422 = add nuw nsw i64 %indvars.iv421, 1
%exitcond426.not = icmp eq i64 %indvars.iv.next422, %wide.trip.count425
br i1 %exitcond426.not, label %for.inc233, label %for.cond82.preheader, !llvm.loop !21
for.inc233: ; preds = %for.inc230, %for.body60
%indvars.iv.next428 = add nuw nsw i64 %indvars.iv427, 1
%exitcond433.not = icmp eq i64 %indvars.iv.next428, %wide.trip.count432
br i1 %exitcond433.not, label %for.cond53.for.inc236_crit_edge, label %for.body60thread-pre-split, !llvm.loop !22
for.cond53.for.inc236_crit_edge: ; preds = %for.inc233, %for.cond53.preheader
%indvars.iv.next435 = add nuw nsw i64 %indvars.iv434, 1
%exitcond439.not = icmp eq i64 %indvars.iv.next435, 4
br i1 %exitcond439.not, label %for.inc239.split, label %for.cond53.preheader, !llvm.loop !24
for.inc239.split: ; preds = %for.cond53.for.inc236_crit_edge
%indvars.iv.next441 = add nuw nsw i64 %indvars.iv440, 1
%exitcond444.not = icmp eq i64 %indvars.iv.next441, 8
br i1 %exitcond444.not, label %for.inc242.split, label %for.cond49.preheader, !llvm.loop !25
for.inc242.split: ; preds = %for.inc239.split
%indvars.iv.next446 = add nuw nsw i64 %indvars.iv445, 1
%exitcond449 = icmp eq i64 %indvars.iv.next446, %wide.trip.count448
br i1 %exitcond449, label %for.end244, label %for.cond45.preheader, !llvm.loop !26
for.end244: ; preds = %for.inc242.split, %for.cond45.preheader.lr.ph, %for.cond40.preheader.for.end244_crit_edge
%indvars.iv.next451.pre-phi = phi i64 [ %.pre454, %for.cond40.preheader.for.end244_crit_edge ], [ %20, %for.cond45.preheader.lr.ph ], [ %20, %for.inc242.split ]
%add245 = add nsw i32 %15, %s.0390
%106 = load i32, ptr %n, align 4, !tbaa !5
%107 = sext i32 %106 to i64
%cmp31 = icmp slt i64 %indvars.iv.next451.pre-phi, %107
br i1 %cmp31, label %for.body32, label %for.end248, !llvm.loop !27
for.end248: ; preds = %for.end244, %for.end25.for.end248_crit_edge
%idxprom249.pre-phi = phi i64 [ %.pre455, %for.end25.for.end248_crit_edge ], [ %107, %for.end244 ]
%arrayidx250 = getelementptr inbounds [101 x [401 x [8 x [4 x i32]]]], ptr %dp, i64 0, i64 %idxprom249.pre-phi
%108 = load i32, ptr %arrayidx250, align 16, !tbaa !5
%call254 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %108)
call void @llvm.lifetime.end.p0(i64 5184128, ptr nonnull %dp) #5
call void @llvm.lifetime.end.p0(i64 643204, ptr nonnull %binom) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: 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.umin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !23}
!23 = !{!"llvm.loop.unswitch.partial.disable"}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
|
#include <stdio.h>
int main () {
int L, R, d, count = 0;
scanf("%d %d %d", &L, &R, &d);
for (int i=L; i<=R; i++){
if (i % d == 0){
count++;
}
}
printf("%d", count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317081/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317081/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca i32, align 4
%R = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L, ptr noundef nonnull %R, ptr noundef nonnull %d)
%0 = load i32, ptr %L, align 4, !tbaa !5
%1 = load i32, ptr %R, align 4, !tbaa !5
%cmp.not7 = icmp sgt i32 %0, %1
br i1 %cmp.not7, label %for.cond.cleanup, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%2 = load i32, ptr %d, align 4, !tbaa !5
%3 = add i32 %1, 1
%4 = sub i32 %3, %0
%xtraiter = and i32 %4, 1
%5 = icmp eq i32 %1, %0
br i1 %5, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %4, -2
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %spec.select.1, %for.body ]
%i.09.unr = phi i32 [ %0, %for.body.lr.ph ], [ %inc2.1, %for.body ]
%count.08.unr = phi i32 [ 0, %for.body.lr.ph ], [ %spec.select.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa
%rem.epil = srem i32 %i.09.unr, %2
%cmp1.epil = icmp eq i32 %rem.epil, 0
%inc.epil = zext i1 %cmp1.epil to i32
%spec.select.epil = add nuw nsw i32 %count.08.unr, %inc.epil
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #3
ret i32 0
for.body: ; preds = %for.body, %for.body.lr.ph.new
%i.09 = phi i32 [ %0, %for.body.lr.ph.new ], [ %inc2.1, %for.body ]
%count.08 = phi i32 [ 0, %for.body.lr.ph.new ], [ %spec.select.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%rem = srem i32 %i.09, %2
%cmp1 = icmp eq i32 %rem, 0
%inc = zext i1 %cmp1 to i32
%spec.select = add nuw nsw i32 %count.08, %inc
%inc2 = add i32 %i.09, 1
%rem.1 = srem i32 %inc2, %2
%cmp1.1 = icmp eq i32 %rem.1, 0
%inc.1 = zext i1 %cmp1.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%inc2.1 = add i32 %i.09, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main()
{
int L;
int R;
int d;
int i;
int t=0;
scanf("%d%d%d",&L,&R,&d);
for(i=1;i<=R;i++)
{
if(i*d>=L&&i*d<=R)
t++;
if(i*d>R)
break;
}
printf("%d",t);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317124/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317124/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca i32, align 4
%R = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L, ptr noundef nonnull %R, ptr noundef nonnull %d)
%0 = load i32, ptr %R, align 4, !tbaa !5
%cmp.not15 = icmp slt i32 %0, 1
br i1 %cmp.not15, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %d, align 4, !tbaa !5
%2 = load i32, ptr %L, align 4
br label %for.body
for.body: ; preds = %for.body.lr.ph, %for.inc
%t.017 = phi i32 [ 0, %for.body.lr.ph ], [ %t.1, %for.inc ]
%i.016 = phi i32 [ 1, %for.body.lr.ph ], [ %inc8, %for.inc ]
%mul = mul nsw i32 %1, %i.016
%cmp3.not.not = icmp sgt i32 %mul, %0
br i1 %cmp3.not.not, label %for.end, label %for.inc
for.inc: ; preds = %for.body
%cmp1.not = icmp sge i32 %mul, %2
%inc = zext i1 %cmp1.not to i32
%t.1 = add nuw nsw i32 %t.017, %inc
%inc8 = add nuw i32 %i.016, 1
%exitcond.not = icmp eq i32 %i.016, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc, %for.body, %entry
%t.0.lcssa = phi i32 [ 0, %entry ], [ %t.017, %for.body ], [ %t.1, %for.inc ]
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %t.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
int i,cnt=0;
for(i=a;i<=b;i++){
if(i%c==0) cnt++;
}
printf("%d\n",cnt);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317168/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317168/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #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.not7 = icmp sgt i32 %0, %1
br i1 %cmp.not7, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = add i32 %1, 1
%4 = sub i32 %3, %0
%xtraiter = and i32 %4, 1
%5 = icmp eq i32 %1, %0
br i1 %5, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %4, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%cnt.09 = phi i32 [ 0, %for.body.lr.ph.new ], [ %spec.select.1, %for.body ]
%i.08 = phi i32 [ %0, %for.body.lr.ph.new ], [ %inc2.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%rem = srem i32 %i.08, %2
%cmp1 = icmp eq i32 %rem, 0
%inc = zext i1 %cmp1 to i32
%spec.select = add nuw nsw i32 %cnt.09, %inc
%inc2 = add i32 %i.08, 1
%rem.1 = srem i32 %inc2, %2
%cmp1.1 = icmp eq i32 %rem.1, 0
%inc.1 = zext i1 %cmp1.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%inc2.1 = add i32 %i.08, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %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.body, %for.body.lr.ph
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %spec.select.1, %for.body ]
%cnt.09.unr = phi i32 [ 0, %for.body.lr.ph ], [ %spec.select.1, %for.body ]
%i.08.unr = phi i32 [ %0, %for.body.lr.ph ], [ %inc2.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%rem.epil = srem i32 %i.08.unr, %2
%cmp1.epil = icmp eq i32 %rem.epil, 0
%inc.epil = zext i1 %cmp1.epil to i32
%spec.select.epil = add nuw nsw i32 %cnt.09.unr, %inc.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
int i,l,r,d,count=0;
scanf("%d %d %d",&l,&r,&d);
for(i=l;i<=r;i++)
{
if(i % d == 0)
{
count++;
}
}
printf("%d",count);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317210/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317210/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%l = alloca i32, align 4
%r = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %r, ptr noundef nonnull %d)
%0 = load i32, ptr %l, align 4, !tbaa !5
%1 = load i32, ptr %r, align 4, !tbaa !5
%cmp.not7 = icmp sgt i32 %0, %1
br i1 %cmp.not7, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%2 = load i32, ptr %d, align 4, !tbaa !5
%3 = add i32 %1, 1
%4 = sub i32 %3, %0
%xtraiter = and i32 %4, 1
%5 = icmp eq i32 %1, %0
br i1 %5, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %4, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%count.09 = phi i32 [ 0, %for.body.lr.ph.new ], [ %spec.select.1, %for.body ]
%i.08 = phi i32 [ %0, %for.body.lr.ph.new ], [ %inc2.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%rem = srem i32 %i.08, %2
%cmp1 = icmp eq i32 %rem, 0
%inc = zext i1 %cmp1 to i32
%spec.select = add nuw nsw i32 %count.09, %inc
%inc2 = add i32 %i.08, 1
%rem.1 = srem i32 %inc2, %2
%cmp1.1 = icmp eq i32 %rem.1, 0
%inc.1 = zext i1 %cmp1.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%inc2.1 = add i32 %i.08, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %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.body, %for.body.lr.ph
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %spec.select.1, %for.body ]
%count.09.unr = phi i32 [ 0, %for.body.lr.ph ], [ %spec.select.1, %for.body ]
%i.08.unr = phi i32 [ %0, %for.body.lr.ph ], [ %inc2.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%rem.epil = srem i32 %i.08.unr, %2
%cmp1.epil = icmp eq i32 %rem.epil, 0
%inc.epil = zext i1 %cmp1.epil to i32
%spec.select.epil = add nuw nsw i32 %count.09.unr, %inc.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
int L, R, d, count=0, i;
scanf("%d %d %d", &L, &R, &d);
for(i=1; i<=R; i++) {
if (L <= i*d && i*d <= R) {
count++;
}
}
printf("%d\n", count);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317254/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317254/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca i32, align 4
%R = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L, ptr noundef nonnull %R, ptr noundef nonnull %d)
%0 = load i32, ptr %R, align 4, !tbaa !5
%cmp.not10 = icmp slt i32 %0, 1
br i1 %cmp.not10, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %L, align 4, !tbaa !5
%2 = load i32, ptr %d, align 4, !tbaa !5
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader, label %vector.ph
vector.ph: ; preds = %for.body.lr.ph
%n.vec = and i32 %0, -8
%ind.end = or i32 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %2, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert15 = insertelement <4 x i32> poison, i32 %1, i64 0
%broadcast.splat16 = shufflevector <4 x i32> %broadcast.splatinsert15, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert17 = insertelement <4 x i32> poison, i32 %0, i64 0
%broadcast.splat18 = shufflevector <4 x i32> %broadcast.splatinsert17, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%vec.phi14 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%3 = mul nsw <4 x i32> %broadcast.splat, %vec.ind
%4 = mul nsw <4 x i32> %broadcast.splat, %step.add
%5 = icmp sle <4 x i32> %broadcast.splat16, %3
%6 = icmp sle <4 x i32> %broadcast.splat16, %4
%7 = icmp sle <4 x i32> %3, %broadcast.splat18
%8 = icmp sle <4 x i32> %4, %broadcast.splat18
%9 = and <4 x i1> %5, %7
%10 = and <4 x i1> %6, %8
%11 = zext <4 x i1> %9 to <4 x i32>
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = add <4 x i32> %vec.phi, %11
%14 = add <4 x i32> %vec.phi14, %12
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%15 = icmp eq i32 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %14, %13
%16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %0, %n.vec
br i1 %cmp.n, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %for.body.lr.ph, %middle.block
%i.012.ph = phi i32 [ 1, %for.body.lr.ph ], [ %ind.end, %middle.block ]
%count.011.ph = phi i32 [ 0, %for.body.lr.ph ], [ %16, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%i.012 = phi i32 [ %inc4, %for.body ], [ %i.012.ph, %for.body.preheader ]
%count.011 = phi i32 [ %count.1, %for.body ], [ %count.011.ph, %for.body.preheader ]
%mul = mul nsw i32 %2, %i.012
%cmp1.not = icmp sle i32 %1, %mul
%cmp3.not = icmp sle i32 %mul, %0
%or.cond.not = and i1 %cmp1.not, %cmp3.not
%inc = zext i1 %or.cond.not to i32
%count.1 = add nuw nsw i32 %count.011, %inc
%inc4 = add nuw i32 %i.012, 1
%exitcond.not = icmp eq i32 %i.012, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %16, %middle.block ], [ %count.1, %for.body ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
|
#include <stdio.h>
int main() {
int i, ans;
int L, R, d;
ans = 0;
scanf("%d %d %d", &L, &R, &d);
for(i=L; i<=R; i++){
if((i % d) == 0) ans++;
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317298/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317298/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca i32, align 4
%R = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %R) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L, ptr noundef nonnull %R, ptr noundef nonnull %d)
%0 = load i32, ptr %L, align 4, !tbaa !5
%1 = load i32, ptr %R, align 4, !tbaa !5
%cmp.not7 = icmp sgt i32 %0, %1
br i1 %cmp.not7, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%2 = load i32, ptr %d, align 4, !tbaa !5
%3 = add i32 %1, 1
%4 = sub i32 %3, %0
%xtraiter = and i32 %4, 1
%5 = icmp eq i32 %1, %0
br i1 %5, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %4, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%ans.09 = phi i32 [ 0, %for.body.lr.ph.new ], [ %spec.select.1, %for.body ]
%i.08 = phi i32 [ %0, %for.body.lr.ph.new ], [ %inc2.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%rem = srem i32 %i.08, %2
%cmp1 = icmp eq i32 %rem, 0
%inc = zext i1 %cmp1 to i32
%spec.select = add nuw nsw i32 %ans.09, %inc
%inc2 = add i32 %i.08, 1
%rem.1 = srem i32 %inc2, %2
%cmp1.1 = icmp eq i32 %rem.1, 0
%inc.1 = zext i1 %cmp1.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%inc2.1 = add i32 %i.08, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %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.body, %for.body.lr.ph
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %spec.select.1, %for.body ]
%ans.09.unr = phi i32 [ 0, %for.body.lr.ph ], [ %spec.select.1, %for.body ]
%i.08.unr = phi i32 [ %0, %for.body.lr.ph ], [ %inc2.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%rem.epil = srem i32 %i.08.unr, %2
%cmp1.epil = icmp eq i32 %rem.epil, 0
%inc.epil = zext i1 %cmp1.epil to i32
%spec.select.epil = add nuw nsw i32 %ans.09.unr, %inc.epil
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%ans.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %R) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %L) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void){
// Your code here!
char s[101], ans[8] = "keyence", temp[8] = {};
scanf("%s\n",s);
int n = strlen(s);
int r = n-7;
int flag = 0;
for(int i = 0; i <= n-r && flag == 0; i++)
{
//printf("%d:\n",i);
for(int j = 0; j < i; j++)
{
temp[j] = s[j];
//printf("%c ",temp[j]);
//printf("%c\n",temp[8]);
}
for(int j = 0; n-j > i+r; j++)
{
temp[7-j-1] = s[n-(j+1)];
//printf("%c ",temp[7-j-1]);
//printf("%c\n",temp[8]);
}
//printf("\n %s \n",temp);
//for(int j = 0; j < 7; j++) printf("%c",temp[j]);
//printf("\n");
if(strcmp(ans,temp) == 0)
flag = 1;
}
printf("%s\n",(flag==1)? "YES":"NO");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317355/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317355/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%s\0A\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 {
for.cond.cleanup19.peel:
%s = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%sext = shl i64 %call2, 32
%0 = ashr exact i64 %sext, 32
%1 = getelementptr i8, ptr %s, i64 %0
%scevgep64 = getelementptr i8, ptr %1, i64 -1
%scevgep65.peel = getelementptr i8, ptr %1, i64 -7
%temp.sroa.0.0.copyload = load i56, ptr %scevgep65.peel, align 1, !tbaa !5
%.not74 = icmp eq i56 %temp.sroa.0.0.copyload, 28538298447783275
br i1 %.not74, label %for.cond.cleanup, label %for.body20.preheader
for.cond.cleanup.loopexit: ; preds = %for.cond15.preheader.6, %for.body20.preheader.5, %for.body20.preheader.4, %for.body20.preheader.3, %for.body20.preheader.2, %for.body20.preheader.1, %for.body20.preheader
%.not76.lcssa = phi i1 [ %.not76, %for.body20.preheader ], [ %.not76.1, %for.body20.preheader.1 ], [ %.not76.2, %for.body20.preheader.2 ], [ %.not76.3, %for.body20.preheader.3 ], [ %.not76.4, %for.body20.preheader.4 ], [ %.not76.5, %for.body20.preheader.5 ], [ %.not76.6, %for.cond15.preheader.6 ]
%2 = select i1 %.not76.lcssa, ptr @.str.1, ptr @.str.2
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %for.cond.cleanup19.peel
%cmp35.lcssa = phi ptr [ @.str.1, %for.cond.cleanup19.peel ], [ %2, %for.cond.cleanup.loopexit ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %cmp35.lcssa)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #5
ret i32 0
for.body20.preheader: ; preds = %for.cond.cleanup19.peel
%temp.sroa.0.0.copyload114 = load i8, ptr %s, align 16, !tbaa !5
%temp.sroa.0.0.insert.insert118 = zext i8 %temp.sroa.0.0.copyload114 to i64
%scevgep65 = getelementptr i8, ptr %1, i64 -6
%temp.sroa.0.1.copyload = load i48, ptr %scevgep65, align 1, !tbaa !5
%temp.sroa.0.1.insert.ext = zext i48 %temp.sroa.0.1.copyload to i64
%temp.sroa.0.1.insert.shift = shl nuw nsw i64 %temp.sroa.0.1.insert.ext, 8
%temp.sroa.0.1.insert.insert = or i64 %temp.sroa.0.1.insert.shift, %temp.sroa.0.0.insert.insert118
%.not76 = icmp eq i64 %temp.sroa.0.1.insert.insert, 28538298447783275
br i1 %.not76, label %for.cond.cleanup.loopexit, label %for.body20.preheader.1, !llvm.loop !8
for.body20.preheader.1: ; preds = %for.body20.preheader
%temp.sroa.0.0.insert.mask112 = and i64 %temp.sroa.0.1.insert.insert, -72057594037927936
%temp.sroa.0.0.copyload109 = load i16, ptr %s, align 16, !tbaa !5
%temp.sroa.0.0.insert.ext111 = zext i16 %temp.sroa.0.0.copyload109 to i64
%temp.sroa.0.0.insert.insert113 = or i64 %temp.sroa.0.0.insert.mask112, %temp.sroa.0.0.insert.ext111
%scevgep65.1 = getelementptr i8, ptr %1, i64 -5
%temp.sroa.0.2.copyload = load i40, ptr %scevgep65.1, align 1, !tbaa !5
%temp.sroa.0.2.insert.ext = zext i40 %temp.sroa.0.2.copyload to i64
%temp.sroa.0.2.insert.shift = shl nuw nsw i64 %temp.sroa.0.2.insert.ext, 16
%temp.sroa.0.2.insert.insert = or i64 %temp.sroa.0.0.insert.insert113, %temp.sroa.0.2.insert.shift
%.not76.1 = icmp eq i64 %temp.sroa.0.2.insert.insert, 28538298447783275
br i1 %.not76.1, label %for.cond.cleanup.loopexit, label %for.body20.preheader.2, !llvm.loop !8
for.body20.preheader.2: ; preds = %for.body20.preheader.1
%temp.sroa.0.0.insert.mask107 = and i64 %temp.sroa.0.2.insert.insert, -72057594037927936
%temp.sroa.0.0.copyload104 = load i24, ptr %s, align 16, !tbaa !5
%temp.sroa.0.0.insert.ext106 = zext i24 %temp.sroa.0.0.copyload104 to i64
%temp.sroa.0.0.insert.insert108 = or i64 %temp.sroa.0.0.insert.mask107, %temp.sroa.0.0.insert.ext106
%scevgep65.2 = getelementptr i8, ptr %1, i64 -4
%temp.sroa.0.3.copyload = load i32, ptr %scevgep65.2, align 1, !tbaa !5
%temp.sroa.0.3.insert.ext = zext i32 %temp.sroa.0.3.copyload to i64
%temp.sroa.0.3.insert.shift = shl nuw nsw i64 %temp.sroa.0.3.insert.ext, 24
%temp.sroa.0.3.insert.insert = or i64 %temp.sroa.0.0.insert.insert108, %temp.sroa.0.3.insert.shift
%.not76.2 = icmp eq i64 %temp.sroa.0.3.insert.insert, 28538298447783275
br i1 %.not76.2, label %for.cond.cleanup.loopexit, label %for.body20.preheader.3, !llvm.loop !8
for.body20.preheader.3: ; preds = %for.body20.preheader.2
%temp.sroa.0.0.insert.mask102 = and i64 %temp.sroa.0.3.insert.insert, -72057594037927936
%temp.sroa.0.0.copyload99 = load i32, ptr %s, align 16, !tbaa !5
%temp.sroa.0.0.insert.ext101 = zext i32 %temp.sroa.0.0.copyload99 to i64
%temp.sroa.0.0.insert.insert103 = or i64 %temp.sroa.0.0.insert.mask102, %temp.sroa.0.0.insert.ext101
%scevgep65.3 = getelementptr i8, ptr %1, i64 -3
%temp.sroa.0.4.copyload = load i24, ptr %scevgep65.3, align 1, !tbaa !5
%temp.sroa.0.4.insert.ext = zext i24 %temp.sroa.0.4.copyload to i64
%temp.sroa.0.4.insert.shift = shl nuw nsw i64 %temp.sroa.0.4.insert.ext, 32
%temp.sroa.0.4.insert.insert = or i64 %temp.sroa.0.0.insert.insert103, %temp.sroa.0.4.insert.shift
%.not76.3 = icmp eq i64 %temp.sroa.0.4.insert.insert, 28538298447783275
br i1 %.not76.3, label %for.cond.cleanup.loopexit, label %for.body20.preheader.4, !llvm.loop !8
for.body20.preheader.4: ; preds = %for.body20.preheader.3
%temp.sroa.0.0.insert.mask97 = and i64 %temp.sroa.0.4.insert.insert, -72057594037927936
%temp.sroa.0.0.copyload94 = load i40, ptr %s, align 16, !tbaa !5
%temp.sroa.0.0.insert.ext96 = zext i40 %temp.sroa.0.0.copyload94 to i64
%temp.sroa.0.0.insert.insert98 = or i64 %temp.sroa.0.0.insert.mask97, %temp.sroa.0.0.insert.ext96
%scevgep65.4 = getelementptr i8, ptr %1, i64 -2
%temp.sroa.0.5.copyload = load i16, ptr %scevgep65.4, align 1, !tbaa !5
%temp.sroa.0.5.insert.ext = zext i16 %temp.sroa.0.5.copyload to i64
%temp.sroa.0.5.insert.shift = shl nuw nsw i64 %temp.sroa.0.5.insert.ext, 40
%temp.sroa.0.5.insert.insert = or i64 %temp.sroa.0.0.insert.insert98, %temp.sroa.0.5.insert.shift
%.not76.4 = icmp eq i64 %temp.sroa.0.5.insert.insert, 28538298447783275
br i1 %.not76.4, label %for.cond.cleanup.loopexit, label %for.body20.preheader.5, !llvm.loop !8
for.body20.preheader.5: ; preds = %for.body20.preheader.4
%temp.sroa.0.0.insert.mask92 = and i64 %temp.sroa.0.5.insert.insert, -72057594037927936
%temp.sroa.0.0.copyload89 = load i48, ptr %s, align 16, !tbaa !5
%temp.sroa.0.0.insert.ext91 = zext i48 %temp.sroa.0.0.copyload89 to i64
%temp.sroa.0.0.insert.insert93 = or i64 %temp.sroa.0.0.insert.mask92, %temp.sroa.0.0.insert.ext91
%temp.sroa.0.6.copyload = load i8, ptr %scevgep64, align 1, !tbaa !5
%temp.sroa.0.6.insert.ext = zext i8 %temp.sroa.0.6.copyload to i64
%temp.sroa.0.6.insert.shift = shl nuw nsw i64 %temp.sroa.0.6.insert.ext, 48
%temp.sroa.0.6.insert.insert = or i64 %temp.sroa.0.0.insert.insert93, %temp.sroa.0.6.insert.shift
%.not76.5 = icmp eq i64 %temp.sroa.0.6.insert.insert, 28538298447783275
br i1 %.not76.5, label %for.cond.cleanup.loopexit, label %for.cond15.preheader.6, !llvm.loop !8
for.cond15.preheader.6: ; preds = %for.body20.preheader.5
%temp.sroa.0.0.copyload84 = load i56, ptr %s, align 16, !tbaa !5
%temp.sroa.0.0.insert.ext86 = zext i56 %temp.sroa.0.0.copyload84 to i64
%temp.sroa.0.0.insert.mask87 = and i64 %temp.sroa.0.6.insert.insert, -72057594037927936
%temp.sroa.0.0.insert.insert88 = or i64 %temp.sroa.0.0.insert.mask87, %temp.sroa.0.0.insert.ext86
%.not76.6 = icmp eq i64 %temp.sroa.0.0.insert.insert88, 28538298447783275
br label %for.cond.cleanup.loopexit
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
int main()
{
int i,j;
int G[10][10];
char m[11];
while(scanf("%s",m)!=EOF){
for(i=0;i<10;i++){
G[0][i]=(m[i]-'0');
}
for(i=0;i<9;i++){
for(j=i;j<9;j++){
G[i+1][j+1]=(G[i][j]+G[i][j+1])%10;
}
}
printf("%d\n",G[9][9]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317399/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317399/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%m = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %m) #3
%call53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%cmp.not54 = icmp eq i32 %call53, -1
br i1 %cmp.not54, label %while.end, label %for.cond.preheader.lr.ph
for.cond.preheader.lr.ph: ; preds = %entry
%arrayidx.1 = getelementptr inbounds [11 x i8], ptr %m, i64 0, i64 1
%arrayidx.2 = getelementptr inbounds [11 x i8], ptr %m, i64 0, i64 2
%arrayidx.3 = getelementptr inbounds [11 x i8], ptr %m, i64 0, i64 3
%arrayidx.4 = getelementptr inbounds [11 x i8], ptr %m, i64 0, i64 4
%arrayidx.5 = getelementptr inbounds [11 x i8], ptr %m, i64 0, i64 5
%arrayidx.6 = getelementptr inbounds [11 x i8], ptr %m, i64 0, i64 6
%arrayidx.7 = getelementptr inbounds [11 x i8], ptr %m, i64 0, i64 7
%arrayidx.8 = getelementptr inbounds [11 x i8], ptr %m, i64 0, i64 8
%arrayidx.9 = getelementptr inbounds [11 x i8], ptr %m, i64 0, i64 9
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %for.cond.preheader
%0 = load i8, ptr %m, align 1, !tbaa !5
%conv = sext i8 %0 to i32
%sub = add nsw i32 %conv, 65488
%1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv.1 = sext i8 %1 to i32
%sub.1 = add nsw i32 %conv.1, -48
%2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5
%conv.2 = sext i8 %2 to i32
%sub.2 = add nsw i32 %conv.2, -48
%3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%conv.3 = sext i8 %3 to i32
%sub.3 = add nsw i32 %conv.3, -48
%4 = load i8, ptr %arrayidx.4, align 1, !tbaa !5
%conv.4 = sext i8 %4 to i32
%sub.4 = add nsw i32 %conv.4, -48
%5 = load i8, ptr %arrayidx.5, align 1, !tbaa !5
%conv.5 = sext i8 %5 to i32
%sub.5 = add nsw i32 %conv.5, -48
%6 = load i8, ptr %arrayidx.6, align 1, !tbaa !5
%conv.6 = sext i8 %6 to i32
%sub.6 = add nsw i32 %conv.6, -48
%7 = load i8, ptr %arrayidx.7, align 1, !tbaa !5
%conv.7 = sext i8 %7 to i32
%sub.7 = add nsw i32 %conv.7, -48
%8 = load i8, ptr %arrayidx.8, align 1, !tbaa !5
%conv.8 = sext i8 %8 to i32
%sub.8 = add nsw i32 %conv.8, -48
%9 = load i8, ptr %arrayidx.9, align 1, !tbaa !5
%conv.9 = sext i8 %9 to i32
%sub.9 = add nsw i32 %conv.9, 65488
%add21 = add nsw i32 %sub.1, %sub
%rem.lhs.trunc = trunc i32 %add21 to i16
%rem154 = srem i16 %rem.lhs.trunc, 10
%add21.163 = add nsw i32 %sub.2, %sub.1
%rem.164.lhs.trunc = trunc i32 %add21.163 to i16
%rem.164155 = srem i16 %rem.164.lhs.trunc, 10
%add21.269 = add nsw i32 %sub.3, %sub.2
%rem.270.lhs.trunc = trunc i32 %add21.269 to i16
%rem.270156 = srem i16 %rem.270.lhs.trunc, 10
%add21.375 = add nsw i32 %sub.4, %sub.3
%rem.376.lhs.trunc = trunc i32 %add21.375 to i16
%rem.376157 = srem i16 %rem.376.lhs.trunc, 10
%add21.481 = add nsw i32 %sub.5, %sub.4
%rem.482.lhs.trunc = trunc i32 %add21.481 to i16
%rem.482158 = srem i16 %rem.482.lhs.trunc, 10
%add21.587 = add nsw i32 %sub.6, %sub.5
%rem.588.lhs.trunc = trunc i32 %add21.587 to i16
%rem.588159 = srem i16 %rem.588.lhs.trunc, 10
%add21.693 = add nsw i32 %sub.7, %sub.6
%rem.694.lhs.trunc = trunc i32 %add21.693 to i16
%rem.694160 = srem i16 %rem.694.lhs.trunc, 10
%add21.799 = add nsw i32 %sub.8, %sub.7
%rem.7100.lhs.trunc = trunc i32 %add21.799 to i16
%rem.7100161 = srem i16 %rem.7100.lhs.trunc, 10
%add21.8105 = add nsw i32 %sub.9, %sub.8
%rem.8106.lhs.trunc = trunc i32 %add21.8105 to i16
%rem.8106162 = srem i16 %rem.8106.lhs.trunc, 10
%narrow = add nsw i16 %rem.164155, %rem154
%rem.1.lhs.trunc = trunc i16 %narrow to i8
%rem.1163 = srem i8 %rem.1.lhs.trunc, 10
%narrow199 = add nsw i16 %rem.270156, %rem.164155
%rem.1.1.lhs.trunc = trunc i16 %narrow199 to i8
%rem.1.1164 = srem i8 %rem.1.1.lhs.trunc, 10
%narrow200 = add nsw i16 %rem.376157, %rem.270156
%rem.1.2.lhs.trunc = trunc i16 %narrow200 to i8
%rem.1.2165 = srem i8 %rem.1.2.lhs.trunc, 10
%narrow201 = add nsw i16 %rem.482158, %rem.376157
%rem.1.3.lhs.trunc = trunc i16 %narrow201 to i8
%rem.1.3166 = srem i8 %rem.1.3.lhs.trunc, 10
%narrow202 = add nsw i16 %rem.588159, %rem.482158
%rem.1.4.lhs.trunc = trunc i16 %narrow202 to i8
%rem.1.4167 = srem i8 %rem.1.4.lhs.trunc, 10
%narrow203 = add nsw i16 %rem.694160, %rem.588159
%rem.1.5.lhs.trunc = trunc i16 %narrow203 to i8
%rem.1.5168 = srem i8 %rem.1.5.lhs.trunc, 10
%narrow204 = add nsw i16 %rem.7100161, %rem.694160
%rem.1.6.lhs.trunc = trunc i16 %narrow204 to i8
%rem.1.6169 = srem i8 %rem.1.6.lhs.trunc, 10
%narrow205 = add nsw i16 %rem.8106162, %rem.7100161
%rem.1.7.lhs.trunc = trunc i16 %narrow205 to i8
%rem.1.7170 = srem i8 %rem.1.7.lhs.trunc, 10
%narrow206 = add nsw i8 %rem.1.1164, %rem.1163
%rem.2171 = srem i8 %narrow206, 10
%narrow207 = add nsw i8 %rem.1.2165, %rem.1.1164
%rem.2.1172 = srem i8 %narrow207, 10
%narrow208 = add nsw i8 %rem.1.3166, %rem.1.2165
%rem.2.2173 = srem i8 %narrow208, 10
%narrow209 = add nsw i8 %rem.1.4167, %rem.1.3166
%rem.2.3174 = srem i8 %narrow209, 10
%narrow210 = add nsw i8 %rem.1.5168, %rem.1.4167
%rem.2.4175 = srem i8 %narrow210, 10
%narrow211 = add nsw i8 %rem.1.6169, %rem.1.5168
%rem.2.5176 = srem i8 %narrow211, 10
%narrow212 = add nsw i8 %rem.1.7170, %rem.1.6169
%rem.2.6177 = srem i8 %narrow212, 10
%narrow213 = add nsw i8 %rem.2.1172, %rem.2171
%rem.3178 = srem i8 %narrow213, 10
%narrow214 = add nsw i8 %rem.2.2173, %rem.2.1172
%rem.3.1179 = srem i8 %narrow214, 10
%narrow215 = add nsw i8 %rem.2.3174, %rem.2.2173
%rem.3.2180 = srem i8 %narrow215, 10
%narrow216 = add nsw i8 %rem.2.4175, %rem.2.3174
%rem.3.3181 = srem i8 %narrow216, 10
%narrow217 = add nsw i8 %rem.2.5176, %rem.2.4175
%rem.3.4182 = srem i8 %narrow217, 10
%narrow218 = add nsw i8 %rem.2.6177, %rem.2.5176
%rem.3.5183 = srem i8 %narrow218, 10
%narrow219 = add nsw i8 %rem.3.1179, %rem.3178
%rem.4184 = srem i8 %narrow219, 10
%narrow220 = add nsw i8 %rem.3.2180, %rem.3.1179
%rem.4.1185 = srem i8 %narrow220, 10
%narrow221 = add nsw i8 %rem.3.3181, %rem.3.2180
%rem.4.2186 = srem i8 %narrow221, 10
%narrow222 = add nsw i8 %rem.3.4182, %rem.3.3181
%rem.4.3187 = srem i8 %narrow222, 10
%narrow223 = add nsw i8 %rem.3.5183, %rem.3.4182
%rem.4.4188 = srem i8 %narrow223, 10
%narrow224 = add nsw i8 %rem.4.1185, %rem.4184
%rem.5189 = srem i8 %narrow224, 10
%narrow225 = add nsw i8 %rem.4.2186, %rem.4.1185
%rem.5.1190 = srem i8 %narrow225, 10
%narrow226 = add nsw i8 %rem.4.3187, %rem.4.2186
%rem.5.2191 = srem i8 %narrow226, 10
%narrow227 = add nsw i8 %rem.4.4188, %rem.4.3187
%rem.5.3192 = srem i8 %narrow227, 10
%narrow228 = add nsw i8 %rem.5.1190, %rem.5189
%rem.6193 = srem i8 %narrow228, 10
%narrow229 = add nsw i8 %rem.5.2191, %rem.5.1190
%rem.6.1194 = srem i8 %narrow229, 10
%narrow230 = add nsw i8 %rem.5.3192, %rem.5.2191
%rem.6.2195 = srem i8 %narrow230, 10
%narrow231 = add nsw i8 %rem.6.1194, %rem.6193
%rem.7196 = srem i8 %narrow231, 10
%narrow232 = add nsw i8 %rem.6.2195, %rem.6.1194
%rem.7.1197 = srem i8 %narrow232, 10
%narrow233 = add nsw i8 %rem.7.1197, %rem.7196
%rem.8198 = srem i8 %narrow233, 10
%rem.8.sext = sext i8 %rem.8198 to i32
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %rem.8.sext)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !8
while.end: ; preds = %for.cond.preheader, %entry
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %m) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int i,j,c;
int ans;
int endflag = 0;
int highests[10];
while(1){
for(i = 0; i < 10; i++){
c = getchar();
if(c == EOF){
endflag = 1;
break;
}
highests[i] = c - '0';
}
if(endflag){break;}
getchar();
for(j = 10; j > 0; j--){
for(i = 0; i < j; i++){
if(j == 1){ans = highests[i];}
else{highests[i] = (highests[i] + highests[i+1] ) % 10;}
}
}
printf("%d\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317456/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317456/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i260 = tail call i32 @getc(ptr noundef %0)
%cmp1261 = icmp eq i32 %call.i260, -1
br i1 %cmp1261, label %while.end, label %if.end
if.end: ; preds = %entry, %for.inc26.9
%call.i262 = phi i32 [ %call.i, %for.inc26.9 ], [ %call.i260, %entry ]
%sub = add nsw i32 %call.i262, -48
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.1 = tail call i32 @getc(ptr noundef %1)
%cmp1.1 = icmp eq i32 %call.i.1, -1
br i1 %cmp1.1, label %while.end, label %if.end.1
if.end.1: ; preds = %if.end
%sub.1 = add nsw i32 %call.i.1, -48
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.2 = tail call i32 @getc(ptr noundef %2)
%cmp1.2 = icmp eq i32 %call.i.2, -1
br i1 %cmp1.2, label %while.end, label %if.end.2
if.end.2: ; preds = %if.end.1
%sub.2 = add nsw i32 %call.i.2, -48
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.3 = tail call i32 @getc(ptr noundef %3)
%cmp1.3 = icmp eq i32 %call.i.3, -1
br i1 %cmp1.3, label %while.end, label %if.end.3
if.end.3: ; preds = %if.end.2
%sub.3 = add nsw i32 %call.i.3, -48
%4 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.4 = tail call i32 @getc(ptr noundef %4)
%cmp1.4 = icmp eq i32 %call.i.4, -1
br i1 %cmp1.4, label %while.end, label %if.end.4
if.end.4: ; preds = %if.end.3
%sub.4 = add nsw i32 %call.i.4, -48
%5 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.5 = tail call i32 @getc(ptr noundef %5)
%cmp1.5 = icmp eq i32 %call.i.5, -1
br i1 %cmp1.5, label %while.end, label %if.end.5
if.end.5: ; preds = %if.end.4
%sub.5 = add nsw i32 %call.i.5, -48
%6 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.6 = tail call i32 @getc(ptr noundef %6)
%cmp1.6 = icmp eq i32 %call.i.6, -1
br i1 %cmp1.6, label %while.end, label %if.end.6
if.end.6: ; preds = %if.end.5
%sub.6 = add nsw i32 %call.i.6, -48
%7 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.7 = tail call i32 @getc(ptr noundef %7)
%cmp1.7 = icmp eq i32 %call.i.7, -1
br i1 %cmp1.7, label %while.end, label %if.end.7
if.end.7: ; preds = %if.end.6
%sub.7 = add nsw i32 %call.i.7, -48
%8 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.8 = tail call i32 @getc(ptr noundef %8)
%cmp1.8 = icmp eq i32 %call.i.8, -1
br i1 %cmp1.8, label %while.end, label %if.end.8
if.end.8: ; preds = %if.end.7
%9 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i.9 = tail call i32 @getc(ptr noundef %9)
%cmp1.9 = icmp eq i32 %call.i.9, -1
br i1 %cmp1.9, label %while.end, label %for.inc26.9
for.inc26.9: ; preds = %if.end.8
%sub.8 = add nsw i32 %call.i.8, -48
%10 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i41 = tail call i32 @getc(ptr noundef %10)
%sub.9 = add nsw i32 %call.i.9, -48
%add19 = add nsw i32 %sub.1, %sub
%rem = srem i32 %add19, 10
%add19.159 = add nsw i32 %sub.2, %sub.1
%rem.160 = srem i32 %add19.159, 10
%add19.263 = add nsw i32 %sub.3, %sub.2
%rem.264 = srem i32 %add19.263, 10
%add19.367 = add nsw i32 %sub.4, %sub.3
%rem.368 = srem i32 %add19.367, 10
%add19.471 = add nsw i32 %sub.5, %sub.4
%rem.472 = srem i32 %add19.471, 10
%add19.575 = add nsw i32 %sub.6, %sub.5
%rem.576 = srem i32 %add19.575, 10
%add19.679 = add nsw i32 %sub.7, %sub.6
%rem.680 = srem i32 %add19.679, 10
%add19.783 = add nsw i32 %sub.8, %sub.7
%rem.784 = srem i32 %add19.783, 10
%add19.887 = add nsw i32 %sub.9, %sub.8
%rem.888 = srem i32 %add19.887, 10
%add19.1 = add nsw i32 %rem.160, %rem
%rem.1.lhs.trunc = trunc i32 %add19.1 to i8
%rem.1197 = srem i8 %rem.1.lhs.trunc, 10
%add19.1.1 = add nsw i32 %rem.264, %rem.160
%rem.1.1.lhs.trunc = trunc i32 %add19.1.1 to i8
%rem.1.1198 = srem i8 %rem.1.1.lhs.trunc, 10
%add19.1.2 = add nsw i32 %rem.368, %rem.264
%rem.1.2.lhs.trunc = trunc i32 %add19.1.2 to i8
%rem.1.2199 = srem i8 %rem.1.2.lhs.trunc, 10
%add19.1.3 = add nsw i32 %rem.472, %rem.368
%rem.1.3.lhs.trunc = trunc i32 %add19.1.3 to i8
%rem.1.3200 = srem i8 %rem.1.3.lhs.trunc, 10
%add19.1.4 = add nsw i32 %rem.576, %rem.472
%rem.1.4.lhs.trunc = trunc i32 %add19.1.4 to i8
%rem.1.4201 = srem i8 %rem.1.4.lhs.trunc, 10
%add19.1.5 = add nsw i32 %rem.680, %rem.576
%rem.1.5.lhs.trunc = trunc i32 %add19.1.5 to i8
%rem.1.5202 = srem i8 %rem.1.5.lhs.trunc, 10
%add19.1.6 = add nsw i32 %rem.784, %rem.680
%rem.1.6.lhs.trunc = trunc i32 %add19.1.6 to i8
%rem.1.6203 = srem i8 %rem.1.6.lhs.trunc, 10
%add19.1.7 = add nsw i32 %rem.888, %rem.784
%rem.1.7.lhs.trunc = trunc i32 %add19.1.7 to i8
%rem.1.7204 = srem i8 %rem.1.7.lhs.trunc, 10
%narrow = add nsw i8 %rem.1.1198, %rem.1197
%rem.2205 = srem i8 %narrow, 10
%narrow233 = add nsw i8 %rem.1.2199, %rem.1.1198
%rem.2.1206 = srem i8 %narrow233, 10
%narrow234 = add nsw i8 %rem.1.3200, %rem.1.2199
%rem.2.2207 = srem i8 %narrow234, 10
%narrow235 = add nsw i8 %rem.1.4201, %rem.1.3200
%rem.2.3208 = srem i8 %narrow235, 10
%narrow236 = add nsw i8 %rem.1.5202, %rem.1.4201
%rem.2.4209 = srem i8 %narrow236, 10
%narrow237 = add nsw i8 %rem.1.6203, %rem.1.5202
%rem.2.5210 = srem i8 %narrow237, 10
%narrow238 = add nsw i8 %rem.1.7204, %rem.1.6203
%rem.2.6211 = srem i8 %narrow238, 10
%narrow239 = add nsw i8 %rem.2.1206, %rem.2205
%rem.3212 = srem i8 %narrow239, 10
%narrow240 = add nsw i8 %rem.2.2207, %rem.2.1206
%rem.3.1213 = srem i8 %narrow240, 10
%narrow241 = add nsw i8 %rem.2.3208, %rem.2.2207
%rem.3.2214 = srem i8 %narrow241, 10
%narrow242 = add nsw i8 %rem.2.4209, %rem.2.3208
%rem.3.3215 = srem i8 %narrow242, 10
%narrow243 = add nsw i8 %rem.2.5210, %rem.2.4209
%rem.3.4216 = srem i8 %narrow243, 10
%narrow244 = add nsw i8 %rem.2.6211, %rem.2.5210
%rem.3.5217 = srem i8 %narrow244, 10
%narrow245 = add nsw i8 %rem.3.1213, %rem.3212
%rem.4218 = srem i8 %narrow245, 10
%narrow246 = add nsw i8 %rem.3.2214, %rem.3.1213
%rem.4.1219 = srem i8 %narrow246, 10
%narrow247 = add nsw i8 %rem.3.3215, %rem.3.2214
%rem.4.2220 = srem i8 %narrow247, 10
%narrow248 = add nsw i8 %rem.3.4216, %rem.3.3215
%rem.4.3221 = srem i8 %narrow248, 10
%narrow249 = add nsw i8 %rem.3.5217, %rem.3.4216
%rem.4.4222 = srem i8 %narrow249, 10
%narrow250 = add nsw i8 %rem.4.1219, %rem.4218
%rem.5223 = srem i8 %narrow250, 10
%narrow251 = add nsw i8 %rem.4.2220, %rem.4.1219
%rem.5.1224 = srem i8 %narrow251, 10
%narrow252 = add nsw i8 %rem.4.3221, %rem.4.2220
%rem.5.2225 = srem i8 %narrow252, 10
%narrow253 = add nsw i8 %rem.4.4222, %rem.4.3221
%rem.5.3226 = srem i8 %narrow253, 10
%narrow254 = add nsw i8 %rem.5.1224, %rem.5223
%rem.6227 = srem i8 %narrow254, 10
%narrow255 = add nsw i8 %rem.5.2225, %rem.5.1224
%rem.6.1228 = srem i8 %narrow255, 10
%narrow256 = add nsw i8 %rem.5.3226, %rem.5.2225
%rem.6.2229 = srem i8 %narrow256, 10
%narrow257 = add nsw i8 %rem.6.1228, %rem.6227
%rem.7230 = srem i8 %narrow257, 10
%narrow258 = add nsw i8 %rem.6.2229, %rem.6.1228
%rem.7.1231 = srem i8 %narrow258, 10
%narrow259 = add nsw i8 %rem.7.1231, %rem.7230
%rem.8232 = srem i8 %narrow259, 10
%rem.8.sext = sext i8 %rem.8232 to i32
%call28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %rem.8.sext)
%11 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %11)
%cmp1 = icmp eq i32 %call.i, -1
br i1 %cmp1, label %while.end, label %if.end
while.end: ; preds = %for.inc26.9, %if.end, %if.end.1, %if.end.2, %if.end.3, %if.end.4, %if.end.5, %if.end.6, %if.end.7, %if.end.8, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
long int x,y,c;
long x1,y1;
long zero=0;
scanf("%ld %ld",&x,&y);
if(x>0){
if(y>0){
c=x+y;
x=c;
y=c;
}
else{
c=y-x;
x=-1*c;
y=c;
}
}
else{
if(y>0){
c=y-x;
y=c;
x=-1*c;
}
else{
c=x+y;
x=c;
y=c;
}
}
if(x<0){
printf("%ld %ld %ld %ld\n",x,zero,zero,y);
}
else{
printf("%ld %ld %ld %ld\n",zero,y,x,zero);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_3175/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_3175/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [17 x i8] c"%ld %ld %ld %ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%x = alloca i64, align 8
%y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%0 = load i64, ptr %x, align 8, !tbaa !5
%cmp = icmp sgt i64 %0, 0
%1 = load i64, ptr %y, align 8, !tbaa !5
%cmp1 = icmp sgt i64 %1, 0
br i1 %cmp, label %if.then, label %if.else3
if.then: ; preds = %entry
br i1 %cmp1, label %if.then2, label %if.else
if.then2: ; preds = %if.then
%add = add nuw nsw i64 %1, %0
store i64 %add, ptr %x, align 8, !tbaa !5
store i64 %add, ptr %y, align 8, !tbaa !5
br label %if.else15
if.else: ; preds = %if.then
%sub = sub nsw i64 %1, %0
%mul = sub nsw i64 0, %sub
store i64 %mul, ptr %x, align 8, !tbaa !5
store i64 %sub, ptr %y, align 8, !tbaa !5
br label %if.else15
if.else3: ; preds = %entry
br i1 %cmp1, label %if.end11.thread35, label %if.end11
if.end11.thread35: ; preds = %if.else3
%sub6 = sub nsw i64 %1, %0
store i64 %sub6, ptr %y, align 8, !tbaa !5
%mul7 = sub nsw i64 0, %sub6
store i64 %mul7, ptr %x, align 8, !tbaa !5
br label %if.then13
if.end11: ; preds = %if.else3
%add9 = add nsw i64 %1, %0
store i64 %add9, ptr %x, align 8, !tbaa !5
store i64 %add9, ptr %y, align 8, !tbaa !5
%cmp12 = icmp slt i64 %add9, 0
br i1 %cmp12, label %if.then13, label %if.else15
if.then13: ; preds = %if.end11.thread35, %if.end11
%2 = phi i64 [ %sub6, %if.end11.thread35 ], [ %add9, %if.end11 ]
%3 = phi i64 [ %mul7, %if.end11.thread35 ], [ %add9, %if.end11 ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %3, i64 noundef 0, i64 noundef 0, i64 noundef %2)
br label %if.end17
if.else15: ; preds = %if.else, %if.then2, %if.end11
%4 = phi i64 [ 0, %if.end11 ], [ %sub, %if.else ], [ %add, %if.then2 ]
%5 = phi i64 [ 0, %if.end11 ], [ %mul, %if.else ], [ %add, %if.then2 ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef 0, i64 noundef %4, i64 noundef %5, i64 noundef 0)
br label %if.end17
if.end17: ; preds = %if.else15, %if.then13
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int n,a[10000],add,add0,i,j,blank;
while(1){
scanf("%d",&n);
if(n == 0) break;
add=0;
add0=0;
for(i = 0; i < n; i++){
scanf("%d",&a[i]);
if(a[i] > 1) add++;
if(a[i] == 0) add0++;
}
n -= add0;
if(add == 0){
printf("NA\n");
continue;
}
printf("%d\n",n+1);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317542/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317542/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"NA\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4
%call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp34 = icmp eq i32 %0, 0
br i1 %cmp34, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %while.cond.backedge
%1 = phi i32 [ %5, %while.cond.backedge ], [ %0, %entry ]
%cmp127 = icmp sgt i32 %1, 0
br i1 %cmp127, label %for.body, label %for.end.thread
for.end.thread: ; preds = %for.cond.preheader
store i32 %1, ptr %n, align 4, !tbaa !5
br label %if.then16
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%add.030 = phi i32 [ %spec.select, %for.body ], [ 0, %for.cond.preheader ]
%add0.029 = phi i32 [ %add0.1, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [10000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %2, 1
%inc = zext i1 %cmp5 to i32
%spec.select = add nuw nsw i32 %add.030, %inc
%cmp10 = icmp eq i32 %2, 0
%inc12 = zext i1 %cmp10 to i32
%add0.1 = add nuw nsw i32 %add0.029, %inc12
%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
%cmp1 = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%sub = sub nsw i32 %3, %add0.1
store i32 %sub, ptr %n, align 4, !tbaa !5
%cmp15 = icmp eq i32 %spec.select, 0
br i1 %cmp15, label %if.then16, label %if.end18
if.then16: ; preds = %for.end.thread, %for.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %while.cond.backedge
while.cond.backedge: ; preds = %if.then16, %if.end18
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %5, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
if.end18: ; preds = %for.end
%add19 = add nsw i32 %sub, 1
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add19)
br label %while.cond.backedge
while.end: ; preds = %while.cond.backedge, %entry
call void @llvm.lifetime.end.p0(i64 40000, 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: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
long long int bitwise(int k, int n, int *a, int *b) {
long long int ans = 0;
for (int i = 0; i < n; i++)
{
if ((k|a[i])==k) ans += b[i];
}
return ans;
}
int main() {
int n, k, a[100010], b[100010], temp;
long long int ans, x;
scanf("%d %d", &n, &k);
for (int i = 0; i < n; i++)
{
scanf("%d %d", &a[i], &b[i]);
}
ans = bitwise(k, n, a, b);
for (int j = 0; j < 30; j++)
{
if (k &(1 << j))
{
temp = (k&~(1 << j)) | ((1 << j) - 1);
x = bitwise(temp, n, a, b);
ans = (ans > x) ? ans : x;
}
}
printf("%lld", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317586/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317586/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @bitwise(i32 noundef %k, i32 noundef %n, ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%cmp9 = icmp sgt i32 %n, 0
br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%xtraiter = and i64 %wide.trip.count, 1
%0 = icmp eq i32 %n, 1
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader
%ans.1.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %ans.1.1, %for.inc.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%ans.010.unr = phi i64 [ 0, %for.body.preheader ], [ %ans.1.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.unr
%1 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5
%or.epil = or i32 %1, %k
%cmp1.epil = icmp eq i32 %or.epil, %k
br i1 %cmp1.epil, label %if.then.epil, label %for.cond.cleanup
if.then.epil: ; preds = %for.body.epil
%arrayidx3.epil = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.unr
%2 = load i32, ptr %arrayidx3.epil, align 4, !tbaa !5
%conv.epil = sext i32 %2 to i64
%add.epil = add nsw i64 %ans.010.unr, %conv.epil
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %if.then.epil, %for.body.epil, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %ans.1.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %add.epil, %if.then.epil ], [ %ans.010.unr, %for.body.epil ]
ret i64 %ans.0.lcssa
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%ans.010 = phi i64 [ 0, %for.body.preheader.new ], [ %ans.1.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%or = or i32 %3, %k
%cmp1 = icmp eq i32 %or, %k
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%arrayidx3 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv
%4 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%conv = sext i32 %4 to i64
%add = add nsw i64 %ans.010, %conv
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%ans.1 = phi i64 [ %add, %if.then ], [ %ans.010, %for.body ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next
%5 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%or.1 = or i32 %5, %k
%cmp1.1 = icmp eq i32 %or.1, %k
br i1 %cmp1.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%arrayidx3.1 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.next
%6 = load i32, ptr %arrayidx3.1, align 4, !tbaa !5
%conv.1 = sext i32 %6 to i64
%add.1 = add nsw i64 %ans.1, %conv.1
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%ans.1.1 = phi i64 [ %add.1, %if.then.1 ], [ %ans.1, %for.inc ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%a = alloca [100010 x i32], align 16
%b = alloca [100010 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 400040, ptr nonnull %b) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %entry
%1 = load i32, ptr %k, align 4, !tbaa !5
br label %for.body9.preheader
for.cond.cleanup: ; preds = %for.body
%2 = load i32, ptr %k, align 4, !tbaa !5
%cmp9.i = icmp sgt i32 %39, 0
br i1 %cmp9.i, label %for.body.preheader.i, label %for.body9.preheader
for.body.preheader.i: ; preds = %for.cond.cleanup
%wide.trip.count.i = zext i32 %39 to i64
%3 = add nsw i64 %wide.trip.count.i, -1
%xtraiter = and i64 %wide.trip.count.i, 1
%4 = icmp eq i64 %3, 0
br i1 %4, label %bitwise.exit.unr-lcssa, label %for.body.preheader.i.new
for.body.preheader.i.new: ; preds = %for.body.preheader.i
%unroll_iter = and i64 %wide.trip.count.i, 4294967294
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.preheader.i.new
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%ans.010.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %ans.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx.i, align 8, !tbaa !5
%or.i = or i32 %5, %2
%cmp1.i = icmp eq i32 %or.i, %2
br i1 %cmp1.i, label %if.then.i, label %for.inc.i
if.then.i: ; preds = %for.body.i
%arrayidx3.i = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx3.i, align 8, !tbaa !5
%conv.i = sext i32 %6 to i64
%add.i = add nsw i64 %ans.010.i, %conv.i
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%ans.1.i = phi i64 [ %add.i, %if.then.i ], [ %ans.010.i, %for.body.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next.i
%7 = load i32, ptr %arrayidx.i.1, align 4, !tbaa !5
%or.i.1 = or i32 %7, %2
%cmp1.i.1 = icmp eq i32 %or.i.1, %2
br i1 %cmp1.i.1, label %if.then.i.1, label %for.inc.i.1
if.then.i.1: ; preds = %for.inc.i
%arrayidx3.i.1 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.next.i
%8 = load i32, ptr %arrayidx3.i.1, align 4, !tbaa !5
%conv.i.1 = sext i32 %8 to i64
%add.i.1 = add nsw i64 %ans.1.i, %conv.i.1
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%ans.1.i.1 = phi i64 [ %add.i.1, %if.then.i.1 ], [ %ans.1.i, %for.inc.i ]
%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 %bitwise.exit.unr-lcssa, label %for.body.i, !llvm.loop !9
bitwise.exit.unr-lcssa: ; preds = %for.inc.i.1, %for.body.preheader.i
%ans.1.i.lcssa.ph = phi i64 [ undef, %for.body.preheader.i ], [ %ans.1.i.1, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%ans.010.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %ans.1.i.1, %for.inc.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %bitwise.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %bitwise.exit.unr-lcssa
%arrayidx.i.epil = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.unr
%9 = load i32, ptr %arrayidx.i.epil, align 4, !tbaa !5
%or.i.epil = or i32 %9, %2
%cmp1.i.epil = icmp eq i32 %or.i.epil, %2
br i1 %cmp1.i.epil, label %if.then.i.epil, label %bitwise.exit
if.then.i.epil: ; preds = %for.body.i.epil
%arrayidx3.i.epil = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.i.unr
%10 = load i32, ptr %arrayidx3.i.epil, align 4, !tbaa !5
%conv.i.epil = sext i32 %10 to i64
%add.i.epil = add nsw i64 %ans.010.i.unr, %conv.i.epil
br label %bitwise.exit
bitwise.exit: ; preds = %for.body.i.epil, %if.then.i.epil, %bitwise.exit.unr-lcssa
%ans.1.i.lcssa = phi i64 [ %ans.1.i.lcssa.ph, %bitwise.exit.unr-lcssa ], [ %add.i.epil, %if.then.i.epil ], [ %ans.010.i.unr, %for.body.i.epil ]
br i1 %cmp9.i, label %for.body9.us.preheader, label %for.body9.preheader
for.body9.us.preheader: ; preds = %bitwise.exit
%xtraiter67 = and i64 %wide.trip.count.i, 1
%11 = icmp eq i64 %3, 0
%unroll_iter70 = and i64 %wide.trip.count.i, 4294967294
%lcmp.mod68.not = icmp eq i64 %xtraiter67, 0
br label %for.body9.us
for.body9.preheader: ; preds = %for.cond.cleanup.thread, %for.cond.cleanup, %bitwise.exit
%ans.0.lcssa.i65 = phi i64 [ %ans.1.i.lcssa, %bitwise.exit ], [ 0, %for.cond.cleanup ], [ 0, %for.cond.cleanup.thread ]
%12 = phi i32 [ %2, %bitwise.exit ], [ %2, %for.cond.cleanup ], [ %1, %for.cond.cleanup.thread ]
%and = and i32 %12, 1
%tobool.not = icmp eq i32 %and, 0
%cond = call i64 @llvm.smax.i64(i64 %ans.0.lcssa.i65, i64 0)
%ans.1 = select i1 %tobool.not, i64 %ans.0.lcssa.i65, i64 %cond
%and.1 = and i32 %12, 2
%tobool.not.1 = icmp eq i32 %and.1, 0
%cond.1 = call i64 @llvm.smax.i64(i64 %ans.1, i64 0)
%ans.1.1 = select i1 %tobool.not.1, i64 %ans.1, i64 %cond.1
%and.2 = and i32 %12, 4
%tobool.not.2 = icmp eq i32 %and.2, 0
%cond.2 = call i64 @llvm.smax.i64(i64 %ans.1.1, i64 0)
%ans.1.2 = select i1 %tobool.not.2, i64 %ans.1.1, i64 %cond.2
%and.3 = and i32 %12, 8
%tobool.not.3 = icmp eq i32 %and.3, 0
%cond.3 = call i64 @llvm.smax.i64(i64 %ans.1.2, i64 0)
%ans.1.3 = select i1 %tobool.not.3, i64 %ans.1.2, i64 %cond.3
%and.4 = and i32 %12, 16
%tobool.not.4 = icmp eq i32 %and.4, 0
%cond.4 = call i64 @llvm.smax.i64(i64 %ans.1.3, i64 0)
%ans.1.4 = select i1 %tobool.not.4, i64 %ans.1.3, i64 %cond.4
%and.5 = and i32 %12, 32
%tobool.not.5 = icmp eq i32 %and.5, 0
%cond.5 = call i64 @llvm.smax.i64(i64 %ans.1.4, i64 0)
%ans.1.5 = select i1 %tobool.not.5, i64 %ans.1.4, i64 %cond.5
%and.6 = and i32 %12, 64
%tobool.not.6 = icmp eq i32 %and.6, 0
%cond.6 = call i64 @llvm.smax.i64(i64 %ans.1.5, i64 0)
%ans.1.6 = select i1 %tobool.not.6, i64 %ans.1.5, i64 %cond.6
%and.7 = and i32 %12, 128
%tobool.not.7 = icmp eq i32 %and.7, 0
%cond.7 = call i64 @llvm.smax.i64(i64 %ans.1.6, i64 0)
%ans.1.7 = select i1 %tobool.not.7, i64 %ans.1.6, i64 %cond.7
%and.8 = and i32 %12, 256
%tobool.not.8 = icmp eq i32 %and.8, 0
%cond.8 = call i64 @llvm.smax.i64(i64 %ans.1.7, i64 0)
%ans.1.8 = select i1 %tobool.not.8, i64 %ans.1.7, i64 %cond.8
%and.9 = and i32 %12, 512
%tobool.not.9 = icmp eq i32 %and.9, 0
%cond.9 = call i64 @llvm.smax.i64(i64 %ans.1.8, i64 0)
%ans.1.9 = select i1 %tobool.not.9, i64 %ans.1.8, i64 %cond.9
%and.10 = and i32 %12, 1024
%tobool.not.10 = icmp eq i32 %and.10, 0
%cond.10 = call i64 @llvm.smax.i64(i64 %ans.1.9, i64 0)
%ans.1.10 = select i1 %tobool.not.10, i64 %ans.1.9, i64 %cond.10
%and.11 = and i32 %12, 2048
%tobool.not.11 = icmp eq i32 %and.11, 0
%cond.11 = call i64 @llvm.smax.i64(i64 %ans.1.10, i64 0)
%ans.1.11 = select i1 %tobool.not.11, i64 %ans.1.10, i64 %cond.11
%and.12 = and i32 %12, 4096
%tobool.not.12 = icmp eq i32 %and.12, 0
%cond.12 = call i64 @llvm.smax.i64(i64 %ans.1.11, i64 0)
%ans.1.12 = select i1 %tobool.not.12, i64 %ans.1.11, i64 %cond.12
%and.13 = and i32 %12, 8192
%tobool.not.13 = icmp eq i32 %and.13, 0
%cond.13 = call i64 @llvm.smax.i64(i64 %ans.1.12, i64 0)
%ans.1.13 = select i1 %tobool.not.13, i64 %ans.1.12, i64 %cond.13
%13 = insertelement <16 x i32> poison, i32 %12, i64 0
%14 = shufflevector <16 x i32> %13, <16 x i32> poison, <16 x i32> zeroinitializer
%15 = and <16 x i32> %14, <i32 536870912, i32 268435456, i32 134217728, i32 67108864, i32 33554432, i32 16777216, i32 8388608, i32 4194304, i32 2097152, i32 1048576, i32 524288, i32 262144, i32 131072, i32 65536, i32 32768, i32 16384>
%cond.14 = call i64 @llvm.smax.i64(i64 %ans.1.13, i64 0)
%16 = icmp eq <16 x i32> %15, zeroinitializer
%17 = extractelement <16 x i1> %16, i64 15
%ans.1.14 = select i1 %17, i64 %ans.1.13, i64 %cond.14
%cond.15 = call i64 @llvm.smax.i64(i64 %ans.1.14, i64 0)
%18 = extractelement <16 x i1> %16, i64 14
%ans.1.15 = select i1 %18, i64 %ans.1.14, i64 %cond.15
%cond.16 = call i64 @llvm.smax.i64(i64 %ans.1.15, i64 0)
%19 = extractelement <16 x i1> %16, i64 13
%ans.1.16 = select i1 %19, i64 %ans.1.15, i64 %cond.16
%cond.17 = call i64 @llvm.smax.i64(i64 %ans.1.16, i64 0)
%20 = extractelement <16 x i1> %16, i64 12
%ans.1.17 = select i1 %20, i64 %ans.1.16, i64 %cond.17
%cond.18 = call i64 @llvm.smax.i64(i64 %ans.1.17, i64 0)
%21 = extractelement <16 x i1> %16, i64 11
%ans.1.18 = select i1 %21, i64 %ans.1.17, i64 %cond.18
%cond.19 = call i64 @llvm.smax.i64(i64 %ans.1.18, i64 0)
%22 = extractelement <16 x i1> %16, i64 10
%ans.1.19 = select i1 %22, i64 %ans.1.18, i64 %cond.19
%cond.20 = call i64 @llvm.smax.i64(i64 %ans.1.19, i64 0)
%23 = extractelement <16 x i1> %16, i64 9
%ans.1.20 = select i1 %23, i64 %ans.1.19, i64 %cond.20
%cond.21 = call i64 @llvm.smax.i64(i64 %ans.1.20, i64 0)
%24 = extractelement <16 x i1> %16, i64 8
%ans.1.21 = select i1 %24, i64 %ans.1.20, i64 %cond.21
%cond.22 = call i64 @llvm.smax.i64(i64 %ans.1.21, i64 0)
%25 = extractelement <16 x i1> %16, i64 7
%ans.1.22 = select i1 %25, i64 %ans.1.21, i64 %cond.22
%cond.23 = call i64 @llvm.smax.i64(i64 %ans.1.22, i64 0)
%26 = extractelement <16 x i1> %16, i64 6
%ans.1.23 = select i1 %26, i64 %ans.1.22, i64 %cond.23
%cond.24 = call i64 @llvm.smax.i64(i64 %ans.1.23, i64 0)
%27 = extractelement <16 x i1> %16, i64 5
%ans.1.24 = select i1 %27, i64 %ans.1.23, i64 %cond.24
%cond.25 = call i64 @llvm.smax.i64(i64 %ans.1.24, i64 0)
%28 = extractelement <16 x i1> %16, i64 4
%ans.1.25 = select i1 %28, i64 %ans.1.24, i64 %cond.25
%cond.26 = call i64 @llvm.smax.i64(i64 %ans.1.25, i64 0)
%29 = extractelement <16 x i1> %16, i64 3
%ans.1.26 = select i1 %29, i64 %ans.1.25, i64 %cond.26
%cond.27 = call i64 @llvm.smax.i64(i64 %ans.1.26, i64 0)
%30 = extractelement <16 x i1> %16, i64 2
%ans.1.27 = select i1 %30, i64 %ans.1.26, i64 %cond.27
%cond.28 = call i64 @llvm.smax.i64(i64 %ans.1.27, i64 0)
%31 = extractelement <16 x i1> %16, i64 1
%ans.1.28 = select i1 %31, i64 %ans.1.27, i64 %cond.28
%cond.29 = call i64 @llvm.smax.i64(i64 %ans.1.28, i64 0)
%32 = extractelement <16 x i1> %16, i64 0
%ans.1.29 = select i1 %32, i64 %ans.1.28, i64 %cond.29
br label %for.cond.cleanup8
for.body9.us: ; preds = %for.body9.us.preheader, %for.inc17.us
%j.053.us = phi i32 [ %inc18.us, %for.inc17.us ], [ 0, %for.body9.us.preheader ]
%ans.052.us = phi i64 [ %ans.1.us, %for.inc17.us ], [ %ans.1.i.lcssa, %for.body9.us.preheader ]
%shl.us = shl nuw nsw i32 1, %j.053.us
%and.us = and i32 %shl.us, %2
%tobool.not.us = icmp eq i32 %and.us, 0
br i1 %tobool.not.us, label %for.inc17.us, label %if.then.us
if.then.us: ; preds = %for.body9.us
%not.us = xor i32 %shl.us, -1
%and11.us = and i32 %2, %not.us
%sub.us = add nsw i32 %shl.us, -1
%or.us = or i32 %and11.us, %sub.us
br i1 %11, label %bitwise.exit49.loopexit.us.unr-lcssa, label %for.body.i35.us
for.body.i35.us: ; preds = %if.then.us, %for.inc.i41.us.1
%indvars.iv.i36.us = phi i64 [ %indvars.iv.next.i43.us.1, %for.inc.i41.us.1 ], [ 0, %if.then.us ]
%ans.010.i37.us = phi i64 [ %ans.1.i42.us.1, %for.inc.i41.us.1 ], [ 0, %if.then.us ]
%niter71 = phi i64 [ %niter71.next.1, %for.inc.i41.us.1 ], [ 0, %if.then.us ]
%arrayidx.i38.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i36.us
%33 = load i32, ptr %arrayidx.i38.us, align 8, !tbaa !5
%or.i39.us = or i32 %33, %or.us
%cmp1.i40.us = icmp eq i32 %or.i39.us, %or.us
br i1 %cmp1.i40.us, label %if.then.i45.us, label %for.inc.i41.us
if.then.i45.us: ; preds = %for.body.i35.us
%arrayidx3.i46.us = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.i36.us
%34 = load i32, ptr %arrayidx3.i46.us, align 8, !tbaa !5
%conv.i47.us = sext i32 %34 to i64
%add.i48.us = add nsw i64 %ans.010.i37.us, %conv.i47.us
br label %for.inc.i41.us
for.inc.i41.us: ; preds = %if.then.i45.us, %for.body.i35.us
%ans.1.i42.us = phi i64 [ %add.i48.us, %if.then.i45.us ], [ %ans.010.i37.us, %for.body.i35.us ]
%indvars.iv.next.i43.us = or i64 %indvars.iv.i36.us, 1
%arrayidx.i38.us.1 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.next.i43.us
%35 = load i32, ptr %arrayidx.i38.us.1, align 4, !tbaa !5
%or.i39.us.1 = or i32 %35, %or.us
%cmp1.i40.us.1 = icmp eq i32 %or.i39.us.1, %or.us
br i1 %cmp1.i40.us.1, label %if.then.i45.us.1, label %for.inc.i41.us.1
if.then.i45.us.1: ; preds = %for.inc.i41.us
%arrayidx3.i46.us.1 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.next.i43.us
%36 = load i32, ptr %arrayidx3.i46.us.1, align 4, !tbaa !5
%conv.i47.us.1 = sext i32 %36 to i64
%add.i48.us.1 = add nsw i64 %ans.1.i42.us, %conv.i47.us.1
br label %for.inc.i41.us.1
for.inc.i41.us.1: ; preds = %if.then.i45.us.1, %for.inc.i41.us
%ans.1.i42.us.1 = phi i64 [ %add.i48.us.1, %if.then.i45.us.1 ], [ %ans.1.i42.us, %for.inc.i41.us ]
%indvars.iv.next.i43.us.1 = add nuw nsw i64 %indvars.iv.i36.us, 2
%niter71.next.1 = add i64 %niter71, 2
%niter71.ncmp.1 = icmp eq i64 %niter71.next.1, %unroll_iter70
br i1 %niter71.ncmp.1, label %bitwise.exit49.loopexit.us.unr-lcssa, label %for.body.i35.us, !llvm.loop !9
for.inc17.us: ; preds = %bitwise.exit49.loopexit.us, %for.body9.us
%ans.1.us = phi i64 [ %cond.us, %bitwise.exit49.loopexit.us ], [ %ans.052.us, %for.body9.us ]
%inc18.us = add nuw nsw i32 %j.053.us, 1
%exitcond.not = icmp eq i32 %inc18.us, 30
br i1 %exitcond.not, label %for.cond.cleanup8, label %for.body9.us, !llvm.loop !11
bitwise.exit49.loopexit.us.unr-lcssa: ; preds = %for.inc.i41.us.1, %if.then.us
%ans.1.i42.us.lcssa.ph = phi i64 [ undef, %if.then.us ], [ %ans.1.i42.us.1, %for.inc.i41.us.1 ]
%indvars.iv.i36.us.unr = phi i64 [ 0, %if.then.us ], [ %indvars.iv.next.i43.us.1, %for.inc.i41.us.1 ]
%ans.010.i37.us.unr = phi i64 [ 0, %if.then.us ], [ %ans.1.i42.us.1, %for.inc.i41.us.1 ]
br i1 %lcmp.mod68.not, label %bitwise.exit49.loopexit.us, label %for.body.i35.us.epil
for.body.i35.us.epil: ; preds = %bitwise.exit49.loopexit.us.unr-lcssa
%arrayidx.i38.us.epil = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i36.us.unr
%37 = load i32, ptr %arrayidx.i38.us.epil, align 4, !tbaa !5
%or.i39.us.epil = or i32 %37, %or.us
%cmp1.i40.us.epil = icmp eq i32 %or.i39.us.epil, %or.us
br i1 %cmp1.i40.us.epil, label %if.then.i45.us.epil, label %bitwise.exit49.loopexit.us
if.then.i45.us.epil: ; preds = %for.body.i35.us.epil
%arrayidx3.i46.us.epil = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.i36.us.unr
%38 = load i32, ptr %arrayidx3.i46.us.epil, align 4, !tbaa !5
%conv.i47.us.epil = sext i32 %38 to i64
%add.i48.us.epil = add nsw i64 %ans.010.i37.us.unr, %conv.i47.us.epil
br label %bitwise.exit49.loopexit.us
bitwise.exit49.loopexit.us: ; preds = %for.body.i35.us.epil, %if.then.i45.us.epil, %bitwise.exit49.loopexit.us.unr-lcssa
%ans.1.i42.us.lcssa = phi i64 [ %ans.1.i42.us.lcssa.ph, %bitwise.exit49.loopexit.us.unr-lcssa ], [ %add.i48.us.epil, %if.then.i45.us.epil ], [ %ans.010.i37.us.unr, %for.body.i35.us.epil ]
%cond.us = call i64 @llvm.smax.i64(i64 %ans.052.us, i64 %ans.1.i42.us.lcssa)
br label %for.inc17.us
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100010 x i32], ptr %a, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [100010 x i32], ptr %b, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%39 = load i32, ptr %n, align 4, !tbaa !5
%40 = sext i32 %39 to i64
%cmp = icmp slt i64 %indvars.iv.next, %40
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !12
for.cond.cleanup8: ; preds = %for.inc17.us, %for.body9.preheader
%.us-phi = phi i64 [ %ans.1.29, %for.body9.preheader ], [ %ans.1.us, %for.inc17.us ]
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.us-phi)
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 400040, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: 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) #4
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int main(){
long long int n, a[5], i, min, ans;
scanf("%lld %lld", &n, &a[0]);
min = a[0];
for(i=1; i<5; i++){
scanf("%lld", &a[i]);
if(min > a[i])
min = a[i];
}
ans = n / min + 4;
if(n % min != 0)
ans++;
printf("%lld\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317629/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317629/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%a = alloca [5 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a)
%0 = load i64, ptr %a, align 16, !tbaa !5
%arrayidx2 = getelementptr inbounds [5 x i64], ptr %a, i64 0, i64 1
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx2)
%1 = load i64, ptr %arrayidx2, align 8, !tbaa !5
%spec.select = call i64 @llvm.smin.i64(i64 %0, i64 %1)
%arrayidx2.1 = getelementptr inbounds [5 x i64], ptr %a, i64 0, i64 2
%call3.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx2.1)
%2 = load i64, ptr %arrayidx2.1, align 16, !tbaa !5
%spec.select.1 = call i64 @llvm.smin.i64(i64 %spec.select, i64 %2)
%arrayidx2.2 = getelementptr inbounds [5 x i64], ptr %a, i64 0, i64 3
%call3.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx2.2)
%3 = load i64, ptr %arrayidx2.2, align 8, !tbaa !5
%spec.select.2 = call i64 @llvm.smin.i64(i64 %spec.select.1, i64 %3)
%arrayidx2.3 = getelementptr inbounds [5 x i64], ptr %a, i64 0, i64 4
%call3.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx2.3)
%4 = load i64, ptr %arrayidx2.3, align 16, !tbaa !5
%spec.select.3 = call i64 @llvm.smin.i64(i64 %spec.select.2, i64 %4)
%5 = load i64, ptr %n, align 8, !tbaa !5
%div = sdiv i64 %5, %spec.select.3
%rem = srem i64 %5, %spec.select.3
%cmp7.not = icmp eq i64 %rem, 0
%spec.select19.v = select i1 %cmp7.not, i64 4, i64 5
%spec.select19 = add nsw i64 %spec.select19.v, %div
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %spec.select19)
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
// 内部定数
#define D_MOVE_CNT 5 // 移動数
// 内部変数
static FILE *szpFpI; // 入力
// 内部変数 - テスト用
#ifdef D_TEST
static int siRes;
static FILE *szpFpA;
static int siTNo;
#endif
// 出力
int
fOut(
char *pcpLine // <I> 1行
)
{
char lc1Buf[1024];
#ifdef D_TEST
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, pcpLine)) {
siRes = -1;
}
#else
printf("%s", pcpLine);
#endif
return 0;
}
// 実行メイン
long long
fMain(
)
{
int i;
char lc1Buf[1024];
// 人数 - 取得
long long llCnt;
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%lld", &llCnt);
// 移動人数 - 取得
long long ll1Move[D_MOVE_CNT];
for (i = 0; i < D_MOVE_CNT; i++) {
fgets(lc1Buf, sizeof(lc1Buf), szpFpI);
sscanf(lc1Buf, "%lld", &ll1Move[i]);
}
// 最大時間 - 取得
long long llMax = 0;
for (i = 0; i < D_MOVE_CNT; i++) {
long long llTime = (llCnt + ll1Move[i] - 1) / ll1Move[i];
if (llMax < llTime) {
llMax = llTime;
}
}
return llMax + D_MOVE_CNT - 1;
}
// 1回実行
int
fOne(
)
{
long long llRet;
char lc1Buf[1024];
// 入力 - セット
#ifdef D_TEST
sprintf(lc1Buf, ".\\Test\\T%d.txt", siTNo);
szpFpI = fopen(lc1Buf, "r");
sprintf(lc1Buf, ".\\Test\\A%d.txt", siTNo);
szpFpA = fopen(lc1Buf, "r");
siRes = 0;
#else
szpFpI = stdin;
#endif
// 実行メイン
llRet = fMain();
// 結果 - セット
sprintf(lc1Buf, "%lld\n", llRet);
// 結果 - 出力
fOut(lc1Buf);
// 残データ有無
#ifdef D_TEST
lc1Buf[0] = '\0';
fgets(lc1Buf, sizeof(lc1Buf), szpFpA);
if (strcmp(lc1Buf, "")) {
siRes = -1;
}
#endif
// テストファイルクローズ
#ifdef D_TEST
fclose(szpFpI);
fclose(szpFpA);
#endif
// テスト結果
#ifdef D_TEST
if (siRes == 0) {
printf("OK %d\n", siTNo);
}
else {
printf("NG %d\n", siTNo);
}
#endif
return 0;
}
// プログラム開始
int
main()
{
#ifdef D_TEST
int i;
for (i = D_TEST_SNO; i <= D_TEST_ENO; i++) {
siTNo = i;
fOne();
}
#else
fOne();
#endif
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317672/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317672/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@szpFpI = internal unnamed_addr global ptr null, align 8
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fOut(ptr noundef %pcpLine) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef %pcpLine)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i64 @fMain() local_unnamed_addr #0 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
%llCnt = alloca i64, align 8
%ll1Move = alloca [5 x i64], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %llCnt) #4
%0 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%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.1, ptr noundef nonnull %llCnt) #4
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %ll1Move) #4
%1 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%call4 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %1)
%call6 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull %ll1Move) #4
%2 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%call4.1 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %2)
%arrayidx.1 = getelementptr inbounds [5 x i64], ptr %ll1Move, i64 0, i64 1
%call6.1 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.1) #4
%3 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%call4.2 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %3)
%arrayidx.2 = getelementptr inbounds [5 x i64], ptr %ll1Move, i64 0, i64 2
%call6.2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.2) #4
%4 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%call4.3 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %4)
%arrayidx.3 = getelementptr inbounds [5 x i64], ptr %ll1Move, i64 0, i64 3
%call6.3 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.3) #4
%5 = load ptr, ptr @szpFpI, align 8, !tbaa !5
%call4.4 = call ptr @fgets(ptr noundef nonnull %lc1Buf, i32 noundef 1024, ptr noundef %5)
%arrayidx.4 = getelementptr inbounds [5 x i64], ptr %ll1Move, i64 0, i64 4
%call6.4 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %lc1Buf, ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx.4) #4
%6 = load i64, ptr %llCnt, align 8, !tbaa !9
%add = add i64 %6, -1
%7 = load i64, ptr %ll1Move, align 16, !tbaa !9
%sub = add i64 %add, %7
%div = sdiv i64 %sub, %7
%8 = load i64, ptr %arrayidx.1, align 8, !tbaa !9
%sub.1 = add i64 %add, %8
%div.1 = sdiv i64 %sub.1, %8
%spec.select = call i64 @llvm.smax.i64(i64 %div, i64 %div.1)
%9 = load i64, ptr %arrayidx.2, align 16, !tbaa !9
%sub.2 = add i64 %add, %9
%div.2 = sdiv i64 %sub.2, %9
%spec.select.1 = call i64 @llvm.smax.i64(i64 %spec.select, i64 %div.2)
%10 = load i64, ptr %arrayidx.3, align 8, !tbaa !9
%sub.3 = add i64 %add, %10
%div.3 = sdiv i64 %sub.3, %10
%spec.select.2 = call i64 @llvm.smax.i64(i64 %spec.select.1, i64 %div.3)
%11 = load i64, ptr %arrayidx.4, align 16, !tbaa !9
%sub.4 = add i64 %add, %11
%div.4 = sdiv i64 %sub.4, %11
%spec.select.3 = call i64 @llvm.smax.i64(i64 %spec.select.2, i64 %div.4)
%spec.select.4 = call i64 @llvm.smax.i64(i64 %spec.select.3, i64 0)
%sub19 = add nuw nsw i64 %spec.select.4, 4
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %ll1Move) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %llCnt) #4
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #4
ret i64 %sub19
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @fOne() local_unnamed_addr #0 {
entry:
%lc1Buf = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
store ptr %0, ptr @szpFpI, align 8, !tbaa !5
%call = tail call i64 @fMain(), !range !11
%call1 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf, ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %call) #4
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%lc1Buf.i = alloca [1024 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %lc1Buf.i) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
store ptr %0, ptr @szpFpI, align 8, !tbaa !5
%call.i = tail call i64 @fMain(), !range !11
%call1.i = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %lc1Buf.i, ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %call.i) #4
%call.i.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %lc1Buf.i)
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %lc1Buf.i) #4
ret i32 0
}
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{i64 4, i64 -9223372036854775804}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define MOD 1000000007
#define MAX(a,b) (a>b?a:b)
#define MAX3(a,b,c) MAX(a,MAX(b,c))
#define MIN(a,b) (a<b?a:b)
#define MIN3(a,b,c) MIN(a, MIN(b,c))
typedef long long lli;
int main()
{
lli i, n, a[5], min=1e15;
scanf("%lld",&n);
for(i=0; i<5; i++) {
scanf("%lld",a+i);
min = MIN(min, a[i]);
}
//printf("%lld\n",min);
if(n<=min) {
printf("5");
return 0;
}
lli ans = (n) / min + 4;
if(n%min!=0) {
ans += 1;
}
printf("%lld",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317715/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317715/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%a = alloca [5 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i64, ptr %a, align 16, !tbaa !5
%add.ptr.1 = getelementptr inbounds i64, ptr %a, i64 1
%call1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.1)
%1 = load i64, ptr %add.ptr.1, align 8, !tbaa !5
%min.0. = call i64 @llvm.smin.i64(i64 %0, i64 %1)
%add.ptr.2 = getelementptr inbounds i64, ptr %a, i64 2
%call1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.2)
%2 = load i64, ptr %add.ptr.2, align 16, !tbaa !5
%min.0..1 = call i64 @llvm.smin.i64(i64 %min.0., i64 %2)
%add.ptr.3 = getelementptr inbounds i64, ptr %a, i64 3
%call1.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.3)
%3 = load i64, ptr %add.ptr.3, align 8, !tbaa !5
%min.0..2 = call i64 @llvm.smin.i64(i64 %min.0..1, i64 %3)
%add.ptr.4 = getelementptr inbounds i64, ptr %a, i64 4
%call1.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr.4)
%4 = load i64, ptr %add.ptr.4, align 16, !tbaa !5
%min.0..3 = call i64 @llvm.smin.i64(i64 %min.0..2, i64 %4)
%min.0..4 = call i64 @llvm.smin.i64(i64 %min.0..3, i64 1000000000000000)
%5 = load i64, ptr %n, align 8, !tbaa !5
%cmp4.not = icmp sgt i64 %5, %min.0..4
br i1 %cmp4.not, label %if.end, label %if.then
if.then: ; preds = %entry
%putchar = call i32 @putchar(i32 53)
br label %cleanup
if.end: ; preds = %entry
%div = sdiv i64 %5, %min.0..4
%rem = srem i64 %5, %min.0..4
%cmp6.not = icmp eq i64 %rem, 0
%spec.select.v = select i1 %cmp6.not, i64 4, i64 5
%spec.select = add nsw i64 %spec.select.v, %div
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %spec.select)
br label %cleanup
cleanup: ; preds = %if.end, %if.then
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 8, 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 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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
long long int N,a[5],min=1000000000000001L,num;
int i;
scanf("%lld",&N);
for(i = 0;i < 5;i++){
scanf("%lld",&a[i]);
if(min > a[i]){min = a[i];}
}
num = N / min+4;
if(N % min > 0){num++;}
printf("%lld\n",num);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317759/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317759/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i64, align 8
%a = alloca [5 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i64, ptr %a, align 16, !tbaa !5
%arrayidx.1 = getelementptr inbounds [5 x i64], ptr %a, i64 0, i64 1
%call1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%1 = load i64, ptr %arrayidx.1, align 8, !tbaa !5
%spec.select = call i64 @llvm.smin.i64(i64 %0, i64 %1)
%arrayidx.2 = getelementptr inbounds [5 x i64], ptr %a, i64 0, i64 2
%call1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%2 = load i64, ptr %arrayidx.2, align 16, !tbaa !5
%spec.select.1 = call i64 @llvm.smin.i64(i64 %spec.select, i64 %2)
%arrayidx.3 = getelementptr inbounds [5 x i64], ptr %a, i64 0, i64 3
%call1.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%3 = load i64, ptr %arrayidx.3, align 8, !tbaa !5
%spec.select.2 = call i64 @llvm.smin.i64(i64 %spec.select.1, i64 %3)
%arrayidx.4 = getelementptr inbounds [5 x i64], ptr %a, i64 0, i64 4
%call1.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%4 = load i64, ptr %arrayidx.4, align 16, !tbaa !5
%spec.select.3 = call i64 @llvm.smin.i64(i64 %spec.select.2, i64 %4)
%spec.select.4 = call i64 @llvm.smin.i64(i64 %spec.select.3, i64 1000000000000001)
%5 = load i64, ptr %N, align 8, !tbaa !5
%div = sdiv i64 %5, %spec.select.4
%rem = srem i64 %5, %spec.select.4
%cmp7 = icmp sgt i64 %rem, 0
%spec.select19.v = select i1 %cmp7, i64 5, i64 4
%spec.select19 = add nsw i64 %spec.select19.v, %div
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %spec.select19)
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define N 200000
#define INF 0x3f3f3f3f3f3f3f3fLL
long long llabs(long long n) {
return n < 0 ? -n : n;
}
int main() {
static int aa[N];
int n, i;
long long snukesum, raccoonsum, min;
scanf("%d", &n);
raccoonsum = 0;
for (i = 0; i < n; i++) {
scanf("%d", &aa[i]);
raccoonsum += aa[i];
}
snukesum = 0;
min = INF;
for (i = 0; i < n - 1; i++) {
long long diff;
snukesum += aa[i];
raccoonsum -= aa[i];
diff = llabs(snukesum - raccoonsum);
if (min > diff)
min = diff;
}
printf("%lld\n", min);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317816/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317816/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@main.aa = internal global [200000 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"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llabs(i64 noundef %n) local_unnamed_addr #0 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %n, i1 true)
ret i64 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
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
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.body, label %for.end21
for.cond4.preheader: ; preds = %for.body
%cmp539 = icmp sgt i32 %3, 1
br i1 %cmp539, label %for.body7.preheader, label %for.end21
for.body7.preheader: ; preds = %for.cond4.preheader
%sub = add nsw i32 %3, -1
%wide.trip.count = zext i32 %sub to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %sub, 1
br i1 %1, label %for.end21.loopexit.unr-lcssa, label %for.body7.preheader.new
for.body7.preheader.new: ; preds = %for.body7.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%raccoonsum.036 = phi i64 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 x i32], ptr @main.aa, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sext i32 %2 to i64
%add = add nsw i64 %raccoonsum.036, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.body7: ; preds = %for.body7, %for.body7.preheader.new
%indvars.iv47 = phi i64 [ 0, %for.body7.preheader.new ], [ %indvars.iv.next48.1, %for.body7 ]
%min.042 = phi i64 [ 4557430888798830399, %for.body7.preheader.new ], [ %spec.select.1, %for.body7 ]
%raccoonsum.141 = phi i64 [ %add, %for.body7.preheader.new ], [ %sub15.1, %for.body7 ]
%snukesum.040 = phi i64 [ 0, %for.body7.preheader.new ], [ %add11.1, %for.body7 ]
%niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.1, %for.body7 ]
%arrayidx9 = getelementptr inbounds [200000 x i32], ptr @main.aa, i64 0, i64 %indvars.iv47
%5 = load i32, ptr %arrayidx9, align 8, !tbaa !5
%conv10 = sext i32 %5 to i64
%add11 = add nsw i64 %snukesum.040, %conv10
%sub15 = sub nsw i64 %raccoonsum.141, %conv10
%sub16 = sub nsw i64 %add11, %sub15
%6 = call i64 @llvm.abs.i64(i64 %sub16, i1 true)
%spec.select = call i64 @llvm.smin.i64(i64 %min.042, i64 %6)
%indvars.iv.next48 = or i64 %indvars.iv47, 1
%arrayidx9.1 = getelementptr inbounds [200000 x i32], ptr @main.aa, i64 0, i64 %indvars.iv.next48
%7 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%conv10.1 = sext i32 %7 to i64
%add11.1 = add nsw i64 %add11, %conv10.1
%sub15.1 = sub nsw i64 %sub15, %conv10.1
%sub16.1 = sub nsw i64 %add11.1, %sub15.1
%8 = call i64 @llvm.abs.i64(i64 %sub16.1, i1 true)
%spec.select.1 = call i64 @llvm.smin.i64(i64 %spec.select, i64 %8)
%indvars.iv.next48.1 = add nuw nsw i64 %indvars.iv47, 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.end21.loopexit.unr-lcssa, label %for.body7, !llvm.loop !11
for.end21.loopexit.unr-lcssa: ; preds = %for.body7, %for.body7.preheader
%spec.select.lcssa.ph = phi i64 [ undef, %for.body7.preheader ], [ %spec.select.1, %for.body7 ]
%indvars.iv47.unr = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next48.1, %for.body7 ]
%min.042.unr = phi i64 [ 4557430888798830399, %for.body7.preheader ], [ %spec.select.1, %for.body7 ]
%raccoonsum.141.unr = phi i64 [ %add, %for.body7.preheader ], [ %sub15.1, %for.body7 ]
%snukesum.040.unr = phi i64 [ 0, %for.body7.preheader ], [ %add11.1, %for.body7 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end21, label %for.body7.epil
for.body7.epil: ; preds = %for.end21.loopexit.unr-lcssa
%arrayidx9.epil = getelementptr inbounds [200000 x i32], ptr @main.aa, i64 0, i64 %indvars.iv47.unr
%9 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5
%conv10.epil = sext i32 %9 to i64
%add11.epil = add nsw i64 %snukesum.040.unr, %conv10.epil
%sub15.epil.neg = sub i64 %conv10.epil, %raccoonsum.141.unr
%sub16.epil = add i64 %sub15.epil.neg, %add11.epil
%10 = call i64 @llvm.abs.i64(i64 %sub16.epil, i1 true)
%spec.select.epil = call i64 @llvm.smin.i64(i64 %min.042.unr, i64 %10)
br label %for.end21
for.end21: ; preds = %for.body7.epil, %for.end21.loopexit.unr-lcssa, %entry, %for.cond4.preheader
%min.0.lcssa = phi i64 [ 4557430888798830399, %for.cond4.preheader ], [ 4557430888798830399, %entry ], [ %spec.select.lcssa.ph, %for.end21.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body7.epil ]
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %min.0.lcssa)
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) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int t,m[100000],n[100000],i;
scanf("%d",&t);
for(i=0;i<t;i++)
scanf("%d%d",&m[i],&n[i]);
for(i=0;i<t;i++)
{
if(m[i]==1||n[i]==1) printf("YES\n");
else if(m[i]>2||n[i]>2) printf("NO\n");
else printf("YES\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_31786/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_31786/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.5 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%m = alloca [100000 x i32], align 16
%n = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp41 = icmp sgt i32 %0, 0
br i1 %cmp41, label %for.body, label %for.end28
for.cond4.preheader: ; preds = %for.body
%1 = icmp sgt i32 %2, 0
br i1 %1, label %for.body6, label %for.end28
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %m, i64 0, i64 %indvars.iv
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr %n, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %t, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9
for.body6: ; preds = %for.cond4.preheader, %for.inc26
%indvars.iv46 = phi i64 [ %indvars.iv.next47, %for.inc26 ], [ 0, %for.cond4.preheader ]
%arrayidx8 = getelementptr inbounds [100000 x i32], ptr %m, i64 0, i64 %indvars.iv46
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp9 = icmp eq i32 %4, 1
br i1 %cmp9, label %for.inc26, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body6
%arrayidx11 = getelementptr inbounds [100000 x i32], ptr %n, i64 0, i64 %indvars.iv46
%5 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp eq i32 %5, 1
br i1 %cmp12, label %for.inc26, label %if.else
if.else: ; preds = %lor.lhs.false
%cmp16 = icmp sgt i32 %4, 2
%cmp20 = icmp sgt i32 %5, 2
%or.cond = or i1 %cmp16, %cmp20
%str.4.str = select i1 %or.cond, ptr @str.4, ptr @str.5
br label %for.inc26
for.inc26: ; preds = %if.else, %for.body6, %lor.lhs.false
%str.5.sink = phi ptr [ @str.5, %lor.lhs.false ], [ @str.5, %for.body6 ], [ %str.4.str, %if.else ]
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink)
%indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
%6 = load i32, ptr %t, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp5 = icmp slt i64 %indvars.iv.next47, %7
br i1 %cmp5, label %for.body6, label %for.end28, !llvm.loop !11
for.end28: ; preds = %for.inc26, %entry, %for.cond4.preheader
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main()
{
int i,t;
scanf("%d",&t);
for(i=0;i<t;i++)
{
int m,n;
scanf("%d %d",&m,&n);
if(m==1||n==1)
printf("YES");
else if(n*m==4)
printf("YES");
else
printf("NO");
if(i!=t-1)
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_31791/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_31791/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %if.end14
%i.019 = phi i32 [ %inc, %if.end14 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %n)
%1 = load i32, ptr %m, align 4, !tbaa !5
%cmp2 = icmp eq i32 %1, 1
%2 = load i32, ptr %n, align 4
%cmp3 = icmp eq i32 %2, 1
%or.cond = select i1 %cmp2, i1 true, i1 %cmp3
%mul = mul nsw i32 %2, %1
%cmp5 = icmp eq i32 %mul, 4
%3 = select i1 %or.cond, i1 true, i1 %cmp5
%.str.2.sink = select i1 %3, ptr @.str.2, ptr @.str.3
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
%4 = load i32, ptr %t, align 4, !tbaa !5
%sub = add nsw i32 %4, -1
%cmp11.not = icmp eq i32 %i.019, %sub
br i1 %cmp11.not, label %if.end14, label %if.then12
if.then12: ; preds = %for.body
%putchar = call i32 @putchar(i32 10)
%.pre = load i32, ptr %t, align 4, !tbaa !5
br label %if.end14
if.end14: ; preds = %if.then12, %for.body
%5 = phi i32 [ %.pre, %if.then12 ], [ %4, %for.body ]
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
%inc = add nuw nsw i32 %i.019, 1
%cmp = icmp slt i32 %inc, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end14, %entry
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
typedef long long ll;
ll power(int x);
int main()
{
ll m, k;
ll max_e;
scanf("%lld %lld", &m, &k);
max_e = power(m);
ll s = 0;
for (ll i = 0; i < max_e; i++) {
if (i != k) {
s ^= i;
}
}
if (s != k && k != 0) {
printf("-1\n");
return 0;
}
for (ll i = 0; i < max_e; i++) {
if (i != k || k == 0) {
printf("%lld ", i);
}
}
if (k != 0) {
printf("%lld ", k);
}
for (ll i = max_e - 1; i >= 0; i--) {
if (i != k || k == 0) {
if (i == 0 && k == 0) {
printf("%lld", i);
}
else {
printf("%lld ", i);
}
}
}
if (k != 0) {
printf("%lld", k);
}
putchar('\n');
return 0;
}
ll power(int x)
{
ll res = 1;
ll mul = 2;
while (x) {
if (x & 1) {
res *= mul;
}
mul *= mul;
x = x >> 1;
}
return res;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_317968/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_317968/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld \00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@stdout = 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:
%m = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %k)
%0 = load i64, ptr %m, align 8, !tbaa !5
%conv = trunc i64 %0 to i32
%tobool.not9.i = icmp eq i32 %conv, 0
br i1 %tobool.not9.i, label %power.exit.thread, label %while.body.i
power.exit.thread: ; preds = %entry
%.pre96 = load i64, ptr %k, align 8
br label %for.body.lr.ph
while.body.i: ; preds = %entry, %while.body.i
%mul.012.i = phi i64 [ %mul3.i, %while.body.i ], [ 2, %entry ]
%res.011.i = phi i64 [ %spec.select.i, %while.body.i ], [ 1, %entry ]
%x.addr.010.i = phi i32 [ %shr.i, %while.body.i ], [ %conv, %entry ]
%and.i = and i32 %x.addr.010.i, 1
%tobool1.not.i = icmp eq i32 %and.i, 0
%mul2.i = select i1 %tobool1.not.i, i64 1, i64 %mul.012.i
%spec.select.i = mul nsw i64 %mul2.i, %res.011.i
%mul3.i = mul nsw i64 %mul.012.i, %mul.012.i
%shr.i = ashr i32 %x.addr.010.i, 1
%tobool.not.i = icmp ult i32 %x.addr.010.i, 2
br i1 %tobool.not.i, label %power.exit, label %while.body.i, !llvm.loop !9
power.exit: ; preds = %while.body.i
%cmp84 = icmp sgt i64 %spec.select.i, 0
%.pre = load i64, ptr %k, align 8
br i1 %cmp84, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %power.exit.thread, %power.exit
%.pre101 = phi i64 [ %.pre96, %power.exit.thread ], [ %.pre, %power.exit ]
%res.0.lcssa.i98 = phi i64 [ 1, %power.exit.thread ], [ %spec.select.i, %power.exit ]
%xtraiter = and i64 %res.0.lcssa.i98, 3
%1 = icmp ult i64 %res.0.lcssa.i98, 4
br i1 %1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %res.0.lcssa.i98, 9223372036854775804
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%spec.select.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %spec.select.3, %for.body ]
%i.086.unr = phi i64 [ 0, %for.body.lr.ph ], [ %inc.3, %for.body ]
%s.085.unr = phi i64 [ 0, %for.body.lr.ph ], [ %spec.select.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%i.086.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.086.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%s.085.epil = phi i64 [ %spec.select.epil, %for.body.epil ], [ %s.085.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%cmp3.not.epil = icmp eq i64 %i.086.epil, %.pre101
%xor.epil = select i1 %cmp3.not.epil, i64 0, i64 %i.086.epil
%spec.select.epil = xor i64 %xor.epil, %s.085.epil
%inc.epil = add nuw nsw i64 %i.086.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.cond.cleanup, label %for.body.epil, !llvm.loop !11
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %power.exit
%.pre102 = phi i64 [ %.pre, %power.exit ], [ %.pre101, %for.body.epil ], [ %.pre101, %for.cond.cleanup.loopexit.unr-lcssa ]
%cmp8499 = phi i1 [ false, %power.exit ], [ true, %for.body.epil ], [ true, %for.cond.cleanup.loopexit.unr-lcssa ]
%res.0.lcssa.i97 = phi i64 [ %spec.select.i, %power.exit ], [ %res.0.lcssa.i98, %for.body.epil ], [ %res.0.lcssa.i98, %for.cond.cleanup.loopexit.unr-lcssa ]
%s.0.lcssa = phi i64 [ 0, %power.exit ], [ %spec.select.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%cmp5 = icmp ne i64 %s.0.lcssa, %.pre102
%cmp7 = icmp ne i64 %.pre102, 0
%or.cond = and i1 %cmp5, %cmp7
br i1 %or.cond, label %if.then9, label %for.cond13.preheader
for.cond13.preheader: ; preds = %for.cond.cleanup
br i1 %cmp8499, label %for.body17, label %for.cond.cleanup16
for.body: ; preds = %for.body, %for.body.lr.ph.new
%i.086 = phi i64 [ 0, %for.body.lr.ph.new ], [ %inc.3, %for.body ]
%s.085 = phi i64 [ 0, %for.body.lr.ph.new ], [ %spec.select.3, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.3, %for.body ]
%cmp3.not = icmp eq i64 %i.086, %.pre101
%xor = select i1 %cmp3.not, i64 0, i64 %i.086
%spec.select = xor i64 %xor, %s.085
%inc = or i64 %i.086, 1
%cmp3.not.1 = icmp eq i64 %inc, %.pre101
%xor.1 = select i1 %cmp3.not.1, i64 0, i64 %inc
%spec.select.1 = xor i64 %xor.1, %spec.select
%inc.1 = or i64 %i.086, 2
%cmp3.not.2 = icmp eq i64 %inc.1, %.pre101
%xor.2 = select i1 %cmp3.not.2, i64 0, i64 %inc.1
%spec.select.2 = xor i64 %xor.2, %spec.select.1
%inc.2 = or i64 %i.086, 3
%cmp3.not.3 = icmp eq i64 %inc.2, %.pre101
%xor.3 = select i1 %cmp3.not.3, i64 0, i64 %inc.2
%spec.select.3 = xor i64 %xor.3, %spec.select.2
%inc.3 = add nuw nsw i64 %i.086, 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.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !13
if.then9: ; preds = %for.cond.cleanup
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
for.cond.cleanup16.loopexit: ; preds = %for.inc25
%.pre93 = load i64, ptr %k, align 8, !tbaa !5
br label %for.cond.cleanup16
for.cond.cleanup16: ; preds = %for.cond.cleanup16.loopexit, %for.cond13.preheader
%2 = phi i64 [ %.pre93, %for.cond.cleanup16.loopexit ], [ %.pre102, %for.cond13.preheader ]
%cmp28.not = icmp eq i64 %2, 0
br i1 %cmp28.not, label %if.end32, label %if.then30
for.body17: ; preds = %for.cond13.preheader, %for.inc25
%i12.088 = phi i64 [ %inc26, %for.inc25 ], [ 0, %for.cond13.preheader ]
%3 = load i64, ptr %k, align 8
%cmp18 = icmp ne i64 %i12.088, %3
%cmp20 = icmp eq i64 %3, 0
%or.cond66 = or i1 %cmp18, %cmp20
br i1 %or.cond66, label %if.then22, label %for.inc25
if.then22: ; preds = %for.body17
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %i12.088)
br label %for.inc25
for.inc25: ; preds = %if.then22, %for.body17
%inc26 = add nuw nsw i64 %i12.088, 1
%exitcond92.not = icmp eq i64 %inc26, %res.0.lcssa.i97
br i1 %exitcond92.not, label %for.cond.cleanup16.loopexit, label %for.body17, !llvm.loop !14
if.then30: ; preds = %for.cond.cleanup16
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %2)
br label %if.end32
if.end32: ; preds = %if.then30, %for.cond.cleanup16
br i1 %cmp8499, label %for.body38, label %for.cond.cleanup37
for.cond.cleanup37: ; preds = %for.inc55, %if.end32
%4 = load i64, ptr %k, align 8, !tbaa !5
%cmp57.not = icmp eq i64 %4, 0
br i1 %cmp57.not, label %if.end61, label %if.then59
for.body38: ; preds = %if.end32, %for.inc55
%i33.091.in = phi i64 [ %i33.091, %for.inc55 ], [ %res.0.lcssa.i97, %if.end32 ]
%i33.091 = add nsw i64 %i33.091.in, -1
%5 = load i64, ptr %k, align 8
%cmp39 = icmp ne i64 %i33.091, %5
%cmp42 = icmp eq i64 %5, 0
%or.cond67 = or i1 %cmp39, %cmp42
br i1 %or.cond67, label %if.then44, label %for.inc55
if.then44: ; preds = %for.body38
%6 = or i64 %5, %i33.091
%or.cond68 = icmp eq i64 %6, 0
br i1 %or.cond68, label %if.then50, label %if.else
if.then50: ; preds = %if.then44
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef 0)
br label %for.inc55
if.else: ; preds = %if.then44
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %i33.091)
br label %for.inc55
for.inc55: ; preds = %for.body38, %if.else, %if.then50
%cmp35 = icmp sgt i64 %i33.091.in, 1
br i1 %cmp35, label %for.body38, label %for.cond.cleanup37, !llvm.loop !15
if.then59: ; preds = %for.cond.cleanup37
%call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %4)
br label %if.end61
if.end61: ; preds = %if.then59, %for.cond.cleanup37
%7 = load ptr, ptr @stdout, align 8, !tbaa !16
%call.i = call i32 @putc(i32 noundef 10, ptr noundef %7)
br label %cleanup
cleanup: ; preds = %if.end61, %if.then9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @power(i32 noundef %x) local_unnamed_addr #3 {
entry:
%tobool.not9 = icmp eq i32 %x, 0
br i1 %tobool.not9, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%mul.012 = phi i64 [ %mul3, %while.body ], [ 2, %entry ]
%res.011 = phi i64 [ %spec.select, %while.body ], [ 1, %entry ]
%x.addr.010 = phi i32 [ %shr, %while.body ], [ %x, %entry ]
%and = and i32 %x.addr.010, 1
%tobool1.not = icmp eq i32 %and, 0
%mul2 = select i1 %tobool1.not, i64 1, i64 %mul.012
%spec.select = mul nsw i64 %mul2, %res.011
%mul3 = mul nsw i64 %mul.012, %mul.012
%shr = ashr i32 %x.addr.010, 1
%tobool.not = icmp ult i32 %x.addr.010, 2
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%res.0.lcssa = phi i64 [ 1, %entry ], [ %spec.select, %while.body ]
ret i64 %res.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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !17, i64 0}
!17 = !{!"any pointer", !7, i64 0}
|
// Starting with the name of Allah
#include<stdio.h>
int main()
{
long long int t,n,m,k,p,q;
scanf("%lld",&t);
while(t--){
scanf("%lld %lld",&n,&m);
k=m*n;
p=m+n;
if(k<=p){
printf("YES\n");
}
else{
printf("NO\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_31801/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_31801/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%n = alloca i64, align 8
%m = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4
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 %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%dec5 = add nsw i64 %0, -1
store i64 %dec5, ptr %t, align 8, !tbaa !5
%tobool.not6 = icmp eq i64 %0, 0
br i1 %tobool.not6, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %m)
%1 = load i64, ptr %m, align 8, !tbaa !5
%2 = load i64, ptr %n, align 8, !tbaa !5
%mul = mul nsw i64 %2, %1
%add = add nsw i64 %2, %1
%cmp.not = icmp sgt i64 %mul, %add
%str.str.4 = select i1 %cmp.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
%3 = load i64, ptr %t, align 8, !tbaa !5
%dec = add nsw i64 %3, -1
store i64 %dec, ptr %t, align 8, !tbaa !5
%tobool.not = icmp eq i64 %3, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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(void)
{
int a, b;
double S;
scanf("%d %d", &a, &b);
S = a * b / 3.305785;
printf("%f\n", S);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318053/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318053/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%conv = sitofp i32 %mul to double
%div = fdiv double %conv, 0x400A723F67F4DBE0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
const double TSUBO = 3.305785;
double a, b;
double area;
scanf("%lf %lf", &a, &b);
area = (a * b) / TSUBO;
printf("%.4f\n", area);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318110/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318110/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [8 x i8] c"%lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%.4f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca double, align 8
%b = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load double, ptr %a, align 8, !tbaa !5
%1 = load double, ptr %b, align 8, !tbaa !5
%mul = fmul double %0, %1
%div = fdiv double %mul, 0x400A723F67F4DBE0
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main(void)
{
int w,h;
char s[60][30];
int i,j,m,n,c;
int dp[60][30][2];
int tmp1,tmp2,min;
while(1){
scanf("%d %d ",&w,&h);
if(w==0 && h==0)break;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
scanf("%c ",&s[i][j]);
}
}
for(i=0;i<h;i++){
for(j=0;j<w;j++){
dp[i][j][0] = -1;
dp[i][j][1] = -1;
}
}
for(i=0;i<w;i++){
if(s[h-1][i] == 'S'){
dp[h-1][i][0] = 0;
dp[h-1][i][1] = 0;
}
}
while(1){
c=0;
for(i=0;i<h;i++){
for(j=0;j<w;j++){
if(dp[i][j][0] >= 0){
for(m=-2;m<=2;m++){
for(n=1;n<=3;n++){
if(i+m>=0 && i+m<h && j+n<w && fabs(m)+n<=3 && s[i+m][j+n]!='X'){
tmp1 = dp[i+m][j+n][1];
if(s[i+m][j+n] == 'S' || s[i+m][j+n] == 'T'){
tmp2 = dp[i][j][0];
}else{
tmp2 = dp[i][j][0] + s[i+m][j+n] - '0';
}
if(tmp1 < 0 || tmp1 > tmp2){
dp[i+m][j+n][1] = tmp2;
c++;
}
}
}
}
}
if(dp[i][j][1] >= 0){
for(m=-2;m<=2;m++){
for(n=1;n<=3;n++){
if(i+m>=0 && i+m<h && j-n>=0 && fabs(m)+n<=3 && s[i+m][j-n]!='X'){
tmp1 = dp[i+m][j-n][0];
if(s[i+m][j-n] == 'S' || s[i+m][j-n] == 'T'){
tmp2 = dp[i][j][1];
}else{
tmp2 = dp[i][j][1] + (int)(s[i+m][j-n] - '0');
}
if(tmp1 < 0 || tmp1 > tmp2){
dp[i+m][j-n][0] = tmp2;
c++;
}
}
}
}
}
}
}
if(c==0)break;
}
min = -1;
for(i=0;i<w;i++){
if(s[0][i] == 'T'){
for(j=0;j<2;j++){
if(min < 0 || (dp[0][i][j] > 0 && min > dp[0][i][j]))min = dp[0][i][j];
}
}
}
printf("%d\n",min);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318161/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318161/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%c \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%w = alloca i32, align 4
%h = alloca i32, align 4
%s = alloca [60 x [30 x i8]], align 16
%dp = alloca [60 x [30 x [2 x i32]]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.start.p0(i64 1800, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 14400, ptr nonnull %dp) #5
%call544 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h)
%0 = load i32, ptr %w, align 4, !tbaa !5
%cmp545 = icmp eq i32 %0, 0
%1 = load i32, ptr %h, align 4
%cmp1546 = icmp eq i32 %1, 0
%or.cond547 = select i1 %cmp545, i1 %cmp1546, i1 false
br i1 %or.cond547, label %while.end355, label %for.cond.preheader.preheader
for.cond.preheader.preheader: ; preds = %entry
%invariant.gep = getelementptr i8, ptr %dp, i64 240
%invariant.gep658 = getelementptr i8, ptr %dp, i64 480
%invariant.gep660 = getelementptr i8, ptr %dp, i64 720
%invariant.gep662 = getelementptr i8, ptr %dp, i64 960
%invariant.gep664 = getelementptr i8, ptr %dp, i64 1200
%invariant.gep666 = getelementptr i8, ptr %dp, i64 1440
%invariant.gep668 = getelementptr i8, ptr %dp, i64 1680
br label %for.cond.preheader
for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.end353
%2 = phi i32 [ %57, %for.end353 ], [ %0, %for.cond.preheader.preheader ]
%3 = phi i32 [ %58, %for.end353 ], [ %1, %for.cond.preheader.preheader ]
%cmp2492 = icmp sgt i32 %3, 0
br i1 %cmp2492, label %for.cond3.preheader.lr.ph, label %for.cond34.preheader
for.cond3.preheader.lr.ph: ; preds = %for.cond.preheader
%4 = icmp sgt i32 %2, 0
br i1 %4, label %for.cond3.preheader, label %for.end353
for.cond12.preheader: ; preds = %for.inc9
%cmp13496 = icmp sgt i32 %20, 0
br i1 %cmp13496, label %for.cond15.preheader.lr.ph, label %for.cond34.preheader
for.cond15.preheader.lr.ph: ; preds = %for.cond12.preheader
%cmp16494 = icmp sgt i32 %21, 0
br i1 %cmp16494, label %for.cond15.preheader.us.preheader, label %for.end353
for.cond15.preheader.us.preheader: ; preds = %for.cond15.preheader.lr.ph
%5 = zext i32 %21 to i64
%6 = shl nuw nsw i64 %5, 3
%wide.trip.count = zext i32 %20 to i64
%xtraiter = and i64 %wide.trip.count, 7
%7 = icmp ult i32 %20, 8
br i1 %7, label %for.cond34.preheader.loopexit.unr-lcssa, label %for.cond15.preheader.us.preheader.new
for.cond15.preheader.us.preheader.new: ; preds = %for.cond15.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967288
br label %for.cond15.preheader.us
for.cond15.preheader.us: ; preds = %for.cond15.preheader.us, %for.cond15.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond15.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond15.preheader.us ]
%niter = phi i64 [ 0, %for.cond15.preheader.us.preheader.new ], [ %niter.next.7, %for.cond15.preheader.us ]
%8 = mul nuw nsw i64 %indvar, 240
%scevgep = getelementptr i8, ptr %dp, i64 %8
call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 -1, i64 %6, i1 false), !tbaa !5
%9 = mul nuw i64 %indvar, 240
%gep = getelementptr i8, ptr %invariant.gep, i64 %9
call void @llvm.memset.p0.i64(ptr align 16 %gep, i8 -1, i64 %6, i1 false), !tbaa !5
%10 = mul nuw i64 %indvar, 240
%gep659 = getelementptr i8, ptr %invariant.gep658, i64 %10
call void @llvm.memset.p0.i64(ptr align 16 %gep659, i8 -1, i64 %6, i1 false), !tbaa !5
%11 = mul nuw i64 %indvar, 240
%gep661 = getelementptr i8, ptr %invariant.gep660, i64 %11
call void @llvm.memset.p0.i64(ptr align 16 %gep661, i8 -1, i64 %6, i1 false), !tbaa !5
%12 = mul nuw i64 %indvar, 240
%gep663 = getelementptr i8, ptr %invariant.gep662, i64 %12
call void @llvm.memset.p0.i64(ptr align 16 %gep663, i8 -1, i64 %6, i1 false), !tbaa !5
%13 = mul nuw i64 %indvar, 240
%gep665 = getelementptr i8, ptr %invariant.gep664, i64 %13
call void @llvm.memset.p0.i64(ptr align 16 %gep665, i8 -1, i64 %6, i1 false), !tbaa !5
%14 = mul nuw i64 %indvar, 240
%gep667 = getelementptr i8, ptr %invariant.gep666, i64 %14
call void @llvm.memset.p0.i64(ptr align 16 %gep667, i8 -1, i64 %6, i1 false), !tbaa !5
%15 = mul nuw i64 %indvar, 240
%gep669 = getelementptr i8, ptr %invariant.gep668, i64 %15
call void @llvm.memset.p0.i64(ptr align 16 %gep669, i8 -1, i64 %6, 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.cond34.preheader.loopexit.unr-lcssa, label %for.cond15.preheader.us, !llvm.loop !9
for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.inc9
%16 = phi i32 [ %20, %for.inc9 ], [ %3, %for.cond3.preheader.lr.ph ]
%17 = phi i32 [ %21, %for.inc9 ], [ %2, %for.cond3.preheader.lr.ph ]
%indvars.iv555 = phi i64 [ %indvars.iv.next556, %for.inc9 ], [ 0, %for.cond3.preheader.lr.ph ]
%cmp4490 = icmp sgt i32 %17, 0
br i1 %cmp4490, label %for.body5, label %for.inc9
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds [60 x [30 x i8]], ptr %s, i64 0, i64 %indvars.iv555, i64 %indvars.iv
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%18 = load i32, ptr %w, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %19
br i1 %cmp4, label %for.body5, label %for.inc9.loopexit, !llvm.loop !11
for.inc9.loopexit: ; preds = %for.body5
%.pre = load i32, ptr %h, align 4
br label %for.inc9
for.inc9: ; preds = %for.inc9.loopexit, %for.cond3.preheader
%20 = phi i32 [ %.pre, %for.inc9.loopexit ], [ %16, %for.cond3.preheader ]
%21 = phi i32 [ %18, %for.inc9.loopexit ], [ %17, %for.cond3.preheader ]
%indvars.iv.next556 = add nuw nsw i64 %indvars.iv555, 1
%22 = sext i32 %20 to i64
%cmp2 = icmp slt i64 %indvars.iv.next556, %22
br i1 %cmp2, label %for.cond3.preheader, label %for.cond12.preheader, !llvm.loop !12
for.cond34.preheader.loopexit.unr-lcssa: ; preds = %for.cond15.preheader.us, %for.cond15.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond15.preheader.us.preheader ], [ %indvar.next.7, %for.cond15.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond34.preheader, label %for.cond15.preheader.us.epil
for.cond15.preheader.us.epil: ; preds = %for.cond34.preheader.loopexit.unr-lcssa, %for.cond15.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond15.preheader.us.epil ], [ %indvar.unr, %for.cond34.preheader.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond15.preheader.us.epil ], [ 0, %for.cond34.preheader.loopexit.unr-lcssa ]
%23 = mul nuw nsw i64 %indvar.epil, 240
%scevgep.epil = getelementptr i8, ptr %dp, i64 %23
call void @llvm.memset.p0.i64(ptr align 16 %scevgep.epil, i8 -1, i64 %6, 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.cond34.preheader, label %for.cond15.preheader.us.epil, !llvm.loop !14
for.cond34.preheader: ; preds = %for.cond34.preheader.loopexit.unr-lcssa, %for.cond15.preheader.us.epil, %for.cond.preheader, %for.cond12.preheader
%cmp13496603 = phi i1 [ false, %for.cond12.preheader ], [ false, %for.cond.preheader ], [ true, %for.cond15.preheader.us.epil ], [ true, %for.cond34.preheader.loopexit.unr-lcssa ]
%.lcssa601 = phi i32 [ %20, %for.cond12.preheader ], [ %3, %for.cond.preheader ], [ %20, %for.cond15.preheader.us.epil ], [ %20, %for.cond34.preheader.loopexit.unr-lcssa ]
%24 = phi i32 [ %21, %for.cond12.preheader ], [ %2, %for.cond.preheader ], [ %21, %for.cond15.preheader.us.epil ], [ %21, %for.cond34.preheader.loopexit.unr-lcssa ]
%cmp35498 = icmp sgt i32 %24, 0
br i1 %cmp35498, label %for.body36.lr.ph, label %while.cond60.preheader
for.body36.lr.ph: ; preds = %for.cond34.preheader
%sub = add nsw i32 %.lcssa601, -1
%idxprom37 = sext i32 %sub to i64
%wide.trip.count565 = zext i32 %24 to i64
%xtraiter651 = and i64 %wide.trip.count565, 1
%25 = icmp eq i32 %24, 1
br i1 %25, label %while.cond60.preheader.loopexit.unr-lcssa, label %for.body36.lr.ph.new
for.body36.lr.ph.new: ; preds = %for.body36.lr.ph
%unroll_iter654 = and i64 %wide.trip.count565, 4294967294
br label %for.body36
while.cond60.preheader.loopexit.unr-lcssa: ; preds = %for.inc57.1, %for.body36.lr.ph
%indvars.iv562.unr = phi i64 [ 0, %for.body36.lr.ph ], [ %indvars.iv.next563.1, %for.inc57.1 ]
%lcmp.mod653.not = icmp eq i64 %xtraiter651, 0
br i1 %lcmp.mod653.not, label %while.cond60.preheader, label %for.body36.epil
for.body36.epil: ; preds = %while.cond60.preheader.loopexit.unr-lcssa
%arrayidx40.epil = getelementptr inbounds [60 x [30 x i8]], ptr %s, i64 0, i64 %idxprom37, i64 %indvars.iv562.unr
%26 = load i8, ptr %arrayidx40.epil, align 1, !tbaa !16
%cmp41.epil = icmp eq i8 %26, 83
br i1 %cmp41.epil, label %if.then43.epil, label %while.cond60.preheader
if.then43.epil: ; preds = %for.body36.epil
%arrayidx48.epil = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom37, i64 %indvars.iv562.unr
store i32 0, ptr %arrayidx48.epil, align 8, !tbaa !5
%arrayidx55.epil = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom37, i64 %indvars.iv562.unr, i64 1
store i32 0, ptr %arrayidx55.epil, align 4, !tbaa !5
br label %while.cond60.preheader
while.cond60.preheader: ; preds = %while.cond60.preheader.loopexit.unr-lcssa, %if.then43.epil, %for.body36.epil, %for.cond34.preheader
%cmp35498618 = phi i1 [ false, %for.cond34.preheader ], [ %cmp35498, %for.body36.epil ], [ %cmp35498, %if.then43.epil ], [ %cmp35498, %while.cond60.preheader.loopexit.unr-lcssa ]
br i1 %cmp13496603, label %while.cond60.preheader.split.us, label %for.cond307.preheader
while.cond60.preheader.split.us: ; preds = %while.cond60.preheader
br i1 %cmp35498618, label %while.cond60.us.us.preheader, label %for.end353
while.cond60.us.us.preheader: ; preds = %while.cond60.preheader.split.us
%27 = sext i32 %24 to i64
%wide.trip.count587 = zext i32 %.lcssa601 to i64
%wide.trip.count582 = zext i32 %24 to i64
br label %for.cond66.preheader.us.us.us
for.cond66.preheader.us.us.us: ; preds = %for.cond66.preheader.us.us.us.backedge, %while.cond60.us.us.preheader
%indvars.iv584 = phi i64 [ 0, %while.cond60.us.us.preheader ], [ %indvars.iv584.be, %for.cond66.preheader.us.us.us.backedge ]
%c.0517.us.us.us = phi i32 [ 0, %while.cond60.us.us.preheader ], [ %c.0517.us.us.us.be, %for.cond66.preheader.us.us.us.backedge ]
%28 = trunc i64 %indvars.iv584 to i32
%29 = trunc i64 %indvars.iv584 to i32
br label %for.body69.us.us.us
for.body69.us.us.us: ; preds = %for.inc297.us.us.us, %for.cond66.preheader.us.us.us
%indvars.iv579 = phi i64 [ %indvars.iv.next580, %for.inc297.us.us.us ], [ 0, %for.cond66.preheader.us.us.us ]
%c.1513.us.us.us = phi i32 [ %c.9.us.us.us, %for.inc297.us.us.us ], [ %c.0517.us.us.us, %for.cond66.preheader.us.us.us ]
%arrayidx73.us.us.us = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %indvars.iv584, i64 %indvars.iv579
%30 = load i32, ptr %arrayidx73.us.us.us, align 8, !tbaa !5
%cmp75.us.us.us = icmp sgt i32 %30, -1
br i1 %cmp75.us.us.us, label %for.cond82.preheader.us.us.us.preheader, label %if.end181.us.us.us
for.cond82.preheader.us.us.us.preheader: ; preds = %for.body69.us.us.us
%31 = add nuw nsw i64 %indvars.iv579, 1
%cmp94.us.us.us.us = icmp sge i64 %31, %27
%32 = add nuw nsw i64 %indvars.iv579, 2
%cmp94.us.us.us.us.1 = icmp sge i64 %32, %27
%33 = add nuw nsw i64 %indvars.iv579, 3
%cmp94.us.us.us.us.2 = icmp sge i64 %33, %27
br label %for.cond82.preheader.us.us.us
if.end181.us.us.us: ; preds = %for.inc178.us.us.us, %for.body69.us.us.us
%c.5.us.us.us = phi i32 [ %c.1513.us.us.us, %for.body69.us.us.us ], [ %.us-phi503.us.us.us, %for.inc178.us.us.us ]
%arrayidx186.us.us.us = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %indvars.iv584, i64 %indvars.iv579, i64 1
%34 = load i32, ptr %arrayidx186.us.us.us, align 4, !tbaa !5
%cmp187.us.us.us = icmp sgt i32 %34, -1
br i1 %cmp187.us.us.us, label %for.cond194.preheader.us.us.us.preheader, label %for.inc297.us.us.us
for.cond194.preheader.us.us.us.preheader: ; preds = %if.end181.us.us.us
%cmp207.us.us.us.us.not = icmp eq i64 %indvars.iv579, 0
%35 = add nuw i64 %indvars.iv579, 4294967295
%idxprom220.us.us.us.us = and i64 %35, 4294967295
%cmp207.us.us.us.us.1 = icmp ugt i64 %indvars.iv579, 1
%36 = add nuw i64 %indvars.iv579, 4294967294
%idxprom220.us.us.us.us.1 = and i64 %36, 4294967295
%cmp207.us.us.us.us.2 = icmp ult i64 %indvars.iv579, 3
%37 = add nuw i64 %indvars.iv579, 4294967293
%idxprom220.us.us.us.us.2 = and i64 %37, 4294967295
br label %for.cond194.preheader.us.us.us
for.inc297.us.us.us: ; preds = %for.inc293.us.us.us, %if.end181.us.us.us
%c.9.us.us.us = phi i32 [ %c.5.us.us.us, %if.end181.us.us.us ], [ %.us-phi508.us.us.us, %for.inc293.us.us.us ]
%indvars.iv.next580 = add nuw nsw i64 %indvars.iv579, 1
%exitcond583.not = icmp eq i64 %indvars.iv.next580, %wide.trip.count582
br i1 %exitcond583.not, label %for.cond66.for.inc300_crit_edge.us.us.us, label %for.body69.us.us.us, !llvm.loop !17
for.cond194.preheader.us.us.us: ; preds = %for.cond194.preheader.us.us.us.preheader, %for.inc293.us.us.us
%c.6510.us.us.us = phi i32 [ %.us-phi508.us.us.us, %for.inc293.us.us.us ], [ %c.5.us.us.us, %for.cond194.preheader.us.us.us.preheader ]
%m.1509.us.us.us = phi i32 [ %inc294.us.us.us, %for.inc293.us.us.us ], [ -2, %for.cond194.preheader.us.us.us.preheader ]
%add198.us.us.us = add nsw i32 %m.1509.us.us.us, %29
%cmp199.us.us.us = icmp slt i32 %add198.us.us.us, 0
%cmp203.us.us.us = icmp sge i32 %add198.us.us.us, %.lcssa601
%or.cond484.us.us.us.not646 = or i1 %cmp199.us.us.us, %cmp203.us.us.us
%conv210.us.us.us = sitofp i32 %m.1509.us.us.us to double
%38 = call double @llvm.fabs.f64(double %conv210.us.us.us)
%idxprom217.us.us.us = zext i32 %add198.us.us.us to i64
%brmerge = or i1 %or.cond484.us.us.us.not646, %cmp207.us.us.us.us.not
br i1 %brmerge, label %for.inc293.us.us.us, label %land.lhs.true209.us.us.us.us
for.cond82.preheader.us.us.us: ; preds = %for.cond82.preheader.us.us.us.preheader, %for.inc178.us.us.us
%c.2505.us.us.us = phi i32 [ %.us-phi503.us.us.us, %for.inc178.us.us.us ], [ %c.1513.us.us.us, %for.cond82.preheader.us.us.us.preheader ]
%m.0504.us.us.us = phi i32 [ %inc179.us.us.us, %for.inc178.us.us.us ], [ -2, %for.cond82.preheader.us.us.us.preheader ]
%add.us.us.us = add nsw i32 %m.0504.us.us.us, %28
%cmp86.us.us.us = icmp sgt i32 %add.us.us.us, -1
%cmp90.us.us.us = icmp slt i32 %add.us.us.us, %.lcssa601
%or.cond482.us.us.us = and i1 %cmp86.us.us.us, %cmp90.us.us.us
%conv97.us.us.us = sitofp i32 %m.0504.us.us.us to double
%39 = call double @llvm.fabs.f64(double %conv97.us.us.us)
%idxprom104.us.us.us = zext i32 %add.us.us.us to i64
br i1 %or.cond482.us.us.us, label %for.body85.us.us.us.us.preheader, label %for.inc178.us.us.us
for.body85.us.us.us.us.preheader: ; preds = %for.cond82.preheader.us.us.us
%add99.us.us.us.us = fadd double %39, 1.000000e+00
%cmp100.us.us.us.us = fcmp ugt double %add99.us.us.us.us, 3.000000e+00
%or.cond642 = or i1 %cmp94.us.us.us.us, %cmp100.us.us.us.us
br i1 %or.cond642, label %for.inc175.us.us.us.us, label %land.lhs.true102.us.us.us.us
for.inc178.us.us.us: ; preds = %for.inc175.us.us.us.us.1, %land.lhs.true102.us.us.us.us.2, %if.then112.us.us.us.us.2, %if.then164.us.us.us.us.2, %for.cond82.preheader.us.us.us
%.us-phi503.us.us.us = phi i32 [ %c.2505.us.us.us, %for.cond82.preheader.us.us.us ], [ %inc172.us.us.us.us.2, %if.then164.us.us.us.us.2 ], [ %c.4.us.us.us.us.1, %land.lhs.true102.us.us.us.us.2 ], [ %c.4.us.us.us.us.1, %for.inc175.us.us.us.us.1 ], [ %c.4.us.us.us.us.1, %if.then112.us.us.us.us.2 ]
%inc179.us.us.us = add nsw i32 %m.0504.us.us.us, 1
%exitcond572.not = icmp eq i32 %inc179.us.us.us, 3
br i1 %exitcond572.not, label %if.end181.us.us.us, label %for.cond82.preheader.us.us.us, !llvm.loop !18
land.lhs.true102.us.us.us.us: ; preds = %for.body85.us.us.us.us.preheader
%arrayidx108.us.us.us.us = getelementptr inbounds [60 x [30 x i8]], ptr %s, i64 0, i64 %idxprom104.us.us.us, i64 %31
%40 = load i8, ptr %arrayidx108.us.us.us.us, align 1, !tbaa !16
%cmp110.not.us.us.us.us = icmp eq i8 %40, 88
br i1 %cmp110.not.us.us.us.us, label %for.inc175.us.us.us.us, label %if.then112.us.us.us.us
if.then112.us.us.us.us: ; preds = %land.lhs.true102.us.us.us.us
%conv109.us.us.us.us = sext i8 %40 to i32
%arrayidx119.us.us.us.us = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom104.us.us.us, i64 %31, i64 1
%41 = load i32, ptr %arrayidx119.us.us.us.us, align 4, !tbaa !5
%.off.us.us.us.us = add i8 %40, -83
%switch.us.us.us.us = icmp ult i8 %.off.us.us.us.us, 2
%add156.us.us.us.us = add nsw i32 %conv109.us.us.us.us, -48
%sub157.us.us.us.us = select i1 %switch.us.us.us.us, i32 0, i32 %add156.us.us.us.us
%tmp2.0.us.us.us.us = add i32 %30, %sub157.us.us.us.us
%cmp159.us.us.us.us = icmp slt i32 %41, 0
%cmp162.us.us.us.us = icmp sgt i32 %41, %tmp2.0.us.us.us.us
%or.cond483.us.us.us.us = select i1 %cmp159.us.us.us.us, i1 true, i1 %cmp162.us.us.us.us
br i1 %or.cond483.us.us.us.us, label %if.then164.us.us.us.us, label %for.inc175.us.us.us.us
if.then164.us.us.us.us: ; preds = %if.then112.us.us.us.us
store i32 %tmp2.0.us.us.us.us, ptr %arrayidx119.us.us.us.us, align 4, !tbaa !5
%inc172.us.us.us.us = add nsw i32 %c.2505.us.us.us, 1
br label %for.inc175.us.us.us.us
for.inc175.us.us.us.us: ; preds = %if.then164.us.us.us.us, %if.then112.us.us.us.us, %land.lhs.true102.us.us.us.us, %for.body85.us.us.us.us.preheader
%c.4.us.us.us.us = phi i32 [ %inc172.us.us.us.us, %if.then164.us.us.us.us ], [ %c.2505.us.us.us, %land.lhs.true102.us.us.us.us ], [ %c.2505.us.us.us, %for.body85.us.us.us.us.preheader ], [ %c.2505.us.us.us, %if.then112.us.us.us.us ]
%add99.us.us.us.us.1 = fadd double %39, 2.000000e+00
%cmp100.us.us.us.us.1 = fcmp ugt double %add99.us.us.us.us.1, 3.000000e+00
%or.cond643 = or i1 %cmp94.us.us.us.us.1, %cmp100.us.us.us.us.1
br i1 %or.cond643, label %for.inc175.us.us.us.us.1, label %land.lhs.true102.us.us.us.us.1
land.lhs.true102.us.us.us.us.1: ; preds = %for.inc175.us.us.us.us
%arrayidx108.us.us.us.us.1 = getelementptr inbounds [60 x [30 x i8]], ptr %s, i64 0, i64 %idxprom104.us.us.us, i64 %32
%42 = load i8, ptr %arrayidx108.us.us.us.us.1, align 1, !tbaa !16
%cmp110.not.us.us.us.us.1 = icmp eq i8 %42, 88
br i1 %cmp110.not.us.us.us.us.1, label %for.inc175.us.us.us.us.1, label %if.then112.us.us.us.us.1
if.then112.us.us.us.us.1: ; preds = %land.lhs.true102.us.us.us.us.1
%conv109.us.us.us.us.1 = sext i8 %42 to i32
%arrayidx119.us.us.us.us.1 = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom104.us.us.us, i64 %32, i64 1
%43 = load i32, ptr %arrayidx119.us.us.us.us.1, align 4, !tbaa !5
%.off.us.us.us.us.1 = add i8 %42, -83
%switch.us.us.us.us.1 = icmp ult i8 %.off.us.us.us.us.1, 2
%add156.us.us.us.us.1 = add nsw i32 %conv109.us.us.us.us.1, -48
%sub157.us.us.us.us.1 = select i1 %switch.us.us.us.us.1, i32 0, i32 %add156.us.us.us.us.1
%tmp2.0.us.us.us.us.1 = add i32 %30, %sub157.us.us.us.us.1
%cmp159.us.us.us.us.1 = icmp slt i32 %43, 0
%cmp162.us.us.us.us.1 = icmp sgt i32 %43, %tmp2.0.us.us.us.us.1
%or.cond483.us.us.us.us.1 = select i1 %cmp159.us.us.us.us.1, i1 true, i1 %cmp162.us.us.us.us.1
br i1 %or.cond483.us.us.us.us.1, label %if.then164.us.us.us.us.1, label %for.inc175.us.us.us.us.1
if.then164.us.us.us.us.1: ; preds = %if.then112.us.us.us.us.1
store i32 %tmp2.0.us.us.us.us.1, ptr %arrayidx119.us.us.us.us.1, align 4, !tbaa !5
%inc172.us.us.us.us.1 = add nsw i32 %c.4.us.us.us.us, 1
br label %for.inc175.us.us.us.us.1
for.inc175.us.us.us.us.1: ; preds = %if.then164.us.us.us.us.1, %if.then112.us.us.us.us.1, %land.lhs.true102.us.us.us.us.1, %for.inc175.us.us.us.us
%c.4.us.us.us.us.1 = phi i32 [ %inc172.us.us.us.us.1, %if.then164.us.us.us.us.1 ], [ %c.4.us.us.us.us, %land.lhs.true102.us.us.us.us.1 ], [ %c.4.us.us.us.us, %for.inc175.us.us.us.us ], [ %c.4.us.us.us.us, %if.then112.us.us.us.us.1 ]
%add99.us.us.us.us.2 = fadd double %39, 3.000000e+00
%cmp100.us.us.us.us.2 = fcmp ugt double %add99.us.us.us.us.2, 3.000000e+00
%or.cond644 = or i1 %cmp94.us.us.us.us.2, %cmp100.us.us.us.us.2
br i1 %or.cond644, label %for.inc178.us.us.us, label %land.lhs.true102.us.us.us.us.2
land.lhs.true102.us.us.us.us.2: ; preds = %for.inc175.us.us.us.us.1
%arrayidx108.us.us.us.us.2 = getelementptr inbounds [60 x [30 x i8]], ptr %s, i64 0, i64 %idxprom104.us.us.us, i64 %33
%44 = load i8, ptr %arrayidx108.us.us.us.us.2, align 1, !tbaa !16
%cmp110.not.us.us.us.us.2 = icmp eq i8 %44, 88
br i1 %cmp110.not.us.us.us.us.2, label %for.inc178.us.us.us, label %if.then112.us.us.us.us.2
if.then112.us.us.us.us.2: ; preds = %land.lhs.true102.us.us.us.us.2
%conv109.us.us.us.us.2 = sext i8 %44 to i32
%arrayidx119.us.us.us.us.2 = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom104.us.us.us, i64 %33, i64 1
%45 = load i32, ptr %arrayidx119.us.us.us.us.2, align 4, !tbaa !5
%.off.us.us.us.us.2 = add i8 %44, -83
%switch.us.us.us.us.2 = icmp ult i8 %.off.us.us.us.us.2, 2
%add156.us.us.us.us.2 = add nsw i32 %conv109.us.us.us.us.2, -48
%sub157.us.us.us.us.2 = select i1 %switch.us.us.us.us.2, i32 0, i32 %add156.us.us.us.us.2
%tmp2.0.us.us.us.us.2 = add i32 %30, %sub157.us.us.us.us.2
%cmp159.us.us.us.us.2 = icmp slt i32 %45, 0
%cmp162.us.us.us.us.2 = icmp sgt i32 %45, %tmp2.0.us.us.us.us.2
%or.cond483.us.us.us.us.2 = select i1 %cmp159.us.us.us.us.2, i1 true, i1 %cmp162.us.us.us.us.2
br i1 %or.cond483.us.us.us.us.2, label %if.then164.us.us.us.us.2, label %for.inc178.us.us.us
if.then164.us.us.us.us.2: ; preds = %if.then112.us.us.us.us.2
store i32 %tmp2.0.us.us.us.us.2, ptr %arrayidx119.us.us.us.us.2, align 4, !tbaa !5
%inc172.us.us.us.us.2 = add nsw i32 %c.4.us.us.us.us.1, 1
br label %for.inc178.us.us.us
for.inc293.us.us.us: ; preds = %for.cond194.preheader.us.us.us, %for.inc290.us.us.us.us, %for.inc290.us.us.us.us.1, %land.lhs.true215.us.us.us.us.2, %if.then225.us.us.us.us.2, %if.then279.us.us.us.us.2
%.us-phi508.us.us.us = phi i32 [ %c.6510.us.us.us, %for.cond194.preheader.us.us.us ], [ %inc287.us.us.us.us.2, %if.then279.us.us.us.us.2 ], [ %c.8.us.us.us.us.1, %land.lhs.true215.us.us.us.us.2 ], [ %c.8.us.us.us.us.1, %for.inc290.us.us.us.us.1 ], [ %c.8.us.us.us.us.1, %if.then225.us.us.us.us.2 ], [ %c.8.us.us.us.us, %for.inc290.us.us.us.us ]
%inc294.us.us.us = add nsw i32 %m.1509.us.us.us, 1
%exitcond578.not = icmp eq i32 %inc294.us.us.us, 3
br i1 %exitcond578.not, label %for.inc297.us.us.us, label %for.cond194.preheader.us.us.us, !llvm.loop !19
land.lhs.true209.us.us.us.us: ; preds = %for.cond194.preheader.us.us.us
%add212.us.us.us.us = fadd double %38, 1.000000e+00
%cmp213.us.us.us.us = fcmp ugt double %add212.us.us.us.us, 3.000000e+00
br i1 %cmp213.us.us.us.us, label %for.inc290.us.us.us.us, label %land.lhs.true215.us.us.us.us
land.lhs.true215.us.us.us.us: ; preds = %land.lhs.true209.us.us.us.us
%arrayidx221.us.us.us.us = getelementptr inbounds [60 x [30 x i8]], ptr %s, i64 0, i64 %idxprom217.us.us.us, i64 %idxprom220.us.us.us.us
%46 = load i8, ptr %arrayidx221.us.us.us.us, align 1, !tbaa !16
%cmp223.not.us.us.us.us = icmp eq i8 %46, 88
br i1 %cmp223.not.us.us.us.us, label %for.inc290.us.us.us.us, label %if.then225.us.us.us.us
if.then225.us.us.us.us: ; preds = %land.lhs.true215.us.us.us.us
%conv222.us.us.us.us = sext i8 %46 to i32
%arrayidx231.us.us.us.us = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom217.us.us.us, i64 %idxprom220.us.us.us.us
%47 = load i32, ptr %arrayidx231.us.us.us.us, align 8, !tbaa !5
%.off487.us.us.us.us = add i8 %46, -83
%switch488.us.us.us.us = icmp ult i8 %.off487.us.us.us.us, 2
%sub271.us.us.us.us = add nsw i32 %conv222.us.us.us.us, -48
%add272.us.us.us.us = select i1 %switch488.us.us.us.us, i32 0, i32 %sub271.us.us.us.us
%tmp2.1.us.us.us.us = add nsw i32 %34, %add272.us.us.us.us
%cmp274.us.us.us.us = icmp slt i32 %47, 0
%cmp277.us.us.us.us = icmp sgt i32 %47, %tmp2.1.us.us.us.us
%or.cond485.us.us.us.us = select i1 %cmp274.us.us.us.us, i1 true, i1 %cmp277.us.us.us.us
br i1 %or.cond485.us.us.us.us, label %if.then279.us.us.us.us, label %for.inc290.us.us.us.us
if.then279.us.us.us.us: ; preds = %if.then225.us.us.us.us
store i32 %tmp2.1.us.us.us.us, ptr %arrayidx231.us.us.us.us, align 8, !tbaa !5
%inc287.us.us.us.us = add nsw i32 %c.6510.us.us.us, 1
br label %for.inc290.us.us.us.us
for.inc290.us.us.us.us: ; preds = %if.then279.us.us.us.us, %if.then225.us.us.us.us, %land.lhs.true215.us.us.us.us, %land.lhs.true209.us.us.us.us
%c.8.us.us.us.us = phi i32 [ %inc287.us.us.us.us, %if.then279.us.us.us.us ], [ %c.6510.us.us.us, %land.lhs.true215.us.us.us.us ], [ %c.6510.us.us.us, %land.lhs.true209.us.us.us.us ], [ %c.6510.us.us.us, %if.then225.us.us.us.us ]
br i1 %cmp207.us.us.us.us.1, label %land.lhs.true209.us.us.us.us.1, label %for.inc293.us.us.us
land.lhs.true209.us.us.us.us.1: ; preds = %for.inc290.us.us.us.us
%add212.us.us.us.us.1 = fadd double %38, 2.000000e+00
%cmp213.us.us.us.us.1 = fcmp ugt double %add212.us.us.us.us.1, 3.000000e+00
br i1 %cmp213.us.us.us.us.1, label %for.inc290.us.us.us.us.1, label %land.lhs.true215.us.us.us.us.1
land.lhs.true215.us.us.us.us.1: ; preds = %land.lhs.true209.us.us.us.us.1
%arrayidx221.us.us.us.us.1 = getelementptr inbounds [60 x [30 x i8]], ptr %s, i64 0, i64 %idxprom217.us.us.us, i64 %idxprom220.us.us.us.us.1
%48 = load i8, ptr %arrayidx221.us.us.us.us.1, align 1, !tbaa !16
%cmp223.not.us.us.us.us.1 = icmp eq i8 %48, 88
br i1 %cmp223.not.us.us.us.us.1, label %for.inc290.us.us.us.us.1, label %if.then225.us.us.us.us.1
if.then225.us.us.us.us.1: ; preds = %land.lhs.true215.us.us.us.us.1
%conv222.us.us.us.us.1 = sext i8 %48 to i32
%arrayidx231.us.us.us.us.1 = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom217.us.us.us, i64 %idxprom220.us.us.us.us.1
%49 = load i32, ptr %arrayidx231.us.us.us.us.1, align 8, !tbaa !5
%.off487.us.us.us.us.1 = add i8 %48, -83
%switch488.us.us.us.us.1 = icmp ult i8 %.off487.us.us.us.us.1, 2
%sub271.us.us.us.us.1 = add nsw i32 %conv222.us.us.us.us.1, -48
%add272.us.us.us.us.1 = select i1 %switch488.us.us.us.us.1, i32 0, i32 %sub271.us.us.us.us.1
%tmp2.1.us.us.us.us.1 = add nsw i32 %34, %add272.us.us.us.us.1
%cmp274.us.us.us.us.1 = icmp slt i32 %49, 0
%cmp277.us.us.us.us.1 = icmp sgt i32 %49, %tmp2.1.us.us.us.us.1
%or.cond485.us.us.us.us.1 = select i1 %cmp274.us.us.us.us.1, i1 true, i1 %cmp277.us.us.us.us.1
br i1 %or.cond485.us.us.us.us.1, label %if.then279.us.us.us.us.1, label %for.inc290.us.us.us.us.1
if.then279.us.us.us.us.1: ; preds = %if.then225.us.us.us.us.1
store i32 %tmp2.1.us.us.us.us.1, ptr %arrayidx231.us.us.us.us.1, align 8, !tbaa !5
%inc287.us.us.us.us.1 = add nsw i32 %c.8.us.us.us.us, 1
br label %for.inc290.us.us.us.us.1
for.inc290.us.us.us.us.1: ; preds = %if.then279.us.us.us.us.1, %if.then225.us.us.us.us.1, %land.lhs.true215.us.us.us.us.1, %land.lhs.true209.us.us.us.us.1
%c.8.us.us.us.us.1 = phi i32 [ %inc287.us.us.us.us.1, %if.then279.us.us.us.us.1 ], [ %c.8.us.us.us.us, %land.lhs.true215.us.us.us.us.1 ], [ %c.8.us.us.us.us, %land.lhs.true209.us.us.us.us.1 ], [ %c.8.us.us.us.us, %if.then225.us.us.us.us.1 ]
%add212.us.us.us.us.2 = fadd double %38, 3.000000e+00
%cmp213.us.us.us.us.2 = fcmp ugt double %add212.us.us.us.us.2, 3.000000e+00
%or.cond645 = or i1 %cmp207.us.us.us.us.2, %cmp213.us.us.us.us.2
br i1 %or.cond645, label %for.inc293.us.us.us, label %land.lhs.true215.us.us.us.us.2
land.lhs.true215.us.us.us.us.2: ; preds = %for.inc290.us.us.us.us.1
%arrayidx221.us.us.us.us.2 = getelementptr inbounds [60 x [30 x i8]], ptr %s, i64 0, i64 %idxprom217.us.us.us, i64 %idxprom220.us.us.us.us.2
%50 = load i8, ptr %arrayidx221.us.us.us.us.2, align 1, !tbaa !16
%cmp223.not.us.us.us.us.2 = icmp eq i8 %50, 88
br i1 %cmp223.not.us.us.us.us.2, label %for.inc293.us.us.us, label %if.then225.us.us.us.us.2
if.then225.us.us.us.us.2: ; preds = %land.lhs.true215.us.us.us.us.2
%conv222.us.us.us.us.2 = sext i8 %50 to i32
%arrayidx231.us.us.us.us.2 = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom217.us.us.us, i64 %idxprom220.us.us.us.us.2
%51 = load i32, ptr %arrayidx231.us.us.us.us.2, align 8, !tbaa !5
%.off487.us.us.us.us.2 = add i8 %50, -83
%switch488.us.us.us.us.2 = icmp ult i8 %.off487.us.us.us.us.2, 2
%sub271.us.us.us.us.2 = add nsw i32 %conv222.us.us.us.us.2, -48
%add272.us.us.us.us.2 = select i1 %switch488.us.us.us.us.2, i32 0, i32 %sub271.us.us.us.us.2
%tmp2.1.us.us.us.us.2 = add nsw i32 %34, %add272.us.us.us.us.2
%cmp274.us.us.us.us.2 = icmp slt i32 %51, 0
%cmp277.us.us.us.us.2 = icmp sgt i32 %51, %tmp2.1.us.us.us.us.2
%or.cond485.us.us.us.us.2 = select i1 %cmp274.us.us.us.us.2, i1 true, i1 %cmp277.us.us.us.us.2
br i1 %or.cond485.us.us.us.us.2, label %if.then279.us.us.us.us.2, label %for.inc293.us.us.us
if.then279.us.us.us.us.2: ; preds = %if.then225.us.us.us.us.2
store i32 %tmp2.1.us.us.us.us.2, ptr %arrayidx231.us.us.us.us.2, align 8, !tbaa !5
%inc287.us.us.us.us.2 = add nsw i32 %c.8.us.us.us.us.1, 1
br label %for.inc293.us.us.us
for.cond66.for.inc300_crit_edge.us.us.us: ; preds = %for.inc297.us.us.us
%indvars.iv.next585 = add nuw nsw i64 %indvars.iv584, 1
%exitcond588.not = icmp eq i64 %indvars.iv.next585, %wide.trip.count587
br i1 %exitcond588.not, label %for.cond62.for.end302_crit_edge.split.us.us.us, label %for.cond66.preheader.us.us.us.backedge
for.cond66.preheader.us.us.us.backedge: ; preds = %for.cond66.for.inc300_crit_edge.us.us.us, %for.cond62.for.end302_crit_edge.split.us.us.us
%indvars.iv584.be = phi i64 [ %indvars.iv.next585, %for.cond66.for.inc300_crit_edge.us.us.us ], [ 0, %for.cond62.for.end302_crit_edge.split.us.us.us ]
%c.0517.us.us.us.be = phi i32 [ %c.9.us.us.us, %for.cond66.for.inc300_crit_edge.us.us.us ], [ 0, %for.cond62.for.end302_crit_edge.split.us.us.us ]
br label %for.cond66.preheader.us.us.us, !llvm.loop !20
for.cond62.for.end302_crit_edge.split.us.us.us: ; preds = %for.cond66.for.inc300_crit_edge.us.us.us
%cmp303.us.us = icmp eq i32 %c.9.us.us.us, 0
br i1 %cmp303.us.us, label %for.cond307.preheader, label %for.cond66.preheader.us.us.us.backedge
for.body36: ; preds = %for.inc57.1, %for.body36.lr.ph.new
%indvars.iv562 = phi i64 [ 0, %for.body36.lr.ph.new ], [ %indvars.iv.next563.1, %for.inc57.1 ]
%niter655 = phi i64 [ 0, %for.body36.lr.ph.new ], [ %niter655.next.1, %for.inc57.1 ]
%arrayidx40 = getelementptr inbounds [60 x [30 x i8]], ptr %s, i64 0, i64 %idxprom37, i64 %indvars.iv562
%52 = load i8, ptr %arrayidx40, align 2, !tbaa !16
%cmp41 = icmp eq i8 %52, 83
br i1 %cmp41, label %if.then43, label %for.inc57
if.then43: ; preds = %for.body36
%arrayidx48 = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom37, i64 %indvars.iv562
store i32 0, ptr %arrayidx48, align 16, !tbaa !5
%arrayidx55 = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom37, i64 %indvars.iv562, i64 1
store i32 0, ptr %arrayidx55, align 4, !tbaa !5
br label %for.inc57
for.inc57: ; preds = %for.body36, %if.then43
%indvars.iv.next563 = or i64 %indvars.iv562, 1
%arrayidx40.1 = getelementptr inbounds [60 x [30 x i8]], ptr %s, i64 0, i64 %idxprom37, i64 %indvars.iv.next563
%53 = load i8, ptr %arrayidx40.1, align 1, !tbaa !16
%cmp41.1 = icmp eq i8 %53, 83
br i1 %cmp41.1, label %if.then43.1, label %for.inc57.1
if.then43.1: ; preds = %for.inc57
%arrayidx48.1 = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom37, i64 %indvars.iv.next563
store i32 0, ptr %arrayidx48.1, align 8, !tbaa !5
%arrayidx55.1 = getelementptr inbounds [60 x [30 x [2 x i32]]], ptr %dp, i64 0, i64 %idxprom37, i64 %indvars.iv.next563, i64 1
store i32 0, ptr %arrayidx55.1, align 4, !tbaa !5
br label %for.inc57.1
for.inc57.1: ; preds = %if.then43.1, %for.inc57
%indvars.iv.next563.1 = add nuw nsw i64 %indvars.iv562, 2
%niter655.next.1 = add i64 %niter655, 2
%niter655.ncmp.1 = icmp eq i64 %niter655.next.1, %unroll_iter654
br i1 %niter655.ncmp.1, label %while.cond60.preheader.loopexit.unr-lcssa, label %for.body36, !llvm.loop !21
for.cond307.preheader: ; preds = %for.cond62.for.end302_crit_edge.split.us.us.us, %while.cond60.preheader
br i1 %cmp35498618, label %for.body310.preheader, label %for.end353
for.body310.preheader: ; preds = %for.cond307.preheader
%wide.trip.count595 = zext i32 %24 to i64
br label %for.body310
for.body310: ; preds = %for.body310.preheader, %for.inc351
%indvars.iv592 = phi i64 [ 0, %for.body310.preheader ], [ %indvars.iv.next593, %for.inc351 ]
%min.0542 = phi i32 [ -1, %for.body310.preheader ], [ %min.3, %for.inc351 ]
%arrayidx313 = getelementptr inbounds [30 x i8], ptr %s, i64 0, i64 %indvars.iv592
%54 = load i8, ptr %arrayidx313, align 1, !tbaa !16
%cmp315 = icmp eq i8 %54, 84
br i1 %cmp315, label %for.body321.preheader, label %for.inc351
for.body321.preheader: ; preds = %for.body310
%cmp322 = icmp slt i32 %min.0542, 0
%arrayidx345.phi.trans.insert = getelementptr inbounds [30 x [2 x i32]], ptr %dp, i64 0, i64 %indvars.iv592, i64 0
%.pre597 = load i32, ptr %arrayidx345.phi.trans.insert, align 8, !tbaa !5
br i1 %cmp322, label %for.inc347, label %lor.lhs.false324
lor.lhs.false324: ; preds = %for.body321.preheader
%cmp330 = icmp sgt i32 %.pre597, 0
%cmp338 = icmp sgt i32 %min.0542, %.pre597
%or.cond486 = and i1 %cmp330, %cmp338
%spec.select = select i1 %or.cond486, i32 %.pre597, i32 %min.0542
br label %lor.lhs.false324.1
for.inc347: ; preds = %for.body321.preheader
%cmp322.1 = icmp slt i32 %.pre597, 0
br i1 %cmp322.1, label %for.inc347.if.then340.1_crit_edge, label %lor.lhs.false324.1
for.inc347.if.then340.1_crit_edge: ; preds = %for.inc347
%arrayidx345.1.phi.trans.insert = getelementptr inbounds [30 x [2 x i32]], ptr %dp, i64 0, i64 %indvars.iv592, i64 1
%.pre598 = load i32, ptr %arrayidx345.1.phi.trans.insert, align 4, !tbaa !5
br label %if.then340.1
lor.lhs.false324.1: ; preds = %lor.lhs.false324, %for.inc347
%min.2629 = phi i32 [ %.pre597, %for.inc347 ], [ %spec.select, %lor.lhs.false324 ]
%arrayidx329.1 = getelementptr inbounds [30 x [2 x i32]], ptr %dp, i64 0, i64 %indvars.iv592, i64 1
%55 = load i32, ptr %arrayidx329.1, align 4, !tbaa !5
%cmp330.1 = icmp sgt i32 %55, 0
%cmp338.1 = icmp sgt i32 %min.2629, %55
%or.cond486.1 = and i1 %cmp330.1, %cmp338.1
br i1 %or.cond486.1, label %if.then340.1, label %for.inc351
if.then340.1: ; preds = %for.inc347.if.then340.1_crit_edge, %lor.lhs.false324.1
%56 = phi i32 [ %.pre598, %for.inc347.if.then340.1_crit_edge ], [ %55, %lor.lhs.false324.1 ]
br label %for.inc351
for.inc351: ; preds = %lor.lhs.false324.1, %if.then340.1, %for.body310
%min.3 = phi i32 [ %min.0542, %for.body310 ], [ %56, %if.then340.1 ], [ %min.2629, %lor.lhs.false324.1 ]
%indvars.iv.next593 = add nuw nsw i64 %indvars.iv592, 1
%exitcond596.not = icmp eq i64 %indvars.iv.next593, %wide.trip.count595
br i1 %exitcond596.not, label %for.end353, label %for.body310, !llvm.loop !22
for.end353: ; preds = %for.inc351, %for.cond3.preheader.lr.ph, %for.cond15.preheader.lr.ph, %while.cond60.preheader.split.us, %for.cond307.preheader
%min.0.lcssa = phi i32 [ -1, %for.cond307.preheader ], [ -1, %while.cond60.preheader.split.us ], [ -1, %for.cond15.preheader.lr.ph ], [ -1, %for.cond3.preheader.lr.ph ], [ %min.3, %for.inc351 ]
%call354 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %min.0.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w, ptr noundef nonnull %h)
%57 = load i32, ptr %w, align 4, !tbaa !5
%cmp = icmp eq i32 %57, 0
%58 = load i32, ptr %h, align 4
%cmp1 = icmp eq i32 %58, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end355, label %for.cond.preheader
while.end355: ; preds = %for.end353, %entry
call void @llvm.lifetime.end.p0(i64 14400, ptr nonnull %dp) #5
call void @llvm.lifetime.end.p0(i64 1800, ptr nonnull %s) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}
!13 = !{!"llvm.loop.unswitch.partial.disable"}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
|
#include<stdio.h>
int main(void)
{
int e,y;
scanf("%d",&e);
scanf("%d",&y);
if(e==0 && y<=1911){
printf("M%d\n",y-1867);
}
else if(e==0 && y<=1925){
printf("T%d\n",y-1911);
}
else if(e==0 && y<=1988){
printf("S%d\n",y-1925);
}
else if(e==0 && y<=2016){
printf("H%d\n",y-1988);
}
if(e==1 && y<=44){
printf("%d\n",y+1867);
}
if(e==2 && y<=14){
printf("%d\n",y+1911);
}
if(e==3 && y<=63){
printf("%d\n",y+1925);
}
if(e==4 && y<=28){
printf("%d\n",y+1988);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318255/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318255/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"M%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"T%d\0A\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"S%d\0A\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"H%d\0A\00", align 1
@.str.5 = 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:
%e = alloca i32, align 4
%y = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %y)
%0 = load i32, ptr %e, align 4, !tbaa !5
%cmp = icmp eq i32 %0, 0
%1 = load i32, ptr %y, align 4
%cmp2 = icmp slt i32 %1, 1912
%or.cond = select i1 %cmp, i1 %cmp2, i1 false
br i1 %or.cond, label %if.end26.sink.split, label %if.else
if.else: ; preds = %entry
%cmp6 = icmp slt i32 %1, 1926
%or.cond54 = select i1 %cmp, i1 %cmp6, i1 false
br i1 %or.cond54, label %if.end26.sink.split, label %if.else10
if.else10: ; preds = %if.else
%cmp13 = icmp slt i32 %1, 1989
%or.cond55 = select i1 %cmp, i1 %cmp13, i1 false
br i1 %or.cond55, label %if.end26.sink.split, label %if.else17
if.else17: ; preds = %if.else10
%cmp20 = icmp slt i32 %1, 2017
%or.cond56 = select i1 %cmp, i1 %cmp20, i1 false
br i1 %or.cond56, label %if.end26.sink.split, label %if.end26
if.end26.sink.split: ; preds = %if.else17, %if.else10, %if.else, %entry
%.sink = phi i32 [ -1867, %entry ], [ -1911, %if.else ], [ -1925, %if.else10 ], [ -1988, %if.else17 ]
%.str.2.sink = phi ptr [ @.str.1, %entry ], [ @.str.2, %if.else ], [ @.str.3, %if.else10 ], [ @.str.4, %if.else17 ]
%sub8 = add nsw i32 %1, %.sink
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink, i32 noundef %sub8)
br label %if.end26
if.end26: ; preds = %if.end26.sink.split, %if.else17
%2 = load i32, ptr %e, align 4, !tbaa !5
%cmp27 = icmp eq i32 %2, 1
%3 = load i32, ptr %y, align 4
%cmp29 = icmp slt i32 %3, 45
%or.cond57 = select i1 %cmp27, i1 %cmp29, i1 false
br i1 %or.cond57, label %if.then30, label %if.end32
if.then30: ; preds = %if.end26
%add = add nsw i32 %3, 1867
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %add)
%.pre = load i32, ptr %e, align 4, !tbaa !5
%.pre65 = load i32, ptr %y, align 4
br label %if.end32
if.end32: ; preds = %if.then30, %if.end26
%4 = phi i32 [ %.pre65, %if.then30 ], [ %3, %if.end26 ]
%5 = phi i32 [ %.pre, %if.then30 ], [ %2, %if.end26 ]
%cmp33 = icmp eq i32 %5, 2
%cmp35 = icmp slt i32 %4, 15
%or.cond58 = select i1 %cmp33, i1 %cmp35, i1 false
br i1 %or.cond58, label %if.then36, label %if.end39
if.then36: ; preds = %if.end32
%add37 = add nsw i32 %4, 1911
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %add37)
%.pre66 = load i32, ptr %e, align 4, !tbaa !5
%.pre67 = load i32, ptr %y, align 4
br label %if.end39
if.end39: ; preds = %if.then36, %if.end32
%6 = phi i32 [ %.pre67, %if.then36 ], [ %4, %if.end32 ]
%7 = phi i32 [ %.pre66, %if.then36 ], [ %5, %if.end32 ]
%cmp40 = icmp eq i32 %7, 3
%cmp42 = icmp slt i32 %6, 64
%or.cond59 = select i1 %cmp40, i1 %cmp42, i1 false
br i1 %or.cond59, label %if.then43, label %if.end46
if.then43: ; preds = %if.end39
%add44 = add nsw i32 %6, 1925
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %add44)
%.pre68 = load i32, ptr %e, align 4, !tbaa !5
%.pre69 = load i32, ptr %y, align 4
br label %if.end46
if.end46: ; preds = %if.then43, %if.end39
%8 = phi i32 [ %.pre69, %if.then43 ], [ %6, %if.end39 ]
%9 = phi i32 [ %.pre68, %if.then43 ], [ %7, %if.end39 ]
%cmp47 = icmp eq i32 %9, 4
%cmp49 = icmp slt i32 %8, 29
%or.cond60 = select i1 %cmp47, i1 %cmp49, i1 false
br i1 %or.cond60, label %if.then50, label %if.end53
if.then50: ; preds = %if.end46
%add51 = add nsw i32 %8, 1988
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %add51)
br label %if.end53
if.end53: ; preds = %if.then50, %if.end46
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#define N 100
void BubbleSortUp(int B[],int min,int max);
void BubbleSortDown(int B[],int min,int max);
int main(void){
int n,i,j,B[N],C[N],sum,num;
char s[N],str[N],*line,A[N];
fgets(s,sizeof(s),stdin);
sscanf(s,"%d",&n);
for(j=0;j<n;j++){
fgets(str,sizeof(str),stdin);
sscanf(str,"%c%c%c%c%c%c%c%c",&A[0],&A[1],&A[2],&A[3],&A[4],&A[5],&A[6],&A[7]);
sum=0; num=1;
for(i=0;i<8;i++){
B[i]=(A[i]-'\0')%48;
C[i]=B[i];
}
BubbleSortUp(B,0,7);
BubbleSortDown(C,0,7);
for(i=0;i<8;i++){
if(i!=0)
num*=10;
sum+=B[i]*num;
sum-=C[i]*num;
}
printf("%d\n",sum);
}
return 0;
}
void BubbleSortUp(int B[],int min,int max){
int i,j,tmp;
for(i=min;i<=max;i++){
for(j=max;j>i;j--){
if(B[j] < B[j-1]){
tmp = B[j-1];
B[j-1] = B[j];
B[j] = tmp;
}
}
}
}
void BubbleSortDown(int B[],int min,int max){
int i,j,tmp;
for(i=min;i<=max;i++){
for(j=max;j>i;j--){
if(B[j] > B[j-1]){
tmp = B[j-1];
B[j-1] = B[j];
B[j] = tmp;
}
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318299/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318299/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [17 x i8] c"%c%c%c%c%c%c%c%c\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [100 x i8], align 16
%str = alloca [100 x i8], align 16
%A = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #5
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %A) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 100, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %s, ptr noundef nonnull @.str, ptr noundef nonnull %n) #5
%1 = load i32, ptr %n, align 4, !tbaa !9
%cmp85 = icmp sgt i32 %1, 0
br i1 %cmp85, label %for.body.lr.ph, label %for.end45
for.body.lr.ph: ; preds = %entry
%arrayidx6 = getelementptr inbounds [100 x i8], ptr %A, i64 0, i64 1
%arrayidx7 = getelementptr inbounds [100 x i8], ptr %A, i64 0, i64 2
%arrayidx8 = getelementptr inbounds [100 x i8], ptr %A, i64 0, i64 3
%arrayidx9 = getelementptr inbounds [100 x i8], ptr %A, i64 0, i64 4
%arrayidx10 = getelementptr inbounds [100 x i8], ptr %A, i64 0, i64 5
%arrayidx11 = getelementptr inbounds [100 x i8], ptr %A, i64 0, i64 6
%arrayidx12 = getelementptr inbounds [100 x i8], ptr %A, i64 0, i64 7
br label %for.body3.preheader.i
for.body3.preheader.i: ; preds = %for.body3.preheader.i, %for.body.lr.ph
%j.086 = phi i32 [ 0, %for.body.lr.ph ], [ %inc44, %for.body3.preheader.i ]
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call4 = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 100, ptr noundef %2)
%call13 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %str, ptr noundef nonnull @.str.1, ptr noundef nonnull %A, ptr noundef nonnull %arrayidx6, ptr noundef nonnull %arrayidx7, ptr noundef nonnull %arrayidx8, ptr noundef nonnull %arrayidx9, ptr noundef nonnull %arrayidx10, ptr noundef nonnull %arrayidx11, ptr noundef nonnull %arrayidx12) #5
%3 = load i8, ptr %A, align 16, !tbaa !11
%rem80 = srem i8 %3, 48
%4 = load i8, ptr %arrayidx6, align 1, !tbaa !11
%rem80.1 = srem i8 %4, 48
%5 = load i8, ptr %arrayidx7, align 2, !tbaa !11
%rem80.2 = srem i8 %5, 48
%6 = load i8, ptr %arrayidx8, align 1, !tbaa !11
%rem80.3 = srem i8 %6, 48
%7 = load i8, ptr %arrayidx9, align 4, !tbaa !11
%rem80.4 = srem i8 %7, 48
%8 = load i8, ptr %arrayidx10, align 1, !tbaa !11
%rem80.5 = srem i8 %8, 48
%9 = load i8, ptr %arrayidx11, align 2, !tbaa !11
%rem80.6 = srem i8 %9, 48
%10 = load i8, ptr %arrayidx12, align 1, !tbaa !11
%rem80.7 = srem i8 %10, 48
%spec.select234 = call i8 @llvm.smin.i8(i8 %rem80.7, i8 %rem80.6)
%spec.select233235 = call i8 @llvm.smax.i8(i8 %rem80.7, i8 %rem80.6)
%spec.select233 = sext i8 %spec.select233235 to i32
%B.sroa.71.1236 = call i8 @llvm.smax.i8(i8 %spec.select234, i8 %rem80.5)
%B.sroa.71.1 = sext i8 %B.sroa.71.1236 to i32
%B.sroa.52.0237 = call i8 @llvm.smin.i8(i8 %spec.select234, i8 %rem80.5)
%B.sroa.52.1238 = call i8 @llvm.smax.i8(i8 %B.sroa.52.0237, i8 %rem80.4)
%B.sroa.52.1 = sext i8 %B.sroa.52.1238 to i32
%B.sroa.36.0239 = call i8 @llvm.smin.i8(i8 %B.sroa.52.0237, i8 %rem80.4)
%B.sroa.36.1240 = call i8 @llvm.smax.i8(i8 %B.sroa.36.0239, i8 %rem80.3)
%B.sroa.36.1 = sext i8 %B.sroa.36.1240 to i32
%B.sroa.23.0241 = call i8 @llvm.smin.i8(i8 %B.sroa.36.0239, i8 %rem80.3)
%B.sroa.23.1242 = call i8 @llvm.smax.i8(i8 %B.sroa.23.0241, i8 %rem80.2)
%B.sroa.23.1 = sext i8 %B.sroa.23.1242 to i32
%B.sroa.13.0243 = call i8 @llvm.smin.i8(i8 %B.sroa.23.0241, i8 %rem80.2)
%B.sroa.13.1244 = call i8 @llvm.smax.i8(i8 %B.sroa.13.0243, i8 %rem80.1)
%B.sroa.13.1 = sext i8 %B.sroa.13.1244 to i32
%B.sroa.6.0245 = call i8 @llvm.smin.i8(i8 %B.sroa.13.0243, i8 %rem80.1)
%B.sroa.6.1246 = call i8 @llvm.smax.i8(i8 %B.sroa.6.0245, i8 %rem80)
%B.sroa.6.1 = sext i8 %B.sroa.6.1246 to i32
%B.sroa.0.0247 = call i8 @llvm.smin.i8(i8 %B.sroa.6.0245, i8 %rem80)
%B.sroa.0.0 = sext i8 %B.sroa.0.0247 to i32
%cmp6.i.1 = icmp sgt i8 %rem80.5, %spec.select233235
%B.sroa.71.3 = select i1 %cmp6.i.1, i32 %spec.select233, i32 %B.sroa.71.1
%B.sroa.93.2 = select i1 %cmp6.i.1, i32 %B.sroa.71.1, i32 %spec.select233
%B.sroa.71.4 = call i32 @llvm.smax.i32(i32 %B.sroa.71.3, i32 %B.sroa.52.1)
%B.sroa.52.3 = call i32 @llvm.smin.i32(i32 %B.sroa.71.3, i32 %B.sroa.52.1)
%B.sroa.52.4 = call i32 @llvm.smax.i32(i32 %B.sroa.52.3, i32 %B.sroa.36.1)
%B.sroa.36.3 = call i32 @llvm.smin.i32(i32 %B.sroa.52.3, i32 %B.sroa.36.1)
%B.sroa.36.4 = call i32 @llvm.smax.i32(i32 %B.sroa.36.3, i32 %B.sroa.23.1)
%B.sroa.23.3 = call i32 @llvm.smin.i32(i32 %B.sroa.36.3, i32 %B.sroa.23.1)
%B.sroa.23.4 = call i32 @llvm.smax.i32(i32 %B.sroa.23.3, i32 %B.sroa.13.1)
%B.sroa.13.3 = call i32 @llvm.smin.i32(i32 %B.sroa.23.3, i32 %B.sroa.13.1)
%B.sroa.13.4 = call i32 @llvm.smax.i32(i32 %B.sroa.13.3, i32 %B.sroa.6.1)
%B.sroa.6.3 = call i32 @llvm.smin.i32(i32 %B.sroa.13.3, i32 %B.sroa.6.1)
%B.sroa.71.6 = call i32 @llvm.smin.i32(i32 %B.sroa.93.2, i32 %B.sroa.71.4)
%B.sroa.93.4 = call i32 @llvm.smax.i32(i32 %B.sroa.93.2, i32 %B.sroa.71.4)
%B.sroa.71.7 = call i32 @llvm.smax.i32(i32 %B.sroa.71.6, i32 %B.sroa.52.4)
%B.sroa.52.6 = call i32 @llvm.smin.i32(i32 %B.sroa.71.6, i32 %B.sroa.52.4)
%B.sroa.52.7 = call i32 @llvm.smax.i32(i32 %B.sroa.52.6, i32 %B.sroa.36.4)
%B.sroa.36.6 = call i32 @llvm.smin.i32(i32 %B.sroa.52.6, i32 %B.sroa.36.4)
%B.sroa.36.7 = call i32 @llvm.smax.i32(i32 %B.sroa.36.6, i32 %B.sroa.23.4)
%B.sroa.23.6 = call i32 @llvm.smin.i32(i32 %B.sroa.36.6, i32 %B.sroa.23.4)
%B.sroa.23.7 = call i32 @llvm.smax.i32(i32 %B.sroa.23.6, i32 %B.sroa.13.4)
%B.sroa.13.6 = call i32 @llvm.smin.i32(i32 %B.sroa.23.6, i32 %B.sroa.13.4)
%cmp6.i.3 = icmp sgt i32 %B.sroa.52.4, %B.sroa.93.4
%B.sroa.71.9 = select i1 %cmp6.i.3, i32 %B.sroa.93.4, i32 %B.sroa.71.7
%B.sroa.93.6 = select i1 %cmp6.i.3, i32 %B.sroa.71.7, i32 %B.sroa.93.4
%B.sroa.71.10 = call i32 @llvm.smax.i32(i32 %B.sroa.71.9, i32 %B.sroa.52.7)
%B.sroa.52.9 = call i32 @llvm.smin.i32(i32 %B.sroa.71.9, i32 %B.sroa.52.7)
%B.sroa.52.10 = call i32 @llvm.smax.i32(i32 %B.sroa.52.9, i32 %B.sroa.36.7)
%B.sroa.36.9 = call i32 @llvm.smin.i32(i32 %B.sroa.52.9, i32 %B.sroa.36.7)
%B.sroa.36.10 = call i32 @llvm.smax.i32(i32 %B.sroa.36.9, i32 %B.sroa.23.7)
%B.sroa.23.9 = call i32 @llvm.smin.i32(i32 %B.sroa.36.9, i32 %B.sroa.23.7)
%B.sroa.71.12 = call i32 @llvm.smin.i32(i32 %B.sroa.93.6, i32 %B.sroa.71.10)
%B.sroa.93.8 = call i32 @llvm.smax.i32(i32 %B.sroa.93.6, i32 %B.sroa.71.10)
%B.sroa.71.13 = call i32 @llvm.smax.i32(i32 %B.sroa.71.12, i32 %B.sroa.52.10)
%B.sroa.52.12 = call i32 @llvm.smin.i32(i32 %B.sroa.71.12, i32 %B.sroa.52.10)
%B.sroa.52.13 = call i32 @llvm.smax.i32(i32 %B.sroa.52.12, i32 %B.sroa.36.10)
%B.sroa.36.12 = call i32 @llvm.smin.i32(i32 %B.sroa.52.12, i32 %B.sroa.36.10)
%cmp6.i.5 = icmp sgt i32 %B.sroa.52.10, %B.sroa.93.8
%B.sroa.71.15 = select i1 %cmp6.i.5, i32 %B.sroa.93.8, i32 %B.sroa.71.13
%B.sroa.93.10 = select i1 %cmp6.i.5, i32 %B.sroa.71.13, i32 %B.sroa.93.8
%B.sroa.71.16 = call i32 @llvm.smax.i32(i32 %B.sroa.71.15, i32 %B.sroa.52.13)
%B.sroa.52.15 = call i32 @llvm.smin.i32(i32 %B.sroa.71.15, i32 %B.sroa.52.13)
%B.sroa.71.18 = call i32 @llvm.smin.i32(i32 %B.sroa.93.10, i32 %B.sroa.71.16)
%B.sroa.93.12 = call i32 @llvm.smax.i32(i32 %B.sroa.93.10, i32 %B.sroa.71.16)
%C.sroa.93.0248 = call i8 @llvm.smin.i8(i8 %rem80.7, i8 %rem80.6)
%C.sroa.93.0 = sext i8 %C.sroa.93.0248 to i32
%C.sroa.71.0.v = call i8 @llvm.smax.i8(i8 %rem80.7, i8 %rem80.6)
%C.sroa.71.1249 = call i8 @llvm.smin.i8(i8 %C.sroa.71.0.v, i8 %rem80.5)
%C.sroa.71.1 = sext i8 %C.sroa.71.1249 to i32
%C.sroa.52.0.v = call i8 @llvm.smax.i8(i8 %C.sroa.71.0.v, i8 %rem80.5)
%C.sroa.52.1250 = call i8 @llvm.smin.i8(i8 %C.sroa.52.0.v, i8 %rem80.4)
%C.sroa.52.1 = sext i8 %C.sroa.52.1250 to i32
%C.sroa.36.0.v = call i8 @llvm.smax.i8(i8 %C.sroa.52.0.v, i8 %rem80.4)
%C.sroa.36.1251 = call i8 @llvm.smin.i8(i8 %C.sroa.36.0.v, i8 %rem80.3)
%C.sroa.36.1 = sext i8 %C.sroa.36.1251 to i32
%C.sroa.23.0.v = call i8 @llvm.smax.i8(i8 %C.sroa.36.0.v, i8 %rem80.3)
%C.sroa.23.1252 = call i8 @llvm.smin.i8(i8 %C.sroa.23.0.v, i8 %rem80.2)
%C.sroa.23.1 = sext i8 %C.sroa.23.1252 to i32
%C.sroa.13.0.v = call i8 @llvm.smax.i8(i8 %C.sroa.23.0.v, i8 %rem80.2)
%C.sroa.13.1253 = call i8 @llvm.smin.i8(i8 %C.sroa.13.0.v, i8 %rem80.1)
%C.sroa.13.1 = sext i8 %C.sroa.13.1253 to i32
%C.sroa.6.0.v = call i8 @llvm.smax.i8(i8 %C.sroa.13.0.v, i8 %rem80.1)
%C.sroa.6.1254 = call i8 @llvm.smin.i8(i8 %C.sroa.6.0.v, i8 %rem80)
%C.sroa.6.1 = sext i8 %C.sroa.6.1254 to i32
%C.sroa.0.0.v = call i8 @llvm.smax.i8(i8 %C.sroa.6.0.v, i8 %rem80)
%C.sroa.0.0 = sext i8 %C.sroa.0.0.v to i32
%cmp6.i75.1 = icmp slt i8 %rem80.5, %C.sroa.93.0248
%C.sroa.93.2 = select i1 %cmp6.i75.1, i32 %C.sroa.71.1, i32 %C.sroa.93.0
%C.sroa.71.3 = select i1 %cmp6.i75.1, i32 %C.sroa.93.0, i32 %C.sroa.71.1
%C.sroa.71.4 = call i32 @llvm.smin.i32(i32 %C.sroa.71.3, i32 %C.sroa.52.1)
%C.sroa.52.3 = call i32 @llvm.smax.i32(i32 %C.sroa.71.3, i32 %C.sroa.52.1)
%C.sroa.52.4 = call i32 @llvm.smin.i32(i32 %C.sroa.52.3, i32 %C.sroa.36.1)
%C.sroa.36.3 = call i32 @llvm.smax.i32(i32 %C.sroa.52.3, i32 %C.sroa.36.1)
%C.sroa.36.4 = call i32 @llvm.smin.i32(i32 %C.sroa.36.3, i32 %C.sroa.23.1)
%C.sroa.23.3 = call i32 @llvm.smax.i32(i32 %C.sroa.36.3, i32 %C.sroa.23.1)
%C.sroa.23.4 = call i32 @llvm.smin.i32(i32 %C.sroa.23.3, i32 %C.sroa.13.1)
%C.sroa.13.3 = call i32 @llvm.smax.i32(i32 %C.sroa.23.3, i32 %C.sroa.13.1)
%C.sroa.13.4 = call i32 @llvm.smin.i32(i32 %C.sroa.13.3, i32 %C.sroa.6.1)
%C.sroa.6.3 = call i32 @llvm.smax.i32(i32 %C.sroa.13.3, i32 %C.sroa.6.1)
%C.sroa.93.4 = call i32 @llvm.smin.i32(i32 %C.sroa.93.2, i32 %C.sroa.71.4)
%C.sroa.71.6 = call i32 @llvm.smax.i32(i32 %C.sroa.93.2, i32 %C.sroa.71.4)
%C.sroa.71.7 = call i32 @llvm.smin.i32(i32 %C.sroa.71.6, i32 %C.sroa.52.4)
%C.sroa.52.6 = call i32 @llvm.smax.i32(i32 %C.sroa.71.6, i32 %C.sroa.52.4)
%C.sroa.52.7 = call i32 @llvm.smin.i32(i32 %C.sroa.52.6, i32 %C.sroa.36.4)
%C.sroa.36.6 = call i32 @llvm.smax.i32(i32 %C.sroa.52.6, i32 %C.sroa.36.4)
%C.sroa.36.7 = call i32 @llvm.smin.i32(i32 %C.sroa.36.6, i32 %C.sroa.23.4)
%C.sroa.23.6 = call i32 @llvm.smax.i32(i32 %C.sroa.36.6, i32 %C.sroa.23.4)
%C.sroa.23.7 = call i32 @llvm.smin.i32(i32 %C.sroa.23.6, i32 %C.sroa.13.4)
%C.sroa.13.6 = call i32 @llvm.smax.i32(i32 %C.sroa.23.6, i32 %C.sroa.13.4)
%cmp6.i75.3 = icmp slt i32 %C.sroa.52.4, %C.sroa.93.4
%C.sroa.93.6 = select i1 %cmp6.i75.3, i32 %C.sroa.71.7, i32 %C.sroa.93.4
%C.sroa.71.9 = select i1 %cmp6.i75.3, i32 %C.sroa.93.4, i32 %C.sroa.71.7
%C.sroa.71.10 = call i32 @llvm.smin.i32(i32 %C.sroa.71.9, i32 %C.sroa.52.7)
%C.sroa.52.9 = call i32 @llvm.smax.i32(i32 %C.sroa.71.9, i32 %C.sroa.52.7)
%C.sroa.52.10 = call i32 @llvm.smin.i32(i32 %C.sroa.52.9, i32 %C.sroa.36.7)
%C.sroa.36.9 = call i32 @llvm.smax.i32(i32 %C.sroa.52.9, i32 %C.sroa.36.7)
%C.sroa.36.10 = call i32 @llvm.smin.i32(i32 %C.sroa.36.9, i32 %C.sroa.23.7)
%C.sroa.23.9 = call i32 @llvm.smax.i32(i32 %C.sroa.36.9, i32 %C.sroa.23.7)
%C.sroa.93.8 = call i32 @llvm.smin.i32(i32 %C.sroa.93.6, i32 %C.sroa.71.10)
%C.sroa.71.12 = call i32 @llvm.smax.i32(i32 %C.sroa.93.6, i32 %C.sroa.71.10)
%C.sroa.71.13 = call i32 @llvm.smin.i32(i32 %C.sroa.71.12, i32 %C.sroa.52.10)
%C.sroa.52.12 = call i32 @llvm.smax.i32(i32 %C.sroa.71.12, i32 %C.sroa.52.10)
%C.sroa.52.13 = call i32 @llvm.smin.i32(i32 %C.sroa.52.12, i32 %C.sroa.36.10)
%C.sroa.36.12 = call i32 @llvm.smax.i32(i32 %C.sroa.52.12, i32 %C.sroa.36.10)
%cmp6.i75.5 = icmp slt i32 %C.sroa.52.10, %C.sroa.93.8
%C.sroa.93.10 = select i1 %cmp6.i75.5, i32 %C.sroa.71.13, i32 %C.sroa.93.8
%C.sroa.71.15 = select i1 %cmp6.i75.5, i32 %C.sroa.93.8, i32 %C.sroa.71.13
%C.sroa.71.16 = call i32 @llvm.smin.i32(i32 %C.sroa.71.15, i32 %C.sroa.52.13)
%C.sroa.52.15 = call i32 @llvm.smax.i32(i32 %C.sroa.71.15, i32 %C.sroa.52.13)
%C.sroa.93.12 = call i32 @llvm.smin.i32(i32 %C.sroa.93.10, i32 %C.sroa.71.16)
%C.sroa.71.18 = call i32 @llvm.smax.i32(i32 %C.sroa.93.10, i32 %C.sroa.71.16)
%reass.add = sub nsw i32 %B.sroa.0.0, %C.sroa.0.0
%reass.add.1 = sub nsw i32 %B.sroa.6.3, %C.sroa.6.3
%reass.mul.1 = mul nsw i32 %reass.add.1, 10
%sub38.1 = add nsw i32 %reass.mul.1, %reass.add
%reass.add.2 = sub nsw i32 %B.sroa.13.6, %C.sroa.13.6
%reass.mul.2 = mul nsw i32 %reass.add.2, 100
%sub38.2 = add nsw i32 %reass.mul.2, %sub38.1
%reass.add.3 = sub nsw i32 %B.sroa.23.9, %C.sroa.23.9
%reass.mul.3 = mul nsw i32 %reass.add.3, 1000
%sub38.3 = add nsw i32 %reass.mul.3, %sub38.2
%reass.add.4 = sub nsw i32 %B.sroa.36.12, %C.sroa.36.12
%reass.mul.4 = mul nsw i32 %reass.add.4, 10000
%sub38.4 = add nsw i32 %reass.mul.4, %sub38.3
%reass.add.5 = sub nsw i32 %B.sroa.52.15, %C.sroa.52.15
%reass.mul.5 = mul nsw i32 %reass.add.5, 100000
%sub38.5 = add nsw i32 %reass.mul.5, %sub38.4
%reass.add.6 = sub nsw i32 %B.sroa.71.18, %C.sroa.71.18
%reass.mul.6 = mul nsw i32 %reass.add.6, 1000000
%sub38.6 = add nsw i32 %reass.mul.6, %sub38.5
%reass.add.7 = sub nsw i32 %B.sroa.93.12, %C.sroa.93.12
%reass.mul.7 = mul nsw i32 %reass.add.7, 10000000
%sub38.7 = add nsw i32 %reass.mul.7, %sub38.6
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub38.7)
%inc44 = add nuw nsw i32 %j.086, 1
%11 = load i32, ptr %n, align 4, !tbaa !9
%cmp = icmp slt i32 %inc44, %11
br i1 %cmp, label %for.body3.preheader.i, label %for.end45, !llvm.loop !12
for.end45: ; preds = %for.body3.preheader.i, %entry
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #5
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @BubbleSortUp(ptr nocapture noundef %B, i32 noundef %min, i32 noundef %max) local_unnamed_addr #3 {
entry:
%cmp.not37 = icmp sgt i32 %min, %max
br i1 %cmp.not37, label %for.end18, label %for.cond1.preheader.preheader
for.cond1.preheader.preheader: ; preds = %entry
%0 = sext i32 %max to i64
%1 = sext i32 %min to i64
%2 = add i32 %max, 1
%arrayidx.phi.trans.insert = getelementptr inbounds i32, ptr %B, i64 %0
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc17
%indvars.iv40 = phi i64 [ %1, %for.cond1.preheader.preheader ], [ %indvars.iv.next41, %for.inc17 ]
%cmp235 = icmp slt i64 %indvars.iv40, %0
br i1 %cmp235, label %for.body3.preheader, label %for.inc17
for.body3.preheader: ; preds = %for.cond1.preheader
%.pre = load i32, ptr %arrayidx.phi.trans.insert, align 4, !tbaa !9
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.inc
%3 = phi i32 [ %.pre, %for.body3.preheader ], [ %5, %for.inc ]
%indvars.iv = phi i64 [ %0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx5 = getelementptr inbounds i32, ptr %B, i64 %indvars.iv.next
%4 = load i32, ptr %arrayidx5, align 4, !tbaa !9
%cmp6 = icmp slt i32 %3, %4
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3
%arrayidx = getelementptr inbounds i32, ptr %B, i64 %indvars.iv
store i32 %3, ptr %arrayidx5, align 4, !tbaa !9
store i32 %4, ptr %arrayidx, align 4, !tbaa !9
br label %for.inc
for.inc: ; preds = %for.body3, %if.then
%5 = phi i32 [ %4, %for.body3 ], [ %3, %if.then ]
%cmp2 = icmp sgt i64 %indvars.iv.next, %indvars.iv40
br i1 %cmp2, label %for.body3, label %for.inc17, !llvm.loop !14
for.inc17: ; preds = %for.inc, %for.cond1.preheader
%indvars.iv.next41 = add nsw i64 %indvars.iv40, 1
%lftr.wideiv = trunc i64 %indvars.iv.next41 to i32
%exitcond.not = icmp eq i32 %2, %lftr.wideiv
br i1 %exitcond.not, label %for.end18, label %for.cond1.preheader, !llvm.loop !15
for.end18: ; preds = %for.inc17, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @BubbleSortDown(ptr nocapture noundef %B, i32 noundef %min, i32 noundef %max) local_unnamed_addr #3 {
entry:
%cmp.not37 = icmp sgt i32 %min, %max
br i1 %cmp.not37, label %for.end18, label %for.cond1.preheader.preheader
for.cond1.preheader.preheader: ; preds = %entry
%0 = sext i32 %max to i64
%1 = sext i32 %min to i64
%2 = add i32 %max, 1
%arrayidx.phi.trans.insert = getelementptr inbounds i32, ptr %B, i64 %0
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.preheader, %for.inc17
%indvars.iv40 = phi i64 [ %1, %for.cond1.preheader.preheader ], [ %indvars.iv.next41, %for.inc17 ]
%cmp235 = icmp slt i64 %indvars.iv40, %0
br i1 %cmp235, label %for.body3.preheader, label %for.inc17
for.body3.preheader: ; preds = %for.cond1.preheader
%.pre = load i32, ptr %arrayidx.phi.trans.insert, align 4, !tbaa !9
br label %for.body3
for.body3: ; preds = %for.body3.preheader, %for.inc
%3 = phi i32 [ %.pre, %for.body3.preheader ], [ %5, %for.inc ]
%indvars.iv = phi i64 [ %0, %for.body3.preheader ], [ %indvars.iv.next, %for.inc ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx5 = getelementptr inbounds i32, ptr %B, i64 %indvars.iv.next
%4 = load i32, ptr %arrayidx5, align 4, !tbaa !9
%cmp6 = icmp sgt i32 %3, %4
br i1 %cmp6, label %if.then, label %for.inc
if.then: ; preds = %for.body3
%arrayidx = getelementptr inbounds i32, ptr %B, i64 %indvars.iv
store i32 %3, ptr %arrayidx5, align 4, !tbaa !9
store i32 %4, ptr %arrayidx, align 4, !tbaa !9
br label %for.inc
for.inc: ; preds = %for.body3, %if.then
%5 = phi i32 [ %4, %for.body3 ], [ %3, %if.then ]
%cmp2 = icmp sgt i64 %indvars.iv.next, %indvars.iv40
br i1 %cmp2, label %for.body3, label %for.inc17, !llvm.loop !16
for.inc17: ; preds = %for.inc, %for.cond1.preheader
%indvars.iv.next41 = add nsw i64 %indvars.iv40, 1
%lftr.wideiv = trunc i64 %indvars.iv.next41 to i32
%exitcond.not = icmp eq i32 %2, %lftr.wideiv
br i1 %exitcond.not, label %for.end18, label %for.cond1.preheader, !llvm.loop !17
for.end18: ; preds = %for.inc17, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.smin.i8(i8, i8) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i8 @llvm.smax.i8(i8, i8) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = !{!"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}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
|
#include <stdio.h>
int main(void){
int i,j,k;
int hist[10];
int a,b;
int c;
int n = 0;
while(1){
c = getchar();
if(c == '\n'){break;}
n = n * 10 + (c -'0');
}
for(k = 0; k < n; k++){
for(i = 0; i < 10; i++){
hist[i] = 0;
}
while(1){
c = getchar();
if(c == '\n'){break;}
hist[c-'0']++;
}
a = 0;
b = 0;
for(j = 9; j >= 0; j--){
for(i = 0; i < hist[j]; i++){
a = a * 10 + j;
}
}
for(j = 1; j <= 9; j++){
for(i = 0; i < hist[j]; i++){
b = b * 10 + j;
}
}
printf("%d\n",a-b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318341/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318341/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%hist = alloca [10 x i32], align 16
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %hist) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i73 = tail call i32 @getc(ptr noundef %0)
%cmp74 = icmp eq i32 %call.i73, 10
br i1 %cmp74, label %for.end51, label %if.end
for.cond.preheader: ; preds = %if.end
%cmp193 = icmp sgt i32 %add, 0
br i1 %cmp193, label %for.cond2.preheader.preheader, label %for.end51
for.cond2.preheader.preheader: ; preds = %for.cond.preheader
%arrayidx21.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %hist, i64 0, i64 9
%arrayidx21.1 = getelementptr inbounds [10 x i32], ptr %hist, i64 0, i64 8
%arrayidx21.2 = getelementptr inbounds [10 x i32], ptr %hist, i64 0, i64 7
%arrayidx21.3 = getelementptr inbounds [10 x i32], ptr %hist, i64 0, i64 6
%arrayidx21.4 = getelementptr inbounds [10 x i32], ptr %hist, i64 0, i64 5
%arrayidx21.5 = getelementptr inbounds [10 x i32], ptr %hist, i64 0, i64 4
%arrayidx21.6 = getelementptr inbounds [10 x i32], ptr %hist, i64 0, i64 3
%arrayidx21.7 = getelementptr inbounds [10 x i32], ptr %hist, i64 0, i64 2
%arrayidx21.8 = getelementptr inbounds [10 x i32], ptr %hist, i64 0, i64 1
br label %for.cond2.preheader
if.end: ; preds = %entry, %if.end
%call.i76 = phi i32 [ %call.i, %if.end ], [ %call.i73, %entry ]
%n.075 = phi i32 [ %add, %if.end ], [ 0, %entry ]
%mul = mul nsw i32 %n.075, 10
%sub = add i32 %mul, -48
%add = add i32 %sub, %call.i76
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %1)
%cmp = icmp eq i32 %call.i, 10
br i1 %cmp, label %for.cond.preheader, label %if.end
for.cond2.preheader: ; preds = %for.cond2.preheader.preheader, %for.inc44.8
%k.094 = phi i32 [ %inc50, %for.inc44.8 ], [ 0, %for.cond2.preheader.preheader ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %hist, i8 0, i64 40, i1 false), !tbaa !9
%2 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i7278 = tail call i32 @getc(ptr noundef %2)
%cmp879 = icmp eq i32 %call.i7278, 10
br i1 %cmp879, label %for.inc29, label %if.end10
for.cond16.preheader: ; preds = %if.end10
%.pre = load i32, ptr %arrayidx21.phi.trans.insert, align 4, !tbaa !9
%cmp2281 = icmp sgt i32 %.pre, 0
br i1 %cmp2281, label %for.body23.preheader, label %for.inc29
for.body23.preheader: ; preds = %for.cond16.preheader
%xtraiter = and i32 %.pre, 7
%3 = icmp ult i32 %.pre, 8
br i1 %3, label %for.inc29.loopexit.unr-lcssa, label %for.body23.preheader.new
for.body23.preheader.new: ; preds = %for.body23.preheader
%unroll_iter = and i32 %.pre, -8
br label %for.body23
if.end10: ; preds = %for.cond2.preheader, %if.end10
%call.i7280 = phi i32 [ %call.i72, %if.end10 ], [ %call.i7278, %for.cond2.preheader ]
%sub11 = add nsw i32 %call.i7280, -48
%idxprom12 = sext i32 %sub11 to i64
%arrayidx13 = getelementptr inbounds [10 x i32], ptr %hist, i64 0, i64 %idxprom12
%4 = load i32, ptr %arrayidx13, align 4, !tbaa !9
%inc14 = add nsw i32 %4, 1
store i32 %inc14, ptr %arrayidx13, align 4, !tbaa !9
%5 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i72 = tail call i32 @getc(ptr noundef %5)
%cmp8 = icmp eq i32 %call.i72, 10
br i1 %cmp8, label %for.cond16.preheader, label %if.end10
for.body23: ; preds = %for.body23, %for.body23.preheader.new
%a.183 = phi i32 [ 0, %for.body23.preheader.new ], [ %add25.7148, %for.body23 ]
%niter = phi i32 [ 0, %for.body23.preheader.new ], [ %niter.next.7, %for.body23 ]
%6 = mul i32 %a.183, 100000000
%add25.7148 = add i32 %6, 99999999
%niter.next.7 = add i32 %niter, 8
%niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.inc29.loopexit.unr-lcssa, label %for.body23, !llvm.loop !11
for.inc29.loopexit.unr-lcssa: ; preds = %for.body23, %for.body23.preheader
%add25.lcssa.ph = phi i32 [ undef, %for.body23.preheader ], [ %add25.7148, %for.body23 ]
%a.183.unr = phi i32 [ 0, %for.body23.preheader ], [ %add25.7148, %for.body23 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc29, label %for.body23.epil
for.body23.epil: ; preds = %for.inc29.loopexit.unr-lcssa, %for.body23.epil
%a.183.epil = phi i32 [ %add25.epil, %for.body23.epil ], [ %a.183.unr, %for.inc29.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body23.epil ], [ 0, %for.inc29.loopexit.unr-lcssa ]
%mul24.epil = mul nsw i32 %a.183.epil, 10
%add25.epil = add nsw i32 %mul24.epil, 9
%epil.iter.next = add i32 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.inc29, label %for.body23.epil, !llvm.loop !13
for.inc29: ; preds = %for.inc29.loopexit.unr-lcssa, %for.body23.epil, %for.cond2.preheader, %for.cond16.preheader
%cmp2281104 = phi i1 [ false, %for.cond16.preheader ], [ false, %for.cond2.preheader ], [ %cmp2281, %for.body23.epil ], [ %cmp2281, %for.inc29.loopexit.unr-lcssa ]
%7 = phi i32 [ %.pre, %for.cond16.preheader ], [ 0, %for.cond2.preheader ], [ %.pre, %for.body23.epil ], [ %.pre, %for.inc29.loopexit.unr-lcssa ]
%a.1.lcssa = phi i32 [ 0, %for.cond16.preheader ], [ 0, %for.cond2.preheader ], [ %add25.lcssa.ph, %for.inc29.loopexit.unr-lcssa ], [ %add25.epil, %for.body23.epil ]
%8 = load i32, ptr %arrayidx21.1, align 16, !tbaa !9
%cmp2281.1 = icmp sgt i32 %8, 0
br i1 %cmp2281.1, label %for.body23.1.preheader, label %for.inc29.1
for.body23.1.preheader: ; preds = %for.inc29
%xtraiter151 = and i32 %8, 7
%9 = icmp ult i32 %8, 8
br i1 %9, label %for.inc29.1.loopexit.unr-lcssa, label %for.body23.1.preheader.new
for.body23.1.preheader.new: ; preds = %for.body23.1.preheader
%unroll_iter155 = and i32 %8, -8
br label %for.body23.1
for.body23.1: ; preds = %for.body23.1, %for.body23.1.preheader.new
%a.183.1 = phi i32 [ %a.1.lcssa, %for.body23.1.preheader.new ], [ %add25.1.7, %for.body23.1 ]
%niter156 = phi i32 [ 0, %for.body23.1.preheader.new ], [ %niter156.next.7, %for.body23.1 ]
%10 = mul i32 %a.183.1, 100000000
%add25.1.7 = add i32 %10, 88888888
%niter156.next.7 = add i32 %niter156, 8
%niter156.ncmp.7 = icmp eq i32 %niter156.next.7, %unroll_iter155
br i1 %niter156.ncmp.7, label %for.inc29.1.loopexit.unr-lcssa, label %for.body23.1, !llvm.loop !11
for.inc29.1.loopexit.unr-lcssa: ; preds = %for.body23.1, %for.body23.1.preheader
%add25.1.lcssa.ph = phi i32 [ undef, %for.body23.1.preheader ], [ %add25.1.7, %for.body23.1 ]
%a.183.1.unr = phi i32 [ %a.1.lcssa, %for.body23.1.preheader ], [ %add25.1.7, %for.body23.1 ]
%lcmp.mod153.not = icmp eq i32 %xtraiter151, 0
br i1 %lcmp.mod153.not, label %for.inc29.1, label %for.body23.1.epil
for.body23.1.epil: ; preds = %for.inc29.1.loopexit.unr-lcssa, %for.body23.1.epil
%a.183.1.epil = phi i32 [ %add25.1.epil, %for.body23.1.epil ], [ %a.183.1.unr, %for.inc29.1.loopexit.unr-lcssa ]
%epil.iter152 = phi i32 [ %epil.iter152.next, %for.body23.1.epil ], [ 0, %for.inc29.1.loopexit.unr-lcssa ]
%mul24.1.epil = mul nsw i32 %a.183.1.epil, 10
%add25.1.epil = add nsw i32 %mul24.1.epil, 8
%epil.iter152.next = add i32 %epil.iter152, 1
%epil.iter152.cmp.not = icmp eq i32 %epil.iter152.next, %xtraiter151
br i1 %epil.iter152.cmp.not, label %for.inc29.1, label %for.body23.1.epil, !llvm.loop !15
for.inc29.1: ; preds = %for.inc29.1.loopexit.unr-lcssa, %for.body23.1.epil, %for.inc29
%a.1.lcssa.1 = phi i32 [ %a.1.lcssa, %for.inc29 ], [ %add25.1.lcssa.ph, %for.inc29.1.loopexit.unr-lcssa ], [ %add25.1.epil, %for.body23.1.epil ]
%11 = load i32, ptr %arrayidx21.2, align 4, !tbaa !9
%cmp2281.2 = icmp sgt i32 %11, 0
br i1 %cmp2281.2, label %for.body23.2.preheader, label %for.inc29.2
for.body23.2.preheader: ; preds = %for.inc29.1
%xtraiter157 = and i32 %11, 7
%12 = icmp ult i32 %11, 8
br i1 %12, label %for.inc29.2.loopexit.unr-lcssa, label %for.body23.2.preheader.new
for.body23.2.preheader.new: ; preds = %for.body23.2.preheader
%unroll_iter161 = and i32 %11, -8
br label %for.body23.2
for.body23.2: ; preds = %for.body23.2, %for.body23.2.preheader.new
%a.183.2 = phi i32 [ %a.1.lcssa.1, %for.body23.2.preheader.new ], [ %add25.2.7, %for.body23.2 ]
%niter162 = phi i32 [ 0, %for.body23.2.preheader.new ], [ %niter162.next.7, %for.body23.2 ]
%13 = mul i32 %a.183.2, 100000000
%add25.2.7 = add i32 %13, 77777777
%niter162.next.7 = add i32 %niter162, 8
%niter162.ncmp.7 = icmp eq i32 %niter162.next.7, %unroll_iter161
br i1 %niter162.ncmp.7, label %for.inc29.2.loopexit.unr-lcssa, label %for.body23.2, !llvm.loop !11
for.inc29.2.loopexit.unr-lcssa: ; preds = %for.body23.2, %for.body23.2.preheader
%add25.2.lcssa.ph = phi i32 [ undef, %for.body23.2.preheader ], [ %add25.2.7, %for.body23.2 ]
%a.183.2.unr = phi i32 [ %a.1.lcssa.1, %for.body23.2.preheader ], [ %add25.2.7, %for.body23.2 ]
%lcmp.mod159.not = icmp eq i32 %xtraiter157, 0
br i1 %lcmp.mod159.not, label %for.inc29.2, label %for.body23.2.epil
for.body23.2.epil: ; preds = %for.inc29.2.loopexit.unr-lcssa, %for.body23.2.epil
%a.183.2.epil = phi i32 [ %add25.2.epil, %for.body23.2.epil ], [ %a.183.2.unr, %for.inc29.2.loopexit.unr-lcssa ]
%epil.iter158 = phi i32 [ %epil.iter158.next, %for.body23.2.epil ], [ 0, %for.inc29.2.loopexit.unr-lcssa ]
%mul24.2.epil = mul nsw i32 %a.183.2.epil, 10
%add25.2.epil = add nsw i32 %mul24.2.epil, 7
%epil.iter158.next = add i32 %epil.iter158, 1
%epil.iter158.cmp.not = icmp eq i32 %epil.iter158.next, %xtraiter157
br i1 %epil.iter158.cmp.not, label %for.inc29.2, label %for.body23.2.epil, !llvm.loop !16
for.inc29.2: ; preds = %for.inc29.2.loopexit.unr-lcssa, %for.body23.2.epil, %for.inc29.1
%a.1.lcssa.2 = phi i32 [ %a.1.lcssa.1, %for.inc29.1 ], [ %add25.2.lcssa.ph, %for.inc29.2.loopexit.unr-lcssa ], [ %add25.2.epil, %for.body23.2.epil ]
%14 = load i32, ptr %arrayidx21.3, align 8, !tbaa !9
%cmp2281.3 = icmp sgt i32 %14, 0
br i1 %cmp2281.3, label %for.body23.3.preheader, label %for.inc29.3
for.body23.3.preheader: ; preds = %for.inc29.2
%xtraiter163 = and i32 %14, 7
%15 = icmp ult i32 %14, 8
br i1 %15, label %for.inc29.3.loopexit.unr-lcssa, label %for.body23.3.preheader.new
for.body23.3.preheader.new: ; preds = %for.body23.3.preheader
%unroll_iter167 = and i32 %14, -8
br label %for.body23.3
for.body23.3: ; preds = %for.body23.3, %for.body23.3.preheader.new
%a.183.3 = phi i32 [ %a.1.lcssa.2, %for.body23.3.preheader.new ], [ %add25.3.7, %for.body23.3 ]
%niter168 = phi i32 [ 0, %for.body23.3.preheader.new ], [ %niter168.next.7, %for.body23.3 ]
%16 = mul i32 %a.183.3, 100000000
%add25.3.7 = add i32 %16, 66666666
%niter168.next.7 = add i32 %niter168, 8
%niter168.ncmp.7 = icmp eq i32 %niter168.next.7, %unroll_iter167
br i1 %niter168.ncmp.7, label %for.inc29.3.loopexit.unr-lcssa, label %for.body23.3, !llvm.loop !11
for.inc29.3.loopexit.unr-lcssa: ; preds = %for.body23.3, %for.body23.3.preheader
%add25.3.lcssa.ph = phi i32 [ undef, %for.body23.3.preheader ], [ %add25.3.7, %for.body23.3 ]
%a.183.3.unr = phi i32 [ %a.1.lcssa.2, %for.body23.3.preheader ], [ %add25.3.7, %for.body23.3 ]
%lcmp.mod165.not = icmp eq i32 %xtraiter163, 0
br i1 %lcmp.mod165.not, label %for.inc29.3, label %for.body23.3.epil
for.body23.3.epil: ; preds = %for.inc29.3.loopexit.unr-lcssa, %for.body23.3.epil
%a.183.3.epil = phi i32 [ %add25.3.epil, %for.body23.3.epil ], [ %a.183.3.unr, %for.inc29.3.loopexit.unr-lcssa ]
%epil.iter164 = phi i32 [ %epil.iter164.next, %for.body23.3.epil ], [ 0, %for.inc29.3.loopexit.unr-lcssa ]
%mul24.3.epil = mul nsw i32 %a.183.3.epil, 10
%add25.3.epil = add nsw i32 %mul24.3.epil, 6
%epil.iter164.next = add i32 %epil.iter164, 1
%epil.iter164.cmp.not = icmp eq i32 %epil.iter164.next, %xtraiter163
br i1 %epil.iter164.cmp.not, label %for.inc29.3, label %for.body23.3.epil, !llvm.loop !17
for.inc29.3: ; preds = %for.inc29.3.loopexit.unr-lcssa, %for.body23.3.epil, %for.inc29.2
%a.1.lcssa.3 = phi i32 [ %a.1.lcssa.2, %for.inc29.2 ], [ %add25.3.lcssa.ph, %for.inc29.3.loopexit.unr-lcssa ], [ %add25.3.epil, %for.body23.3.epil ]
%17 = load i32, ptr %arrayidx21.4, align 4, !tbaa !9
%cmp2281.4 = icmp sgt i32 %17, 0
br i1 %cmp2281.4, label %for.body23.4.preheader, label %for.inc29.4
for.body23.4.preheader: ; preds = %for.inc29.3
%xtraiter169 = and i32 %17, 7
%18 = icmp ult i32 %17, 8
br i1 %18, label %for.inc29.4.loopexit.unr-lcssa, label %for.body23.4.preheader.new
for.body23.4.preheader.new: ; preds = %for.body23.4.preheader
%unroll_iter173 = and i32 %17, -8
br label %for.body23.4
for.body23.4: ; preds = %for.body23.4, %for.body23.4.preheader.new
%a.183.4 = phi i32 [ %a.1.lcssa.3, %for.body23.4.preheader.new ], [ %add25.4.7, %for.body23.4 ]
%niter174 = phi i32 [ 0, %for.body23.4.preheader.new ], [ %niter174.next.7, %for.body23.4 ]
%19 = mul i32 %a.183.4, 100000000
%add25.4.7 = add i32 %19, 55555555
%niter174.next.7 = add i32 %niter174, 8
%niter174.ncmp.7 = icmp eq i32 %niter174.next.7, %unroll_iter173
br i1 %niter174.ncmp.7, label %for.inc29.4.loopexit.unr-lcssa, label %for.body23.4, !llvm.loop !11
for.inc29.4.loopexit.unr-lcssa: ; preds = %for.body23.4, %for.body23.4.preheader
%add25.4.lcssa.ph = phi i32 [ undef, %for.body23.4.preheader ], [ %add25.4.7, %for.body23.4 ]
%a.183.4.unr = phi i32 [ %a.1.lcssa.3, %for.body23.4.preheader ], [ %add25.4.7, %for.body23.4 ]
%lcmp.mod171.not = icmp eq i32 %xtraiter169, 0
br i1 %lcmp.mod171.not, label %for.inc29.4, label %for.body23.4.epil
for.body23.4.epil: ; preds = %for.inc29.4.loopexit.unr-lcssa, %for.body23.4.epil
%a.183.4.epil = phi i32 [ %add25.4.epil, %for.body23.4.epil ], [ %a.183.4.unr, %for.inc29.4.loopexit.unr-lcssa ]
%epil.iter170 = phi i32 [ %epil.iter170.next, %for.body23.4.epil ], [ 0, %for.inc29.4.loopexit.unr-lcssa ]
%mul24.4.epil = mul nsw i32 %a.183.4.epil, 10
%add25.4.epil = add nsw i32 %mul24.4.epil, 5
%epil.iter170.next = add i32 %epil.iter170, 1
%epil.iter170.cmp.not = icmp eq i32 %epil.iter170.next, %xtraiter169
br i1 %epil.iter170.cmp.not, label %for.inc29.4, label %for.body23.4.epil, !llvm.loop !18
for.inc29.4: ; preds = %for.inc29.4.loopexit.unr-lcssa, %for.body23.4.epil, %for.inc29.3
%a.1.lcssa.4 = phi i32 [ %a.1.lcssa.3, %for.inc29.3 ], [ %add25.4.lcssa.ph, %for.inc29.4.loopexit.unr-lcssa ], [ %add25.4.epil, %for.body23.4.epil ]
%20 = load i32, ptr %arrayidx21.5, align 16, !tbaa !9
%cmp2281.5 = icmp sgt i32 %20, 0
br i1 %cmp2281.5, label %for.body23.5.preheader, label %for.inc29.5
for.body23.5.preheader: ; preds = %for.inc29.4
%xtraiter175 = and i32 %20, 7
%21 = icmp ult i32 %20, 8
br i1 %21, label %for.inc29.5.loopexit.unr-lcssa, label %for.body23.5.preheader.new
for.body23.5.preheader.new: ; preds = %for.body23.5.preheader
%unroll_iter179 = and i32 %20, -8
br label %for.body23.5
for.body23.5: ; preds = %for.body23.5, %for.body23.5.preheader.new
%a.183.5 = phi i32 [ %a.1.lcssa.4, %for.body23.5.preheader.new ], [ %add25.5.7, %for.body23.5 ]
%niter180 = phi i32 [ 0, %for.body23.5.preheader.new ], [ %niter180.next.7, %for.body23.5 ]
%22 = mul i32 %a.183.5, 100000000
%add25.5.7 = add i32 %22, 44444444
%niter180.next.7 = add i32 %niter180, 8
%niter180.ncmp.7 = icmp eq i32 %niter180.next.7, %unroll_iter179
br i1 %niter180.ncmp.7, label %for.inc29.5.loopexit.unr-lcssa, label %for.body23.5, !llvm.loop !11
for.inc29.5.loopexit.unr-lcssa: ; preds = %for.body23.5, %for.body23.5.preheader
%add25.5.lcssa.ph = phi i32 [ undef, %for.body23.5.preheader ], [ %add25.5.7, %for.body23.5 ]
%a.183.5.unr = phi i32 [ %a.1.lcssa.4, %for.body23.5.preheader ], [ %add25.5.7, %for.body23.5 ]
%lcmp.mod177.not = icmp eq i32 %xtraiter175, 0
br i1 %lcmp.mod177.not, label %for.inc29.5, label %for.body23.5.epil
for.body23.5.epil: ; preds = %for.inc29.5.loopexit.unr-lcssa, %for.body23.5.epil
%a.183.5.epil = phi i32 [ %add25.5.epil, %for.body23.5.epil ], [ %a.183.5.unr, %for.inc29.5.loopexit.unr-lcssa ]
%epil.iter176 = phi i32 [ %epil.iter176.next, %for.body23.5.epil ], [ 0, %for.inc29.5.loopexit.unr-lcssa ]
%mul24.5.epil = mul nsw i32 %a.183.5.epil, 10
%add25.5.epil = add nsw i32 %mul24.5.epil, 4
%epil.iter176.next = add i32 %epil.iter176, 1
%epil.iter176.cmp.not = icmp eq i32 %epil.iter176.next, %xtraiter175
br i1 %epil.iter176.cmp.not, label %for.inc29.5, label %for.body23.5.epil, !llvm.loop !19
for.inc29.5: ; preds = %for.inc29.5.loopexit.unr-lcssa, %for.body23.5.epil, %for.inc29.4
%a.1.lcssa.5 = phi i32 [ %a.1.lcssa.4, %for.inc29.4 ], [ %add25.5.lcssa.ph, %for.inc29.5.loopexit.unr-lcssa ], [ %add25.5.epil, %for.body23.5.epil ]
%23 = load i32, ptr %arrayidx21.6, align 4, !tbaa !9
%cmp2281.6 = icmp sgt i32 %23, 0
br i1 %cmp2281.6, label %for.body23.6.preheader, label %for.inc29.6
for.body23.6.preheader: ; preds = %for.inc29.5
%xtraiter181 = and i32 %23, 7
%24 = icmp ult i32 %23, 8
br i1 %24, label %for.inc29.6.loopexit.unr-lcssa, label %for.body23.6.preheader.new
for.body23.6.preheader.new: ; preds = %for.body23.6.preheader
%unroll_iter185 = and i32 %23, -8
br label %for.body23.6
for.body23.6: ; preds = %for.body23.6, %for.body23.6.preheader.new
%a.183.6 = phi i32 [ %a.1.lcssa.5, %for.body23.6.preheader.new ], [ %add25.6.7, %for.body23.6 ]
%niter186 = phi i32 [ 0, %for.body23.6.preheader.new ], [ %niter186.next.7, %for.body23.6 ]
%25 = mul i32 %a.183.6, 100000000
%add25.6.7 = add i32 %25, 33333333
%niter186.next.7 = add i32 %niter186, 8
%niter186.ncmp.7 = icmp eq i32 %niter186.next.7, %unroll_iter185
br i1 %niter186.ncmp.7, label %for.inc29.6.loopexit.unr-lcssa, label %for.body23.6, !llvm.loop !11
for.inc29.6.loopexit.unr-lcssa: ; preds = %for.body23.6, %for.body23.6.preheader
%add25.6.lcssa.ph = phi i32 [ undef, %for.body23.6.preheader ], [ %add25.6.7, %for.body23.6 ]
%a.183.6.unr = phi i32 [ %a.1.lcssa.5, %for.body23.6.preheader ], [ %add25.6.7, %for.body23.6 ]
%lcmp.mod183.not = icmp eq i32 %xtraiter181, 0
br i1 %lcmp.mod183.not, label %for.inc29.6, label %for.body23.6.epil
for.body23.6.epil: ; preds = %for.inc29.6.loopexit.unr-lcssa, %for.body23.6.epil
%a.183.6.epil = phi i32 [ %add25.6.epil, %for.body23.6.epil ], [ %a.183.6.unr, %for.inc29.6.loopexit.unr-lcssa ]
%epil.iter182 = phi i32 [ %epil.iter182.next, %for.body23.6.epil ], [ 0, %for.inc29.6.loopexit.unr-lcssa ]
%mul24.6.epil = mul nsw i32 %a.183.6.epil, 10
%add25.6.epil = add nsw i32 %mul24.6.epil, 3
%epil.iter182.next = add i32 %epil.iter182, 1
%epil.iter182.cmp.not = icmp eq i32 %epil.iter182.next, %xtraiter181
br i1 %epil.iter182.cmp.not, label %for.inc29.6, label %for.body23.6.epil, !llvm.loop !20
for.inc29.6: ; preds = %for.inc29.6.loopexit.unr-lcssa, %for.body23.6.epil, %for.inc29.5
%a.1.lcssa.6 = phi i32 [ %a.1.lcssa.5, %for.inc29.5 ], [ %add25.6.lcssa.ph, %for.inc29.6.loopexit.unr-lcssa ], [ %add25.6.epil, %for.body23.6.epil ]
%26 = load i32, ptr %arrayidx21.7, align 8, !tbaa !9
%cmp2281.7 = icmp sgt i32 %26, 0
br i1 %cmp2281.7, label %for.body23.7.preheader, label %for.inc29.7
for.body23.7.preheader: ; preds = %for.inc29.6
%xtraiter187 = and i32 %26, 7
%27 = icmp ult i32 %26, 8
br i1 %27, label %for.inc29.7.loopexit.unr-lcssa, label %for.body23.7.preheader.new
for.body23.7.preheader.new: ; preds = %for.body23.7.preheader
%unroll_iter191 = and i32 %26, -8
br label %for.body23.7
for.body23.7: ; preds = %for.body23.7, %for.body23.7.preheader.new
%a.183.7 = phi i32 [ %a.1.lcssa.6, %for.body23.7.preheader.new ], [ %add25.7.7, %for.body23.7 ]
%niter192 = phi i32 [ 0, %for.body23.7.preheader.new ], [ %niter192.next.7, %for.body23.7 ]
%28 = mul i32 %a.183.7, 100000000
%add25.7.7 = add i32 %28, 22222222
%niter192.next.7 = add i32 %niter192, 8
%niter192.ncmp.7 = icmp eq i32 %niter192.next.7, %unroll_iter191
br i1 %niter192.ncmp.7, label %for.inc29.7.loopexit.unr-lcssa, label %for.body23.7, !llvm.loop !11
for.inc29.7.loopexit.unr-lcssa: ; preds = %for.body23.7, %for.body23.7.preheader
%add25.7.lcssa.ph = phi i32 [ undef, %for.body23.7.preheader ], [ %add25.7.7, %for.body23.7 ]
%a.183.7.unr = phi i32 [ %a.1.lcssa.6, %for.body23.7.preheader ], [ %add25.7.7, %for.body23.7 ]
%lcmp.mod189.not = icmp eq i32 %xtraiter187, 0
br i1 %lcmp.mod189.not, label %for.inc29.7, label %for.body23.7.epil
for.body23.7.epil: ; preds = %for.inc29.7.loopexit.unr-lcssa, %for.body23.7.epil
%a.183.7.epil = phi i32 [ %add25.7.epil, %for.body23.7.epil ], [ %a.183.7.unr, %for.inc29.7.loopexit.unr-lcssa ]
%epil.iter188 = phi i32 [ %epil.iter188.next, %for.body23.7.epil ], [ 0, %for.inc29.7.loopexit.unr-lcssa ]
%mul24.7.epil = mul nsw i32 %a.183.7.epil, 10
%add25.7.epil = add nsw i32 %mul24.7.epil, 2
%epil.iter188.next = add i32 %epil.iter188, 1
%epil.iter188.cmp.not = icmp eq i32 %epil.iter188.next, %xtraiter187
br i1 %epil.iter188.cmp.not, label %for.inc29.7, label %for.body23.7.epil, !llvm.loop !21
for.inc29.7: ; preds = %for.inc29.7.loopexit.unr-lcssa, %for.body23.7.epil, %for.inc29.6
%a.1.lcssa.7 = phi i32 [ %a.1.lcssa.6, %for.inc29.6 ], [ %add25.7.lcssa.ph, %for.inc29.7.loopexit.unr-lcssa ], [ %add25.7.epil, %for.body23.7.epil ]
%29 = load i32, ptr %arrayidx21.8, align 4, !tbaa !9
%cmp2281.8 = icmp sgt i32 %29, 0
br i1 %cmp2281.8, label %for.body23.8.preheader, label %for.inc29.8
for.body23.8.preheader: ; preds = %for.inc29.7
%xtraiter193 = and i32 %29, 7
%30 = icmp ult i32 %29, 8
br i1 %30, label %for.inc29.8.loopexit.unr-lcssa, label %for.body23.8.preheader.new
for.body23.8.preheader.new: ; preds = %for.body23.8.preheader
%unroll_iter197 = and i32 %29, -8
br label %for.body23.8
for.body23.8: ; preds = %for.body23.8, %for.body23.8.preheader.new
%a.183.8 = phi i32 [ %a.1.lcssa.7, %for.body23.8.preheader.new ], [ %add25.8.7, %for.body23.8 ]
%niter198 = phi i32 [ 0, %for.body23.8.preheader.new ], [ %niter198.next.7, %for.body23.8 ]
%31 = mul i32 %a.183.8, 100000000
%add25.8.7 = add i32 %31, 11111111
%niter198.next.7 = add i32 %niter198, 8
%niter198.ncmp.7 = icmp eq i32 %niter198.next.7, %unroll_iter197
br i1 %niter198.ncmp.7, label %for.inc29.8.loopexit.unr-lcssa, label %for.body23.8, !llvm.loop !11
for.inc29.8.loopexit.unr-lcssa: ; preds = %for.body23.8, %for.body23.8.preheader
%add25.8.lcssa.ph = phi i32 [ undef, %for.body23.8.preheader ], [ %add25.8.7, %for.body23.8 ]
%a.183.8.unr = phi i32 [ %a.1.lcssa.7, %for.body23.8.preheader ], [ %add25.8.7, %for.body23.8 ]
%lcmp.mod195.not = icmp eq i32 %xtraiter193, 0
br i1 %lcmp.mod195.not, label %for.inc29.8, label %for.body23.8.epil
for.body23.8.epil: ; preds = %for.inc29.8.loopexit.unr-lcssa, %for.body23.8.epil
%a.183.8.epil = phi i32 [ %add25.8.epil, %for.body23.8.epil ], [ %a.183.8.unr, %for.inc29.8.loopexit.unr-lcssa ]
%epil.iter194 = phi i32 [ %epil.iter194.next, %for.body23.8.epil ], [ 0, %for.inc29.8.loopexit.unr-lcssa ]
%mul24.8.epil = mul nsw i32 %a.183.8.epil, 10
%add25.8.epil = or i32 %mul24.8.epil, 1
%epil.iter194.next = add i32 %epil.iter194, 1
%epil.iter194.cmp.not = icmp eq i32 %epil.iter194.next, %xtraiter193
br i1 %epil.iter194.cmp.not, label %for.inc29.8, label %for.body23.8.epil, !llvm.loop !22
for.inc29.8: ; preds = %for.inc29.8.loopexit.unr-lcssa, %for.body23.8.epil, %for.inc29.7
%a.1.lcssa.8 = phi i32 [ %a.1.lcssa.7, %for.inc29.7 ], [ %add25.8.lcssa.ph, %for.inc29.8.loopexit.unr-lcssa ], [ %add25.8.epil, %for.body23.8.epil ]
%32 = load i32, ptr %hist, align 16, !tbaa !9
%cmp2281.9 = icmp sgt i32 %32, 0
br i1 %cmp2281.9, label %for.body23.9.preheader, label %for.inc29.9
for.body23.9.preheader: ; preds = %for.inc29.8
%min.iters.check = icmp ult i32 %32, 8
br i1 %min.iters.check, label %for.body23.9.preheader106, label %vector.ph
vector.ph: ; preds = %for.body23.9.preheader
%n.vec = and i32 %32, -8
%33 = insertelement <4 x i32> <i32 poison, i32 1, i32 1, i32 1>, i32 %a.1.lcssa.8, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %33, %vector.ph ], [ %34, %vector.body ]
%vec.phi105 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %35, %vector.body ]
%34 = mul <4 x i32> %vec.phi, <i32 10, i32 10, i32 10, i32 10>
%35 = mul <4 x i32> %vec.phi105, <i32 10, i32 10, i32 10, i32 10>
%index.next = add nuw i32 %index, 8
%36 = icmp eq i32 %index.next, %n.vec
br i1 %36, label %middle.block, label %vector.body, !llvm.loop !23
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %35, %34
%37 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %32, %n.vec
br i1 %cmp.n, label %for.inc29.9, label %for.body23.9.preheader106
for.body23.9.preheader106: ; preds = %for.body23.9.preheader, %middle.block
%a.183.9.ph = phi i32 [ %a.1.lcssa.8, %for.body23.9.preheader ], [ %37, %middle.block ]
%i.182.9.ph = phi i32 [ 0, %for.body23.9.preheader ], [ %n.vec, %middle.block ]
br label %for.body23.9
for.body23.9: ; preds = %for.body23.9.preheader106, %for.body23.9
%a.183.9 = phi i32 [ %mul24.9, %for.body23.9 ], [ %a.183.9.ph, %for.body23.9.preheader106 ]
%i.182.9 = phi i32 [ %inc27.9, %for.body23.9 ], [ %i.182.9.ph, %for.body23.9.preheader106 ]
%mul24.9 = mul nsw i32 %a.183.9, 10
%inc27.9 = add nuw nsw i32 %i.182.9, 1
%exitcond.9.not = icmp eq i32 %inc27.9, %32
br i1 %exitcond.9.not, label %for.inc29.9, label %for.body23.9, !llvm.loop !26
for.inc29.9: ; preds = %for.body23.9, %middle.block, %for.inc29.8
%a.1.lcssa.9 = phi i32 [ %a.1.lcssa.8, %for.inc29.8 ], [ %37, %middle.block ], [ %mul24.9, %for.body23.9 ]
br i1 %cmp2281.8, label %for.body38.preheader, label %for.inc44
for.body38.preheader: ; preds = %for.inc29.9
%xtraiter199 = and i32 %29, 7
%38 = icmp ult i32 %29, 8
br i1 %38, label %for.inc44.loopexit.unr-lcssa, label %for.body38.preheader.new
for.body38.preheader.new: ; preds = %for.body38.preheader
%unroll_iter203 = and i32 %29, -8
br label %for.body38
for.body38: ; preds = %for.body38, %for.body38.preheader.new
%b.189 = phi i32 [ 0, %for.body38.preheader.new ], [ %add40.7244, %for.body38 ]
%niter204 = phi i32 [ 0, %for.body38.preheader.new ], [ %niter204.next.7, %for.body38 ]
%39 = mul i32 %b.189, 100000000
%add40.7244 = add i32 %39, 11111111
%niter204.next.7 = add i32 %niter204, 8
%niter204.ncmp.7 = icmp eq i32 %niter204.next.7, %unroll_iter203
br i1 %niter204.ncmp.7, label %for.inc44.loopexit.unr-lcssa, label %for.body38, !llvm.loop !27
for.inc44.loopexit.unr-lcssa: ; preds = %for.body38, %for.body38.preheader
%add40.lcssa.ph = phi i32 [ undef, %for.body38.preheader ], [ %add40.7244, %for.body38 ]
%b.189.unr = phi i32 [ 0, %for.body38.preheader ], [ %add40.7244, %for.body38 ]
%lcmp.mod201.not = icmp eq i32 %xtraiter199, 0
br i1 %lcmp.mod201.not, label %for.inc44, label %for.body38.epil
for.body38.epil: ; preds = %for.inc44.loopexit.unr-lcssa, %for.body38.epil
%b.189.epil = phi i32 [ %add40.epil, %for.body38.epil ], [ %b.189.unr, %for.inc44.loopexit.unr-lcssa ]
%epil.iter200 = phi i32 [ %epil.iter200.next, %for.body38.epil ], [ 0, %for.inc44.loopexit.unr-lcssa ]
%mul39.epil = mul nsw i32 %b.189.epil, 10
%add40.epil = or i32 %mul39.epil, 1
%epil.iter200.next = add i32 %epil.iter200, 1
%epil.iter200.cmp.not = icmp eq i32 %epil.iter200.next, %xtraiter199
br i1 %epil.iter200.cmp.not, label %for.inc44, label %for.body38.epil, !llvm.loop !28
for.inc44: ; preds = %for.inc44.loopexit.unr-lcssa, %for.body38.epil, %for.inc29.9
%b.1.lcssa = phi i32 [ 0, %for.inc29.9 ], [ %add40.lcssa.ph, %for.inc44.loopexit.unr-lcssa ], [ %add40.epil, %for.body38.epil ]
br i1 %cmp2281.7, label %for.body38.1.preheader, label %for.inc44.1
for.body38.1.preheader: ; preds = %for.inc44
%xtraiter247 = and i32 %26, 7
%40 = icmp ult i32 %26, 8
br i1 %40, label %for.inc44.1.loopexit.unr-lcssa, label %for.body38.1.preheader.new
for.body38.1.preheader.new: ; preds = %for.body38.1.preheader
%unroll_iter251 = and i32 %26, -8
br label %for.body38.1
for.body38.1: ; preds = %for.body38.1, %for.body38.1.preheader.new
%b.189.1 = phi i32 [ %b.1.lcssa, %for.body38.1.preheader.new ], [ %add40.1.7, %for.body38.1 ]
%niter252 = phi i32 [ 0, %for.body38.1.preheader.new ], [ %niter252.next.7, %for.body38.1 ]
%41 = mul i32 %b.189.1, 100000000
%add40.1.7 = add i32 %41, 22222222
%niter252.next.7 = add i32 %niter252, 8
%niter252.ncmp.7 = icmp eq i32 %niter252.next.7, %unroll_iter251
br i1 %niter252.ncmp.7, label %for.inc44.1.loopexit.unr-lcssa, label %for.body38.1, !llvm.loop !27
for.inc44.1.loopexit.unr-lcssa: ; preds = %for.body38.1, %for.body38.1.preheader
%add40.1.lcssa.ph = phi i32 [ undef, %for.body38.1.preheader ], [ %add40.1.7, %for.body38.1 ]
%b.189.1.unr = phi i32 [ %b.1.lcssa, %for.body38.1.preheader ], [ %add40.1.7, %for.body38.1 ]
%lcmp.mod249.not = icmp eq i32 %xtraiter247, 0
br i1 %lcmp.mod249.not, label %for.inc44.1, label %for.body38.1.epil
for.body38.1.epil: ; preds = %for.inc44.1.loopexit.unr-lcssa, %for.body38.1.epil
%b.189.1.epil = phi i32 [ %add40.1.epil, %for.body38.1.epil ], [ %b.189.1.unr, %for.inc44.1.loopexit.unr-lcssa ]
%epil.iter248 = phi i32 [ %epil.iter248.next, %for.body38.1.epil ], [ 0, %for.inc44.1.loopexit.unr-lcssa ]
%mul39.1.epil = mul nsw i32 %b.189.1.epil, 10
%add40.1.epil = add nsw i32 %mul39.1.epil, 2
%epil.iter248.next = add i32 %epil.iter248, 1
%epil.iter248.cmp.not = icmp eq i32 %epil.iter248.next, %xtraiter247
br i1 %epil.iter248.cmp.not, label %for.inc44.1, label %for.body38.1.epil, !llvm.loop !29
for.inc44.1: ; preds = %for.inc44.1.loopexit.unr-lcssa, %for.body38.1.epil, %for.inc44
%b.1.lcssa.1 = phi i32 [ %b.1.lcssa, %for.inc44 ], [ %add40.1.lcssa.ph, %for.inc44.1.loopexit.unr-lcssa ], [ %add40.1.epil, %for.body38.1.epil ]
br i1 %cmp2281.6, label %for.body38.2.preheader, label %for.inc44.2
for.body38.2.preheader: ; preds = %for.inc44.1
%xtraiter253 = and i32 %23, 7
%42 = icmp ult i32 %23, 8
br i1 %42, label %for.inc44.2.loopexit.unr-lcssa, label %for.body38.2.preheader.new
for.body38.2.preheader.new: ; preds = %for.body38.2.preheader
%unroll_iter257 = and i32 %23, -8
br label %for.body38.2
for.body38.2: ; preds = %for.body38.2, %for.body38.2.preheader.new
%b.189.2 = phi i32 [ %b.1.lcssa.1, %for.body38.2.preheader.new ], [ %add40.2.7, %for.body38.2 ]
%niter258 = phi i32 [ 0, %for.body38.2.preheader.new ], [ %niter258.next.7, %for.body38.2 ]
%43 = mul i32 %b.189.2, 100000000
%add40.2.7 = add i32 %43, 33333333
%niter258.next.7 = add i32 %niter258, 8
%niter258.ncmp.7 = icmp eq i32 %niter258.next.7, %unroll_iter257
br i1 %niter258.ncmp.7, label %for.inc44.2.loopexit.unr-lcssa, label %for.body38.2, !llvm.loop !27
for.inc44.2.loopexit.unr-lcssa: ; preds = %for.body38.2, %for.body38.2.preheader
%add40.2.lcssa.ph = phi i32 [ undef, %for.body38.2.preheader ], [ %add40.2.7, %for.body38.2 ]
%b.189.2.unr = phi i32 [ %b.1.lcssa.1, %for.body38.2.preheader ], [ %add40.2.7, %for.body38.2 ]
%lcmp.mod255.not = icmp eq i32 %xtraiter253, 0
br i1 %lcmp.mod255.not, label %for.inc44.2, label %for.body38.2.epil
for.body38.2.epil: ; preds = %for.inc44.2.loopexit.unr-lcssa, %for.body38.2.epil
%b.189.2.epil = phi i32 [ %add40.2.epil, %for.body38.2.epil ], [ %b.189.2.unr, %for.inc44.2.loopexit.unr-lcssa ]
%epil.iter254 = phi i32 [ %epil.iter254.next, %for.body38.2.epil ], [ 0, %for.inc44.2.loopexit.unr-lcssa ]
%mul39.2.epil = mul nsw i32 %b.189.2.epil, 10
%add40.2.epil = add nsw i32 %mul39.2.epil, 3
%epil.iter254.next = add i32 %epil.iter254, 1
%epil.iter254.cmp.not = icmp eq i32 %epil.iter254.next, %xtraiter253
br i1 %epil.iter254.cmp.not, label %for.inc44.2, label %for.body38.2.epil, !llvm.loop !30
for.inc44.2: ; preds = %for.inc44.2.loopexit.unr-lcssa, %for.body38.2.epil, %for.inc44.1
%b.1.lcssa.2 = phi i32 [ %b.1.lcssa.1, %for.inc44.1 ], [ %add40.2.lcssa.ph, %for.inc44.2.loopexit.unr-lcssa ], [ %add40.2.epil, %for.body38.2.epil ]
br i1 %cmp2281.5, label %for.body38.3.preheader, label %for.inc44.3
for.body38.3.preheader: ; preds = %for.inc44.2
%xtraiter259 = and i32 %20, 7
%44 = icmp ult i32 %20, 8
br i1 %44, label %for.inc44.3.loopexit.unr-lcssa, label %for.body38.3.preheader.new
for.body38.3.preheader.new: ; preds = %for.body38.3.preheader
%unroll_iter263 = and i32 %20, -8
br label %for.body38.3
for.body38.3: ; preds = %for.body38.3, %for.body38.3.preheader.new
%b.189.3 = phi i32 [ %b.1.lcssa.2, %for.body38.3.preheader.new ], [ %add40.3.7, %for.body38.3 ]
%niter264 = phi i32 [ 0, %for.body38.3.preheader.new ], [ %niter264.next.7, %for.body38.3 ]
%45 = mul i32 %b.189.3, 100000000
%add40.3.7 = add i32 %45, 44444444
%niter264.next.7 = add i32 %niter264, 8
%niter264.ncmp.7 = icmp eq i32 %niter264.next.7, %unroll_iter263
br i1 %niter264.ncmp.7, label %for.inc44.3.loopexit.unr-lcssa, label %for.body38.3, !llvm.loop !27
for.inc44.3.loopexit.unr-lcssa: ; preds = %for.body38.3, %for.body38.3.preheader
%add40.3.lcssa.ph = phi i32 [ undef, %for.body38.3.preheader ], [ %add40.3.7, %for.body38.3 ]
%b.189.3.unr = phi i32 [ %b.1.lcssa.2, %for.body38.3.preheader ], [ %add40.3.7, %for.body38.3 ]
%lcmp.mod261.not = icmp eq i32 %xtraiter259, 0
br i1 %lcmp.mod261.not, label %for.inc44.3, label %for.body38.3.epil
for.body38.3.epil: ; preds = %for.inc44.3.loopexit.unr-lcssa, %for.body38.3.epil
%b.189.3.epil = phi i32 [ %add40.3.epil, %for.body38.3.epil ], [ %b.189.3.unr, %for.inc44.3.loopexit.unr-lcssa ]
%epil.iter260 = phi i32 [ %epil.iter260.next, %for.body38.3.epil ], [ 0, %for.inc44.3.loopexit.unr-lcssa ]
%mul39.3.epil = mul nsw i32 %b.189.3.epil, 10
%add40.3.epil = add nsw i32 %mul39.3.epil, 4
%epil.iter260.next = add i32 %epil.iter260, 1
%epil.iter260.cmp.not = icmp eq i32 %epil.iter260.next, %xtraiter259
br i1 %epil.iter260.cmp.not, label %for.inc44.3, label %for.body38.3.epil, !llvm.loop !31
for.inc44.3: ; preds = %for.inc44.3.loopexit.unr-lcssa, %for.body38.3.epil, %for.inc44.2
%b.1.lcssa.3 = phi i32 [ %b.1.lcssa.2, %for.inc44.2 ], [ %add40.3.lcssa.ph, %for.inc44.3.loopexit.unr-lcssa ], [ %add40.3.epil, %for.body38.3.epil ]
br i1 %cmp2281.4, label %for.body38.4.preheader, label %for.inc44.4
for.body38.4.preheader: ; preds = %for.inc44.3
%xtraiter265 = and i32 %17, 7
%46 = icmp ult i32 %17, 8
br i1 %46, label %for.inc44.4.loopexit.unr-lcssa, label %for.body38.4.preheader.new
for.body38.4.preheader.new: ; preds = %for.body38.4.preheader
%unroll_iter269 = and i32 %17, -8
br label %for.body38.4
for.body38.4: ; preds = %for.body38.4, %for.body38.4.preheader.new
%b.189.4 = phi i32 [ %b.1.lcssa.3, %for.body38.4.preheader.new ], [ %add40.4.7, %for.body38.4 ]
%niter270 = phi i32 [ 0, %for.body38.4.preheader.new ], [ %niter270.next.7, %for.body38.4 ]
%47 = mul i32 %b.189.4, 100000000
%add40.4.7 = add i32 %47, 55555555
%niter270.next.7 = add i32 %niter270, 8
%niter270.ncmp.7 = icmp eq i32 %niter270.next.7, %unroll_iter269
br i1 %niter270.ncmp.7, label %for.inc44.4.loopexit.unr-lcssa, label %for.body38.4, !llvm.loop !27
for.inc44.4.loopexit.unr-lcssa: ; preds = %for.body38.4, %for.body38.4.preheader
%add40.4.lcssa.ph = phi i32 [ undef, %for.body38.4.preheader ], [ %add40.4.7, %for.body38.4 ]
%b.189.4.unr = phi i32 [ %b.1.lcssa.3, %for.body38.4.preheader ], [ %add40.4.7, %for.body38.4 ]
%lcmp.mod267.not = icmp eq i32 %xtraiter265, 0
br i1 %lcmp.mod267.not, label %for.inc44.4, label %for.body38.4.epil
for.body38.4.epil: ; preds = %for.inc44.4.loopexit.unr-lcssa, %for.body38.4.epil
%b.189.4.epil = phi i32 [ %add40.4.epil, %for.body38.4.epil ], [ %b.189.4.unr, %for.inc44.4.loopexit.unr-lcssa ]
%epil.iter266 = phi i32 [ %epil.iter266.next, %for.body38.4.epil ], [ 0, %for.inc44.4.loopexit.unr-lcssa ]
%mul39.4.epil = mul nsw i32 %b.189.4.epil, 10
%add40.4.epil = add nsw i32 %mul39.4.epil, 5
%epil.iter266.next = add i32 %epil.iter266, 1
%epil.iter266.cmp.not = icmp eq i32 %epil.iter266.next, %xtraiter265
br i1 %epil.iter266.cmp.not, label %for.inc44.4, label %for.body38.4.epil, !llvm.loop !32
for.inc44.4: ; preds = %for.inc44.4.loopexit.unr-lcssa, %for.body38.4.epil, %for.inc44.3
%b.1.lcssa.4 = phi i32 [ %b.1.lcssa.3, %for.inc44.3 ], [ %add40.4.lcssa.ph, %for.inc44.4.loopexit.unr-lcssa ], [ %add40.4.epil, %for.body38.4.epil ]
br i1 %cmp2281.3, label %for.body38.5.preheader, label %for.inc44.5
for.body38.5.preheader: ; preds = %for.inc44.4
%xtraiter271 = and i32 %14, 7
%48 = icmp ult i32 %14, 8
br i1 %48, label %for.inc44.5.loopexit.unr-lcssa, label %for.body38.5.preheader.new
for.body38.5.preheader.new: ; preds = %for.body38.5.preheader
%unroll_iter275 = and i32 %14, -8
br label %for.body38.5
for.body38.5: ; preds = %for.body38.5, %for.body38.5.preheader.new
%b.189.5 = phi i32 [ %b.1.lcssa.4, %for.body38.5.preheader.new ], [ %add40.5.7, %for.body38.5 ]
%niter276 = phi i32 [ 0, %for.body38.5.preheader.new ], [ %niter276.next.7, %for.body38.5 ]
%49 = mul i32 %b.189.5, 100000000
%add40.5.7 = add i32 %49, 66666666
%niter276.next.7 = add i32 %niter276, 8
%niter276.ncmp.7 = icmp eq i32 %niter276.next.7, %unroll_iter275
br i1 %niter276.ncmp.7, label %for.inc44.5.loopexit.unr-lcssa, label %for.body38.5, !llvm.loop !27
for.inc44.5.loopexit.unr-lcssa: ; preds = %for.body38.5, %for.body38.5.preheader
%add40.5.lcssa.ph = phi i32 [ undef, %for.body38.5.preheader ], [ %add40.5.7, %for.body38.5 ]
%b.189.5.unr = phi i32 [ %b.1.lcssa.4, %for.body38.5.preheader ], [ %add40.5.7, %for.body38.5 ]
%lcmp.mod273.not = icmp eq i32 %xtraiter271, 0
br i1 %lcmp.mod273.not, label %for.inc44.5, label %for.body38.5.epil
for.body38.5.epil: ; preds = %for.inc44.5.loopexit.unr-lcssa, %for.body38.5.epil
%b.189.5.epil = phi i32 [ %add40.5.epil, %for.body38.5.epil ], [ %b.189.5.unr, %for.inc44.5.loopexit.unr-lcssa ]
%epil.iter272 = phi i32 [ %epil.iter272.next, %for.body38.5.epil ], [ 0, %for.inc44.5.loopexit.unr-lcssa ]
%mul39.5.epil = mul nsw i32 %b.189.5.epil, 10
%add40.5.epil = add nsw i32 %mul39.5.epil, 6
%epil.iter272.next = add i32 %epil.iter272, 1
%epil.iter272.cmp.not = icmp eq i32 %epil.iter272.next, %xtraiter271
br i1 %epil.iter272.cmp.not, label %for.inc44.5, label %for.body38.5.epil, !llvm.loop !33
for.inc44.5: ; preds = %for.inc44.5.loopexit.unr-lcssa, %for.body38.5.epil, %for.inc44.4
%b.1.lcssa.5 = phi i32 [ %b.1.lcssa.4, %for.inc44.4 ], [ %add40.5.lcssa.ph, %for.inc44.5.loopexit.unr-lcssa ], [ %add40.5.epil, %for.body38.5.epil ]
br i1 %cmp2281.2, label %for.body38.6.preheader, label %for.inc44.6
for.body38.6.preheader: ; preds = %for.inc44.5
%xtraiter277 = and i32 %11, 7
%50 = icmp ult i32 %11, 8
br i1 %50, label %for.inc44.6.loopexit.unr-lcssa, label %for.body38.6.preheader.new
for.body38.6.preheader.new: ; preds = %for.body38.6.preheader
%unroll_iter281 = and i32 %11, -8
br label %for.body38.6
for.body38.6: ; preds = %for.body38.6, %for.body38.6.preheader.new
%b.189.6 = phi i32 [ %b.1.lcssa.5, %for.body38.6.preheader.new ], [ %add40.6.7, %for.body38.6 ]
%niter282 = phi i32 [ 0, %for.body38.6.preheader.new ], [ %niter282.next.7, %for.body38.6 ]
%51 = mul i32 %b.189.6, 100000000
%add40.6.7 = add i32 %51, 77777777
%niter282.next.7 = add i32 %niter282, 8
%niter282.ncmp.7 = icmp eq i32 %niter282.next.7, %unroll_iter281
br i1 %niter282.ncmp.7, label %for.inc44.6.loopexit.unr-lcssa, label %for.body38.6, !llvm.loop !27
for.inc44.6.loopexit.unr-lcssa: ; preds = %for.body38.6, %for.body38.6.preheader
%add40.6.lcssa.ph = phi i32 [ undef, %for.body38.6.preheader ], [ %add40.6.7, %for.body38.6 ]
%b.189.6.unr = phi i32 [ %b.1.lcssa.5, %for.body38.6.preheader ], [ %add40.6.7, %for.body38.6 ]
%lcmp.mod279.not = icmp eq i32 %xtraiter277, 0
br i1 %lcmp.mod279.not, label %for.inc44.6, label %for.body38.6.epil
for.body38.6.epil: ; preds = %for.inc44.6.loopexit.unr-lcssa, %for.body38.6.epil
%b.189.6.epil = phi i32 [ %add40.6.epil, %for.body38.6.epil ], [ %b.189.6.unr, %for.inc44.6.loopexit.unr-lcssa ]
%epil.iter278 = phi i32 [ %epil.iter278.next, %for.body38.6.epil ], [ 0, %for.inc44.6.loopexit.unr-lcssa ]
%mul39.6.epil = mul nsw i32 %b.189.6.epil, 10
%add40.6.epil = add nsw i32 %mul39.6.epil, 7
%epil.iter278.next = add i32 %epil.iter278, 1
%epil.iter278.cmp.not = icmp eq i32 %epil.iter278.next, %xtraiter277
br i1 %epil.iter278.cmp.not, label %for.inc44.6, label %for.body38.6.epil, !llvm.loop !34
for.inc44.6: ; preds = %for.inc44.6.loopexit.unr-lcssa, %for.body38.6.epil, %for.inc44.5
%b.1.lcssa.6 = phi i32 [ %b.1.lcssa.5, %for.inc44.5 ], [ %add40.6.lcssa.ph, %for.inc44.6.loopexit.unr-lcssa ], [ %add40.6.epil, %for.body38.6.epil ]
br i1 %cmp2281.1, label %for.body38.7.preheader, label %for.inc44.7
for.body38.7.preheader: ; preds = %for.inc44.6
%xtraiter283 = and i32 %8, 7
%52 = icmp ult i32 %8, 8
br i1 %52, label %for.inc44.7.loopexit.unr-lcssa, label %for.body38.7.preheader.new
for.body38.7.preheader.new: ; preds = %for.body38.7.preheader
%unroll_iter287 = and i32 %8, -8
br label %for.body38.7
for.body38.7: ; preds = %for.body38.7, %for.body38.7.preheader.new
%b.189.7 = phi i32 [ %b.1.lcssa.6, %for.body38.7.preheader.new ], [ %add40.7.7, %for.body38.7 ]
%niter288 = phi i32 [ 0, %for.body38.7.preheader.new ], [ %niter288.next.7, %for.body38.7 ]
%53 = mul i32 %b.189.7, 100000000
%add40.7.7 = add i32 %53, 88888888
%niter288.next.7 = add i32 %niter288, 8
%niter288.ncmp.7 = icmp eq i32 %niter288.next.7, %unroll_iter287
br i1 %niter288.ncmp.7, label %for.inc44.7.loopexit.unr-lcssa, label %for.body38.7, !llvm.loop !27
for.inc44.7.loopexit.unr-lcssa: ; preds = %for.body38.7, %for.body38.7.preheader
%add40.7.lcssa.ph = phi i32 [ undef, %for.body38.7.preheader ], [ %add40.7.7, %for.body38.7 ]
%b.189.7.unr = phi i32 [ %b.1.lcssa.6, %for.body38.7.preheader ], [ %add40.7.7, %for.body38.7 ]
%lcmp.mod285.not = icmp eq i32 %xtraiter283, 0
br i1 %lcmp.mod285.not, label %for.inc44.7, label %for.body38.7.epil
for.body38.7.epil: ; preds = %for.inc44.7.loopexit.unr-lcssa, %for.body38.7.epil
%b.189.7.epil = phi i32 [ %add40.7.epil, %for.body38.7.epil ], [ %b.189.7.unr, %for.inc44.7.loopexit.unr-lcssa ]
%epil.iter284 = phi i32 [ %epil.iter284.next, %for.body38.7.epil ], [ 0, %for.inc44.7.loopexit.unr-lcssa ]
%mul39.7.epil = mul nsw i32 %b.189.7.epil, 10
%add40.7.epil = add nsw i32 %mul39.7.epil, 8
%epil.iter284.next = add i32 %epil.iter284, 1
%epil.iter284.cmp.not = icmp eq i32 %epil.iter284.next, %xtraiter283
br i1 %epil.iter284.cmp.not, label %for.inc44.7, label %for.body38.7.epil, !llvm.loop !35
for.inc44.7: ; preds = %for.inc44.7.loopexit.unr-lcssa, %for.body38.7.epil, %for.inc44.6
%b.1.lcssa.7 = phi i32 [ %b.1.lcssa.6, %for.inc44.6 ], [ %add40.7.lcssa.ph, %for.inc44.7.loopexit.unr-lcssa ], [ %add40.7.epil, %for.body38.7.epil ]
br i1 %cmp2281104, label %for.body38.8.preheader, label %for.inc44.8
for.body38.8.preheader: ; preds = %for.inc44.7
%54 = add i32 %7, -1
%xtraiter289 = and i32 %7, 7
%55 = icmp ult i32 %54, 7
br i1 %55, label %for.inc44.8.loopexit.unr-lcssa, label %for.body38.8.preheader.new
for.body38.8.preheader.new: ; preds = %for.body38.8.preheader
%unroll_iter293 = and i32 %7, -8
br label %for.body38.8
for.body38.8: ; preds = %for.body38.8, %for.body38.8.preheader.new
%b.189.8 = phi i32 [ %b.1.lcssa.7, %for.body38.8.preheader.new ], [ %add40.8.7, %for.body38.8 ]
%niter294 = phi i32 [ 0, %for.body38.8.preheader.new ], [ %niter294.next.7, %for.body38.8 ]
%56 = mul i32 %b.189.8, 100000000
%add40.8.7 = add i32 %56, 99999999
%niter294.next.7 = add i32 %niter294, 8
%niter294.ncmp.7 = icmp eq i32 %niter294.next.7, %unroll_iter293
br i1 %niter294.ncmp.7, label %for.inc44.8.loopexit.unr-lcssa, label %for.body38.8, !llvm.loop !27
for.inc44.8.loopexit.unr-lcssa: ; preds = %for.body38.8, %for.body38.8.preheader
%add40.8.lcssa.ph = phi i32 [ undef, %for.body38.8.preheader ], [ %add40.8.7, %for.body38.8 ]
%b.189.8.unr = phi i32 [ %b.1.lcssa.7, %for.body38.8.preheader ], [ %add40.8.7, %for.body38.8 ]
%lcmp.mod291.not = icmp eq i32 %xtraiter289, 0
br i1 %lcmp.mod291.not, label %for.inc44.8, label %for.body38.8.epil
for.body38.8.epil: ; preds = %for.inc44.8.loopexit.unr-lcssa, %for.body38.8.epil
%b.189.8.epil = phi i32 [ %add40.8.epil, %for.body38.8.epil ], [ %b.189.8.unr, %for.inc44.8.loopexit.unr-lcssa ]
%epil.iter290 = phi i32 [ %epil.iter290.next, %for.body38.8.epil ], [ 0, %for.inc44.8.loopexit.unr-lcssa ]
%mul39.8.epil = mul nsw i32 %b.189.8.epil, 10
%add40.8.epil = add nsw i32 %mul39.8.epil, 9
%epil.iter290.next = add i32 %epil.iter290, 1
%epil.iter290.cmp.not = icmp eq i32 %epil.iter290.next, %xtraiter289
br i1 %epil.iter290.cmp.not, label %for.inc44.8, label %for.body38.8.epil, !llvm.loop !36
for.inc44.8: ; preds = %for.inc44.8.loopexit.unr-lcssa, %for.body38.8.epil, %for.inc44.7
%b.1.lcssa.8 = phi i32 [ %b.1.lcssa.7, %for.inc44.7 ], [ %add40.8.lcssa.ph, %for.inc44.8.loopexit.unr-lcssa ], [ %add40.8.epil, %for.body38.8.epil ]
%sub47 = sub nsw i32 %a.1.lcssa.9, %b.1.lcssa.8
%call48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %sub47)
%inc50 = add nuw nsw i32 %k.094, 1
%exitcond100.not = icmp eq i32 %inc50, %add
br i1 %exitcond100.not, label %for.end51, label %for.cond2.preheader, !llvm.loop !37
for.end51: ; preds = %for.inc44.8, %entry, %for.cond.preheader
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %hist) #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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !12, !24, !25}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !12, !25, !24}
!27 = distinct !{!27, !12}
!28 = distinct !{!28, !14}
!29 = distinct !{!29, !14}
!30 = distinct !{!30, !14}
!31 = distinct !{!31, !14}
!32 = distinct !{!32, !14}
!33 = distinct !{!33, !14}
!34 = distinct !{!34, !14}
!35 = distinct !{!35, !14}
!36 = distinct !{!36, !14}
!37 = distinct !{!37, !12}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
#define FOR(n) for(int i=0;i<n;i++)
#define FORJ(n) for(int j=0;j<n;j++)
#define PRN(n) printf("%d\n",n)
#define PRF(n) printf("%lf\n",n)
#define PRL(n) printf("%lld\n",n)
#define PRS(s) printf("%s\n",s)
#define PRC(c) printf("%c",c)
#define mod 1000000007
typedef long long int ll;
ll dp[100001];
int q(const void *a, const void *b){
return *(ll*)a-*(ll*)b;
}
int min(int a,int b){
if(a>b)return b;
return a;
}
int max(int a,int b){
if(a>b)return a;
return b;
}
int gcd(int a,int b){
if(!b)return a;
return gcd(b,a%b);
}
int a[3][101];
int main(void) {
int n,x,b,cnt=0;
scanf("%d",&n);
FOR(3){
scanf("%d",&x);
FORJ(x){
scanf("%d",&b);
a[i][b]=1;
}
}
FOR(101){
if(a[2][i]){
cnt+=1-a[0][i];
cnt+=a[0][i]*a[1][i];
}
}
PRN(cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318406/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318406/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 local_unnamed_addr global [3 x [101 x i32]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@dp = dso_local local_unnamed_addr global [100001 x i64] zeroinitializer, align 16
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @q(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%b.a = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %b.a
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i32 %b, 0
br i1 %tobool.not4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%b.tr6 = phi i32 [ %rem, %if.end ], [ %b, %entry ]
%a.tr5 = phi i32 [ %b.tr6, %if.end ], [ %a, %entry ]
%rem = srem i32 %a.tr5, %b.tr6
%tobool.not = icmp eq i32 %rem, 0
br i1 %tobool.not, label %return, label %if.end
return: ; preds = %if.end, %entry
%a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.end ]
ret i32 %a.tr.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%0 = load i32, ptr %x, align 4, !tbaa !9
%cmp340 = icmp sgt i32 %0, 0
br i1 %cmp340, label %for.body5, label %for.cond.cleanup4
for.cond.cleanup4: ; preds = %for.body5, %entry
%call1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !9
%cmp340.1 = icmp sgt i32 %1, 0
br i1 %cmp340.1, label %for.body5.1, label %for.cond.cleanup4.1
for.body5.1: ; preds = %for.cond.cleanup4, %for.body5.1
%j.041.1 = phi i32 [ %inc.1, %for.body5.1 ], [ 0, %for.cond.cleanup4 ]
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%2 = load i32, ptr %b, align 4, !tbaa !9
%idxprom7.1 = sext i32 %2 to i64
%arrayidx8.1 = getelementptr inbounds [3 x [101 x i32]], ptr @a, i64 0, i64 1, i64 %idxprom7.1
store i32 1, ptr %arrayidx8.1, align 4, !tbaa !9
%inc.1 = add nuw nsw i32 %j.041.1, 1
%3 = load i32, ptr %x, align 4, !tbaa !9
%cmp3.1 = icmp slt i32 %inc.1, %3
br i1 %cmp3.1, label %for.body5.1, label %for.cond.cleanup4.1, !llvm.loop !11
for.cond.cleanup4.1: ; preds = %for.body5.1, %for.cond.cleanup4
%call1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%4 = load i32, ptr %x, align 4, !tbaa !9
%cmp340.2 = icmp sgt i32 %4, 0
br i1 %cmp340.2, label %for.body5.2, label %vector.body.preheader
for.body5.2: ; preds = %for.cond.cleanup4.1, %for.body5.2
%j.041.2 = phi i32 [ %inc.2, %for.body5.2 ], [ 0, %for.cond.cleanup4.1 ]
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%5 = load i32, ptr %b, align 4, !tbaa !9
%idxprom7.2 = sext i32 %5 to i64
%arrayidx8.2 = getelementptr inbounds [3 x [101 x i32]], ptr @a, i64 0, i64 2, i64 %idxprom7.2
store i32 1, ptr %arrayidx8.2, align 4, !tbaa !9
%inc.2 = add nuw nsw i32 %j.041.2, 1
%6 = load i32, ptr %x, align 4, !tbaa !9
%cmp3.2 = icmp slt i32 %inc.2, %6
br i1 %cmp3.2, label %for.body5.2, label %vector.body.preheader, !llvm.loop !11
vector.body.preheader: ; preds = %for.body5.2, %for.cond.cleanup4.1
br label %vector.body
vector.body: ; preds = %vector.body.preheader, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %vector.body.preheader ]
%vec.phi = phi <4 x i32> [ %predphi, %vector.body ], [ zeroinitializer, %vector.body.preheader ]
%7 = getelementptr inbounds [3 x [101 x i32]], ptr @a, i64 0, i64 2, i64 %index
%wide.load = load <4 x i32>, ptr %7, align 8, !tbaa !9
%8 = icmp eq <4 x i32> %wide.load, zeroinitializer
%9 = getelementptr [101 x i32], ptr @a, i64 0, i64 %index
%wide.load47 = load <4 x i32>, ptr %9, align 16, !tbaa !9
%10 = getelementptr [3 x [101 x i32]], ptr @a, i64 0, i64 1, i64 %index
%wide.load48 = load <4 x i32>, ptr %10, align 4, !tbaa !9
%11 = mul nsw <4 x i32> %wide.load48, %wide.load47
%12 = add <4 x i32> %vec.phi, <i32 1, i32 1, i32 1, i32 1>
%13 = sub <4 x i32> %12, %wide.load47
%14 = add <4 x i32> %13, %11
%predphi = select <4 x i1> %8, <4 x i32> %vec.phi, <4 x i32> %14
%index.next = add nuw i64 %index, 4
%15 = icmp eq i64 %index.next, 100
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %predphi)
%17 = load i32, ptr getelementptr inbounds ([3 x [101 x i32]], ptr @a, i64 0, i64 2, i64 100), align 8, !tbaa !9
%tobool.not = icmp eq i32 %17, 0
br i1 %tobool.not, label %for.inc26, label %if.then
for.body5: ; preds = %entry, %for.body5
%j.041 = phi i32 [ %inc, %for.body5 ], [ 0, %entry ]
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%18 = load i32, ptr %b, align 4, !tbaa !9
%idxprom7 = sext i32 %18 to i64
%arrayidx8 = getelementptr inbounds [3 x [101 x i32]], ptr @a, i64 0, i64 0, i64 %idxprom7
store i32 1, ptr %arrayidx8, align 4, !tbaa !9
%inc = add nuw nsw i32 %j.041, 1
%19 = load i32, ptr %x, align 4, !tbaa !9
%cmp3 = icmp slt i32 %inc, %19
br i1 %cmp3, label %for.body5, label %for.cond.cleanup4, !llvm.loop !11
if.then: ; preds = %middle.block
%20 = load i32, ptr getelementptr inbounds ([3 x [101 x i32]], ptr @a, i64 0, i64 0, i64 100), align 16, !tbaa !9
%21 = load i32, ptr getelementptr inbounds ([3 x [101 x i32]], ptr @a, i64 0, i64 1, i64 100), align 4, !tbaa !9
%mul = mul nsw i32 %21, %20
%reass.sub = add i32 %16, 1
%add = sub i32 %reass.sub, %20
%add25 = add nsw i32 %add, %mul
br label %for.inc26
for.inc26: ; preds = %middle.block, %if.then
%cnt.1 = phi i32 [ %add25, %if.then ], [ %16, %middle.block ]
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree 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 #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
|
#include <stdio.h>
int main(void){
long a,b,c,d;
scanf("%ld %ld %ld %ld", &a, &b, &c, &d);
long answer = a*b;
if (c*d > answer) {
answer = c*d;
}
printf("%ld\n", answer);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318457/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318457/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [16 x i8] c"%ld %ld %ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
%d = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%mul = mul nsw i64 %1, %0
%2 = load i64, ptr %c, align 8, !tbaa !5
%3 = load i64, ptr %d, align 8, !tbaa !5
%mul1 = mul nsw i64 %3, %2
%spec.select = call i64 @llvm.smax.i64(i64 %mul1, i64 %mul)
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n,a,b,c,x,y,d;
while(~scanf("%d %d %d %d",&a,&b,&c,&d))
{
x=a*b;
y=c*d;
if(x>y)
{
printf("%d\n",x);
}
else if(x<y)
{
printf("%d\n",y);
}
else if(x==y)
{
printf("%d\n",x);
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318507/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318507/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #3
%call19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%tobool.not20 = icmp eq i32 %call19, -1
br i1 %tobool.not20, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end11
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%mul1 = mul nsw i32 %3, %2
%cmp = icmp sgt i32 %mul, %mul1
br i1 %cmp, label %if.end11.sink.split, label %if.else
if.else: ; preds = %while.body
%cmp3 = icmp slt i32 %mul, %mul1
br i1 %cmp3, label %if.end11.sink.split, label %if.else6
if.else6: ; preds = %if.else
%cmp7 = icmp eq i32 %mul, %mul1
br i1 %cmp7, label %if.end11.sink.split, label %if.end11
if.end11.sink.split: ; preds = %if.else6, %if.else, %while.body
%mul1.sink = phi i32 [ %mul, %while.body ], [ %mul1, %if.else ], [ %mul, %if.else6 ]
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul1.sink)
br label %if.end11
if.end11: ; preds = %if.end11.sink.split, %if.else6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%tobool.not = icmp eq i32 %call, -1
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end11, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int a,b,c,d;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
if(a*b>c*d){printf("%d",a*b);}
else{printf("%d",c*d);}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318550/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318550/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%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)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%mul4 = mul nsw i32 %3, %2
%mul.mul4 = call i32 @llvm.smax.i32(i32 %mul, i32 %mul4)
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %mul.mul4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
int s1 = a * b;
int s2 = c * d;
if(s1 > s2){
s2 = s1;
}
printf("%d",s2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318594/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318594/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%mul1 = mul nsw i32 %3, %2
%spec.select = call i32 @llvm.smax.i32(i32 %mul, i32 %mul1)
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
long long a,b,c,d,x,y;
scanf("%lld %lld %lld %lld",&a,&b,&c,&d);
x = a * b;
y = c * d;
if(x > y)
printf("%lld\n",x);
else
printf("%lld\n",y);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318637/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318637/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [20 x i8] c"%lld %lld %lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
%d = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%mul = mul nsw i64 %1, %0
%2 = load i64, ptr %c, align 8, !tbaa !5
%3 = load i64, ptr %d, align 8, !tbaa !5
%mul1 = mul nsw i64 %3, %2
%mul.mul1 = call i64 @llvm.smax.i64(i64 %mul, i64 %mul1)
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %mul.mul1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define LINE_BUF_SIZE 256
int main(){
int i,j,k;
long int A,B,C,D;
char line[LINE_BUF_SIZE];
fgets(line,sizeof(line),stdin);
sscanf(line,"%ld %ld %ld %ld", &A,&B,&C,&D);
if(A*B == C*D){
printf("%ld",A*B);
return 0;
}
if(A*B > C*D){
printf("%ld",A*B);
return 0;
}
else{
printf("%ld",C*D);
return 0;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318680/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318680/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [16 x i8] c"%ld %ld %ld %ld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i64, align 8
%B = alloca i64, align 8
%C = alloca i64, align 8
%D = alloca i64, align 8
%line = alloca [256 x i8], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %D) #4
call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %line) #4
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %line, i32 noundef 256, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %line, ptr noundef nonnull @.str, ptr noundef nonnull %A, ptr noundef nonnull %B, ptr noundef nonnull %C, ptr noundef nonnull %D) #4
%1 = load i64, ptr %A, align 8, !tbaa !9
%2 = load i64, ptr %B, align 8, !tbaa !9
%mul = mul nsw i64 %2, %1
%3 = load i64, ptr %C, align 8, !tbaa !9
%4 = load i64, ptr %D, align 8, !tbaa !9
%mul3 = mul nsw i64 %4, %3
%mul.mul3 = call i64 @llvm.smax.i64(i64 %mul, i64 %mul3)
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %mul.mul3)
call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %line) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %D) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
|
#include<stdio.h>
int main() {
int a, b, c, d, e, f; scanf("%d%d%d%d", &a, &b, &c, &d);
e = a*b; f = c*d;
printf("%d\n", e<f ? f : e);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318723/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318723/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%mul1 = mul nsw i32 %3, %2
%cond = call i32 @llvm.smax.i32(i32 %mul, i32 %mul1)
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main (void){
int a,b,c,d;
scanf("%d %d %d %d",&a,&b,&c,&d);
if(a*b>c*d){
printf("%d\n",a*b);
}else{
printf("%d\n",c*d);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318774/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318774/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %d)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %c, align 4, !tbaa !5
%3 = load i32, ptr %d, align 4, !tbaa !5
%mul1 = mul nsw i32 %3, %2
%mul.mul1 = call i32 @llvm.smax.i32(i32 %mul, i32 %mul1)
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul.mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
// AOJ 2845: Star in Parentheses
// 2017.11.23 bal4u@uu
#include <stdio.h>
char buf[102];
int main()
{
int ans;
char *p;
scanf("%s", p=buf);
ans = 0;
while (*p != '*') {
if (*p == '(') ans++;
else if (*p == ')') ans--;
p++;
}
printf("%d\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318817/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318817/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@buf = dso_local global [102 x i8] 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:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @buf)
br label %while.cond
while.cond: ; preds = %if.end9, %entry
%ans.0 = phi i32 [ 0, %entry ], [ %ans.1, %if.end9 ]
%p.0 = phi ptr [ @buf, %entry ], [ %incdec.ptr, %if.end9 ]
%0 = load i8, ptr %p.0, align 1, !tbaa !5
switch i8 %0, label %if.end9 [
i8 42, label %while.end
i8 40, label %if.then
i8 41, label %if.then8
]
if.then: ; preds = %while.cond
%inc = add nsw i32 %ans.0, 1
br label %if.end9
if.then8: ; preds = %while.cond
%dec = add nsw i32 %ans.0, -1
br label %if.end9
if.end9: ; preds = %while.cond, %if.then8, %if.then
%ans.1 = phi i32 [ %inc, %if.then ], [ %dec, %if.then8 ], [ %ans.0, %while.cond ]
%incdec.ptr = getelementptr inbounds i8, ptr %p.0, i64 1
br label %while.cond, !llvm.loop !8
while.end: ; preds = %while.cond
%call10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
/* ex 9_1
yy8332 */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//スタックに格納するデータの最大数
#define SIZE 100
//スタックの定義
typedef struct stack{
int size;
int count;
char data[SIZE];
char *top;
} stack;
//スタックの初期化
void initialize_stack(stack *stk){
stk->count = 0;
stk->size = SIZE;
stk->top = &(stk->data[SIZE]);
}
//データの追加
void push(stack *stk, char elem){
if(stk->count >= stk->size){
fprintf(stderr, "Error: stack overflow. (x=%c)\n", elem);
exit(1);
}
else{
stk->top--;
*(stk->top) = elem;
stk->count++;
}
}
//データの取り出し
char pop(stack *stk){
char latest;
if(stk->count <= 0){
fprintf(stdout, "Error: stack underflow.\n");
exit(1);
}
else{
latest = *(stk->top);
stk->top++;
stk->count--;
return latest;
}
}
int main(void){
stack stk;
char input[11], str1[11], str2[11];
int len1, len2, i;
//スタックを初期化(ポインタ渡しで関数にわたすこと)
initialize_stack(&stk);
//入力読み取り
scanf("%s", &input);
//入力文字列の長さ取得
len1 = strlen(input);
//入力で場合分けしてstackを操作
for(i = 0; i < len1; i++){
if(input[i] == 'B' && stk.count != 0){
pop(&stk);
}
else if(input[i] == '0' || input[i] == '1'){
push(&stk, input[i]);
}
}
//出力文字列の長さ取得
len2 = stk.count;
//出力
for(i = 0; i < len2; i++){
str1[i] = pop(&stk);
}
for(i = 0; i < len2; i++){
str2[i] = str1[(len2 - 1) - i];
}
str2[len2] = '\0';
printf("%s\n", str2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318860/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318860/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.stack = type { i32, i32, [100 x i8], ptr }
@stderr = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [31 x i8] c"Error: stack overflow. (x=%c)\0A\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.1 = private unnamed_addr constant [25 x i8] c"Error: stack underflow.\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @initialize_stack(ptr noundef %stk) local_unnamed_addr #0 {
entry:
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
store i32 0, ptr %count, align 4, !tbaa !5
store i32 100, ptr %stk, align 8, !tbaa !11
%arrayidx = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 2, i64 100
%top = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
store ptr %arrayidx, ptr %top, align 8, !tbaa !12
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @push(ptr nocapture noundef %stk, i8 noundef signext %elem) local_unnamed_addr #1 {
entry:
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
%0 = load i32, ptr %count, align 4, !tbaa !5
%1 = load i32, ptr %stk, align 8, !tbaa !11
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%2 = load ptr, ptr @stderr, align 8, !tbaa !13
%conv = sext i8 %elem to i32
%call = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str, i32 noundef %conv) #7
tail call void @exit(i32 noundef 1) #8
unreachable
if.else: ; preds = %entry
%top = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
%3 = load ptr, ptr %top, align 8, !tbaa !12
%incdec.ptr = getelementptr inbounds i8, ptr %3, i64 -1
store ptr %incdec.ptr, ptr %top, align 8, !tbaa !12
store i8 %elem, ptr %incdec.ptr, align 1, !tbaa !14
%4 = load i32, ptr %count, align 4, !tbaa !5
%inc = add nsw i32 %4, 1
store i32 %inc, ptr %count, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3
; Function Attrs: nounwind uwtable
define dso_local signext i8 @pop(ptr nocapture noundef %stk) local_unnamed_addr #1 {
entry:
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
%0 = load i32, ptr %count, align 4, !tbaa !5
%cmp = icmp slt i32 %0, 1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%1 = load ptr, ptr @stdout, align 8, !tbaa !13
%2 = tail call i64 @fwrite(ptr nonnull @.str.1, i64 24, i64 1, ptr %1)
tail call void @exit(i32 noundef 1) #8
unreachable
if.else: ; preds = %entry
%top = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
%3 = load ptr, ptr %top, align 8, !tbaa !12
%4 = load i8, ptr %3, align 1, !tbaa !14
%incdec.ptr = getelementptr inbounds i8, ptr %3, i64 1
store ptr %incdec.ptr, ptr %top, align 8, !tbaa !12
%dec = add nsw i32 %0, -1
store i32 %dec, ptr %count, align 4, !tbaa !5
ret i8 %4
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%stk = alloca %struct.stack, align 8
%input = alloca [11 x i8], align 1
%str1 = alloca [11 x i8], align 1
%str2 = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %stk) #9
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %input) #9
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %str1) #9
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %str2) #9
%count.i = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
store i32 0, ptr %count.i, align 4, !tbaa !5
store i32 100, ptr %stk, align 8, !tbaa !11
%arrayidx.i = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 2, i64 100
%top.i = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
store ptr %arrayidx.i, ptr %top.i, align 8, !tbaa !12
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %input)
%call1 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %input) #10
%conv = trunc i64 %call1 to i32
%cmp79 = icmp sgt i32 %conv, 0
%.pre100 = load i32, ptr %count.i, align 4
br i1 %cmp79, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call1, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%0 = phi i32 [ %.pre100, %for.body.preheader ], [ %10, %for.inc ]
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds [11 x i8], ptr %input, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !14
%cmp4 = icmp eq i8 %1, 66
%cmp6 = icmp ne i32 %0, 0
%or.cond = select i1 %cmp4, i1 %cmp6, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %for.body
%cmp.i = icmp slt i32 %0, 1
br i1 %cmp.i, label %if.then.i, label %pop.exit
if.then.i: ; preds = %if.then
%2 = load ptr, ptr @stdout, align 8, !tbaa !13
%3 = call i64 @fwrite(ptr nonnull @.str.1, i64 24, i64 1, ptr %2)
call void @exit(i32 noundef 1) #8
unreachable
pop.exit: ; preds = %if.then
%4 = load ptr, ptr %top.i, align 8, !tbaa !12
%incdec.ptr.i = getelementptr inbounds i8, ptr %4, i64 1
store ptr %incdec.ptr.i, ptr %top.i, align 8, !tbaa !12
%dec.i = add nsw i32 %0, -1
br label %for.inc.sink.split
if.else: ; preds = %for.body
%5 = and i8 %1, -2
%switch = icmp eq i8 %5, 48
br i1 %switch, label %if.then19, label %for.inc
if.then19: ; preds = %if.else
%6 = load i32, ptr %stk, align 8, !tbaa !11
%cmp.not.i = icmp slt i32 %0, %6
br i1 %cmp.not.i, label %push.exit, label %if.then.i68
if.then.i68: ; preds = %if.then19
%7 = load ptr, ptr @stderr, align 8, !tbaa !13
%conv.i = zext i8 %1 to i32
%call.i = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str, i32 noundef %conv.i) #7
call void @exit(i32 noundef 1) #8
unreachable
push.exit: ; preds = %if.then19
%8 = load ptr, ptr %top.i, align 8, !tbaa !12
%incdec.ptr.i70 = getelementptr inbounds i8, ptr %8, i64 -1
store ptr %incdec.ptr.i70, ptr %top.i, align 8, !tbaa !12
store i8 %1, ptr %incdec.ptr.i70, align 1, !tbaa !14
%9 = load i32, ptr %count.i, align 4, !tbaa !5
%inc.i = add nsw i32 %9, 1
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %push.exit, %pop.exit
%dec.i.sink = phi i32 [ %dec.i, %pop.exit ], [ %inc.i, %push.exit ]
store i32 %dec.i.sink, ptr %count.i, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %if.else
%10 = phi i32 [ %0, %if.else ], [ %dec.i.sink, %for.inc.sink.split ]
%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 !15
for.end: ; preds = %for.inc, %entry
%11 = phi i32 [ %.pre100, %entry ], [ %10, %for.inc ]
%cmp2581 = icmp sgt i32 %11, 0
br i1 %cmp2581, label %for.body27.preheader, label %for.end45
for.body27.preheader: ; preds = %for.end
%top.i.promoted = load ptr, ptr %top.i, align 8, !tbaa !12
%wide.trip.count91 = zext i32 %11 to i64
br label %for.body27
for.cond34.preheader: ; preds = %pop.exit77
br i1 %cmp2581, label %iter.check, label %for.end45
iter.check: ; preds = %for.cond34.preheader
%wide.trip.count98 = zext i32 %11 to i64
%min.iters.check = icmp ult i32 %11, 8
br i1 %min.iters.check, label %for.body37.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %iter.check
%12 = add nsw i64 %wide.trip.count91, -1
%13 = add i32 %11, -1
%14 = trunc i64 %12 to i32
%15 = sub i32 %13, %14
%16 = icmp sgt i32 %15, %13
%17 = icmp ugt i64 %12, 4294967295
%18 = or i1 %16, %17
br i1 %18, label %for.body37.preheader, label %vector.main.loop.iter.check
vector.main.loop.iter.check: ; preds = %vector.scevcheck
%min.iters.check107 = icmp ult i32 %11, 32
br i1 %min.iters.check107, label %vec.epilog.ph, label %vector.ph
vector.ph: ; preds = %vector.main.loop.iter.check
%n.vec = and i64 %wide.trip.count91, 4294967264
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%offset.idx = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%19 = trunc i64 %offset.idx to i32
%20 = xor i32 %19, -1
%21 = add i32 %11, %20
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [11 x i8], ptr %str1, i64 0, i64 %22
%24 = getelementptr inbounds i8, ptr %23, i64 -15
%wide.load = load <16 x i8>, ptr %24, align 1, !tbaa !14
%reverse = shufflevector <16 x i8> %wide.load, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%25 = getelementptr inbounds i8, ptr %23, i64 -31
%wide.load108 = load <16 x i8>, ptr %25, align 1, !tbaa !14
%reverse109 = shufflevector <16 x i8> %wide.load108, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%26 = getelementptr inbounds [11 x i8], ptr %str2, i64 0, i64 %offset.idx
store <16 x i8> %reverse, ptr %26, align 1, !tbaa !14
%27 = getelementptr inbounds i8, ptr %26, i64 16
store <16 x i8> %reverse109, ptr %27, align 1, !tbaa !14
%index.next = add nuw i64 %offset.idx, 32
%28 = icmp eq i64 %index.next, %n.vec
br i1 %28, label %middle.block, label %vector.body, !llvm.loop !17
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count91
br i1 %cmp.n, label %for.end45, label %vec.epilog.iter.check
vec.epilog.iter.check: ; preds = %middle.block
%n.vec.remaining = and i64 %wide.trip.count91, 24
%min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
br i1 %min.epilog.iters.check, label %for.body37.preheader, label %vec.epilog.ph
vec.epilog.ph: ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
%vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
%n.vec111 = and i64 %wide.trip.count91, 4294967288
%invariant.gep = getelementptr i8, ptr %str1, i64 -7
br label %vec.epilog.vector.body
vec.epilog.vector.body: ; preds = %vec.epilog.vector.body, %vec.epilog.ph
%offset.idx113 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next116, %vec.epilog.vector.body ]
%29 = trunc i64 %offset.idx113 to i32
%30 = xor i32 %29, -1
%31 = add i32 %11, %30
%32 = sext i32 %31 to i64
%gep = getelementptr [11 x i8], ptr %invariant.gep, i64 0, i64 %32
%wide.load114 = load <8 x i8>, ptr %gep, align 1, !tbaa !14
%reverse115 = shufflevector <8 x i8> %wide.load114, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%33 = getelementptr inbounds [11 x i8], ptr %str2, i64 0, i64 %offset.idx113
store <8 x i8> %reverse115, ptr %33, align 1, !tbaa !14
%index.next116 = add nuw i64 %offset.idx113, 8
%34 = icmp eq i64 %index.next116, %n.vec111
br i1 %34, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !20
vec.epilog.middle.block: ; preds = %vec.epilog.vector.body
%cmp.n112 = icmp eq i64 %n.vec111, %wide.trip.count91
br i1 %cmp.n112, label %for.end45, label %for.body37.preheader
for.body37.preheader: ; preds = %vector.scevcheck, %iter.check, %vec.epilog.iter.check, %vec.epilog.middle.block
%indvars.iv95.ph = phi i64 [ 0, %iter.check ], [ 0, %vector.scevcheck ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec111, %vec.epilog.middle.block ]
%xtraiter = and i64 %wide.trip.count91, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body37.prol.loopexit, label %for.body37.prol
for.body37.prol: ; preds = %for.body37.preheader
%35 = trunc i64 %indvars.iv95.ph to i32
%36 = xor i32 %35, -1
%sub38.prol = add i32 %11, %36
%idxprom39.prol = sext i32 %sub38.prol to i64
%arrayidx40.prol = getelementptr inbounds [11 x i8], ptr %str1, i64 0, i64 %idxprom39.prol
%37 = load i8, ptr %arrayidx40.prol, align 1, !tbaa !14
%arrayidx42.prol = getelementptr inbounds [11 x i8], ptr %str2, i64 0, i64 %indvars.iv95.ph
store i8 %37, ptr %arrayidx42.prol, align 1, !tbaa !14
%indvars.iv.next96.prol = or i64 %indvars.iv95.ph, 1
br label %for.body37.prol.loopexit
for.body37.prol.loopexit: ; preds = %for.body37.prol, %for.body37.preheader
%indvars.iv95.unr = phi i64 [ %indvars.iv95.ph, %for.body37.preheader ], [ %indvars.iv.next96.prol, %for.body37.prol ]
%38 = sub nsw i64 0, %wide.trip.count91
%39 = xor i64 %indvars.iv95.ph, %38
%40 = icmp eq i64 %39, -1
br i1 %40, label %for.end45, label %for.body37
for.body27: ; preds = %for.body27.preheader, %pop.exit77
%indvars.iv88 = phi i64 [ 0, %for.body27.preheader ], [ %indvars.iv.next89, %pop.exit77 ]
%41 = phi i32 [ %11, %for.body27.preheader ], [ %dec.i75, %pop.exit77 ]
%42 = phi ptr [ %top.i.promoted, %for.body27.preheader ], [ %incdec.ptr.i74, %pop.exit77 ]
%exitcond92 = icmp eq i64 %indvars.iv88, %wide.trip.count91
br i1 %exitcond92, label %if.then.i76, label %pop.exit77
if.then.i76: ; preds = %for.body27
%43 = load ptr, ptr @stdout, align 8, !tbaa !13
%44 = call i64 @fwrite(ptr nonnull @.str.1, i64 24, i64 1, ptr %43)
call void @exit(i32 noundef 1) #8
unreachable
pop.exit77: ; preds = %for.body27
%45 = load i8, ptr %42, align 1, !tbaa !14
%incdec.ptr.i74 = getelementptr inbounds i8, ptr %42, i64 1
store ptr %incdec.ptr.i74, ptr %top.i, align 8, !tbaa !12
%dec.i75 = add nsw i32 %41, -1
store i32 %dec.i75, ptr %count.i, align 4, !tbaa !5
%arrayidx30 = getelementptr inbounds [11 x i8], ptr %str1, i64 0, i64 %indvars.iv88
store i8 %45, ptr %arrayidx30, align 1, !tbaa !14
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%exitcond94.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count91
br i1 %exitcond94.not, label %for.cond34.preheader, label %for.body27, !llvm.loop !21
for.body37: ; preds = %for.body37.prol.loopexit, %for.body37
%indvars.iv95 = phi i64 [ %indvars.iv.next96.1, %for.body37 ], [ %indvars.iv95.unr, %for.body37.prol.loopexit ]
%46 = trunc i64 %indvars.iv95 to i32
%47 = xor i32 %46, -1
%sub38 = add i32 %11, %47
%idxprom39 = sext i32 %sub38 to i64
%arrayidx40 = getelementptr inbounds [11 x i8], ptr %str1, i64 0, i64 %idxprom39
%48 = load i8, ptr %arrayidx40, align 1, !tbaa !14
%arrayidx42 = getelementptr inbounds [11 x i8], ptr %str2, i64 0, i64 %indvars.iv95
store i8 %48, ptr %arrayidx42, align 1, !tbaa !14
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%49 = trunc i64 %indvars.iv.next96 to i32
%50 = xor i32 %49, -1
%sub38.1 = add i32 %11, %50
%idxprom39.1 = sext i32 %sub38.1 to i64
%arrayidx40.1 = getelementptr inbounds [11 x i8], ptr %str1, i64 0, i64 %idxprom39.1
%51 = load i8, ptr %arrayidx40.1, align 1, !tbaa !14
%arrayidx42.1 = getelementptr inbounds [11 x i8], ptr %str2, i64 0, i64 %indvars.iv.next96
store i8 %51, ptr %arrayidx42.1, align 1, !tbaa !14
%indvars.iv.next96.1 = add nuw nsw i64 %indvars.iv95, 2
%exitcond99.not.1 = icmp eq i64 %indvars.iv.next96.1, %wide.trip.count98
br i1 %exitcond99.not.1, label %for.end45, label %for.body37, !llvm.loop !22
for.end45: ; preds = %for.body37.prol.loopexit, %for.body37, %middle.block, %vec.epilog.middle.block, %for.end, %for.cond34.preheader
%idxprom46 = sext i32 %11 to i64
%arrayidx47 = getelementptr inbounds [11 x i8], ptr %str2, i64 0, i64 %idxprom46
store i8 0, ptr %arrayidx47, align 1, !tbaa !14
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str2)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %str2) #9
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %str1) #9
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %input) #9
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %stk) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { cold }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 4}
!6 = !{!"stack", !7, i64 0, !7, i64 4, !8, i64 8, !10, i64 112}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !10, i64 112}
!13 = !{!10, !10, i64 0}
!14 = !{!8, !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !16, !18, !19}
!21 = distinct !{!21, !16}
!22 = distinct !{!22, !16, !18}
|
/* ex4-1
kas056*/
#include <stdio.h>
#include <stdlib.h>
#define SIZE 15
typedef struct{
int size;//格納最大数
int count;//現在のデータ数
char data[SIZE];//データ配列
char *top;//topのポインタ
char *bottom;//一番下のポインタ
}stack;
void initialize(stack *stk){
stk -> count = 0;
stk -> size = SIZE;
stk -> top = &(stk->data[SIZE]);//配列の最終要素の一つ手前
stk -> bottom = &(stk->data[SIZE]);//初期配列の要素の一つ手前...(*)
}
void push(stack *stk, char s){
if(stk->count >= stk -> size){//格納最大数を超えたらエラー
fprintf(stderr, "Error: Stack overflow. (s=%c)\n", s);
}
else{
stk -> top--;//一つ上にあげる(=一つ手前に移動)
*(stk->top) = s;
stk->count++;
}
}
void pop(stack *stk){
//popが指示されたとき、
if(stk->count > 0){//要素があれば取り出すようにする。
stk->top++;//一つ下に移動(=一つ後に移動)
stk->count--;
}
}
void print_stack(stack *stk){
char *c;
int i;
c = stk->bottom-1;//配列の一番下のポインタを指定する。
for(i = stk->count-1; i>-1; i--){//スタック内の文字数分操作
printf("%c", *c--);//出力したら一つ上にあげる。
}
}
stack stk;
int main(void){
char sentence[SIZE];
int i;
initialize(&stk);
scanf("%s", sentence);
for(i=0; i<SIZE; i++){
if(sentence[i] == '0' || sentence[i] == '1'){
push(&stk, sentence[i]);//B以外はpush
}
else if(sentence[i] == 'B'){
pop(&stk);//Bがでたらpop
}
else{
continue;
}
}
print_stack(&stk);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318910/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318910/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.stack = type { i32, i32, [15 x i8], ptr, ptr }
@stderr = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [31 x i8] c"Error: Stack overflow. (s=%c)\0A\00", align 1
@stk = dso_local global %struct.stack zeroinitializer, align 8
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @initialize(ptr noundef %stk) local_unnamed_addr #0 {
entry:
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
store i32 0, ptr %count, align 4, !tbaa !5
store i32 15, ptr %stk, align 8, !tbaa !11
%arrayidx = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 2, i64 15
%top = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
store ptr %arrayidx, ptr %top, align 8, !tbaa !12
%bottom = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 4
store ptr %arrayidx, ptr %bottom, align 8, !tbaa !13
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @push(ptr nocapture noundef %stk, i8 noundef signext %s) local_unnamed_addr #1 {
entry:
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
%0 = load i32, ptr %count, align 4, !tbaa !5
%1 = load i32, ptr %stk, align 8, !tbaa !11
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%2 = load ptr, ptr @stderr, align 8, !tbaa !14
%conv = sext i8 %s to i32
%call = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str, i32 noundef %conv) #6
br label %if.end
if.else: ; preds = %entry
%top = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
%3 = load ptr, ptr %top, align 8, !tbaa !12
%incdec.ptr = getelementptr inbounds i8, ptr %3, i64 -1
store ptr %incdec.ptr, ptr %top, align 8, !tbaa !12
store i8 %s, ptr %incdec.ptr, align 1, !tbaa !15
%4 = load i32, ptr %count, align 4, !tbaa !5
%inc = add nsw i32 %4, 1
store i32 %inc, ptr %count, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.else, %if.then
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @pop(ptr nocapture noundef %stk) local_unnamed_addr #3 {
entry:
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
%0 = load i32, ptr %count, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%top = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
%1 = load ptr, ptr %top, align 8, !tbaa !12
%incdec.ptr = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr, ptr %top, align 8, !tbaa !12
%dec = add nsw i32 %0, -1
store i32 %dec, ptr %count, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print_stack(ptr nocapture noundef readonly %stk) local_unnamed_addr #1 {
entry:
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
%0 = load i32, ptr %count, align 4, !tbaa !5
%cmp3 = icmp sgt i32 %0, 0
br i1 %cmp3, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%bottom = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 4
%1 = load ptr, ptr %bottom, align 8, !tbaa !13
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%i.0.in5 = phi i32 [ %i.0, %for.body ], [ %0, %for.body.preheader ]
%.pn4 = phi ptr [ %c.0, %for.body ], [ %1, %for.body.preheader ]
%c.0 = getelementptr inbounds i8, ptr %.pn4, i64 -1
%i.0 = add nsw i32 %i.0.in5, -1
%2 = load i8, ptr %c.0, align 1, !tbaa !15
%conv = sext i8 %2 to i32
%putchar = tail call i32 @putchar(i32 %conv)
%cmp = icmp ugt i32 %i.0.in5, 1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !16
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%sentence = alloca [15 x i8], align 1
call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %sentence) #7
store i32 0, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 1), align 4, !tbaa !5
store i32 15, ptr @stk, align 8, !tbaa !11
store ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 2, i64 15), ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 3), align 8, !tbaa !12
store ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 2, i64 15), ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 4), align 8, !tbaa !13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %sentence)
br label %for.body
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds [15 x i8], ptr %sentence, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !15
switch i8 %0, label %for.inc [
i8 48, label %if.then
i8 49, label %if.then
i8 66, label %if.then15
]
if.then: ; preds = %for.body, %for.body
%1 = load i32, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 1), align 4, !tbaa !5
%2 = load i32, ptr @stk, align 8, !tbaa !11
%cmp.not.i = icmp slt i32 %1, %2
br i1 %cmp.not.i, label %if.else.i, label %if.then.i
if.then.i: ; preds = %if.then
%3 = load ptr, ptr @stderr, align 8, !tbaa !14
%conv.i = zext i8 %0 to i32
%call.i = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %3, ptr noundef nonnull @.str, i32 noundef %conv.i) #6
br label %for.inc
if.else.i: ; preds = %if.then
%4 = load ptr, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 3), align 8, !tbaa !12
%incdec.ptr.i = getelementptr inbounds i8, ptr %4, i64 -1
store ptr %incdec.ptr.i, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 3), align 8, !tbaa !12
store i8 %0, ptr %incdec.ptr.i, align 1, !tbaa !15
%5 = load i32, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 1), align 4, !tbaa !5
%inc.i = add nsw i32 %5, 1
store i32 %inc.i, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 1), align 4, !tbaa !5
br label %for.inc
if.then15: ; preds = %for.body
%6 = load i32, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 1), align 4, !tbaa !5
%cmp.i = icmp sgt i32 %6, 0
br i1 %cmp.i, label %if.then.i23, label %for.inc
if.then.i23: ; preds = %if.then15
%7 = load ptr, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 3), align 8, !tbaa !12
%incdec.ptr.i24 = getelementptr inbounds i8, ptr %7, i64 1
store ptr %incdec.ptr.i24, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 3), align 8, !tbaa !12
%dec.i = add nsw i32 %6, -1
store i32 %dec.i, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 1), align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then.i23, %if.then15, %if.else.i, %if.then.i, %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 15
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !18
for.end: ; preds = %for.inc
%8 = load i32, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 1), align 4, !tbaa !5
%cmp3.i = icmp sgt i32 %8, 0
br i1 %cmp3.i, label %for.body.preheader.i, label %print_stack.exit
for.body.preheader.i: ; preds = %for.end
%9 = load ptr, ptr getelementptr inbounds (%struct.stack, ptr @stk, i64 0, i32 4), align 8, !tbaa !13
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%i.0.in5.i = phi i32 [ %i.0.i, %for.body.i ], [ %8, %for.body.preheader.i ]
%.pn4.i = phi ptr [ %c.0.i, %for.body.i ], [ %9, %for.body.preheader.i ]
%c.0.i = getelementptr inbounds i8, ptr %.pn4.i, i64 -1
%i.0.i = add nsw i32 %i.0.in5.i, -1
%10 = load i8, ptr %c.0.i, align 1, !tbaa !15
%conv.i25 = sext i8 %10 to i32
%putchar.i = call i32 @putchar(i32 %conv.i25)
%cmp.i26 = icmp ugt i32 %i.0.in5.i, 1
br i1 %cmp.i26, label %for.body.i, label %print_stack.exit, !llvm.loop !16
print_stack.exit: ; preds = %for.body.i, %for.end
call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %sentence) #7
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 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind }
attributes #6 = { cold }
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 4}
!6 = !{!"", !7, i64 0, !7, i64 4, !8, i64 8, !10, i64 24, !10, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !10, i64 24}
!13 = !{!6, !10, i64 32}
!14 = !{!10, !10, i64 0}
!15 = !{!8, !8, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
|
/* ex 9_1
nknm */
#include <stdio.h>
#include <stdlib.h>
//スタックに格納するデータの最大数
#define SIZE 100
//スタックの定義
typedef struct stack{
int size;
int count;
char data[SIZE];
char *top;
} stack;
//スタックの初期化
void initialize_stack(stack *stk){
stk->count = 0;
stk->size = SIZE;
stk->top = &(stk->data[SIZE]);
}
//データの追加
void push(stack *stk, char elem){
if(stk->count >= stk->size){ //sizeを超えたpushはエラー
fprintf(stderr, "Error: stack overflow. (x=%c)\n", elem);
exit(1);
}
else{ //topを1つ上にあげて文字を追加、カウントを1プラス
stk->top--;
*(stk->top) = elem;
stk->count++;
}
}
//データの取り出し
void pop(stack *stk){
if(stk->count > 0){ //要素がある場合のみ有効、topを1つ下げてカウントを1マイナス
stk->top++;
stk->count--;
}
}
void print_stack(stack *stk){ //スタックの中身を古いほうからプリント
int i = 0;
char *ptr;
ptr = stk->top;
while(i < stk->count - 1){ //ポインタを最も古い要素に動かす
ptr++;
i++;
}
for(i = 0; i < stk->count; i++){ //1文字出力するごとにポインタを1つ上に動かす
printf("%c", *ptr--);
}
printf("\n");
}
int main(void){
stack stk;
char imput[SIZE];
int i;
scanf("%s", imput);
//スタックを初期化(ポインタ渡しで関数にわたすこと)
initialize_stack(&stk);
//スタックにデータを追加
for(i = 0; imput[i] != '\0'; i++){
if(imput[i] == '0'){
push(&stk, '0');
}else if(imput[i] == '1'){
push(&stk, '1');
//スタックからデータを取り出す
}else if(imput[i] == 'B'){
pop(&stk);
}
}
print_stack(&stk);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_318954/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_318954/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.stack = type { i32, i32, [100 x i8], ptr }
@stderr = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [31 x i8] c"Error: stack overflow. (x=%c)\0A\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @initialize_stack(ptr noundef %stk) local_unnamed_addr #0 {
entry:
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
store i32 0, ptr %count, align 4, !tbaa !5
store i32 100, ptr %stk, align 8, !tbaa !11
%arrayidx = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 2, i64 100
%top = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
store ptr %arrayidx, ptr %top, align 8, !tbaa !12
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @push(ptr nocapture noundef %stk, i8 noundef signext %elem) local_unnamed_addr #1 {
entry:
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
%0 = load i32, ptr %count, align 4, !tbaa !5
%1 = load i32, ptr %stk, align 8, !tbaa !11
%cmp.not = icmp slt i32 %0, %1
br i1 %cmp.not, label %if.else, label %if.then
if.then: ; preds = %entry
%2 = load ptr, ptr @stderr, align 8, !tbaa !13
%conv = sext i8 %elem to i32
%call = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str, i32 noundef %conv) #8
tail call void @exit(i32 noundef 1) #9
unreachable
if.else: ; preds = %entry
%top = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
%3 = load ptr, ptr %top, align 8, !tbaa !12
%incdec.ptr = getelementptr inbounds i8, ptr %3, i64 -1
store ptr %incdec.ptr, ptr %top, align 8, !tbaa !12
store i8 %elem, ptr %incdec.ptr, align 1, !tbaa !14
%4 = load i32, ptr %count, align 4, !tbaa !5
%inc = add nsw i32 %4, 1
store i32 %inc, ptr %count, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @pop(ptr nocapture noundef %stk) local_unnamed_addr #4 {
entry:
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
%0 = load i32, ptr %count, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%top = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
%1 = load ptr, ptr %top, align 8, !tbaa !12
%incdec.ptr = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr, ptr %top, align 8, !tbaa !12
%dec = add nsw i32 %0, -1
store i32 %dec, ptr %count, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @print_stack(ptr nocapture noundef readonly %stk) local_unnamed_addr #5 {
entry:
%top = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
%0 = load ptr, ptr %top, align 8, !tbaa !12
%count = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
%1 = load i32, ptr %count, align 4, !tbaa !5
%cmp13 = icmp sgt i32 %1, 1
br i1 %cmp13, label %for.cond.preheader.thread, label %for.cond.preheader
for.cond.preheader.thread: ; preds = %entry
%2 = add nsw i32 %1, -2
%3 = zext i32 %2 to i64
%4 = getelementptr i8, ptr %0, i64 %3
%scevgep = getelementptr i8, ptr %4, i64 1
br label %for.body.preheader
for.cond.preheader: ; preds = %entry
%cmp216 = icmp eq i32 %1, 1
br i1 %cmp216, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %for.cond.preheader.thread, %for.cond.preheader
%ptr.118.ph = phi ptr [ %0, %for.cond.preheader ], [ %scevgep, %for.cond.preheader.thread ]
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%ptr.118 = phi ptr [ %incdec.ptr3, %for.body ], [ %ptr.118.ph, %for.body.preheader ]
%i.117 = phi i32 [ %inc4, %for.body ], [ 0, %for.body.preheader ]
%incdec.ptr3 = getelementptr inbounds i8, ptr %ptr.118, i64 -1
%5 = load i8, ptr %ptr.118, align 1, !tbaa !14
%conv = sext i8 %5 to i32
%putchar12 = tail call i32 @putchar(i32 %conv)
%inc4 = add nuw nsw i32 %i.117, 1
%6 = load i32, ptr %count, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc4, %6
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !15
for.end: ; preds = %for.body, %for.cond.preheader
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #6
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%stk = alloca %struct.stack, align 8
%imput = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %stk) #10
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %imput) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %imput)
%count.i = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 1
store i32 0, ptr %count.i, align 4, !tbaa !5
store i32 100, ptr %stk, align 8, !tbaa !11
%arrayidx.i = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 2, i64 100
%top.i = getelementptr inbounds %struct.stack, ptr %stk, i64 0, i32 3
store ptr %arrayidx.i, ptr %top.i, align 8, !tbaa !12
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%0 = phi i32 [ %11, %for.inc ], [ 0, %entry ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %imput, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !14
switch i8 %1, label %for.inc [
i8 0, label %for.end
i8 48, label %if.then
i8 49, label %if.then12
i8 66, label %if.then19
]
if.then: ; preds = %for.cond
%2 = load i32, ptr %stk, align 8, !tbaa !11
%cmp.not.i = icmp slt i32 %0, %2
br i1 %cmp.not.i, label %push.exit, label %if.then.i
if.then.i: ; preds = %if.then
%3 = load ptr, ptr @stderr, align 8, !tbaa !13
%call.i = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %3, ptr noundef nonnull @.str, i32 noundef 48) #8
call void @exit(i32 noundef 1) #9
unreachable
push.exit: ; preds = %if.then
%4 = load ptr, ptr %top.i, align 8, !tbaa !12
%incdec.ptr.i = getelementptr inbounds i8, ptr %4, i64 -1
store ptr %incdec.ptr.i, ptr %top.i, align 8, !tbaa !12
store i8 48, ptr %incdec.ptr.i, align 1, !tbaa !14
%5 = load i32, ptr %count.i, align 4, !tbaa !5
%inc.i = add nsw i32 %5, 1
br label %for.inc.sink.split
if.then12: ; preds = %for.cond
%6 = load i32, ptr %stk, align 8, !tbaa !11
%cmp.not.i29 = icmp slt i32 %0, %6
br i1 %cmp.not.i29, label %push.exit35, label %if.then.i30
if.then.i30: ; preds = %if.then12
%7 = load ptr, ptr @stderr, align 8, !tbaa !13
%call.i31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %7, ptr noundef nonnull @.str, i32 noundef 49) #8
call void @exit(i32 noundef 1) #9
unreachable
push.exit35: ; preds = %if.then12
%8 = load ptr, ptr %top.i, align 8, !tbaa !12
%incdec.ptr.i33 = getelementptr inbounds i8, ptr %8, i64 -1
store ptr %incdec.ptr.i33, ptr %top.i, align 8, !tbaa !12
store i8 49, ptr %incdec.ptr.i33, align 1, !tbaa !14
%9 = load i32, ptr %count.i, align 4, !tbaa !5
%inc.i34 = add nsw i32 %9, 1
br label %for.inc.sink.split
if.then19: ; preds = %for.cond
%cmp.i = icmp sgt i32 %0, 0
br i1 %cmp.i, label %if.then.i37, label %for.inc
if.then.i37: ; preds = %if.then19
%10 = load ptr, ptr %top.i, align 8, !tbaa !12
%incdec.ptr.i39 = getelementptr inbounds i8, ptr %10, i64 1
store ptr %incdec.ptr.i39, ptr %top.i, align 8, !tbaa !12
%dec.i = add nsw i32 %0, -1
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %push.exit35, %push.exit, %if.then.i37
%dec.i.sink = phi i32 [ %dec.i, %if.then.i37 ], [ %inc.i, %push.exit ], [ %inc.i34, %push.exit35 ]
store i32 %dec.i.sink, ptr %count.i, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %if.then19, %for.cond
%11 = phi i32 [ %0, %if.then19 ], [ %0, %for.cond ], [ %dec.i.sink, %for.inc.sink.split ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !17
for.end: ; preds = %for.cond
%12 = load ptr, ptr %top.i, align 8, !tbaa !12
%cmp13.i = icmp sgt i32 %0, 1
br i1 %cmp13.i, label %for.cond.preheader.thread.i, label %for.cond.preheader.i
for.cond.preheader.thread.i: ; preds = %for.end
%13 = add nsw i32 %0, -2
%14 = zext i32 %13 to i64
%15 = getelementptr i8, ptr %12, i64 %14
%scevgep.i = getelementptr i8, ptr %15, i64 1
br label %for.body.i.preheader
for.cond.preheader.i: ; preds = %for.end
%cmp216.i = icmp eq i32 %0, 1
br i1 %cmp216.i, label %for.body.i.preheader, label %print_stack.exit
for.body.i.preheader: ; preds = %for.cond.preheader.i, %for.cond.preheader.thread.i
%ptr.118.i.ph = phi ptr [ %12, %for.cond.preheader.i ], [ %scevgep.i, %for.cond.preheader.thread.i ]
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%ptr.118.i = phi ptr [ %incdec.ptr3.i, %for.body.i ], [ %ptr.118.i.ph, %for.body.i.preheader ]
%i.117.i = phi i32 [ %inc4.i, %for.body.i ], [ 0, %for.body.i.preheader ]
%incdec.ptr3.i = getelementptr inbounds i8, ptr %ptr.118.i, i64 -1
%16 = load i8, ptr %ptr.118.i, align 1, !tbaa !14
%conv.i = sext i8 %16 to i32
%putchar12.i = call i32 @putchar(i32 %conv.i)
%inc4.i = add nuw nsw i32 %i.117.i, 1
%17 = load i32, ptr %count.i, align 4, !tbaa !5
%cmp2.i = icmp slt i32 %inc4.i, %17
br i1 %cmp2.i, label %for.body.i, label %print_stack.exit, !llvm.loop !15
print_stack.exit: ; preds = %for.body.i, %for.cond.preheader.i
%putchar.i = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %imput) #10
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %stk) #10
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 @putchar(i32 noundef) local_unnamed_addr #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nofree nounwind }
attributes #8 = { cold }
attributes #9 = { noreturn nounwind }
attributes #10 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE 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 4}
!6 = !{!"stack", !7, i64 0, !7, i64 4, !8, i64 8, !10, i64 112}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !10, i64 112}
!13 = !{!10, !10, i64 0}
!14 = !{!8, !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
|
#include <stdio.h>
int main() {
char s[15]={'\0'};
char ans[15]={'\0'};
int i=0,p=0;
scanf("%s",s);
while(s[i]!='\0'){
switch (s[i]) {
case '0':
ans[p++]='0';
break;
case '1':
ans[p++]='1';
break;
case 'B':
if(p>0) ans[--p]='\0';
break;
default:
break;
}
i++;
}
printf("%s\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319003/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319003/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [15 x i8], align 1
%ans = alloca [15 x i8], align 1
call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %s) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) %s, i8 0, i64 15, i1 false)
call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %ans) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(15) %ans, i8 0, i64 15, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%0 = load i8, ptr %s, align 1, !tbaa !5
%cmp.not24 = icmp eq i8 %0, 0
br i1 %cmp.not24, label %while.end, label %while.body
while.body: ; preds = %entry, %sw.epilog
%indvars.iv = phi i64 [ %indvars.iv.next, %sw.epilog ], [ 0, %entry ]
%1 = phi i8 [ %2, %sw.epilog ], [ %0, %entry ]
%p.026 = phi i32 [ %p.1, %sw.epilog ], [ 0, %entry ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.epilog [
i32 48, label %sw.bb
i32 49, label %sw.bb7
i32 66, label %sw.bb11
]
sw.bb: ; preds = %while.body
%inc = add nsw i32 %p.026, 1
%idxprom5 = sext i32 %p.026 to i64
br label %sw.epilog.sink.split
sw.bb7: ; preds = %while.body
%inc8 = add nsw i32 %p.026, 1
%idxprom9 = sext i32 %p.026 to i64
br label %sw.epilog.sink.split
sw.bb11: ; preds = %while.body
%cmp12 = icmp sgt i32 %p.026, 0
br i1 %cmp12, label %if.then, label %sw.epilog
if.then: ; preds = %sw.bb11
%dec = add nsw i32 %p.026, -1
%idxprom14 = zext i32 %dec to i64
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb7, %if.then
%idxprom14.sink = phi i64 [ %idxprom14, %if.then ], [ %idxprom9, %sw.bb7 ], [ %idxprom5, %sw.bb ]
%.sink = phi i8 [ 0, %if.then ], [ 49, %sw.bb7 ], [ 48, %sw.bb ]
%p.1.ph = phi i32 [ %dec, %if.then ], [ %inc8, %sw.bb7 ], [ %inc, %sw.bb ]
%arrayidx15 = getelementptr inbounds [15 x i8], ptr %ans, i64 0, i64 %idxprom14.sink
store i8 %.sink, ptr %arrayidx15, align 1, !tbaa !5
br label %sw.epilog
sw.epilog: ; preds = %sw.epilog.sink.split, %while.body, %sw.bb11
%p.1 = phi i32 [ %p.026, %while.body ], [ %p.026, %sw.bb11 ], [ %p.1.ph, %sw.epilog.sink.split ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [15 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %2, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8
while.end: ; preds = %sw.epilog, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %ans)
call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %ans) #5
call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
char s[20];
char ans[20];
int ans_i=0;
scanf("%s",s);
int cnt=0;
for(int i=0;s[i]!='\0';i++){
if(s[i]=='0'){
ans[ans_i++]='0';
}else if(s[i]=='1'){
ans[ans_i++]='1';
}else{
if(ans_i-1>=0)ans_i--;
}
}
ans[ans_i]='\0';
printf("%s\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319054/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319054/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [20 x i8], align 16
%ans = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %ans) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%ans_i.0 = phi i32 [ %ans_i.1, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %if.else18 [
i8 0, label %for.cond.cleanup
i8 48, label %if.then
i8 49, label %if.then14
]
for.cond.cleanup: ; preds = %for.cond
%idxprom25 = sext i32 %ans_i.0 to i64
%arrayidx26 = getelementptr inbounds [20 x i8], ptr %ans, i64 0, i64 %idxprom25
store i8 0, ptr %arrayidx26, align 1, !tbaa !5
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %ans)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %ans) #4
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #4
ret i32 0
if.then: ; preds = %for.cond
%inc = add nsw i32 %ans_i.0, 1
%idxprom7 = sext i32 %ans_i.0 to i64
%arrayidx8 = getelementptr inbounds [20 x i8], ptr %ans, i64 0, i64 %idxprom7
store i8 48, ptr %arrayidx8, align 1, !tbaa !5
br label %for.inc
if.then14: ; preds = %for.cond
%inc15 = add nsw i32 %ans_i.0, 1
%idxprom16 = sext i32 %ans_i.0 to i64
%arrayidx17 = getelementptr inbounds [20 x i8], ptr %ans, i64 0, i64 %idxprom16
store i8 49, ptr %arrayidx17, align 1, !tbaa !5
br label %for.inc
if.else18: ; preds = %for.cond
%cmp19 = icmp sgt i32 %ans_i.0, 0
%dec = sext i1 %cmp19 to i32
%spec.select = add nsw i32 %ans_i.0, %dec
br label %for.inc
for.inc: ; preds = %if.else18, %if.then, %if.then14
%ans_i.1 = phi i32 [ %inc, %if.then ], [ %inc15, %if.then14 ], [ %spec.select, %if.else18 ]
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %for.cond, !llvm.loop !8
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
char s[99];
int main(){
int cnt=0;
while(1){
char c=getchar();
if(c==10)break;
if(c=='B'){
if(cnt>0)s[--cnt]=0;
}else{
s[cnt++]=c;
}
}
puts(s);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319098/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319098/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@s = dso_local global [99 x i8] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
br label %while.cond.outer
while.cond.outer: ; preds = %cleanup.sink.split, %entry
%cnt.0.ph = phi i32 [ %cnt.2.ph, %cleanup.sink.split ], [ 0, %entry ]
%cmp7 = icmp sgt i32 %cnt.0.ph, 0
br label %while.cond
while.cond: ; preds = %while.cond.outer, %if.then6
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call i32 @getc(ptr noundef %0)
%sext = shl i32 %call.i, 24
switch i32 %sext, label %if.else [
i32 167772160, label %while.end
i32 1107296256, label %if.then6
]
if.then6: ; preds = %while.cond
br i1 %cmp7, label %if.then9, label %while.cond
if.then9: ; preds = %if.then6
%dec = add nsw i32 %cnt.0.ph, -1
%idxprom = zext i32 %dec to i64
br label %cleanup.sink.split
if.else: ; preds = %while.cond
%conv = trunc i32 %call.i to i8
%inc = add nsw i32 %cnt.0.ph, 1
%idxprom11 = sext i32 %cnt.0.ph to i64
br label %cleanup.sink.split
cleanup.sink.split: ; preds = %if.then9, %if.else
%idxprom11.sink = phi i64 [ %idxprom11, %if.else ], [ %idxprom, %if.then9 ]
%conv.sink = phi i8 [ %conv, %if.else ], [ 0, %if.then9 ]
%cnt.2.ph = phi i32 [ %inc, %if.else ], [ %dec, %if.then9 ]
%arrayidx12 = getelementptr inbounds [99 x i8], ptr @s, i64 0, i64 %idxprom11.sink
store i8 %conv.sink, ptr %arrayidx12, align 1, !tbaa !9
br label %while.cond.outer
while.end: ; preds = %while.cond
%call14 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @s)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
char s[12], ans[12]={0};
int j, i = 0;
scanf("%s", s);
for(j = 0; j < strlen(s); j++){
if(s[j] == '0'){
ans[i] = '0';
i++;
}else if(s[j] == '1'){
ans[i] = '1';
i++;
}else if(i != 0){
ans[i-1] = 0;
i--;
}
}
printf("%s\n", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319155/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319155/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [12 x i8], align 1
%ans = alloca [12 x i8], align 1
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %ans) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(12) %ans, i8 0, i64 12, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7
%cmp38.not = icmp eq i64 %call2, 0
br i1 %cmp38.not, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%i.040 = phi i32 [ %i.1, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [12 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %if.else18 [
i8 48, label %if.then
i8 49, label %if.then14
]
if.then: ; preds = %for.body
%idxprom7 = sext i32 %i.040 to i64
%arrayidx8 = getelementptr inbounds [12 x i8], ptr %ans, i64 0, i64 %idxprom7
store i8 48, ptr %arrayidx8, align 1, !tbaa !5
%inc = add nsw i32 %i.040, 1
br label %for.inc
if.then14: ; preds = %for.body
%idxprom15 = sext i32 %i.040 to i64
%arrayidx16 = getelementptr inbounds [12 x i8], ptr %ans, i64 0, i64 %idxprom15
store i8 49, ptr %arrayidx16, align 1, !tbaa !5
%inc17 = add nsw i32 %i.040, 1
br label %for.inc
if.else18: ; preds = %for.body
%cmp19.not = icmp eq i32 %i.040, 0
br i1 %cmp19.not, label %for.inc, label %if.then21
if.then21: ; preds = %if.else18
%sub = add nsw i32 %i.040, -1
%idxprom22 = sext i32 %sub to i64
%arrayidx23 = getelementptr inbounds [12 x i8], ptr %ans, i64 0, i64 %idxprom22
store i8 0, ptr %arrayidx23, align 1, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then, %if.else18, %if.then21, %if.then14
%i.1 = phi i32 [ %inc, %if.then ], [ %inc17, %if.then14 ], [ %sub, %if.then21 ], [ 0, %if.else18 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %call2
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.inc, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %ans)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %ans) #6
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#define min(rhs,lhs) ((rhs)<(lhs)?(rhs):(lhs))
#define iabs(num) ((num) < 0 ? (-(num)):(num))
#include<limits.h>
int main(void){
register int i;
int n,k;
scanf("%d %d",&n,&k);
long x[n];
for(i = 0;i < n;i++)scanf("%ld",&x[i]);
long dist[n-k+1];
for(i = 0;i < n-k+1;i++)dist[i] = iabs(x[i+k-1] - x[i]) + min(iabs(x[i+k-1]),iabs(x[i]));
long ans = LONG_MAX;
for(i = 0;i < n-k+1;i++)ans = min(ans,dist[i]);
printf("%ld",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319212/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319212/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp158 = icmp sgt i32 %3, 0
br i1 %cmp158, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %3, %entry ], [ %4, %for.body ]
%6 = load i32, ptr %k, align 4, !tbaa !5
%sub = sub nsw i32 %.lcssa, %6
%add = add nsw i32 %sub, 1
%7 = zext i32 %add to i64
%vla2 = alloca i64, i64 %7, align 16
%cmp6.not160 = icmp slt i32 %sub, 0
br i1 %cmp6.not160, label %for.end118, label %for.body7.lr.ph
for.body7.lr.ph: ; preds = %for.end
%add8 = add i32 %6, -1
%8 = add i32 %.lcssa, 1
%9 = sub i32 %8, %6
%wide.trip.count = zext i32 %9 to i64
%min.iters.check = icmp ult i32 %9, 6
br i1 %min.iters.check, label %for.body7.preheader, label %vector.scevcheck
vector.scevcheck: ; preds = %for.body7.lr.ph
%10 = add nsw i64 %wide.trip.count, -1
%11 = add i32 %6, -1
%12 = trunc i64 %10 to i32
%13 = add i32 %11, %12
%14 = icmp slt i32 %13, %11
%15 = icmp ugt i64 %10, 4294967295
%16 = or i1 %14, %15
br i1 %16, label %for.body7.preheader, label %vector.ph
vector.ph: ; preds = %vector.scevcheck
%n.vec = and i64 %wide.trip.count, 4294967294
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%offset.idx = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%17 = trunc i64 %offset.idx to i32
%18 = add i32 %add8, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i64, ptr %vla, i64 %19
%wide.load = load <2 x i64>, ptr %20, align 8, !tbaa !11
%21 = getelementptr inbounds i64, ptr %vla, i64 %offset.idx
%wide.load178 = load <2 x i64>, ptr %21, align 16, !tbaa !11
%22 = sub nsw <2 x i64> %wide.load, %wide.load178
%23 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %22, i1 true)
%24 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %wide.load, i1 true)
%25 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %wide.load178, i1 true)
%26 = call <2 x i64> @llvm.umin.v2i64(<2 x i64> %24, <2 x i64> %25)
%27 = add nuw nsw <2 x i64> %23, %26
%28 = getelementptr inbounds i64, ptr %vla2, i64 %offset.idx
store <2 x i64> %27, ptr %28, align 16, !tbaa !11
%index.next = add nuw i64 %offset.idx, 2
%29 = icmp eq i64 %index.next, %n.vec
br i1 %29, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond102.preheader, label %for.body7.preheader
for.body7.preheader: ; preds = %vector.scevcheck, %for.body7.lr.ph, %middle.block
%indvars.iv168.ph = phi i64 [ 0, %vector.scevcheck ], [ 0, %for.body7.lr.ph ], [ %n.vec, %middle.block ]
br label %for.body7
for.cond102.preheader: ; preds = %for.body7, %middle.block
br i1 %cmp6.not160, label %for.end118, label %for.body106.preheader
for.body106.preheader: ; preds = %for.cond102.preheader
%30 = add i32 %.lcssa, 1
%31 = sub i32 %30, %6
%wide.trip.count174 = zext i32 %31 to i64
%min.iters.check181 = icmp ult i32 %9, 4
br i1 %min.iters.check181, label %for.body106.preheader192, label %vector.ph182
vector.ph182: ; preds = %for.body106.preheader
%n.vec184 = and i64 %wide.trip.count, 4294967292
br label %vector.body187
vector.body187: ; preds = %vector.body187, %vector.ph182
%index = phi i64 [ 0, %vector.ph182 ], [ %index.next191, %vector.body187 ]
%vec.phi = phi <2 x i64> [ <i64 9223372036854775807, i64 9223372036854775807>, %vector.ph182 ], [ %34, %vector.body187 ]
%vec.phi188 = phi <2 x i64> [ <i64 9223372036854775807, i64 9223372036854775807>, %vector.ph182 ], [ %35, %vector.body187 ]
%32 = getelementptr inbounds i64, ptr %vla2, i64 %index
%wide.load189 = load <2 x i64>, ptr %32, align 16, !tbaa !11
%33 = getelementptr inbounds i64, ptr %32, i64 2
%wide.load190 = load <2 x i64>, ptr %33, align 16, !tbaa !11
%34 = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load189)
%35 = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi188, <2 x i64> %wide.load190)
%index.next191 = add nuw i64 %index, 4
%36 = icmp eq i64 %index.next191, %n.vec184
br i1 %36, label %middle.block179, label %vector.body187, !llvm.loop !16
middle.block179: ; preds = %vector.body187
%rdx.minmax = call <2 x i64> @llvm.smin.v2i64(<2 x i64> %34, <2 x i64> %35)
%37 = call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n186 = icmp eq i64 %n.vec184, %wide.trip.count
br i1 %cmp.n186, label %for.end118, label %for.body106.preheader192
for.body106.preheader192: ; preds = %for.body106.preheader, %middle.block179
%indvars.iv171.ph = phi i64 [ 0, %for.body106.preheader ], [ %n.vec184, %middle.block179 ]
%ans.0164.ph = phi i64 [ 9223372036854775807, %for.body106.preheader ], [ %37, %middle.block179 ]
br label %for.body106
for.body7: ; preds = %for.body7.preheader, %for.body7
%indvars.iv168 = phi i64 [ %indvars.iv.next169, %for.body7 ], [ %indvars.iv168.ph, %for.body7.preheader ]
%38 = trunc i64 %indvars.iv168 to i32
%sub9 = add i32 %add8, %38
%idxprom10 = sext i32 %sub9 to i64
%arrayidx11 = getelementptr inbounds i64, ptr %vla, i64 %idxprom10
%39 = load i64, ptr %arrayidx11, align 8, !tbaa !11
%arrayidx13 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv168
%40 = load i64, ptr %arrayidx13, align 8, !tbaa !11
%sub14 = sub nsw i64 %39, %40
%cond = call i64 @llvm.abs.i64(i64 %sub14, i1 true)
%cond48 = call i64 @llvm.abs.i64(i64 %39, i1 true)
%cond60 = call i64 @llvm.abs.i64(i64 %40, i1 true)
%spec.select = call i64 @llvm.umin.i64(i64 %cond48, i64 %cond60)
%add96 = add nuw nsw i64 %cond, %spec.select
%arrayidx98 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv168
store i64 %add96, ptr %arrayidx98, align 8, !tbaa !11
%indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
%exitcond.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count
br i1 %exitcond.not, label %for.cond102.preheader, label %for.body7, !llvm.loop !17
for.body106: ; preds = %for.body106.preheader192, %for.body106
%indvars.iv171 = phi i64 [ %indvars.iv.next172, %for.body106 ], [ %indvars.iv171.ph, %for.body106.preheader192 ]
%ans.0164 = phi i64 [ %ans.0., %for.body106 ], [ %ans.0164.ph, %for.body106.preheader192 ]
%arrayidx108 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv171
%41 = load i64, ptr %arrayidx108, align 8, !tbaa !11
%ans.0. = call i64 @llvm.smin.i64(i64 %ans.0164, i64 %41)
%indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
%exitcond175.not = icmp eq i64 %indvars.iv.next172, %wide.trip.count174
br i1 %exitcond175.not, label %for.end118, label %for.body106, !llvm.loop !18
for.end118: ; preds = %for.body106, %middle.block179, %for.end, %for.cond102.preheader
%ans.0.lcssa = phi i64 [ 9223372036854775807, %for.cond102.preheader ], [ 9223372036854775807, %for.end ], [ %37, %middle.block179 ], [ %ans.0., %for.body106 ]
%call119 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 i64 @llvm.abs.i64(i64, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.abs.v2i64(<2 x i64>, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.umin.v2i64(<2 x i64>, <2 x i64>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !14, !15}
!17 = distinct !{!17, !10, !14}
!18 = distinct !{!18, !10, !15, !14}
|
#include <stdlib.h>
#include <stdio.h>
#define min(a,b) a<=b?a:b
int main()
{
int n,k,i;
long long t,ans=11451919810,x[100001];
scanf("%d%d",&n,&k);
for(i=0;i<n;i++){
scanf("%lld",&x[i]);
}
for(i=0;i<=n-k;i++){
if(x[i]>=0){
t=abs(x[i+k-1]); }
else if(x[i+k-1]<0){
t=abs(x[i]);
}else if(x[i]<0&&x[i+k-1]>0){
t=min((-2*x[i]+x[i+k-1]),(2*x[i+k-1]-x[i]));
}
ans=min(ans,t);
}
printf("%lld",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319263/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319263/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%lld\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%x = alloca [100001 x i64], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %x) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp102 = icmp sgt i32 %0, 0
br i1 %cmp102, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %4, %for.body ]
%1 = load i32, ptr %k, align 4, !tbaa !5
%cmp3.not104 = icmp slt i32 %.lcssa, %1
br i1 %cmp3.not104, label %for.end78, label %for.body4.preheader
for.body4.preheader: ; preds = %for.cond2.preheader
%2 = add i32 %.lcssa, 1
%3 = sub i32 %2, %1
%wide.trip.count = zext i32 %3 to i64
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100001 x i64], ptr %x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.body4.preheader, %if.end69
%indvars.iv111 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next112, %if.end69 ]
%ans.0107 = phi i64 [ 11451919810, %for.body4.preheader ], [ %cond75, %if.end69 ]
%t.0106 = phi i64 [ undef, %for.body4.preheader ], [ %t.1, %if.end69 ]
%arrayidx6 = getelementptr inbounds [100001 x i64], ptr %x, i64 0, i64 %indvars.iv111
%6 = load i64, ptr %arrayidx6, align 8, !tbaa !11
%cmp7 = icmp sgt i64 %6, -1
%7 = trunc i64 %indvars.iv111 to i32
%8 = add i32 %7, -1
%sub8 = add i32 %8, %1
%idxprom9 = sext i32 %sub8 to i64
%arrayidx10 = getelementptr inbounds [100001 x i64], ptr %x, i64 0, i64 %idxprom9
%9 = load i64, ptr %arrayidx10, align 8, !tbaa !11
br i1 %cmp7, label %if.then, label %if.else
if.then: ; preds = %for.body4
%conv = trunc i64 %9 to i32
%10 = call i32 @llvm.abs.i32(i32 %conv, i1 true)
%conv11 = zext i32 %10 to i64
br label %if.end69
if.else: ; preds = %for.body4
%cmp16 = icmp slt i64 %9, 0
br i1 %cmp16, label %if.then18, label %land.lhs.true
if.then18: ; preds = %if.else
%conv21 = trunc i64 %6 to i32
%11 = call i32 @llvm.abs.i32(i32 %conv21, i1 true)
%conv22 = zext i32 %11 to i64
br label %if.end69
land.lhs.true: ; preds = %if.else
%cmp32.not = icmp eq i64 %9, 0
br i1 %cmp32.not, label %if.end69, label %if.then34
if.then34: ; preds = %land.lhs.true
%12 = shl i64 %6, 1
%add41 = sub i64 %9, %12
%mul46 = shl nuw nsw i64 %9, 1
%sub49 = sub nsw i64 %mul46, %6
%sub49.add41 = call i64 @llvm.smin.i64(i64 %add41, i64 %sub49)
br label %if.end69
if.end69: ; preds = %if.then18, %if.then34, %land.lhs.true, %if.then
%t.1 = phi i64 [ %conv11, %if.then ], [ %conv22, %if.then18 ], [ %sub49.add41, %if.then34 ], [ %t.0106, %land.lhs.true ]
%cond75 = call i64 @llvm.smin.i64(i64 %ans.0107, i64 %t.1)
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%exitcond.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count
br i1 %exitcond.not, label %for.end78, label %for.body4, !llvm.loop !13
for.end78: ; preds = %if.end69, %for.cond2.preheader
%ans.0.lcssa = phi i64 [ 11451919810, %for.cond2.preheader ], [ %cond75, %if.end69 ]
%call79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void){
int n,i;
char a[100],t[100];
scanf("%d",&n);
scanf("%s",a);
scanf("%s",t);
for(i=0;i<n;i++){
printf("%c%c",a[i],t[i]);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319328/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319328/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%c%c\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 [100 x i8], align 16
%t = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %a, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %1 to i32
%arrayidx5 = getelementptr inbounds [100 x i8], ptr %t, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%conv6 = sext i8 %2 to i32
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv, i32 noundef %conv6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int n;
scanf("%d\n", &n);
char s[n+1];
char t[n+1];
for (int i = 0; i < n; i++) {
scanf("%c", &s[i]);
}
scanf("%s", t);
for (int i = 0; i < n; i++) {
printf("%c%c", s[i], t[i]);
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319371/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319371/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%c%c\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
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%add1 = add nsw i32 %3, 1
%4 = zext i32 %add1 to i64
%vla2 = alloca i8, i64 %4, align 16
%cmp25 = icmp sgt i32 %3, 0
br i1 %cmp25, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %vla2)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp727 = icmp sgt i32 %5, 0
br i1 %cmp727, label %for.body9, label %for.cond.cleanup8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup8: ; preds = %for.body9, %for.cond.cleanup
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body9: ; preds = %for.cond.cleanup, %for.body9
%indvars.iv30 = phi i64 [ %indvars.iv.next31, %for.body9 ], [ 0, %for.cond.cleanup ]
%arrayidx11 = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv30
%8 = load i8, ptr %arrayidx11, align 1, !tbaa !11
%conv = sext i8 %8 to i32
%arrayidx13 = getelementptr inbounds i8, ptr %vla2, i64 %indvars.iv30
%9 = load i8, ptr %arrayidx13, align 1, !tbaa !11
%conv14 = sext i8 %9 to i32
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %conv, i32 noundef %conv14)
%indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp7 = icmp slt i64 %indvars.iv.next31, %11
br i1 %cmp7, label %for.body9, label %for.cond.cleanup8, !llvm.loop !12
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main (void) {
int n;
scanf("%d", &n);
char s[n+1], t[n+1];
scanf("%s%s", s, t);
for ( int i=0; i<n; i++ )
printf("%c%c", s[i], t[i]);
printf("\n");
return EXIT_SUCCESS;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319414/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319414/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%c%c\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
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%add1 = add nsw i32 %3, 1
%4 = zext i32 %add1 to i64
%vla2 = alloca i8, i64 %4, align 16
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla, ptr noundef nonnull %vla2)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %5, 0
br i1 %cmp12, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%6 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %6 to i32
%arrayidx5 = getelementptr inbounds i8, ptr %vla2, i64 %indvars.iv
%7 = load i8, ptr %arrayidx5, align 1, !tbaa !9
%conv6 = sext i8 %7 to i32
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv, i32 noundef %conv6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main()
{
char S[100],T[100];
int N;
int j = 0;
int ai = 0,bi = 0;
scanf("%d",&N);
scanf("%s",S);
scanf("%s",T);
for(int i = 0;i < N*2;i++){
if(i%2 == 0){
printf("%c",S[ai]);
ai++;
}
else if(i%2 == 1){
printf("%c",T[bi]);
bi++;
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319472/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319472/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [100 x i8], align 16
%T = alloca [100 x i8], align 16
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %T) #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)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %T)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %0, 0
br i1 %cmp24, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #4
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.027 = phi i32 [ %inc16, %for.inc ], [ 0, %entry ]
%bi.026 = phi i32 [ %bi.1, %for.inc ], [ 0, %entry ]
%ai.025 = phi i32 [ %ai.1, %for.inc ], [ 0, %entry ]
%rem = and i32 %i.027, 1
%cmp4 = icmp eq i32 %rem, 0
br i1 %cmp4, label %if.then, label %if.then9
if.then: ; preds = %for.body
%idxprom = sext i32 %ai.025 to i64
%arrayidx = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %1 to i32
%putchar22 = call i32 @putchar(i32 %conv)
%inc = add nsw i32 %ai.025, 1
br label %for.inc
if.then9: ; preds = %for.body
%idxprom10 = sext i32 %bi.026 to i64
%arrayidx11 = getelementptr inbounds [100 x i8], ptr %T, i64 0, i64 %idxprom10
%2 = load i8, ptr %arrayidx11, align 1, !tbaa !9
%conv12 = sext i8 %2 to i32
%putchar = call i32 @putchar(i32 %conv12)
%inc14 = add nsw i32 %bi.026, 1
br label %for.inc
for.inc: ; preds = %if.then, %if.then9
%ai.1 = phi i32 [ %inc, %if.then ], [ %ai.025, %if.then9 ]
%bi.1 = phi i32 [ %bi.026, %if.then ], [ %inc14, %if.then9 ]
%inc16 = add nuw nsw i32 %i.027, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%mul = shl nsw i32 %3, 1
%cmp = icmp slt i32 %inc16, %mul
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
int main()
{
int n,i,d;
char str1[102],str2[102],str3[202];
scanf("%d",&n);
d = n * 2;
scanf("%s",str1);
scanf("%s",str2);
for(i=0; i<n; i++)
{
printf("%c",str1[i]);
printf("%c",str2[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319515/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319515/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%str1 = alloca [102 x i8], align 16
%str2 = alloca [102 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %str1) #4
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %str2) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str1)
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str2)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp13 = icmp sgt i32 %0, 0
br i1 %cmp13, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [102 x i8], ptr %str1, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %1 to i32
%putchar = call i32 @putchar(i32 %conv)
%arrayidx6 = getelementptr inbounds [102 x i8], ptr %str2, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%conv7 = sext i8 %2 to i32
%putchar12 = call i32 @putchar(i32 %conv7)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %str2) #4
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %str1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
int main(void){
int n;
scanf("%d",&n);
char s[n],t[n];
char ans[2*n];
scanf("%s%s",s,t);
int i,j;
for(i=0;i<n;i++){
ans[2*i]=s[i];
ans[2*i+1]=t[i];
}
ans[2*n]='\0';
printf("%s",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319559/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319559/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i8, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = zext i32 %3 to i64
%vla1 = alloca i8, i64 %4, align 16
%mul = shl nsw i32 %3, 1
%5 = zext i32 %mul to i64
%vla2 = alloca i8, i64 %5, align 16
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla, ptr noundef nonnull %vla1)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp21 = icmp sgt i32 %6, 0
br i1 %cmp21, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %6 to i64
%min.iters.check = icmp ult i32 %6, 16
br i1 %min.iters.check, label %for.body.preheader30, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967280
%invariant.gep = getelementptr i8, ptr %vla2, i64 -1
%invariant.gep31 = getelementptr i8, ptr %vla2, i64 -1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%7 = getelementptr inbounds i8, ptr %vla, i64 %index
%wide.load = load <8 x i8>, ptr %7, align 16, !tbaa !9
%8 = getelementptr inbounds i8, ptr %7, i64 8
%wide.load26 = load <8 x i8>, ptr %8, align 8, !tbaa !9
%9 = shl nuw nsw i64 %index, 1
%10 = shl i64 %index, 1
%11 = getelementptr inbounds i8, ptr %vla1, i64 %index
%wide.load27 = load <8 x i8>, ptr %11, align 16, !tbaa !9
%12 = getelementptr inbounds i8, ptr %11, i64 8
%wide.load28 = load <8 x i8>, ptr %12, align 8, !tbaa !9
%13 = or i64 %9, 1
%14 = or i64 %10, 17
%gep = getelementptr i8, ptr %invariant.gep, i64 %13
%gep32 = getelementptr i8, ptr %invariant.gep31, i64 %14
%interleaved.vec = shufflevector <8 x i8> %wide.load, <8 x i8> %wide.load27, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %interleaved.vec, ptr %gep, align 16, !tbaa !9
%interleaved.vec29 = shufflevector <8 x i8> %wide.load26, <8 x i8> %wide.load28, <16 x i32> <i32 0, i32 8, i32 1, i32 9, i32 2, i32 10, i32 3, i32 11, i32 4, i32 12, i32 5, i32 13, i32 6, i32 14, i32 7, i32 15>
store <16 x i8> %interleaved.vec29, ptr %gep32, align 16, !tbaa !9
%index.next = add nuw i64 %index, 16
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end, label %for.body.preheader30
for.body.preheader30: ; 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.preheader30, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader30 ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%16 = load i8, ptr %arrayidx, align 1, !tbaa !9
%17 = shl nuw nsw i64 %indvars.iv, 1
%arrayidx6 = getelementptr inbounds i8, ptr %vla2, i64 %17
store i8 %16, ptr %arrayidx6, align 2, !tbaa !9
%arrayidx8 = getelementptr inbounds i8, ptr %vla1, i64 %indvars.iv
%18 = load i8, ptr %arrayidx8, align 1, !tbaa !9
%19 = or i64 %17, 1
%arrayidx11 = getelementptr inbounds i8, ptr %vla2, i64 %19
store i8 %18, ptr %arrayidx11, align 1, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14
for.end: ; preds = %for.body, %middle.block, %entry
%mul12 = shl nsw i32 %6, 1
%idxprom13 = sext i32 %mul12 to i64
%arrayidx14 = getelementptr inbounds i8, ptr %vla2, i64 %idxprom13
store i8 0, ptr %arrayidx14, align 2, !tbaa !9
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef nonnull %vla2)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
|
#include<stdio.h>
int main()
{
int i;
int n;
char s[101];
char t[101];
scanf("%d", &n);
scanf("%s%s", s, t);
for(i = 0; i < n; i++){
printf("%c%c", s[i], t[i]);
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319601/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319601/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%c%c\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%s = alloca [101 x i8], align 16
%t = alloca [101 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %t)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %1 to i32
%arrayidx4 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx4, align 1, !tbaa !9
%conv5 = sext i8 %2 to i32
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %conv, i32 noundef %conv5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !10
for.end: ; preds = %for.body, %entry
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(void){
int i,j, H,W,length,x,y;
char buf[102];
char field[101][101],check[101][101];
while(scanf("%d %d",&H,&W)!=EOF){
if(H==0&&W==0) break;
fgets(buf,sizeof(buf),stdin);
for(i=0;i<H;i++){
for(j=0;j<W;j++) check[i][j]=0;
}
for(i=0;i<H;i++){
fgets(buf,sizeof(buf),stdin);
length=strlen(buf);
buf[length-1]='\0';
for(j=0;j<length;j++) field[i][j]=buf[j];
field[i][j]='\0';
}
x=y=0;
for(;;){
check[x][y]+=1;
if(check[x][y]>1){
printf("LOOP\n");
break;
}
else{
if(field[x][y]=='>') y++;
else if(field[x][y]=='<') y--;
else if(field[x][y]=='^') x--;
else if(field[x][y]=='v') x++;
else if(field[x][y]=='.'){
printf("%d %d\n",y,x);
break;
}
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319652/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319652/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@str = private unnamed_addr constant [5 x i8] c"LOOP\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
%buf = alloca [102 x i8], align 16
%field = alloca [101 x [101 x i8]], align 16
%check = alloca [101 x [101 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #7
call void @llvm.lifetime.start.p0(i64 102, ptr nonnull %buf) #7
call void @llvm.lifetime.start.p0(i64 10201, ptr nonnull %field) #7
call void @llvm.lifetime.start.p0(i64 10201, ptr nonnull %check) #7
%call161 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%cmp.not162 = icmp eq i32 %call161, -1
br i1 %cmp.not162, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%invariant.gep = getelementptr i8, ptr %check, i64 101
%invariant.gep184 = getelementptr i8, ptr %check, i64 202
%invariant.gep186 = getelementptr i8, ptr %check, i64 303
%invariant.gep188 = getelementptr i8, ptr %check, i64 404
%invariant.gep190 = getelementptr i8, ptr %check, i64 505
%invariant.gep192 = getelementptr i8, ptr %check, i64 606
%invariant.gep194 = getelementptr i8, ptr %check, i64 707
br label %while.body
while.body: ; preds = %while.body.preheader, %for.end112
%0 = load i32, ptr %H, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, 0
%1 = load i32, ptr %W, align 4
%cmp2 = icmp eq i32 %1, 0
%or.cond = select i1 %cmp1, i1 %cmp2, i1 false
br i1 %or.cond, label %while.end, label %if.end
if.end: ; preds = %while.body
%2 = load ptr, ptr @stdin, align 8, !tbaa !9
%call3 = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 102, ptr noundef %2)
%3 = load i32, ptr %H, align 4, !tbaa !5
%cmp4149 = icmp sgt i32 %3, 0
br i1 %cmp4149, label %for.cond5.preheader.lr.ph, label %for.cond42.preheader
for.cond5.preheader.lr.ph: ; preds = %if.end
%4 = load i32, ptr %W, align 4, !tbaa !5
%cmp6147 = icmp sgt i32 %4, 0
br i1 %cmp6147, label %for.cond5.preheader.us.preheader, label %for.body15.preheader
for.cond5.preheader.us.preheader: ; preds = %for.cond5.preheader.lr.ph
%5 = zext i32 %4 to i64
%wide.trip.count = zext i32 %3 to i64
%xtraiter = and i64 %wide.trip.count, 7
%6 = icmp ult i32 %3, 8
br i1 %6, label %for.cond13.preheader.unr-lcssa, label %for.cond5.preheader.us.preheader.new
for.cond5.preheader.us.preheader.new: ; preds = %for.cond5.preheader.us.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967288
br label %for.cond5.preheader.us
for.cond5.preheader.us: ; preds = %for.cond5.preheader.us, %for.cond5.preheader.us.preheader.new
%indvar = phi i64 [ 0, %for.cond5.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond5.preheader.us ]
%niter = phi i64 [ 0, %for.cond5.preheader.us.preheader.new ], [ %niter.next.7, %for.cond5.preheader.us ]
%7 = mul nuw nsw i64 %indvar, 101
%scevgep = getelementptr i8, ptr %check, i64 %7
call void @llvm.memset.p0.i64(ptr align 8 %scevgep, i8 0, i64 %5, i1 false), !tbaa !11
%8 = mul nuw i64 %indvar, 101
%gep = getelementptr i8, ptr %invariant.gep, i64 %8
call void @llvm.memset.p0.i64(ptr align 1 %gep, i8 0, i64 %5, i1 false), !tbaa !11
%9 = mul nuw i64 %indvar, 101
%gep185 = getelementptr i8, ptr %invariant.gep184, i64 %9
call void @llvm.memset.p0.i64(ptr align 2 %gep185, i8 0, i64 %5, i1 false), !tbaa !11
%10 = mul nuw i64 %indvar, 101
%gep187 = getelementptr i8, ptr %invariant.gep186, i64 %10
call void @llvm.memset.p0.i64(ptr align 1 %gep187, i8 0, i64 %5, i1 false), !tbaa !11
%11 = mul nuw i64 %indvar, 101
%gep189 = getelementptr i8, ptr %invariant.gep188, i64 %11
call void @llvm.memset.p0.i64(ptr align 4 %gep189, i8 0, i64 %5, i1 false), !tbaa !11
%12 = mul nuw i64 %indvar, 101
%gep191 = getelementptr i8, ptr %invariant.gep190, i64 %12
call void @llvm.memset.p0.i64(ptr align 1 %gep191, i8 0, i64 %5, i1 false), !tbaa !11
%13 = mul nuw i64 %indvar, 101
%gep193 = getelementptr i8, ptr %invariant.gep192, i64 %13
call void @llvm.memset.p0.i64(ptr align 2 %gep193, i8 0, i64 %5, i1 false), !tbaa !11
%14 = mul nuw i64 %indvar, 101
%gep195 = getelementptr i8, ptr %invariant.gep194, i64 %14
call void @llvm.memset.p0.i64(ptr align 1 %gep195, i8 0, i64 %5, i1 false), !tbaa !11
%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.cond13.preheader.unr-lcssa, label %for.cond5.preheader.us, !llvm.loop !12
for.cond13.preheader.unr-lcssa: ; preds = %for.cond5.preheader.us, %for.cond5.preheader.us.preheader
%indvar.unr = phi i64 [ 0, %for.cond5.preheader.us.preheader ], [ %indvar.next.7, %for.cond5.preheader.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond13.preheader, label %for.cond5.preheader.us.epil
for.cond5.preheader.us.epil: ; preds = %for.cond13.preheader.unr-lcssa, %for.cond5.preheader.us.epil
%indvar.epil = phi i64 [ %indvar.next.epil, %for.cond5.preheader.us.epil ], [ %indvar.unr, %for.cond13.preheader.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.cond5.preheader.us.epil ], [ 0, %for.cond13.preheader.unr-lcssa ]
%15 = mul nuw nsw i64 %indvar.epil, 101
%scevgep.epil = getelementptr i8, ptr %check, i64 %15
call void @llvm.memset.p0.i64(ptr align 1 %scevgep.epil, i8 0, i64 %5, i1 false), !tbaa !11
%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.cond13.preheader, label %for.cond5.preheader.us.epil, !llvm.loop !14
for.cond13.preheader: ; preds = %for.cond5.preheader.us.epil, %for.cond13.preheader.unr-lcssa
br i1 %cmp4149, label %for.body15.preheader, label %for.cond42.preheader
for.body15.preheader: ; preds = %for.cond5.preheader.lr.ph, %for.cond13.preheader
br label %for.body15
for.cond42.preheader: ; preds = %for.end34, %if.end, %for.cond13.preheader
%16 = load i8, ptr %check, align 16, !tbaa !11
%add155 = add i8 %16, 1
store i8 %add155, ptr %check, align 16, !tbaa !11
%cmp54156 = icmp sgt i8 %add155, 1
br i1 %cmp54156, label %if.then56, label %if.else
for.body15: ; preds = %for.body15.preheader, %for.end34
%indvar168 = phi i64 [ %indvar.next169, %for.end34 ], [ 0, %for.body15.preheader ]
%17 = load ptr, ptr @stdin, align 8, !tbaa !9
%call17 = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 102, ptr noundef %17)
%call19 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %buf) #8
%conv = trunc i64 %call19 to i32
%sub = shl i64 %call19, 32
%sext = add i64 %sub, -4294967296
%idxprom20 = ashr exact i64 %sext, 32
%arrayidx21 = getelementptr inbounds [102 x i8], ptr %buf, i64 0, i64 %idxprom20
store i8 0, ptr %arrayidx21, align 1, !tbaa !11
%cmp23151 = icmp sgt i32 %conv, 0
br i1 %cmp23151, label %for.body25.lr.ph, label %for.end34
for.body25.lr.ph: ; preds = %for.body15
%18 = mul nuw nsw i64 %indvar168, 101
%scevgep170 = getelementptr i8, ptr %field, i64 %18
%19 = and i64 %call19, 4294967295
call void @llvm.memcpy.p0.p0.i64(ptr align 1 %scevgep170, ptr nonnull align 16 %buf, i64 %19, i1 false), !tbaa !11
br label %for.end34
for.end34: ; preds = %for.body25.lr.ph, %for.body15
%j.1.lcssa = phi i64 [ 0, %for.body15 ], [ %call19, %for.body25.lr.ph ]
%idxprom37 = and i64 %j.1.lcssa, 4294967295
%arrayidx38 = getelementptr inbounds [101 x [101 x i8]], ptr %field, i64 0, i64 %indvar168, i64 %idxprom37
store i8 0, ptr %arrayidx38, align 1, !tbaa !11
%indvar.next169 = add nuw nsw i64 %indvar168, 1
%20 = load i32, ptr %H, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp14 = icmp slt i64 %indvar.next169, %21
br i1 %cmp14, label %for.body15, label %for.cond42.preheader, !llvm.loop !16
if.then56: ; preds = %if.end111, %for.cond42.preheader
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.end112
if.else: ; preds = %for.cond42.preheader, %if.end111
%idxprom45160 = phi i64 [ %idxprom45, %if.end111 ], [ 0, %for.cond42.preheader ]
%idxprom43159 = phi i64 [ %idxprom43, %if.end111 ], [ 0, %for.cond42.preheader ]
%y.0158 = phi i32 [ %y.1, %if.end111 ], [ 0, %for.cond42.preheader ]
%x.0157 = phi i32 [ %x.1, %if.end111 ], [ 0, %for.cond42.preheader ]
%arrayidx61 = getelementptr inbounds [101 x [101 x i8]], ptr %field, i64 0, i64 %idxprom43159, i64 %idxprom45160
%22 = load i8, ptr %arrayidx61, align 1, !tbaa !11
switch i8 %22, label %if.end111 [
i8 62, label %if.then65
i8 60, label %if.then75
i8 94, label %if.then84
i8 118, label %if.then94
i8 46, label %if.then104
]
if.then65: ; preds = %if.else
%inc66 = add nsw i32 %y.0158, 1
br label %if.end111
if.then75: ; preds = %if.else
%dec = add nsw i32 %y.0158, -1
br label %if.end111
if.then84: ; preds = %if.else
%dec85 = add nsw i32 %x.0157, -1
br label %if.end111
if.then94: ; preds = %if.else
%inc95 = add nsw i32 %x.0157, 1
br label %if.end111
if.then104: ; preds = %if.else
%call105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %y.0158, i32 noundef %x.0157)
br label %for.end112
if.end111: ; preds = %if.else, %if.then65, %if.then84, %if.then94, %if.then75
%x.1 = phi i32 [ %x.0157, %if.then65 ], [ %x.0157, %if.then75 ], [ %dec85, %if.then84 ], [ %inc95, %if.then94 ], [ %x.0157, %if.else ]
%y.1 = phi i32 [ %inc66, %if.then65 ], [ %dec, %if.then75 ], [ %y.0158, %if.then84 ], [ %y.0158, %if.then94 ], [ %y.0158, %if.else ]
%idxprom43 = sext i32 %x.1 to i64
%idxprom45 = sext i32 %y.1 to i64
%arrayidx46 = getelementptr inbounds [101 x [101 x i8]], ptr %check, i64 0, i64 %idxprom43, i64 %idxprom45
%23 = load i8, ptr %arrayidx46, align 1, !tbaa !11
%add = add i8 %23, 1
store i8 %add, ptr %arrayidx46, align 1, !tbaa !11
%cmp54 = icmp sgt i8 %add, 1
br i1 %cmp54, label %if.then56, label %if.else
for.end112: ; preds = %if.then104, %if.then56
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !17
while.end: ; preds = %for.end112, %while.body, %entry
call void @llvm.lifetime.end.p0(i64 10201, ptr nonnull %check) #7
call void @llvm.lifetime.end.p0(i64 10201, ptr nonnull %field) #7
call void @llvm.lifetime.end.p0(i64 102, ptr nonnull %buf) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #7
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
; 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) #6
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.unroll.disable"}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
|
#include<stdio.h>
#include<limits.h>
int main()
{
long long int n, i, t;
scanf("%lld", &t);
while(t--)
{
scanf("%lld", &n);
long long int a[n], sum = 0, temp1 = 0, max1 = INT_MIN, flag = 0 , temp2 = 0, max2 = INT_MIN;
for(i = 0; i < n; i++)
{
scanf("%lld", a + i);
sum += a[i];
}
for(i = 0; i < n-1; i++)
{
temp1 += a[i];
if(temp1 > max1)
max1 = temp1;
if(temp1 < 0)
temp1 = 0;
}
for(i = 1; i < n; i++)
{
temp2 += a[i];
if(temp2 > max2)
max2 = temp2;
if(temp2 < 0)
temp2 = 0;
}
if(sum > max1 && sum > max2)
printf("YES\n");
else
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_31971/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_31971/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%t = 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 %t) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%dec71 = add nsw i64 %0, -1
store i64 %dec71, ptr %t, align 8, !tbaa !5
%tobool.not72 = icmp eq i64 %0, 0
br i1 %tobool.not72, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end28
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !5
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i64, i64 %1, align 16
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp57 = icmp sgt i64 %3, 0
br i1 %cmp57, label %for.body, label %for.end28
for.cond3.preheader: ; preds = %for.body
%cmp461 = icmp sgt i64 %8, 1
br i1 %cmp461, label %for.body5.preheader, label %for.end28
for.body5.preheader: ; preds = %for.cond3.preheader
%4 = add i64 %8, -2
%5 = add i64 %8, -1
%xtraiter = and i64 %5, 1
%6 = icmp eq i64 %4, 0
br i1 %6, label %for.cond15.preheader.unr-lcssa, label %for.body5.preheader.new
for.body5.preheader.new: ; preds = %for.body5.preheader
%unroll_iter = and i64 %5, -2
br label %for.body5
for.body: ; preds = %while.body, %for.body
%i.059 = phi i64 [ %inc, %for.body ], [ 0, %while.body ]
%sum.058 = phi i64 [ %add, %for.body ], [ 0, %while.body ]
%add.ptr = getelementptr inbounds i64, ptr %vla, i64 %i.059
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%7 = load i64, ptr %add.ptr, align 8, !tbaa !5
%add = add nsw i64 %7, %sum.058
%inc = add nuw nsw i64 %i.059, 1
%8 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %8
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !9
for.cond15.preheader.unr-lcssa: ; preds = %for.body5, %for.body5.preheader
%spec.select.lcssa.ph = phi i64 [ undef, %for.body5.preheader ], [ %spec.select.1, %for.body5 ]
%i.164.unr = phi i64 [ 0, %for.body5.preheader ], [ %inc13.1, %for.body5 ]
%max1.063.unr = phi i64 [ -2147483648, %for.body5.preheader ], [ %spec.select.1, %for.body5 ]
%temp1.062.unr = phi i64 [ 0, %for.body5.preheader ], [ %spec.store.select.1, %for.body5 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond15.preheader, label %for.body5.epil
for.body5.epil: ; preds = %for.cond15.preheader.unr-lcssa
%arrayidx6.epil = getelementptr inbounds i64, ptr %vla, i64 %i.164.unr
%9 = load i64, ptr %arrayidx6.epil, align 8, !tbaa !5
%add7.epil = add nsw i64 %9, %temp1.062.unr
%spec.select.epil = call i64 @llvm.smax.i64(i64 %add7.epil, i64 %max1.063.unr)
br label %for.cond15.preheader
for.cond15.preheader: ; preds = %for.cond15.preheader.unr-lcssa, %for.body5.epil
%spec.select.lcssa = phi i64 [ %spec.select.lcssa.ph, %for.cond15.preheader.unr-lcssa ], [ %spec.select.epil, %for.body5.epil ]
br i1 %cmp461, label %for.body17.preheader, label %for.end28
for.body17.preheader: ; preds = %for.cond15.preheader
%xtraiter88 = and i64 %5, 1
%10 = icmp eq i64 %4, 0
br i1 %10, label %for.end28.loopexit.unr-lcssa, label %for.body17.preheader.new
for.body17.preheader.new: ; preds = %for.body17.preheader
%unroll_iter91 = and i64 %5, -2
%invariant.gep = getelementptr i64, ptr %vla, i64 1
br label %for.body17
for.body5: ; preds = %for.body5, %for.body5.preheader.new
%i.164 = phi i64 [ 0, %for.body5.preheader.new ], [ %inc13.1, %for.body5 ]
%max1.063 = phi i64 [ -2147483648, %for.body5.preheader.new ], [ %spec.select.1, %for.body5 ]
%temp1.062 = phi i64 [ 0, %for.body5.preheader.new ], [ %spec.store.select.1, %for.body5 ]
%niter = phi i64 [ 0, %for.body5.preheader.new ], [ %niter.next.1, %for.body5 ]
%arrayidx6 = getelementptr inbounds i64, ptr %vla, i64 %i.164
%11 = load i64, ptr %arrayidx6, align 16, !tbaa !5
%add7 = add nsw i64 %11, %temp1.062
%spec.select = call i64 @llvm.smax.i64(i64 %add7, i64 %max1.063)
%spec.store.select = call i64 @llvm.smax.i64(i64 %add7, i64 0)
%inc13 = or i64 %i.164, 1
%arrayidx6.1 = getelementptr inbounds i64, ptr %vla, i64 %inc13
%12 = load i64, ptr %arrayidx6.1, align 8, !tbaa !5
%add7.1 = add nsw i64 %12, %spec.store.select
%spec.select.1 = call i64 @llvm.smax.i64(i64 %add7.1, i64 %spec.select)
%spec.store.select.1 = call i64 @llvm.smax.i64(i64 %add7.1, i64 0)
%inc13.1 = add nuw nsw i64 %i.164, 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.cond15.preheader.unr-lcssa, label %for.body5, !llvm.loop !11
for.body17: ; preds = %for.body17, %for.body17.preheader.new
%max2.069 = phi i64 [ -2147483648, %for.body17.preheader.new ], [ %spec.select56.1, %for.body17 ]
%temp2.068 = phi i64 [ 0, %for.body17.preheader.new ], [ %spec.store.select35.1, %for.body17 ]
%i.267 = phi i64 [ 1, %for.body17.preheader.new ], [ %inc27.1, %for.body17 ]
%niter92 = phi i64 [ 0, %for.body17.preheader.new ], [ %niter92.next.1, %for.body17 ]
%arrayidx18 = getelementptr inbounds i64, ptr %vla, i64 %i.267
%13 = load i64, ptr %arrayidx18, align 8, !tbaa !5
%add19 = add nsw i64 %13, %temp2.068
%spec.select56 = call i64 @llvm.smax.i64(i64 %add19, i64 %max2.069)
%spec.store.select35 = call i64 @llvm.smax.i64(i64 %add19, i64 0)
%gep = getelementptr i64, ptr %invariant.gep, i64 %i.267
%14 = load i64, ptr %gep, align 8, !tbaa !5
%add19.1 = add nsw i64 %14, %spec.store.select35
%spec.select56.1 = call i64 @llvm.smax.i64(i64 %add19.1, i64 %spec.select56)
%spec.store.select35.1 = call i64 @llvm.smax.i64(i64 %add19.1, i64 0)
%inc27.1 = add nuw nsw i64 %i.267, 2
%niter92.next.1 = add i64 %niter92, 2
%niter92.ncmp.1 = icmp eq i64 %niter92.next.1, %unroll_iter91
br i1 %niter92.ncmp.1, label %for.end28.loopexit.unr-lcssa, label %for.body17, !llvm.loop !12
for.end28.loopexit.unr-lcssa: ; preds = %for.body17, %for.body17.preheader
%spec.select56.lcssa.ph = phi i64 [ undef, %for.body17.preheader ], [ %spec.select56.1, %for.body17 ]
%max2.069.unr = phi i64 [ -2147483648, %for.body17.preheader ], [ %spec.select56.1, %for.body17 ]
%temp2.068.unr = phi i64 [ 0, %for.body17.preheader ], [ %spec.store.select35.1, %for.body17 ]
%i.267.unr = phi i64 [ 1, %for.body17.preheader ], [ %inc27.1, %for.body17 ]
%lcmp.mod89.not = icmp eq i64 %xtraiter88, 0
br i1 %lcmp.mod89.not, label %for.end28, label %for.body17.epil
for.body17.epil: ; preds = %for.end28.loopexit.unr-lcssa
%arrayidx18.epil = getelementptr inbounds i64, ptr %vla, i64 %i.267.unr
%15 = load i64, ptr %arrayidx18.epil, align 8, !tbaa !5
%add19.epil = add nsw i64 %15, %temp2.068.unr
%spec.select56.epil = call i64 @llvm.smax.i64(i64 %add19.epil, i64 %max2.069.unr)
br label %for.end28
for.end28: ; preds = %for.body17.epil, %for.end28.loopexit.unr-lcssa, %while.body, %for.cond3.preheader, %for.cond15.preheader
%max1.0.lcssa86 = phi i64 [ %spec.select.lcssa, %for.cond15.preheader ], [ -2147483648, %for.cond3.preheader ], [ -2147483648, %while.body ], [ %spec.select.lcssa, %for.end28.loopexit.unr-lcssa ], [ %spec.select.lcssa, %for.body17.epil ]
%sum.0.lcssa7885 = phi i64 [ %add, %for.cond15.preheader ], [ %add, %for.cond3.preheader ], [ 0, %while.body ], [ %add, %for.end28.loopexit.unr-lcssa ], [ %add, %for.body17.epil ]
%max2.0.lcssa = phi i64 [ -2147483648, %for.cond15.preheader ], [ -2147483648, %for.cond3.preheader ], [ -2147483648, %while.body ], [ %spec.select56.lcssa.ph, %for.end28.loopexit.unr-lcssa ], [ %spec.select56.epil, %for.body17.epil ]
%cmp29 = icmp sgt i64 %sum.0.lcssa7885, %max1.0.lcssa86
%cmp30 = icmp sgt i64 %sum.0.lcssa7885, %max2.0.lcssa
%or.cond = select i1 %cmp29, i1 %cmp30, 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.stackrestore.p0(ptr %2)
%16 = load i64, ptr %t, align 8, !tbaa !5
%dec = add nsw i64 %16, -1
store i64 %dec, ptr %t, align 8, !tbaa !5
%tobool.not = icmp eq i64 %16, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13
while.end: ; preds = %for.end28, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #6
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress 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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { 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 = !{!"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>
int main() {
long long int X, Y;
scanf("%lld%lld", &X, &Y);
int len = 0;
while (X <= Y) {
X *= 2;
len++;
}
printf("%d", len);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319753/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319753/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%X = alloca i64, align 8
%Y = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %X) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Y) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %X, ptr noundef nonnull %Y)
%0 = load i64, ptr %Y, align 8, !tbaa !5
%X.promoted = load i64, ptr %X, align 8, !tbaa !5
%cmp.not4 = icmp sgt i64 %X.promoted, %0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%len.06 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%mul35 = phi i64 [ %mul, %while.body ], [ %X.promoted, %entry ]
%mul = shl nsw i64 %mul35, 1
%inc = add nuw nsw i32 %len.06, 1
%cmp.not = icmp sgt i64 %mul, %0
br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9
while.cond.while.end_crit_edge: ; preds = %while.body
store i64 %mul, ptr %X, align 8, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond.while.end_crit_edge, %entry
%len.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %len.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Y) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %X) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!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(void)
{
long long int min,max,i;
int cnt=0;
scanf("%lld %lld",&min,&max);
i = min;
while(i<=max)
{
cnt++;
i = i * 2;
}
printf("%d\n",cnt);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319797/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319797/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%min = alloca i64, align 8
%max = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %min) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %max) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %min, ptr noundef nonnull %max)
%0 = load i64, ptr %min, align 8, !tbaa !5
%1 = load i64, ptr %max, align 8, !tbaa !5
%cmp.not4 = icmp sgt i64 %0, %1
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%cnt.06 = phi i32 [ %inc, %while.body ], [ 0, %entry ]
%i.05 = phi i64 [ %mul, %while.body ], [ %0, %entry ]
%inc = add nuw nsw i32 %cnt.06, 1
%mul = shl nsw i64 %i.05, 1
%cmp.not = icmp sgt i64 %mul, %1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%cnt.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %max) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %min) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<limits.h>
long long int arr[1100000];
long long int arr1[1100000];
long long int arr2[1100000];
int main ()
{
long long int t,n,max,sum,us,flag,max1,max2;
scanf("%lld", &t);
while (t--)
{
scanf("%lld", &n);
sum=0;
for (int i=0;i<n;i++)
{
scanf("%lld", &arr[i]);
arr1[i]=arr[i];
arr2[i]=arr[i];
sum=sum+arr[i];
}
max1=arr[1];
for (int i=2;i<n;i++)
{
if (arr1[i]<arr1[i]+arr1[i-1])
arr1[i]=arr1[i]+arr1[i-1];
if (max1<arr1[i])
max1=arr1[i];
}
max2=arr[0];
for (int i=1;i<n-1;i++)
{
if (arr2[i]<arr2[i]+arr2[i-1])
arr2[i]=arr2[i]+arr2[i-1];
if (max2<arr2[i])
max2=arr2[i];
}
if (n==1)
printf("NO\n");
else
{
if (max1>=sum || max2>=sum)
printf("NO\n");
else
printf("YES\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_31984/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_31984/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@arr = dso_local global [1100000 x i64] zeroinitializer, align 16
@arr1 = dso_local local_unnamed_addr global [1100000 x i64] zeroinitializer, align 16
@arr2 = dso_local local_unnamed_addr global [1100000 x i64] zeroinitializer, align 16
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i64, ptr %t, align 8, !tbaa !5
%dec150 = add nsw i64 %0, -1
store i64 %dec150, ptr %t, align 8, !tbaa !5
%tobool.not151 = icmp eq i64 %0, 0
br i1 %tobool.not151, label %while.end, label %while.body
while.body: ; preds = %entry, %for.cond.cleanup55
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !5
%cmp135 = icmp sgt i64 %1, 0
br i1 %cmp135, label %for.body, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %while.body
%2 = load i64, ptr getelementptr inbounds ([1100000 x i64], ptr @arr, i64 0, i64 1), align 8, !tbaa !5
br label %for.cond.cleanup19.thread
for.cond.cleanup: ; preds = %for.body
%3 = load i64, ptr getelementptr inbounds ([1100000 x i64], ptr @arr, i64 0, i64 1), align 8, !tbaa !5
%cmp17140 = icmp sgt i64 %8, 2
br i1 %cmp17140, label %for.body20.preheader, label %for.cond.cleanup19.thread
for.body20.preheader: ; preds = %for.cond.cleanup
%.pre = load i64, ptr getelementptr inbounds ([1100000 x i64], ptr @arr1, i64 0, i64 1), align 8, !tbaa !5
%4 = add i64 %8, -2
%5 = add i64 %8, -3
%xtraiter = and i64 %8, 1
%6 = icmp eq i64 %5, 0
br i1 %6, label %for.cond.cleanup19.unr-lcssa, label %for.body20.preheader.new
for.body20.preheader.new: ; preds = %for.body20.preheader
%unroll_iter = and i64 %4, -2
br label %for.body20
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%sum.0136 = phi i64 [ %add, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [1100000 x i64], ptr @arr, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%7 = load i64, ptr %arrayidx, align 8, !tbaa !5
%arrayidx7 = getelementptr inbounds [1100000 x i64], ptr @arr1, i64 0, i64 %indvars.iv
store i64 %7, ptr %arrayidx7, align 8, !tbaa !5
%arrayidx11 = getelementptr inbounds [1100000 x i64], ptr @arr2, i64 0, i64 %indvars.iv
store i64 %7, ptr %arrayidx11, align 8, !tbaa !5
%add = add nsw i64 %7, %sum.0136
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp sgt i64 %8, %indvars.iv.next
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup19.thread: ; preds = %for.cond.cleanup, %for.cond.cleanup.thread
%.lcssa170.ph = phi i64 [ %1, %for.cond.cleanup.thread ], [ %8, %for.cond.cleanup ]
%sum.0.lcssa169.ph = phi i64 [ 0, %for.cond.cleanup.thread ], [ %add, %for.cond.cleanup ]
%max1.0.lcssa.ph = phi i64 [ %2, %for.cond.cleanup.thread ], [ %3, %for.cond.cleanup ]
%9 = load i64, ptr @arr, align 16, !tbaa !5
br label %for.cond.cleanup55
for.cond.cleanup19.unr-lcssa: ; preds = %if.end.1, %for.body20.preheader
%spec.select.lcssa.ph = phi i64 [ undef, %for.body20.preheader ], [ %spec.select.1, %if.end.1 ]
%.unr = phi i64 [ %.pre, %for.body20.preheader ], [ %15, %if.end.1 ]
%indvars.iv154.unr = phi i64 [ 2, %for.body20.preheader ], [ %indvars.iv.next155.1, %if.end.1 ]
%max1.0141.unr = phi i64 [ %3, %for.body20.preheader ], [ %spec.select.1, %if.end.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup19, label %for.body20.epil
for.body20.epil: ; preds = %for.cond.cleanup19.unr-lcssa
%arrayidx22.epil = getelementptr inbounds [1100000 x i64], ptr @arr1, i64 0, i64 %indvars.iv154.unr
%cmp28.epil = icmp sgt i64 %.unr, 0
%.pre163.epil = load i64, ptr %arrayidx22.epil, align 8, !tbaa !5
br i1 %cmp28.epil, label %if.then.epil, label %if.end.epil
if.then.epil: ; preds = %for.body20.epil
%add27.epil = add nsw i64 %.pre163.epil, %.unr
store i64 %add27.epil, ptr %arrayidx22.epil, align 8, !tbaa !5
br label %if.end.epil
if.end.epil: ; preds = %if.then.epil, %for.body20.epil
%10 = phi i64 [ %add27.epil, %if.then.epil ], [ %.pre163.epil, %for.body20.epil ]
%spec.select.epil = call i64 @llvm.smax.i64(i64 %max1.0141.unr, i64 %10)
br label %for.cond.cleanup19
for.cond.cleanup19: ; preds = %for.cond.cleanup19.unr-lcssa, %if.end.epil
%spec.select.lcssa = phi i64 [ %spec.select.lcssa.ph, %for.cond.cleanup19.unr-lcssa ], [ %spec.select.epil, %if.end.epil ]
%11 = load i64, ptr @arr, align 16, !tbaa !5
br i1 %cmp17140, label %for.body56.preheader, label %for.cond.cleanup55
for.body56.preheader: ; preds = %for.cond.cleanup19
%.pre164 = load i64, ptr @arr2, align 16, !tbaa !5
%xtraiter180 = and i64 %8, 1
%12 = icmp eq i64 %5, 0
br i1 %12, label %for.cond.cleanup55.loopexit.unr-lcssa, label %for.body56.preheader.new
for.body56.preheader.new: ; preds = %for.body56.preheader
%unroll_iter184 = and i64 %4, -2
br label %for.body56
for.body20: ; preds = %if.end.1, %for.body20.preheader.new
%13 = phi i64 [ %.pre, %for.body20.preheader.new ], [ %15, %if.end.1 ]
%indvars.iv154 = phi i64 [ 2, %for.body20.preheader.new ], [ %indvars.iv.next155.1, %if.end.1 ]
%max1.0141 = phi i64 [ %3, %for.body20.preheader.new ], [ %spec.select.1, %if.end.1 ]
%niter = phi i64 [ 0, %for.body20.preheader.new ], [ %niter.next.1, %if.end.1 ]
%arrayidx22 = getelementptr inbounds [1100000 x i64], ptr @arr1, i64 0, i64 %indvars.iv154
%cmp28 = icmp sgt i64 %13, 0
%.pre163 = load i64, ptr %arrayidx22, align 16, !tbaa !5
br i1 %cmp28, label %if.then, label %if.end
if.then: ; preds = %for.body20
%add27 = add nsw i64 %.pre163, %13
store i64 %add27, ptr %arrayidx22, align 16, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %for.body20
%14 = phi i64 [ %add27, %if.then ], [ %.pre163, %for.body20 ]
%spec.select = call i64 @llvm.smax.i64(i64 %max1.0141, i64 %14)
%indvars.iv.next155 = or i64 %indvars.iv154, 1
%arrayidx22.1 = getelementptr inbounds [1100000 x i64], ptr @arr1, i64 0, i64 %indvars.iv.next155
%cmp28.1 = icmp sgt i64 %14, 0
%.pre163.1 = load i64, ptr %arrayidx22.1, align 8, !tbaa !5
br i1 %cmp28.1, label %if.then.1, label %if.end.1
if.then.1: ; preds = %if.end
%add27.1 = add nsw i64 %.pre163.1, %14
store i64 %add27.1, ptr %arrayidx22.1, align 8, !tbaa !5
br label %if.end.1
if.end.1: ; preds = %if.then.1, %if.end
%15 = phi i64 [ %add27.1, %if.then.1 ], [ %.pre163.1, %if.end ]
%spec.select.1 = call i64 @llvm.smax.i64(i64 %spec.select, i64 %15)
%indvars.iv.next155.1 = add nuw nsw i64 %indvars.iv154, 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.cleanup19.unr-lcssa, label %for.body20, !llvm.loop !11
for.cond.cleanup55.loopexit.unr-lcssa: ; preds = %if.end76.1, %for.body56.preheader
%spec.select134.lcssa.ph = phi i64 [ undef, %for.body56.preheader ], [ %spec.select134.1, %if.end76.1 ]
%.unr181 = phi i64 [ %.pre164, %for.body56.preheader ], [ %20, %if.end76.1 ]
%indvars.iv158.unr = phi i64 [ 1, %for.body56.preheader ], [ %indvars.iv.next159.1, %if.end76.1 ]
%max2.0146.unr = phi i64 [ %11, %for.body56.preheader ], [ %spec.select134.1, %if.end76.1 ]
%lcmp.mod182.not = icmp eq i64 %xtraiter180, 0
br i1 %lcmp.mod182.not, label %for.cond.cleanup55, label %for.body56.epil
for.body56.epil: ; preds = %for.cond.cleanup55.loopexit.unr-lcssa
%arrayidx58.epil = getelementptr inbounds [1100000 x i64], ptr @arr2, i64 0, i64 %indvars.iv158.unr
%cmp65.epil = icmp sgt i64 %.unr181, 0
%.pre165.epil = load i64, ptr %arrayidx58.epil, align 8, !tbaa !5
br i1 %cmp65.epil, label %if.then67.epil, label %if.end76.epil
if.then67.epil: ; preds = %for.body56.epil
%add64.epil = add nsw i64 %.pre165.epil, %.unr181
store i64 %add64.epil, ptr %arrayidx58.epil, align 8, !tbaa !5
br label %if.end76.epil
if.end76.epil: ; preds = %if.then67.epil, %for.body56.epil
%16 = phi i64 [ %add64.epil, %if.then67.epil ], [ %.pre165.epil, %for.body56.epil ]
%spec.select134.epil = call i64 @llvm.smax.i64(i64 %max2.0146.unr, i64 %16)
br label %for.cond.cleanup55
for.cond.cleanup55: ; preds = %if.end76.epil, %for.cond.cleanup55.loopexit.unr-lcssa, %for.cond.cleanup19.thread, %for.cond.cleanup19
%max1.0.lcssa178 = phi i64 [ %spec.select.lcssa, %for.cond.cleanup19 ], [ %max1.0.lcssa.ph, %for.cond.cleanup19.thread ], [ %spec.select.lcssa, %for.cond.cleanup55.loopexit.unr-lcssa ], [ %spec.select.lcssa, %if.end76.epil ]
%sum.0.lcssa169177 = phi i64 [ %add, %for.cond.cleanup19 ], [ %sum.0.lcssa169.ph, %for.cond.cleanup19.thread ], [ %add, %for.cond.cleanup55.loopexit.unr-lcssa ], [ %add, %if.end76.epil ]
%.lcssa170176 = phi i64 [ %8, %for.cond.cleanup19 ], [ %.lcssa170.ph, %for.cond.cleanup19.thread ], [ %8, %for.cond.cleanup55.loopexit.unr-lcssa ], [ %8, %if.end76.epil ]
%max2.0.lcssa = phi i64 [ %11, %for.cond.cleanup19 ], [ %9, %for.cond.cleanup19.thread ], [ %spec.select134.lcssa.ph, %for.cond.cleanup55.loopexit.unr-lcssa ], [ %spec.select134.epil, %if.end76.epil ]
%cmp88 = icmp eq i64 %.lcssa170176, 1
%cmp92.not = icmp slt i64 %max1.0.lcssa178, %sum.0.lcssa169177
%cmp94.not = icmp slt i64 %max2.0.lcssa, %sum.0.lcssa169177
%or.cond = select i1 %cmp92.not, i1 %cmp94.not, i1 false
%str.str.3 = select i1 %or.cond, ptr @str, ptr @str.4
%str.3.sink = select i1 %cmp88, ptr @str.4, ptr %str.str.3
%puts132 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
%17 = load i64, ptr %t, align 8, !tbaa !5
%dec = add nsw i64 %17, -1
store i64 %dec, ptr %t, align 8, !tbaa !5
%tobool.not = icmp eq i64 %17, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !12
for.body56: ; preds = %if.end76.1, %for.body56.preheader.new
%18 = phi i64 [ %.pre164, %for.body56.preheader.new ], [ %20, %if.end76.1 ]
%indvars.iv158 = phi i64 [ 1, %for.body56.preheader.new ], [ %indvars.iv.next159.1, %if.end76.1 ]
%max2.0146 = phi i64 [ %11, %for.body56.preheader.new ], [ %spec.select134.1, %if.end76.1 ]
%niter185 = phi i64 [ 0, %for.body56.preheader.new ], [ %niter185.next.1, %if.end76.1 ]
%arrayidx58 = getelementptr inbounds [1100000 x i64], ptr @arr2, i64 0, i64 %indvars.iv158
%cmp65 = icmp sgt i64 %18, 0
%.pre165 = load i64, ptr %arrayidx58, align 8, !tbaa !5
br i1 %cmp65, label %if.then67, label %if.end76
if.then67: ; preds = %for.body56
%add64 = add nsw i64 %.pre165, %18
store i64 %add64, ptr %arrayidx58, align 8, !tbaa !5
br label %if.end76
if.end76: ; preds = %if.then67, %for.body56
%19 = phi i64 [ %add64, %if.then67 ], [ %.pre165, %for.body56 ]
%spec.select134 = call i64 @llvm.smax.i64(i64 %max2.0146, i64 %19)
%indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
%arrayidx58.1 = getelementptr inbounds [1100000 x i64], ptr @arr2, i64 0, i64 %indvars.iv.next159
%cmp65.1 = icmp sgt i64 %19, 0
%.pre165.1 = load i64, ptr %arrayidx58.1, align 8, !tbaa !5
br i1 %cmp65.1, label %if.then67.1, label %if.end76.1
if.then67.1: ; preds = %if.end76
%add64.1 = add nsw i64 %.pre165.1, %19
store i64 %add64.1, ptr %arrayidx58.1, align 8, !tbaa !5
br label %if.end76.1
if.end76.1: ; preds = %if.then67.1, %if.end76
%20 = phi i64 [ %add64.1, %if.then67.1 ], [ %.pre165.1, %if.end76 ]
%spec.select134.1 = call i64 @llvm.smax.i64(i64 %spec.select134, i64 %20)
%indvars.iv.next159.1 = add nuw nsw i64 %indvars.iv158, 2
%niter185.next.1 = add i64 %niter185, 2
%niter185.ncmp.1 = icmp eq i64 %niter185.next.1, %unroll_iter184
br i1 %niter185.ncmp.1, label %for.cond.cleanup55.loopexit.unr-lcssa, label %for.body56, !llvm.loop !13
while.end: ; preds = %for.cond.cleanup55, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 8, 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 memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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>
/// dlfcn.h ///
#ifdef __cplusplus
extern "C"{
#endif
#if defined(WIN32) || (!defined(__GNUC__) && !defined(__clang__))
void* LoadLibraryA(const char *x);
void* GetProcAddress(void *x,const char *y);
int FreeLibrary(void *x);
#elif defined(__APPLE__)
void* dlopen(const char *x,int y);
void* dlsym(void *x,const char *y);
int dlclose(void *x);
#define LoadLibraryA(s) dlopen(s,2)
#define GetProcAddress dlsym
#define FreeLibrary dlclose
#else
void* __libc_dlopen_mode(const char *x,int y);
void* __libc_dlsym(void *x,const char *y);
int __libc_dlclose(void *x);
#define LoadLibraryA(s) __libc_dlopen_mode(s,2)
#define GetProcAddress __libc_dlsym
#define FreeLibrary __libc_dlclose
#endif
#ifdef __cplusplus
}
#endif
#include "gmp.h"
typedef void (*type_mpz_init)(mpz_t);
typedef void (*type_mpz_clear)(mpz_t);
typedef void (*type_mpz_out_str)(FILE*,int,mpz_t);
typedef void (*type_mpz_set)(mpz_t,mpz_t);
typedef void (*type_mpz_set_str)(mpz_t,char*,int);
typedef void (*type_mpz_set_si)(mpz_t,long);
typedef int (*type_mpz_cmp)(mpz_t,mpz_t);
typedef int (*type_mpz_cmp_si)(mpz_t,long);
typedef void (*type_mpz_add)(mpz_t,mpz_t,mpz_t);
typedef void (*type_mpz_sub)(mpz_t,mpz_t,mpz_t);
typedef void (*type_mpz_mul)(mpz_t,mpz_t,mpz_t);
typedef void (*type_mpz_tdiv_q)(mpz_t,mpz_t,mpz_t);
typedef void (*type_mpz_tdiv_r)(mpz_t,mpz_t,mpz_t);
typedef void (*type_mpz_add_ui)(mpz_t,mpz_t,long);
typedef void (*type_mpz_sub_ui)(mpz_t,mpz_t,long);
typedef void (*type_mpz_mul_ui)(mpz_t,mpz_t,long);
typedef void (*type_mpz_tdiv_q_ui)(mpz_t,mpz_t,long);
typedef void (*type_mpz_tdiv_r_ui)(mpz_t,mpz_t,long);
type_mpz_init mympz_init;
type_mpz_clear mympz_clear;
type_mpz_out_str mympz_out_str;
type_mpz_set mympz_set;
type_mpz_set_str mympz_set_str;
type_mpz_set_si mympz_set_si;
type_mpz_cmp mympz_cmp;
type_mpz_cmp_si mympz_cmp_si;
type_mpz_add mympz_add;
type_mpz_sub mympz_sub;
type_mpz_mul mympz_mul;
type_mpz_tdiv_q mympz_tdiv_q;
type_mpz_tdiv_r mympz_tdiv_r;
type_mpz_add_ui mympz_add_ui;
type_mpz_sub_ui mympz_sub_ui;
type_mpz_mul_ui mympz_mul_ui;
type_mpz_tdiv_q_ui mympz_tdiv_q_ui;
type_mpz_tdiv_r_ui mympz_tdiv_r_ui;
int main(){
//MacPorts
//void *H=LoadLibraryA("/opt/local/lib/libgmp.dylib");
//ideone
//void *H=LoadLibraryA("/usr/lib/i386-linux-gnu/libgmp.so.10");
//paiza.io/atcoder
//void *H=LoadLibraryA("/usr/lib/x86_64-linux-gnu/libgmp.so.10");
//wandbox/yukicoder
void *H=LoadLibraryA("/usr/lib64/libgmp.so.3");
mympz_init=(type_mpz_init)GetProcAddress(H,"__gmpz_init");
mympz_clear=(type_mpz_clear)GetProcAddress(H,"__gmpz_clear");
mympz_out_str=(type_mpz_out_str)GetProcAddress(H,"__gmpz_out_str");
mympz_set=(type_mpz_set)GetProcAddress(H,"__gmpz_set");
mympz_set_str=(type_mpz_set_str)GetProcAddress(H,"__gmpz_set_str");
mympz_set_si=(type_mpz_set_si)GetProcAddress(H,"__gmpz_set_si");
mympz_cmp=(type_mpz_cmp)GetProcAddress(H,"__gmpz_cmp");
mympz_cmp_si=(type_mpz_cmp_si)GetProcAddress(H,"__gmpz_cmp_si");
mympz_add=(type_mpz_add)GetProcAddress(H,"__gmpz_add");
mympz_sub=(type_mpz_sub)GetProcAddress(H,"__gmpz_sub");
mympz_mul=(type_mpz_mul)GetProcAddress(H,"__gmpz_mul");
mympz_tdiv_q=(type_mpz_tdiv_q)GetProcAddress(H,"__gmpz_tdiv_q");
mympz_tdiv_r=(type_mpz_tdiv_r)GetProcAddress(H,"__gmpz_tdiv_r");
mympz_add_ui=(type_mpz_add_ui)GetProcAddress(H,"__gmpz_add_ui");
mympz_sub_ui=(type_mpz_sub_ui)GetProcAddress(H,"__gmpz_sub_ui");
mympz_mul_ui=(type_mpz_mul_ui)GetProcAddress(H,"__gmpz_mul_ui");
mympz_tdiv_q_ui=(type_mpz_tdiv_q_ui)GetProcAddress(H,"__gmpz_tdiv_q_ui");
mympz_tdiv_r_ui=(type_mpz_tdiv_r_ui)GetProcAddress(H,"__gmpz_tdiv_r_ui");
mpz_t a,b,c;
mympz_init(a);
mympz_init(b);
mympz_init(c);
mympz_set_str(c,"100000000000000000000000000000000000000000000000000000000000000000000000000000000",10);
char A[101],B[101];
int T;
for(scanf("%d",&T);T--;){
scanf("%s%s",A,B);
mympz_set_str(a,A,10);
mympz_set_str(b,B,10);
mympz_add(a,a,b);
if(mympz_cmp(a,c)>=0){
puts("overflow");
}else{
mympz_out_str(stdout,10,a);
puts("");
}
}
mympz_clear(a);
mympz_clear(b);
mympz_clear(c);
FreeLibrary(H);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319890/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319890/source.c"
target datalayout = "e-m:e-p270: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.__mpz_struct = type { i32, i32, ptr }
@.str = private unnamed_addr constant [23 x i8] c"/usr/lib64/libgmp.so.3\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"__gmpz_init\00", align 1
@mympz_init = dso_local local_unnamed_addr global ptr null, align 8
@.str.2 = private unnamed_addr constant [13 x i8] c"__gmpz_clear\00", align 1
@mympz_clear = dso_local local_unnamed_addr global ptr null, align 8
@.str.3 = private unnamed_addr constant [15 x i8] c"__gmpz_out_str\00", align 1
@mympz_out_str = dso_local local_unnamed_addr global ptr null, align 8
@.str.4 = private unnamed_addr constant [11 x i8] c"__gmpz_set\00", align 1
@mympz_set = dso_local local_unnamed_addr global ptr null, align 8
@.str.5 = private unnamed_addr constant [15 x i8] c"__gmpz_set_str\00", align 1
@mympz_set_str = dso_local local_unnamed_addr global ptr null, align 8
@.str.6 = private unnamed_addr constant [14 x i8] c"__gmpz_set_si\00", align 1
@mympz_set_si = dso_local local_unnamed_addr global ptr null, align 8
@.str.7 = private unnamed_addr constant [11 x i8] c"__gmpz_cmp\00", align 1
@mympz_cmp = dso_local local_unnamed_addr global ptr null, align 8
@.str.8 = private unnamed_addr constant [14 x i8] c"__gmpz_cmp_si\00", align 1
@mympz_cmp_si = dso_local local_unnamed_addr global ptr null, align 8
@.str.9 = private unnamed_addr constant [11 x i8] c"__gmpz_add\00", align 1
@mympz_add = dso_local local_unnamed_addr global ptr null, align 8
@.str.10 = private unnamed_addr constant [11 x i8] c"__gmpz_sub\00", align 1
@mympz_sub = dso_local local_unnamed_addr global ptr null, align 8
@.str.11 = private unnamed_addr constant [11 x i8] c"__gmpz_mul\00", align 1
@mympz_mul = dso_local local_unnamed_addr global ptr null, align 8
@.str.12 = private unnamed_addr constant [14 x i8] c"__gmpz_tdiv_q\00", align 1
@mympz_tdiv_q = dso_local local_unnamed_addr global ptr null, align 8
@.str.13 = private unnamed_addr constant [14 x i8] c"__gmpz_tdiv_r\00", align 1
@mympz_tdiv_r = dso_local local_unnamed_addr global ptr null, align 8
@.str.14 = private unnamed_addr constant [14 x i8] c"__gmpz_add_ui\00", align 1
@mympz_add_ui = dso_local local_unnamed_addr global ptr null, align 8
@.str.15 = private unnamed_addr constant [14 x i8] c"__gmpz_sub_ui\00", align 1
@mympz_sub_ui = dso_local local_unnamed_addr global ptr null, align 8
@.str.16 = private unnamed_addr constant [14 x i8] c"__gmpz_mul_ui\00", align 1
@mympz_mul_ui = dso_local local_unnamed_addr global ptr null, align 8
@.str.17 = private unnamed_addr constant [17 x i8] c"__gmpz_tdiv_q_ui\00", align 1
@mympz_tdiv_q_ui = dso_local local_unnamed_addr global ptr null, align 8
@.str.18 = private unnamed_addr constant [17 x i8] c"__gmpz_tdiv_r_ui\00", align 1
@mympz_tdiv_r_ui = dso_local local_unnamed_addr global ptr null, align 8
@.str.19 = private unnamed_addr constant [82 x i8] c"100000000000000000000000000000000000000000000000000000000000000000000000000000000\00", align 1
@.str.20 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.21 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@.str.22 = private unnamed_addr constant [9 x i8] c"overflow\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [1 x %struct.__mpz_struct], align 16
%b = alloca [1 x %struct.__mpz_struct], align 16
%c = alloca [1 x %struct.__mpz_struct], align 16
%A = alloca [101 x i8], align 16
%B = alloca [101 x i8], align 16
%T = alloca i32, align 4
%call = tail call ptr @__libc_dlopen_mode(ptr noundef nonnull @.str, i32 noundef 2) #5
%call1 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.1) #5
store ptr %call1, ptr @mympz_init, align 8, !tbaa !5
%call2 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.2) #5
store ptr %call2, ptr @mympz_clear, align 8, !tbaa !5
%call3 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.3) #5
store ptr %call3, ptr @mympz_out_str, align 8, !tbaa !5
%call4 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.4) #5
store ptr %call4, ptr @mympz_set, align 8, !tbaa !5
%call5 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.5) #5
store ptr %call5, ptr @mympz_set_str, align 8, !tbaa !5
%call6 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.6) #5
store ptr %call6, ptr @mympz_set_si, align 8, !tbaa !5
%call7 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.7) #5
store ptr %call7, ptr @mympz_cmp, align 8, !tbaa !5
%call8 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.8) #5
store ptr %call8, ptr @mympz_cmp_si, align 8, !tbaa !5
%call9 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.9) #5
store ptr %call9, ptr @mympz_add, align 8, !tbaa !5
%call10 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.10) #5
store ptr %call10, ptr @mympz_sub, align 8, !tbaa !5
%call11 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.11) #5
store ptr %call11, ptr @mympz_mul, align 8, !tbaa !5
%call12 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.12) #5
store ptr %call12, ptr @mympz_tdiv_q, align 8, !tbaa !5
%call13 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.13) #5
store ptr %call13, ptr @mympz_tdiv_r, align 8, !tbaa !5
%call14 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.14) #5
store ptr %call14, ptr @mympz_add_ui, align 8, !tbaa !5
%call15 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.15) #5
store ptr %call15, ptr @mympz_sub_ui, align 8, !tbaa !5
%call16 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.16) #5
store ptr %call16, ptr @mympz_mul_ui, align 8, !tbaa !5
%call17 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.17) #5
store ptr %call17, ptr @mympz_tdiv_q_ui, align 8, !tbaa !5
%call18 = tail call ptr @__libc_dlsym(ptr noundef %call, ptr noundef nonnull @.str.18) #5
store ptr %call18, ptr @mympz_tdiv_r_ui, align 8, !tbaa !5
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %c) #5
%0 = load ptr, ptr @mympz_init, align 8, !tbaa !5
call void %0(ptr noundef nonnull %a) #5
%1 = load ptr, ptr @mympz_init, align 8, !tbaa !5
call void %1(ptr noundef nonnull %b) #5
%2 = load ptr, ptr @mympz_init, align 8, !tbaa !5
call void %2(ptr noundef nonnull %c) #5
%3 = load ptr, ptr @mympz_set_str, align 8, !tbaa !5
call void %3(ptr noundef nonnull %c, ptr noundef nonnull @.str.19, i32 noundef 10) #5
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %T) #5
%call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.20, ptr noundef nonnull %T)
%4 = load i32, ptr %T, align 4, !tbaa !9
%dec61 = add nsw i32 %4, -1
store i32 %dec61, ptr %T, align 4, !tbaa !9
%tobool.not62 = icmp eq i32 %4, 0
br i1 %tobool.not62, label %for.end, label %for.body
for.body: ; preds = %entry, %if.end
%call25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.21, ptr noundef nonnull %A, ptr noundef nonnull %B)
%5 = load ptr, ptr @mympz_set_str, align 8, !tbaa !5
call void %5(ptr noundef nonnull %a, ptr noundef nonnull %A, i32 noundef 10) #5
%6 = load ptr, ptr @mympz_set_str, align 8, !tbaa !5
call void %6(ptr noundef nonnull %b, ptr noundef nonnull %B, i32 noundef 10) #5
%7 = load ptr, ptr @mympz_add, align 8, !tbaa !5
call void %7(ptr noundef nonnull %a, ptr noundef nonnull %a, ptr noundef nonnull %b) #5
%8 = load ptr, ptr @mympz_cmp, align 8, !tbaa !5
%call35 = call i32 %8(ptr noundef nonnull %a, ptr noundef nonnull %c) #5
%cmp = icmp sgt i32 %call35, -1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %for.body
%call36 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.22)
br label %if.end
if.else: ; preds = %for.body
%9 = load ptr, ptr @mympz_out_str, align 8, !tbaa !5
%10 = load ptr, ptr @stdout, align 8, !tbaa !5
call void %9(ptr noundef %10, i32 noundef 10, ptr noundef nonnull %a) #5
%putchar = call i32 @putchar(i32 10)
br label %if.end
if.end: ; preds = %if.else, %if.then
%11 = load i32, ptr %T, align 4, !tbaa !9
%dec = add nsw i32 %11, -1
store i32 %dec, ptr %T, align 4, !tbaa !9
%tobool.not = icmp eq i32 %11, 0
br i1 %tobool.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %if.end, %entry
%12 = load ptr, ptr @mympz_clear, align 8, !tbaa !5
call void %12(ptr noundef nonnull %a) #5
%13 = load ptr, ptr @mympz_clear, align 8, !tbaa !5
call void %13(ptr noundef nonnull %b) #5
%14 = load ptr, ptr @mympz_clear, align 8, !tbaa !5
call void %14(ptr noundef nonnull %c) #5
%call42 = call i32 @__libc_dlclose(ptr noundef %call) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
declare ptr @__libc_dlopen_mode(ptr noundef, i32 noundef) local_unnamed_addr #2
declare ptr @__libc_dlsym(ptr noundef, ptr noundef) local_unnamed_addr #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
declare i32 @__libc_dlclose(ptr noundef) local_unnamed_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 #4
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
char A[999],B[999],C[999];
int a,b,c,va,vb,v;
int main(){
scanf("%*d");
while(~scanf("%s%s",A,B)){
a=strlen(A),b=strlen(B);
while(a|b|v){
va=(a?A[--a]-'0':0);
vb=(b?B[--b]-'0':0);
v+=va+vb;
C[c++]=v%10+'0';
v/=10;
}
if(c>80)
puts("overflow");
else{
for(;c--;)
putchar(C[c]);
puts("");
}
c=0;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319933/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319933/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%*d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@A = dso_local global [999 x i8] zeroinitializer, align 16
@B = dso_local global [999 x i8] zeroinitializer, align 16
@a = dso_local local_unnamed_addr global i32 0, align 4
@b = dso_local local_unnamed_addr global i32 0, align 4
@v = dso_local local_unnamed_addr global i32 0, align 4
@va = dso_local local_unnamed_addr global i32 0, align 4
@vb = dso_local local_unnamed_addr global i32 0, align 4
@C = dso_local local_unnamed_addr global [999 x i8] zeroinitializer, align 16
@c = dso_local local_unnamed_addr global i32 0, align 4
@.str.2 = private unnamed_addr constant [9 x i8] c"overflow\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str)
%call155 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @A, ptr noundef nonnull @B)
%tobool.not56 = icmp eq i32 %call155, -1
br i1 %tobool.not56, label %while.end35, label %while.body
while.body: ; preds = %entry, %if.end
%call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @A) #3
%conv = trunc i64 %call2 to i32
store i32 %conv, ptr @a, align 4, !tbaa !5
%call3 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @B) #3
%conv4 = trunc i64 %call3 to i32
store i32 %conv4, ptr @b, align 4, !tbaa !5
%v.promoted = load i32, ptr @v, align 4, !tbaa !5
%c.promoted = load i32, ptr @c, align 4, !tbaa !5
%0 = or i32 %conv, %conv4
%or646 = or i32 %0, %v.promoted
%tobool7.not47 = icmp eq i32 %or646, 0
br i1 %tobool7.not47, label %while.end, label %while.body8.preheader
while.body8.preheader: ; preds = %while.body
%1 = sext i32 %c.promoted to i64
br label %while.body8
while.body8: ; preds = %while.body8.preheader, %cond.end19
%indvars.iv = phi i64 [ %1, %while.body8.preheader ], [ %indvars.iv.next, %cond.end19 ]
%div4051 = phi i32 [ %v.promoted, %while.body8.preheader ], [ %div, %cond.end19 ]
%.pr4150 = phi i32 [ %conv, %while.body8.preheader ], [ %.pr42, %cond.end19 ]
%.pr384349 = phi i32 [ %conv4, %while.body8.preheader ], [ %.pr3844, %cond.end19 ]
%tobool9.not = icmp eq i32 %.pr4150, 0
br i1 %tobool9.not, label %cond.end, label %cond.true
cond.true: ; preds = %while.body8
%dec = add nsw i32 %.pr4150, -1
store i32 %dec, ptr @a, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [999 x i8], ptr @A, i64 0, i64 %idxprom
%2 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv10 = sext i8 %2 to i32
%sub = add nsw i32 %conv10, -48
br label %cond.end
cond.end: ; preds = %while.body8, %cond.true
%.pr42 = phi i32 [ %dec, %cond.true ], [ 0, %while.body8 ]
%cond = phi i32 [ %sub, %cond.true ], [ 0, %while.body8 ]
%tobool11.not = icmp eq i32 %.pr384349, 0
br i1 %tobool11.not, label %cond.end19, label %cond.true12
cond.true12: ; preds = %cond.end
%dec13 = add nsw i32 %.pr384349, -1
store i32 %dec13, ptr @b, align 4, !tbaa !5
%idxprom14 = sext i32 %dec13 to i64
%arrayidx15 = getelementptr inbounds [999 x i8], ptr @B, i64 0, i64 %idxprom14
%3 = load i8, ptr %arrayidx15, align 1, !tbaa !9
%conv16 = sext i8 %3 to i32
%sub17 = add nsw i32 %conv16, -48
br label %cond.end19
cond.end19: ; preds = %cond.end, %cond.true12
%.pr3844 = phi i32 [ %dec13, %cond.true12 ], [ 0, %cond.end ]
%cond20 = phi i32 [ %sub17, %cond.true12 ], [ 0, %cond.end ]
%add = add i32 %cond, %div4051
%add21 = add i32 %add, %cond20
%rem = srem i32 %add21, 10
%4 = trunc i32 %rem to i8
%conv23 = add nsw i8 %4, 48
%indvars.iv.next = add i64 %indvars.iv, 1
%arrayidx25 = getelementptr inbounds [999 x i8], ptr @C, i64 0, i64 %indvars.iv
store i8 %conv23, ptr %arrayidx25, align 1, !tbaa !9
%div = sdiv i32 %add21, 10
%5 = or i32 %.pr42, %.pr3844
%or6 = or i32 %5, %div
%tobool7.not = icmp eq i32 %or6, 0
br i1 %tobool7.not, label %while.cond5.while.end_crit_edge, label %while.body8, !llvm.loop !10
while.cond5.while.end_crit_edge: ; preds = %cond.end19
%6 = trunc i64 %indvars.iv.next to i32
store i32 %cond, ptr @va, align 4, !tbaa !5
store i32 %cond20, ptr @vb, align 4, !tbaa !5
store i32 %div, ptr @v, align 4, !tbaa !5
store i32 %6, ptr @c, align 4, !tbaa !5
br label %while.end
while.end: ; preds = %while.cond5.while.end_crit_edge, %while.body
%7 = phi i32 [ %6, %while.cond5.while.end_crit_edge ], [ %c.promoted, %while.body ]
%cmp = icmp sgt i32 %7, 80
br i1 %cmp, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %while.end
%dec2852 = add nsw i32 %7, -1
store i32 %dec2852, ptr @c, align 4, !tbaa !5
%tobool29.not53 = icmp eq i32 %7, 0
br i1 %tobool29.not53, label %for.end, label %for.body
if.then: ; preds = %while.end
%call27 = tail call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %if.end
for.body: ; preds = %for.cond.preheader, %for.body
%dec2854 = phi i32 [ %dec28, %for.body ], [ %dec2852, %for.cond.preheader ]
%idxprom30 = sext i32 %dec2854 to i64
%arrayidx31 = getelementptr inbounds [999 x i8], ptr @C, i64 0, i64 %idxprom30
%8 = load i8, ptr %arrayidx31, align 1, !tbaa !9
%conv32 = sext i8 %8 to i32
%9 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i = tail call noundef i32 @putc(i32 noundef %conv32, ptr noundef %9)
%.pr39 = load i32, ptr @c, align 4, !tbaa !5
%dec28 = add nsw i32 %.pr39, -1
store i32 %dec28, ptr @c, align 4, !tbaa !5
%tobool29.not = icmp eq i32 %.pr39, 0
br i1 %tobool29.not, label %for.end, label %for.body, !llvm.loop !14
for.end: ; preds = %for.body, %for.cond.preheader
%10 = load ptr, ptr @stdout, align 8, !tbaa !12
%call.i37 = tail call noundef i32 @putc(i32 noundef 10, ptr noundef %10)
br label %if.end
if.end: ; preds = %for.end, %if.then
store i32 0, ptr @c, align 4, !tbaa !5
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @A, ptr noundef nonnull @B)
%tobool.not = icmp eq i32 %call1, -1
br i1 %tobool.not, label %while.end35, label %while.body, !llvm.loop !15
while.end35: ; preds = %if.end, %entry
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
|
#include <stdio.h>
#include <string.h>
typedef unsigned long long ull;
char buf1[101], buf2[101], buf3[101];
int l1, l2, l3;
void rev(char b[], int n) {
int i,t;
for(i = 0; i < (n+1)/2; i ++) {
t=b[i];b[i]=b[n-i-1];b[n-i-1]=t;
}
}
int main() {
int tn,ti,c,i,x;
scanf("%d",&tn);
for(ti=0;ti<tn;ti++){
scanf("%s%s",&buf1,&buf2);
l1 = strlen(buf1); l2 = strlen(buf2);
rev(buf1, l1); rev(buf2, l2);
for(i=l1;i<100;i++)buf1[i]='0';
for(i=l2;i<100;i++)buf2[i]='0';
c=0,l3=0;
for(i=0;i<100;i++){
x=buf1[i]-'0'+buf2[i]-'0'+c;
if(x>=10)x-=10,c=1;
else c=0;
if(x)l3=i;
buf3[i]=x+'0';
}
l3++;
buf3[l3]=0;
rev(buf3, l3);
if(l3>80)
puts("overflow");
else
puts(buf3);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_319991/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_319991/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s%s\00", align 1
@buf1 = dso_local global [101 x i8] zeroinitializer, align 16
@buf2 = dso_local global [101 x i8] zeroinitializer, align 16
@l1 = dso_local local_unnamed_addr global i32 0, align 4
@l2 = dso_local local_unnamed_addr global i32 0, align 4
@l3 = dso_local local_unnamed_addr global i32 0, align 4
@buf3 = dso_local global [101 x i8] zeroinitializer, align 16
@.str.2 = private unnamed_addr constant [9 x i8] c"overflow\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @rev(ptr nocapture noundef %b, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp21 = icmp sgt i32 %n, 0
br i1 %cmp21, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%add = add nuw nsw i32 %n, 1
%div2425 = lshr i32 %add, 1
%wide.trip.count = zext i32 %div2425 to i64
%xtraiter = and i64 %wide.trip.count, 1
%0 = icmp eq i32 %div2425, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 2147483646
br label %for.body
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 i8, ptr %b, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%2 = trunc i64 %indvars.iv to i32
%3 = xor i32 %2, -1
%sub1 = add i32 %3, %n
%idxprom2 = sext i32 %sub1 to i64
%arrayidx3 = getelementptr inbounds i8, ptr %b, i64 %idxprom2
%4 = load i8, ptr %arrayidx3, align 1, !tbaa !5
store i8 %4, ptr %arrayidx, align 1, !tbaa !5
store i8 %1, ptr %arrayidx3, align 1, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds i8, ptr %b, i64 %indvars.iv.next
%5 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%6 = trunc i64 %indvars.iv.next to i32
%7 = xor i32 %6, -1
%sub1.1 = add i32 %7, %n
%idxprom2.1 = sext i32 %sub1.1 to i64
%arrayidx3.1 = getelementptr inbounds i8, ptr %b, i64 %idxprom2.1
%8 = load i8, ptr %arrayidx3.1, align 1, !tbaa !5
store i8 %8, ptr %arrayidx.1, align 1, !tbaa !5
store i8 %5, ptr %arrayidx3.1, align 1, !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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !8
for.end.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.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds i8, ptr %b, i64 %indvars.iv.unr
%9 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%10 = trunc i64 %indvars.iv.unr to i32
%11 = xor i32 %10, -1
%sub1.epil = add i32 %11, %n
%idxprom2.epil = sext i32 %sub1.epil to i64
%arrayidx3.epil = getelementptr inbounds i8, ptr %b, i64 %idxprom2.epil
%12 = load i8, ptr %arrayidx3.epil, align 1, !tbaa !5
store i8 %12, ptr %arrayidx.epil, align 1, !tbaa !5
store i8 %9, ptr %arrayidx3.epil, align 1, !tbaa !5
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%tn = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tn) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tn)
%0 = load i32, ptr %tn, align 4, !tbaa !10
%cmp106 = icmp sgt i32 %0, 0
br i1 %cmp106, label %for.body, label %for.end54
for.body: ; preds = %entry, %for.inc52
%ti.0107 = phi i32 [ %inc53, %for.inc52 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @buf1, ptr noundef nonnull @buf2)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @buf1) #7
%conv = trunc i64 %call2 to i32
store i32 %conv, ptr @l1, align 4, !tbaa !10
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) @buf2) #7
%conv4 = trunc i64 %call3 to i32
store i32 %conv4, ptr @l2, align 4, !tbaa !10
%cmp21.i = icmp sgt i32 %conv, 0
br i1 %cmp21.i, label %for.body.preheader.i, label %rev.exit
for.body.preheader.i: ; preds = %for.body
%add.i = add i64 %call2, 1
%div2425.i = lshr i64 %add.i, 1
%wide.trip.count.i = and i64 %div2425.i, 2147483647
%xtraiter = and i64 %div2425.i, 1
%1 = icmp eq i64 %wide.trip.count.i, 1
br i1 %1, label %rev.exit.loopexit.unr-lcssa, label %for.body.preheader.i.new
for.body.preheader.i.new: ; preds = %for.body.preheader.i
%unroll_iter = sub nsw i64 %wide.trip.count.i, %xtraiter
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ]
%arrayidx.i = getelementptr inbounds i8, ptr @buf1, i64 %indvars.iv.i
%2 = load i8, ptr %arrayidx.i, align 2, !tbaa !5
%3 = xor i64 %indvars.iv.i, -1
%sub1.i = add i64 %call2, %3
%sext = shl i64 %sub1.i, 32
%idxprom2.i = ashr exact i64 %sext, 32
%arrayidx3.i = getelementptr inbounds i8, ptr @buf1, i64 %idxprom2.i
%4 = load i8, ptr %arrayidx3.i, align 1, !tbaa !5
store i8 %4, ptr %arrayidx.i, align 2, !tbaa !5
store i8 %2, ptr %arrayidx3.i, align 1, !tbaa !5
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx.i.1 = getelementptr inbounds i8, ptr @buf1, i64 %indvars.iv.next.i
%5 = load i8, ptr %arrayidx.i.1, align 1, !tbaa !5
%6 = xor i64 %indvars.iv.i, 4294967294
%sub1.i.1 = add i64 %call2, %6
%sext.1 = shl i64 %sub1.i.1, 32
%idxprom2.i.1 = ashr exact i64 %sext.1, 32
%arrayidx3.i.1 = getelementptr inbounds i8, ptr @buf1, i64 %idxprom2.i.1
%7 = load i8, ptr %arrayidx3.i.1, align 1, !tbaa !5
store i8 %7, ptr %arrayidx.i.1, align 1, !tbaa !5
store i8 %5, ptr %arrayidx3.i.1, align 1, !tbaa !5
%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 %rev.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !8
rev.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %rev.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %rev.exit.loopexit.unr-lcssa
%arrayidx.i.epil = getelementptr inbounds i8, ptr @buf1, i64 %indvars.iv.i.unr
%8 = load i8, ptr %arrayidx.i.epil, align 1, !tbaa !5
%9 = xor i64 %indvars.iv.i.unr, -1
%sub1.i.epil = add i64 %call2, %9
%sext.epil = shl i64 %sub1.i.epil, 32
%idxprom2.i.epil = ashr exact i64 %sext.epil, 32
%arrayidx3.i.epil = getelementptr inbounds i8, ptr @buf1, i64 %idxprom2.i.epil
%10 = load i8, ptr %arrayidx3.i.epil, align 1, !tbaa !5
store i8 %10, ptr %arrayidx.i.epil, align 1, !tbaa !5
store i8 %8, ptr %arrayidx3.i.epil, align 1, !tbaa !5
br label %rev.exit
rev.exit: ; preds = %for.body.i.epil, %rev.exit.loopexit.unr-lcssa, %for.body
%cmp21.i70 = icmp sgt i32 %conv4, 0
br i1 %cmp21.i70, label %for.body.preheader.i71, label %rev.exit83
for.body.preheader.i71: ; preds = %rev.exit
%add.i72 = add i64 %call3, 1
%div2425.i73 = lshr i64 %add.i72, 1
%wide.trip.count.i74 = and i64 %div2425.i73, 2147483647
%xtraiter114 = and i64 %div2425.i73, 1
%11 = icmp eq i64 %wide.trip.count.i74, 1
br i1 %11, label %rev.exit83.loopexit.unr-lcssa, label %for.body.preheader.i71.new
for.body.preheader.i71.new: ; preds = %for.body.preheader.i71
%unroll_iter116 = sub nsw i64 %wide.trip.count.i74, %xtraiter114
br label %for.body.i75
for.body.i75: ; preds = %for.body.i75, %for.body.preheader.i71.new
%indvars.iv.i76 = phi i64 [ 0, %for.body.preheader.i71.new ], [ %indvars.iv.next.i81.1, %for.body.i75 ]
%niter117 = phi i64 [ 0, %for.body.preheader.i71.new ], [ %niter117.next.1, %for.body.i75 ]
%arrayidx.i77 = getelementptr inbounds i8, ptr @buf2, i64 %indvars.iv.i76
%12 = load i8, ptr %arrayidx.i77, align 2, !tbaa !5
%13 = xor i64 %indvars.iv.i76, -1
%sub1.i78 = add i64 %call3, %13
%sext99 = shl i64 %sub1.i78, 32
%idxprom2.i79 = ashr exact i64 %sext99, 32
%arrayidx3.i80 = getelementptr inbounds i8, ptr @buf2, i64 %idxprom2.i79
%14 = load i8, ptr %arrayidx3.i80, align 1, !tbaa !5
store i8 %14, ptr %arrayidx.i77, align 2, !tbaa !5
store i8 %12, ptr %arrayidx3.i80, align 1, !tbaa !5
%indvars.iv.next.i81 = or i64 %indvars.iv.i76, 1
%arrayidx.i77.1 = getelementptr inbounds i8, ptr @buf2, i64 %indvars.iv.next.i81
%15 = load i8, ptr %arrayidx.i77.1, align 1, !tbaa !5
%16 = xor i64 %indvars.iv.i76, 4294967294
%sub1.i78.1 = add i64 %call3, %16
%sext99.1 = shl i64 %sub1.i78.1, 32
%idxprom2.i79.1 = ashr exact i64 %sext99.1, 32
%arrayidx3.i80.1 = getelementptr inbounds i8, ptr @buf2, i64 %idxprom2.i79.1
%17 = load i8, ptr %arrayidx3.i80.1, align 1, !tbaa !5
store i8 %17, ptr %arrayidx.i77.1, align 1, !tbaa !5
store i8 %15, ptr %arrayidx3.i80.1, align 1, !tbaa !5
%indvars.iv.next.i81.1 = add nuw nsw i64 %indvars.iv.i76, 2
%niter117.next.1 = add i64 %niter117, 2
%niter117.ncmp.1 = icmp eq i64 %niter117.next.1, %unroll_iter116
br i1 %niter117.ncmp.1, label %rev.exit83.loopexit.unr-lcssa, label %for.body.i75, !llvm.loop !8
rev.exit83.loopexit.unr-lcssa: ; preds = %for.body.i75, %for.body.preheader.i71
%indvars.iv.i76.unr = phi i64 [ 0, %for.body.preheader.i71 ], [ %indvars.iv.next.i81.1, %for.body.i75 ]
%lcmp.mod115.not = icmp eq i64 %xtraiter114, 0
br i1 %lcmp.mod115.not, label %rev.exit83, label %for.body.i75.epil
for.body.i75.epil: ; preds = %rev.exit83.loopexit.unr-lcssa
%arrayidx.i77.epil = getelementptr inbounds i8, ptr @buf2, i64 %indvars.iv.i76.unr
%18 = load i8, ptr %arrayidx.i77.epil, align 1, !tbaa !5
%19 = xor i64 %indvars.iv.i76.unr, -1
%sub1.i78.epil = add i64 %call3, %19
%sext99.epil = shl i64 %sub1.i78.epil, 32
%idxprom2.i79.epil = ashr exact i64 %sext99.epil, 32
%arrayidx3.i80.epil = getelementptr inbounds i8, ptr @buf2, i64 %idxprom2.i79.epil
%20 = load i8, ptr %arrayidx3.i80.epil, align 1, !tbaa !5
store i8 %20, ptr %arrayidx.i77.epil, align 1, !tbaa !5
store i8 %18, ptr %arrayidx3.i80.epil, align 1, !tbaa !5
br label %rev.exit83
rev.exit83: ; preds = %for.body.i75.epil, %rev.exit83.loopexit.unr-lcssa, %rev.exit
%cmp6100 = icmp slt i32 %conv, 100
br i1 %cmp6100, label %for.body8.preheader, label %for.cond9.preheader
for.body8.preheader: ; preds = %rev.exit83
%sext112 = shl i64 %call2, 32
%21 = ashr exact i64 %sext112, 32
%scevgep = getelementptr i8, ptr @buf1, i64 %21
%22 = sub i64 99, %call2
%23 = and i64 %22, 4294967295
%24 = add nuw nsw i64 %23, 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep, i8 48, i64 %24, i1 false), !tbaa !5
br label %for.cond9.preheader
for.cond9.preheader: ; preds = %for.body8.preheader, %rev.exit83
%cmp10102 = icmp slt i32 %conv4, 100
br i1 %cmp10102, label %for.body12.preheader, label %for.body21.preheader
for.body12.preheader: ; preds = %for.cond9.preheader
%sext113 = shl i64 %call3, 32
%25 = ashr exact i64 %sext113, 32
%scevgep109 = getelementptr i8, ptr @buf2, i64 %25
%26 = sub i64 99, %call3
%27 = and i64 %26, 4294967295
%28 = add nuw nsw i64 %27, 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %scevgep109, i8 48, i64 %28, i1 false), !tbaa !5
br label %for.body21.preheader
for.body21.preheader: ; preds = %for.body12.preheader, %for.cond9.preheader
br label %for.body21
for.body21: ; preds = %for.body21.preheader, %for.body21
%29 = phi i32 [ %spec.select, %for.body21 ], [ 0, %for.body21.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body21 ], [ 0, %for.body21.preheader ]
%c.0104 = phi i32 [ %c.1, %for.body21 ], [ 0, %for.body21.preheader ]
%arrayidx23 = getelementptr inbounds [101 x i8], ptr @buf1, i64 0, i64 %indvars.iv
%30 = load i8, ptr %arrayidx23, align 1, !tbaa !5
%conv24 = sext i8 %30 to i32
%arrayidx26 = getelementptr inbounds [101 x i8], ptr @buf2, i64 0, i64 %indvars.iv
%31 = load i8, ptr %arrayidx26, align 1, !tbaa !5
%conv27 = sext i8 %31 to i32
%add = or i32 %c.0104, -96
%sub28 = add nsw i32 %add, %conv24
%add29 = add nsw i32 %sub28, %conv27
%cmp30 = icmp sgt i32 %add29, 9
%sub32 = add nsw i32 %add29, -10
%c.1 = zext i1 %cmp30 to i32
%x.0 = select i1 %cmp30, i32 %sub32, i32 %add29
%tobool.not = icmp eq i32 %x.0, 0
%32 = trunc i64 %indvars.iv to i32
%spec.select = select i1 %tobool.not, i32 %29, i32 %32
%33 = trunc i32 %x.0 to i8
%conv36 = add i8 %33, 48
%arrayidx38 = getelementptr inbounds [101 x i8], ptr @buf3, i64 0, i64 %indvars.iv
store i8 %conv36, ptr %arrayidx38, align 1, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 100
br i1 %exitcond.not, label %for.end41, label %for.body21, !llvm.loop !12
for.end41: ; preds = %for.body21
%inc42 = add nsw i32 %spec.select, 1
store i32 %inc42, ptr @l3, align 4, !tbaa !10
%idxprom43 = sext i32 %inc42 to i64
%arrayidx44 = getelementptr inbounds [101 x i8], ptr @buf3, i64 0, i64 %idxprom43
store i8 0, ptr %arrayidx44, align 1, !tbaa !5
%cmp21.i84 = icmp sgt i32 %spec.select, -1
br i1 %cmp21.i84, label %for.body.preheader.i85, label %if.else49
for.body.preheader.i85: ; preds = %for.end41
%add.i86 = add nuw nsw i32 %spec.select, 2
%div2425.i87 = lshr i32 %add.i86, 1
%wide.trip.count.i88 = zext i32 %div2425.i87 to i64
%xtraiter118 = and i64 %wide.trip.count.i88, 1
%34 = icmp eq i32 %div2425.i87, 1
br i1 %34, label %rev.exit97.unr-lcssa, label %for.body.preheader.i85.new
for.body.preheader.i85.new: ; preds = %for.body.preheader.i85
%unroll_iter120 = and i64 %wide.trip.count.i88, 2147483646
br label %for.body.i89
for.body.i89: ; preds = %for.body.i89, %for.body.preheader.i85.new
%indvars.iv.i90 = phi i64 [ 0, %for.body.preheader.i85.new ], [ %indvars.iv.next.i95.1, %for.body.i89 ]
%niter121 = phi i64 [ 0, %for.body.preheader.i85.new ], [ %niter121.next.1, %for.body.i89 ]
%arrayidx.i91 = getelementptr inbounds i8, ptr @buf3, i64 %indvars.iv.i90
%35 = load i8, ptr %arrayidx.i91, align 2, !tbaa !5
%36 = trunc i64 %indvars.iv.i90 to i32
%sub1.i92 = sub i32 %spec.select, %36
%idxprom2.i93 = sext i32 %sub1.i92 to i64
%arrayidx3.i94 = getelementptr inbounds i8, ptr @buf3, i64 %idxprom2.i93
%37 = load i8, ptr %arrayidx3.i94, align 1, !tbaa !5
store i8 %37, ptr %arrayidx.i91, align 2, !tbaa !5
store i8 %35, ptr %arrayidx3.i94, align 1, !tbaa !5
%indvars.iv.next.i95 = or i64 %indvars.iv.i90, 1
%arrayidx.i91.1 = getelementptr inbounds i8, ptr @buf3, i64 %indvars.iv.next.i95
%38 = load i8, ptr %arrayidx.i91.1, align 1, !tbaa !5
%39 = trunc i64 %indvars.iv.next.i95 to i32
%sub1.i92.1 = sub i32 %spec.select, %39
%idxprom2.i93.1 = sext i32 %sub1.i92.1 to i64
%arrayidx3.i94.1 = getelementptr inbounds i8, ptr @buf3, i64 %idxprom2.i93.1
%40 = load i8, ptr %arrayidx3.i94.1, align 1, !tbaa !5
store i8 %40, ptr %arrayidx.i91.1, align 1, !tbaa !5
store i8 %38, ptr %arrayidx3.i94.1, align 1, !tbaa !5
%indvars.iv.next.i95.1 = add nuw nsw i64 %indvars.iv.i90, 2
%niter121.next.1 = add i64 %niter121, 2
%niter121.ncmp.1 = icmp eq i64 %niter121.next.1, %unroll_iter120
br i1 %niter121.ncmp.1, label %rev.exit97.unr-lcssa, label %for.body.i89, !llvm.loop !8
rev.exit97.unr-lcssa: ; preds = %for.body.i89, %for.body.preheader.i85
%indvars.iv.i90.unr = phi i64 [ 0, %for.body.preheader.i85 ], [ %indvars.iv.next.i95.1, %for.body.i89 ]
%lcmp.mod119.not = icmp eq i64 %xtraiter118, 0
br i1 %lcmp.mod119.not, label %rev.exit97, label %for.body.i89.epil
for.body.i89.epil: ; preds = %rev.exit97.unr-lcssa
%arrayidx.i91.epil = getelementptr inbounds i8, ptr @buf3, i64 %indvars.iv.i90.unr
%41 = load i8, ptr %arrayidx.i91.epil, align 1, !tbaa !5
%42 = trunc i64 %indvars.iv.i90.unr to i32
%sub1.i92.epil = sub i32 %spec.select, %42
%idxprom2.i93.epil = sext i32 %sub1.i92.epil to i64
%arrayidx3.i94.epil = getelementptr inbounds i8, ptr @buf3, i64 %idxprom2.i93.epil
%43 = load i8, ptr %arrayidx3.i94.epil, align 1, !tbaa !5
store i8 %43, ptr %arrayidx.i91.epil, align 1, !tbaa !5
store i8 %41, ptr %arrayidx3.i94.epil, align 1, !tbaa !5
br label %rev.exit97
rev.exit97: ; preds = %rev.exit97.unr-lcssa, %for.body.i89.epil
%cmp45 = icmp sgt i32 %spec.select, 79
br i1 %cmp45, label %for.inc52, label %if.else49
if.else49: ; preds = %for.end41, %rev.exit97
br label %for.inc52
for.inc52: ; preds = %rev.exit97, %if.else49
%.str.2.sink = phi ptr [ @buf3, %if.else49 ], [ @.str.2, %rev.exit97 ]
%call48 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
%inc53 = add nuw nsw i32 %ti.0107, 1
%44 = load i32, ptr %tn, align 4, !tbaa !10
%cmp = icmp slt i32 %inc53, %44
br i1 %cmp, label %for.body, label %for.end54, !llvm.loop !13
for.end54: ; preds = %for.inc52, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tn) #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 memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = distinct !{!12, !9}
!13 = distinct !{!13, !9}
|
#include<stdio.h>
#include<string.h>
int main()
{
int n;
scanf("%d",&n);
char s[n];
scanf("%s",&s);
int x=0, y=0;
for(int i=0; i<n; i++){
if(s[i]=='L') x = x+1;
if(s[i]=='R') y = y+1;
}
printf("%d\n",x+y+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_32004/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_32004/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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()
%vla = alloca i8, i64 %1, align 16
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla)
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp20 = icmp sgt i32 %3, 0
br i1 %cmp20, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %3 to i64
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body.preheader32, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%vec.phi26 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%vec.phi27 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%vec.phi28 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%4 = getelementptr inbounds i8, ptr %vla, i64 %index
%wide.load = load <4 x i8>, ptr %4, align 8, !tbaa !9
%5 = getelementptr inbounds i8, ptr %4, i64 4
%wide.load29 = load <4 x i8>, ptr %5, align 4, !tbaa !9
%6 = icmp eq <4 x i8> %wide.load, <i8 76, i8 76, i8 76, i8 76>
%7 = icmp eq <4 x i8> %wide.load29, <i8 76, i8 76, i8 76, i8 76>
%8 = zext <4 x i1> %6 to <4 x i32>
%9 = zext <4 x i1> %7 to <4 x i32>
%10 = add <4 x i32> %vec.phi27, %8
%11 = add <4 x i32> %vec.phi28, %9
%12 = icmp eq <4 x i8> %wide.load, <i8 82, i8 82, i8 82, i8 82>
%13 = icmp eq <4 x i8> %wide.load29, <i8 82, i8 82, i8 82, i8 82>
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi, %14
%17 = add <4 x i32> %vec.phi26, %15
%index.next = add nuw i64 %index, 8
%18 = icmp eq i64 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%bin.rdx30 = add <4 x i32> %11, %10
%19 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx30)
%bin.rdx = add <4 x i32> %17, %16
%20 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup.loopexit, label %for.body.preheader32
for.body.preheader32: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%y.022.ph = phi i32 [ 0, %for.body.preheader ], [ %20, %middle.block ]
%x.021.ph = phi i32 [ 0, %for.body.preheader ], [ %19, %middle.block ]
br label %for.body
for.cond.cleanup.loopexit: ; preds = %for.body, %middle.block
%spec.select.lcssa = phi i32 [ %19, %middle.block ], [ %spec.select, %for.body ]
%y.1.lcssa = phi i32 [ %20, %middle.block ], [ %y.1, %for.body ]
%21 = add nuw i32 %spec.select.lcssa, 1
%22 = add i32 %21, %y.1.lcssa
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%add13 = phi i32 [ 1, %entry ], [ %22, %for.cond.cleanup.loopexit ]
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add13)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
for.body: ; preds = %for.body.preheader32, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader32 ]
%y.022 = phi i32 [ %y.1, %for.body ], [ %y.022.ph, %for.body.preheader32 ]
%x.021 = phi i32 [ %spec.select, %for.body ], [ %x.021.ph, %for.body.preheader32 ]
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %indvars.iv
%23 = load i8, ptr %arrayidx, align 1, !tbaa !9
%cmp2 = icmp eq i8 %23, 76
%add = zext i1 %cmp2 to i32
%spec.select = add nuw nsw i32 %x.021, %add
%cmp7 = icmp eq i8 %23, 82
%add10 = zext i1 %cmp7 to i32
%y.1 = add nuw nsw i32 %y.022, %add10
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
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.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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11, !12, !13}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !11, !13, !12}
|
#include <stdio.h>
void color(int map[10][10], int x, int y)
{
if (0 <= x && x <= 9 && 0 <= y && y <= 9){
map[y][x]++;
}
}
int main(void)
{
int map[10][10] = {0};
int x, y, size;
int i, j;
int white = 0, darkest = 0;
while (scanf("%d,%d,%d", &x, &y, &size) != EOF){
map[y][x]++;
if (size == 3){
color(map, x + 2, y);
color(map, x - 2, y);
color(map, x, y + 2);
color(map, x, y - 2);
}
if (size >= 2){
color(map, x + 1, y + 1);
color(map, x - 1, y + 1);
color(map, x + 1, y - 1);
color(map, x - 1, y - 1);
}
if (size >= 1){
color(map, x, y + 1);
color(map, x, y - 1);
color(map, x + 1, y);
color(map, x - 1, y);
}
}
for (i = 0; i < 10; i++){
for (j = 0; j < 10; j++){
if (map[i][j] == 0){
white++;
}
if (darkest < map[i][j]){
darkest = map[i][j];
}
}
}
printf("%d\n%d\n", white, darkest);
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320104/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320104/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d\0A%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @color(ptr nocapture noundef %map, i32 noundef %x, i32 noundef %y) local_unnamed_addr #0 {
entry:
%or.cond = icmp ult i32 %x, 10
%0 = icmp ult i32 %y, 10
%or.cond9 = and i1 %or.cond, %0
br i1 %or.cond9, label %if.then, label %if.end
if.then: ; preds = %entry
%idxprom = zext i32 %y to i64
%idxprom6 = zext i32 %x to i64
%arrayidx7 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom, i64 %idxprom6
%1 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%inc = add nsw i32 %1, 1
store i32 %inc, ptr %arrayidx7, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%map = alloca [10 x [10 x i32]], align 16
%x = alloca i32, align 4
%y = alloca i32, align 4
%size = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %map) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %map, i8 0, i64 400, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %size) #6
%call163 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %size)
%cmp.not164 = icmp eq i32 %call163, -1
br i1 %cmp.not164, label %for.cond36.preheader.preheader, label %while.body
while.body: ; preds = %entry, %if.end34
%0 = load i32, ptr %y, align 4, !tbaa !5
%idxprom = sext i32 %0 to i64
%1 = load i32, ptr %x, align 4, !tbaa !5
%idxprom1 = sext i32 %1 to i64
%arrayidx2 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %idxprom, i64 %idxprom1
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%inc = add nsw i32 %2, 1
store i32 %inc, ptr %arrayidx2, align 4, !tbaa !5
%3 = load i32, ptr %size, align 4, !tbaa !5
%cmp3 = icmp eq i32 %3, 3
br i1 %cmp3, label %if.then, label %if.end
if.then: ; preds = %while.body
%add = add nsw i32 %1, 2
%or.cond.i = icmp ult i32 %add, 10
%4 = icmp ult i32 %0, 10
%or.cond9.i = and i1 %4, %or.cond.i
br i1 %or.cond9.i, label %if.then.i, label %color.exit
if.then.i: ; preds = %if.then
%idxprom.i = zext i32 %0 to i64
%idxprom6.i = zext i32 %add to i64
%arrayidx7.i = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i, i64 %idxprom6.i
%5 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5
%inc.i = add nsw i32 %5, 1
store i32 %inc.i, ptr %arrayidx7.i, align 4, !tbaa !5
br label %color.exit
color.exit: ; preds = %if.then, %if.then.i
%sub = add nsw i32 %1, -2
%or.cond.i73 = icmp ult i32 %sub, 10
%or.cond9.i74 = and i1 %4, %or.cond.i73
br i1 %or.cond9.i74, label %if.then.i75, label %color.exit80
if.then.i75: ; preds = %color.exit
%idxprom.i76 = zext i32 %0 to i64
%idxprom6.i77 = zext i32 %sub to i64
%arrayidx7.i78 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i76, i64 %idxprom6.i77
%6 = load i32, ptr %arrayidx7.i78, align 4, !tbaa !5
%inc.i79 = add nsw i32 %6, 1
store i32 %inc.i79, ptr %arrayidx7.i78, align 4, !tbaa !5
br label %color.exit80
color.exit80: ; preds = %color.exit, %if.then.i75
%add6 = add nsw i32 %0, 2
%or.cond.i81 = icmp ult i32 %1, 10
%7 = icmp ult i32 %add6, 10
%or.cond9.i82 = and i1 %or.cond.i81, %7
br i1 %or.cond9.i82, label %if.then.i83, label %color.exit88
if.then.i83: ; preds = %color.exit80
%idxprom.i84 = zext i32 %add6 to i64
%idxprom6.i85 = zext i32 %1 to i64
%arrayidx7.i86 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i84, i64 %idxprom6.i85
%8 = load i32, ptr %arrayidx7.i86, align 4, !tbaa !5
%inc.i87 = add nsw i32 %8, 1
store i32 %inc.i87, ptr %arrayidx7.i86, align 4, !tbaa !5
br label %color.exit88
color.exit88: ; preds = %color.exit80, %if.then.i83
%sub8 = add nsw i32 %0, -2
%9 = icmp ult i32 %sub8, 10
%or.cond9.i90 = and i1 %or.cond.i81, %9
br i1 %or.cond9.i90, label %if.then.i91, label %if.then10
if.then.i91: ; preds = %color.exit88
%idxprom.i92 = zext i32 %sub8 to i64
%idxprom6.i93 = zext i32 %1 to i64
%arrayidx7.i94 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i92, i64 %idxprom6.i93
%10 = load i32, ptr %arrayidx7.i94, align 4, !tbaa !5
%inc.i95 = add nsw i32 %10, 1
store i32 %inc.i95, ptr %arrayidx7.i94, align 4, !tbaa !5
br label %if.then10
if.end: ; preds = %while.body
%cmp9 = icmp sgt i32 %3, 1
br i1 %cmp9, label %if.then10, label %if.end23
if.then10: ; preds = %color.exit88, %if.then.i91, %if.end
%add12 = add nsw i32 %1, 1
%add13 = add nsw i32 %0, 1
%or.cond.i97 = icmp ult i32 %add12, 10
%11 = icmp ult i32 %add13, 10
%or.cond9.i98 = and i1 %11, %or.cond.i97
br i1 %or.cond9.i98, label %if.then.i99, label %color.exit104
if.then.i99: ; preds = %if.then10
%idxprom.i100 = zext i32 %add13 to i64
%idxprom6.i101 = zext i32 %add12 to i64
%arrayidx7.i102 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i100, i64 %idxprom6.i101
%12 = load i32, ptr %arrayidx7.i102, align 4, !tbaa !5
%inc.i103 = add nsw i32 %12, 1
store i32 %inc.i103, ptr %arrayidx7.i102, align 4, !tbaa !5
br label %color.exit104
color.exit104: ; preds = %if.then10, %if.then.i99
%sub15 = add nsw i32 %1, -1
%or.cond.i105 = icmp ult i32 %sub15, 10
%or.cond9.i106 = and i1 %11, %or.cond.i105
br i1 %or.cond9.i106, label %if.then.i107, label %color.exit112
if.then.i107: ; preds = %color.exit104
%idxprom.i108 = zext i32 %add13 to i64
%idxprom6.i109 = zext i32 %sub15 to i64
%arrayidx7.i110 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i108, i64 %idxprom6.i109
%13 = load i32, ptr %arrayidx7.i110, align 4, !tbaa !5
%inc.i111 = add nsw i32 %13, 1
store i32 %inc.i111, ptr %arrayidx7.i110, align 4, !tbaa !5
br label %color.exit112
color.exit112: ; preds = %color.exit104, %if.then.i107
%sub19 = add nsw i32 %0, -1
%14 = icmp ult i32 %sub19, 10
%or.cond9.i114 = and i1 %14, %or.cond.i97
br i1 %or.cond9.i114, label %if.then.i115, label %color.exit120
if.then.i115: ; preds = %color.exit112
%idxprom.i116 = zext i32 %sub19 to i64
%idxprom6.i117 = zext i32 %add12 to i64
%arrayidx7.i118 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i116, i64 %idxprom6.i117
%15 = load i32, ptr %arrayidx7.i118, align 4, !tbaa !5
%inc.i119 = add nsw i32 %15, 1
store i32 %inc.i119, ptr %arrayidx7.i118, align 4, !tbaa !5
br label %color.exit120
color.exit120: ; preds = %color.exit112, %if.then.i115
%or.cond9.i122 = and i1 %14, %or.cond.i105
br i1 %or.cond9.i122, label %if.then.i123, label %if.then25
if.then.i123: ; preds = %color.exit120
%idxprom.i124 = zext i32 %sub19 to i64
%idxprom6.i125 = zext i32 %sub15 to i64
%arrayidx7.i126 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i124, i64 %idxprom6.i125
%16 = load i32, ptr %arrayidx7.i126, align 4, !tbaa !5
%inc.i127 = add nsw i32 %16, 1
store i32 %inc.i127, ptr %arrayidx7.i126, align 4, !tbaa !5
br label %if.then25
if.end23: ; preds = %if.end
%cmp24 = icmp eq i32 %3, 1
br i1 %cmp24, label %if.end23.if.then25_crit_edge, label %if.end34
if.end23.if.then25_crit_edge: ; preds = %if.end23
%.pre = add nsw i32 %0, 1
br label %if.then25
if.then25: ; preds = %if.end23.if.then25_crit_edge, %color.exit120, %if.then.i123
%add27.pre-phi = phi i32 [ %.pre, %if.end23.if.then25_crit_edge ], [ %add13, %color.exit120 ], [ %add13, %if.then.i123 ]
%or.cond.i129 = icmp ult i32 %1, 10
%17 = icmp ult i32 %add27.pre-phi, 10
%or.cond9.i130 = and i1 %or.cond.i129, %17
br i1 %or.cond9.i130, label %if.then.i131, label %color.exit136
if.then.i131: ; preds = %if.then25
%idxprom.i132 = zext i32 %add27.pre-phi to i64
%idxprom6.i133 = zext i32 %1 to i64
%arrayidx7.i134 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i132, i64 %idxprom6.i133
%18 = load i32, ptr %arrayidx7.i134, align 4, !tbaa !5
%inc.i135 = add nsw i32 %18, 1
store i32 %inc.i135, ptr %arrayidx7.i134, align 4, !tbaa !5
br label %color.exit136
color.exit136: ; preds = %if.then25, %if.then.i131
%sub29 = add nsw i32 %0, -1
%19 = icmp ult i32 %sub29, 10
%or.cond9.i138 = and i1 %or.cond.i129, %19
br i1 %or.cond9.i138, label %if.then.i139, label %color.exit144
if.then.i139: ; preds = %color.exit136
%idxprom.i140 = zext i32 %sub29 to i64
%idxprom6.i141 = zext i32 %1 to i64
%arrayidx7.i142 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i140, i64 %idxprom6.i141
%20 = load i32, ptr %arrayidx7.i142, align 4, !tbaa !5
%inc.i143 = add nsw i32 %20, 1
store i32 %inc.i143, ptr %arrayidx7.i142, align 4, !tbaa !5
br label %color.exit144
color.exit144: ; preds = %color.exit136, %if.then.i139
%add31 = add nsw i32 %1, 1
%or.cond.i145 = icmp ult i32 %add31, 10
%21 = icmp ult i32 %0, 10
%or.cond9.i146 = and i1 %21, %or.cond.i145
br i1 %or.cond9.i146, label %if.then.i147, label %color.exit152
if.then.i147: ; preds = %color.exit144
%idxprom.i148 = zext i32 %0 to i64
%idxprom6.i149 = zext i32 %add31 to i64
%arrayidx7.i150 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i148, i64 %idxprom6.i149
%22 = load i32, ptr %arrayidx7.i150, align 4, !tbaa !5
%inc.i151 = add nsw i32 %22, 1
store i32 %inc.i151, ptr %arrayidx7.i150, align 4, !tbaa !5
br label %color.exit152
color.exit152: ; preds = %color.exit144, %if.then.i147
%sub33 = add nsw i32 %1, -1
%or.cond.i153 = icmp ult i32 %sub33, 10
%or.cond9.i154 = and i1 %21, %or.cond.i153
br i1 %or.cond9.i154, label %if.then.i155, label %if.end34
if.then.i155: ; preds = %color.exit152
%idxprom.i156 = zext i32 %0 to i64
%idxprom6.i157 = zext i32 %sub33 to i64
%arrayidx7.i158 = getelementptr inbounds [10 x i32], ptr %map, i64 %idxprom.i156, i64 %idxprom6.i157
%23 = load i32, ptr %arrayidx7.i158, align 4, !tbaa !5
%inc.i159 = add nsw i32 %23, 1
store i32 %inc.i159, ptr %arrayidx7.i158, align 4, !tbaa !5
br label %if.end34
if.end34: ; preds = %if.then.i155, %color.exit152, %if.end23
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %size)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.cond36.preheader.preheader, label %while.body, !llvm.loop !9
for.cond36.preheader.preheader: ; preds = %if.end34, %entry
br label %for.cond36.preheader
for.cond36.preheader: ; preds = %for.cond36.preheader.preheader, %for.cond36.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond36.preheader ], [ 0, %for.cond36.preheader.preheader ]
%darkest.0170 = phi i32 [ %darkest.2.9, %for.cond36.preheader ], [ 0, %for.cond36.preheader.preheader ]
%white.0169 = phi i32 [ %spec.select.9, %for.cond36.preheader ], [ 0, %for.cond36.preheader.preheader ]
%arrayidx42 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %indvars.iv, i64 0
%24 = load i32, ptr %arrayidx42, align 8, !tbaa !5
%cmp43 = icmp eq i32 %24, 0
%inc45 = zext i1 %cmp43 to i32
%spec.select = add nsw i32 %white.0169, %inc45
%darkest.2 = call i32 @llvm.smax.i32(i32 %darkest.0170, i32 %24)
%arrayidx42.1 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %indvars.iv, i64 1
%25 = load i32, ptr %arrayidx42.1, align 4, !tbaa !5
%cmp43.1 = icmp eq i32 %25, 0
%inc45.1 = zext i1 %cmp43.1 to i32
%spec.select.1 = add nsw i32 %spec.select, %inc45.1
%darkest.2.1 = call i32 @llvm.smax.i32(i32 %darkest.2, i32 %25)
%arrayidx42.2 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %indvars.iv, i64 2
%26 = load i32, ptr %arrayidx42.2, align 8, !tbaa !5
%cmp43.2 = icmp eq i32 %26, 0
%inc45.2 = zext i1 %cmp43.2 to i32
%spec.select.2 = add nsw i32 %spec.select.1, %inc45.2
%darkest.2.2 = call i32 @llvm.smax.i32(i32 %darkest.2.1, i32 %26)
%arrayidx42.3 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %indvars.iv, i64 3
%27 = load i32, ptr %arrayidx42.3, align 4, !tbaa !5
%cmp43.3 = icmp eq i32 %27, 0
%inc45.3 = zext i1 %cmp43.3 to i32
%spec.select.3 = add nsw i32 %spec.select.2, %inc45.3
%darkest.2.3 = call i32 @llvm.smax.i32(i32 %darkest.2.2, i32 %27)
%arrayidx42.4 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %indvars.iv, i64 4
%28 = load i32, ptr %arrayidx42.4, align 8, !tbaa !5
%cmp43.4 = icmp eq i32 %28, 0
%inc45.4 = zext i1 %cmp43.4 to i32
%spec.select.4 = add nsw i32 %spec.select.3, %inc45.4
%darkest.2.4 = call i32 @llvm.smax.i32(i32 %darkest.2.3, i32 %28)
%arrayidx42.5 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %indvars.iv, i64 5
%29 = load i32, ptr %arrayidx42.5, align 4, !tbaa !5
%cmp43.5 = icmp eq i32 %29, 0
%inc45.5 = zext i1 %cmp43.5 to i32
%spec.select.5 = add nsw i32 %spec.select.4, %inc45.5
%darkest.2.5 = call i32 @llvm.smax.i32(i32 %darkest.2.4, i32 %29)
%arrayidx42.6 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %indvars.iv, i64 6
%30 = load i32, ptr %arrayidx42.6, align 8, !tbaa !5
%cmp43.6 = icmp eq i32 %30, 0
%inc45.6 = zext i1 %cmp43.6 to i32
%spec.select.6 = add nsw i32 %spec.select.5, %inc45.6
%darkest.2.6 = call i32 @llvm.smax.i32(i32 %darkest.2.5, i32 %30)
%arrayidx42.7 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %indvars.iv, i64 7
%31 = load i32, ptr %arrayidx42.7, align 4, !tbaa !5
%cmp43.7 = icmp eq i32 %31, 0
%inc45.7 = zext i1 %cmp43.7 to i32
%spec.select.7 = add nsw i32 %spec.select.6, %inc45.7
%darkest.2.7 = call i32 @llvm.smax.i32(i32 %darkest.2.6, i32 %31)
%arrayidx42.8 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %indvars.iv, i64 8
%32 = load i32, ptr %arrayidx42.8, align 8, !tbaa !5
%cmp43.8 = icmp eq i32 %32, 0
%inc45.8 = zext i1 %cmp43.8 to i32
%spec.select.8 = add nsw i32 %spec.select.7, %inc45.8
%darkest.2.8 = call i32 @llvm.smax.i32(i32 %darkest.2.7, i32 %32)
%arrayidx42.9 = getelementptr inbounds [10 x [10 x i32]], ptr %map, i64 0, i64 %indvars.iv, i64 9
%33 = load i32, ptr %arrayidx42.9, align 4, !tbaa !5
%cmp43.9 = icmp eq i32 %33, 0
%inc45.9 = zext i1 %cmp43.9 to i32
%spec.select.9 = add nsw i32 %spec.select.8, %inc45.9
%darkest.2.9 = call i32 @llvm.smax.i32(i32 %darkest.2.8, i32 %33)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 10
br i1 %exitcond.not, label %for.end61, label %for.cond36.preheader, !llvm.loop !11
for.end61: ; preds = %for.cond36.preheader
%call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.9, i32 noundef %darkest.2.9)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %size) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %map) #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) #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 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress 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 nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<string.h>
int m[18][18],x,y,s,a,b,i,j;
int main(){
memset(m,0,sizeof(m));
while(scanf("%d,%d,%d",&x,&y,&s)!=EOF){
if(s==1){
m[x+2][y+2]++;
m[x+2+1][y+2]++;
m[x+2][y+2+1]++;
m[x+2-1][y+2]++;
m[x+2][y+2-1]++;
}
if(s==2){
m[x+2][y+2]++;
m[x+2+1][y+2]++;
m[x+2][y+2+1]++;
m[x+2-1][y+2]++;
m[x+2][y+2-1]++;
m[x+2+1][y+2+1]++;
m[x+2-1][y+2+1]++;
m[x+2-1][y+2-1]++;
m[x+2+1][y+2-1]++;
}
if(s==3){
m[x+2][y+2]++;
m[x+2+1][y+2]++;
m[x+2][y+2+1]++;
m[x+2-1][y+2]++;
m[x+2][y+2-1]++;
m[x+2+1][y+2+1]++;
m[x+2-1][y+2+1]++;
m[x+2-1][y+2-1]++;
m[x+2+1][y+2-1]++;
m[x+2+2][y+2]++;
m[x+2][y+2+2]++;
m[x+2-2][y+2]++;
m[x+2][y+2-2]++;
}
}
a=b=0;
for(i=2;i<12;i++){
for(j=2;j<12;j++){
if(m[i][j]==0)a++;
if(m[i][j]>b)b=m[i][j];
}
}
printf("%d\n%d\n",a,b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320155/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320155/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@m = dso_local local_unnamed_addr global [18 x [18 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [9 x i8] c"%d,%d,%d\00", align 1
@x = dso_local global i32 0, align 4
@y = dso_local global i32 0, align 4
@s = dso_local global i32 0, align 4
@b = dso_local local_unnamed_addr global i32 0, align 4
@a = dso_local local_unnamed_addr global i32 0, align 4
@i = dso_local local_unnamed_addr global i32 0, align 4
@j = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [7 x i8] c"%d\0A%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1296) @m, i8 0, i64 1296, i1 false)
%call256 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x, ptr noundef nonnull @y, ptr noundef nonnull @s)
%cmp.not257 = icmp eq i32 %call256, -1
br i1 %cmp.not257, label %while.end, label %while.body
while.body: ; preds = %entry, %if.end223
%0 = load i32, ptr @s, align 4, !tbaa !5
switch i32 %0, label %if.end223 [
i32 1, label %if.end.thread
i32 2, label %if.then37
i32 3, label %if.then115
]
if.end.thread: ; preds = %while.body
%1 = load i32, ptr @x, align 4, !tbaa !5
%add = add nsw i32 %1, 2
%idxprom = sext i32 %add to i64
%2 = load i32, ptr @y, align 4, !tbaa !5
%add2 = add nsw i32 %2, 2
%idxprom3 = sext i32 %add2 to i64
%arrayidx4 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom, i64 %idxprom3
%add6 = add nsw i32 %1, 3
%idxprom7 = sext i32 %add6 to i64
%arrayidx11 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom7, i64 %idxprom3
%3 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%inc12 = add nsw i32 %3, 1
store i32 %inc12, ptr %arrayidx11, align 4, !tbaa !5
%4 = load <2 x i32>, ptr %arrayidx4, align 4, !tbaa !5
%5 = add nsw <2 x i32> %4, <i32 1, i32 1>
store <2 x i32> %5, ptr %arrayidx4, align 4, !tbaa !5
%sub = add nsw i32 %1, 1
%idxprom22 = sext i32 %sub to i64
%arrayidx26 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom22, i64 %idxprom3
%6 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%inc27 = add nsw i32 %6, 1
store i32 %inc27, ptr %arrayidx26, align 4, !tbaa !5
%sub32 = add nsw i32 %2, 1
%idxprom33 = sext i32 %sub32 to i64
%arrayidx34 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom, i64 %idxprom33
br label %if.end223.sink.split
if.then37: ; preds = %while.body
%7 = load i32, ptr @x, align 4, !tbaa !5
%add38 = add nsw i32 %7, 2
%idxprom39 = sext i32 %add38 to i64
%8 = load i32, ptr @y, align 4, !tbaa !5
%add41 = add nsw i32 %8, 2
%idxprom42 = sext i32 %add41 to i64
%add46 = add nsw i32 %7, 3
%idxprom47 = sext i32 %add46 to i64
%arrayidx51 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom47, i64 %idxprom42
%add57 = add nsw i32 %8, 3
%idxprom58 = sext i32 %add57 to i64
%arrayidx59 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom39, i64 %idxprom58
%9 = load i32, ptr %arrayidx59, align 4, !tbaa !5
%inc60 = add nsw i32 %9, 1
store i32 %inc60, ptr %arrayidx59, align 4, !tbaa !5
%sub62 = add nsw i32 %7, 1
%idxprom63 = sext i32 %sub62 to i64
%sub73 = add nsw i32 %8, 1
%idxprom74 = sext i32 %sub73 to i64
%arrayidx75 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom39, i64 %idxprom74
%10 = load <2 x i32>, ptr %arrayidx75, align 4, !tbaa !5
%11 = add nsw <2 x i32> %10, <i32 1, i32 1>
store <2 x i32> %11, ptr %arrayidx75, align 4, !tbaa !5
%12 = load <2 x i32>, ptr %arrayidx51, align 4, !tbaa !5
%13 = add nsw <2 x i32> %12, <i32 1, i32 1>
store <2 x i32> %13, ptr %arrayidx51, align 4, !tbaa !5
%arrayidx93 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom63, i64 %idxprom58
%14 = load i32, ptr %arrayidx93, align 4, !tbaa !5
%inc94 = add nsw i32 %14, 1
store i32 %inc94, ptr %arrayidx93, align 4, !tbaa !5
%arrayidx102 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom63, i64 %idxprom74
%15 = load <2 x i32>, ptr %arrayidx102, align 4, !tbaa !5
%16 = add nsw <2 x i32> %15, <i32 1, i32 1>
store <2 x i32> %16, ptr %arrayidx102, align 4, !tbaa !5
%arrayidx111 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom47, i64 %idxprom74
br label %if.end223.sink.split
if.then115: ; preds = %while.body
%17 = load i32, ptr @x, align 4, !tbaa !5
%add116 = add nsw i32 %17, 2
%idxprom117 = sext i32 %add116 to i64
%18 = load i32, ptr @y, align 4, !tbaa !5
%add119 = add nsw i32 %18, 2
%idxprom120 = sext i32 %add119 to i64
%add124 = add nsw i32 %17, 3
%idxprom125 = sext i32 %add124 to i64
%add135 = add nsw i32 %18, 3
%idxprom136 = sext i32 %add135 to i64
%arrayidx137 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom117, i64 %idxprom136
%19 = load i32, ptr %arrayidx137, align 4, !tbaa !5
%inc138 = add nsw i32 %19, 1
store i32 %inc138, ptr %arrayidx137, align 4, !tbaa !5
%sub140 = add nsw i32 %17, 1
%idxprom141 = sext i32 %sub140 to i64
%sub151 = add nsw i32 %18, 1
%idxprom152 = sext i32 %sub151 to i64
%arrayidx153 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom117, i64 %idxprom152
%20 = load <2 x i32>, ptr %arrayidx153, align 4, !tbaa !5
%21 = add nsw <2 x i32> %20, <i32 1, i32 1>
store <2 x i32> %21, ptr %arrayidx153, align 4, !tbaa !5
%arrayidx162 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom125, i64 %idxprom136
%22 = load i32, ptr %arrayidx162, align 4, !tbaa !5
%inc163 = add nsw i32 %22, 1
store i32 %inc163, ptr %arrayidx162, align 4, !tbaa !5
%arrayidx171 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom141, i64 %idxprom136
%23 = load i32, ptr %arrayidx171, align 4, !tbaa !5
%inc172 = add nsw i32 %23, 1
store i32 %inc172, ptr %arrayidx171, align 4, !tbaa !5
%arrayidx180 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom141, i64 %idxprom152
%24 = load <2 x i32>, ptr %arrayidx180, align 4, !tbaa !5
%25 = add nsw <2 x i32> %24, <i32 1, i32 1>
store <2 x i32> %25, ptr %arrayidx180, align 4, !tbaa !5
%arrayidx189 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom125, i64 %idxprom152
%26 = load <2 x i32>, ptr %arrayidx189, align 4, !tbaa !5
%27 = add nsw <2 x i32> %26, <i32 1, i32 1>
store <2 x i32> %27, ptr %arrayidx189, align 4, !tbaa !5
%add192 = add nsw i32 %17, 4
%idxprom193 = sext i32 %add192 to i64
%arrayidx197 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom193, i64 %idxprom120
%28 = load i32, ptr %arrayidx197, align 4, !tbaa !5
%inc198 = add nsw i32 %28, 1
store i32 %inc198, ptr %arrayidx197, align 4, !tbaa !5
%add203 = add nsw i32 %18, 4
%idxprom204 = sext i32 %add203 to i64
%arrayidx205 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom117, i64 %idxprom204
%29 = load i32, ptr %arrayidx205, align 4, !tbaa !5
%inc206 = add nsw i32 %29, 1
store i32 %inc206, ptr %arrayidx205, align 4, !tbaa !5
%idxprom209 = sext i32 %17 to i64
%arrayidx213 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom209, i64 %idxprom120
%30 = load i32, ptr %arrayidx213, align 4, !tbaa !5
%inc214 = add nsw i32 %30, 1
store i32 %inc214, ptr %arrayidx213, align 4, !tbaa !5
%idxprom220 = sext i32 %18 to i64
%arrayidx221 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %idxprom117, i64 %idxprom220
br label %if.end223.sink.split
if.end223.sink.split: ; preds = %if.then115, %if.end.thread, %if.then37
%arrayidx111.sink277 = phi ptr [ %arrayidx111, %if.then37 ], [ %arrayidx34, %if.end.thread ], [ %arrayidx221, %if.then115 ]
%31 = load i32, ptr %arrayidx111.sink277, align 4, !tbaa !5
%inc112 = add nsw i32 %31, 1
store i32 %inc112, ptr %arrayidx111.sink277, align 4, !tbaa !5
br label %if.end223
if.end223: ; preds = %if.end223.sink.split, %while.body
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @x, ptr noundef nonnull @y, ptr noundef nonnull @s)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %if.end223, %entry
store i32 0, ptr @b, align 4, !tbaa !5
store i32 0, ptr @a, align 4, !tbaa !5
br label %for.cond225.preheader
for.cond225.preheader: ; preds = %while.end, %for.inc.9
%indvars.iv = phi i64 [ 2, %while.end ], [ %indvars.iv.next, %for.inc.9 ]
%a.promoted266272 = phi i32 [ 0, %while.end ], [ %42, %for.inc.9 ]
%b.promoted270271 = phi i32 [ 0, %while.end ], [ %43, %for.inc.9 ]
%arrayidx231 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 2
%32 = load i32, ptr %arrayidx231, align 8, !tbaa !5
%cmp232 = icmp eq i32 %32, 0
br i1 %cmp232, label %if.then233, label %if.end235
if.then233: ; preds = %for.cond225.preheader
%inc234 = add nsw i32 %a.promoted266272, 1
store i32 %inc234, ptr @a, align 4, !tbaa !5
br label %if.end235
if.end235: ; preds = %if.then233, %for.cond225.preheader
%a.promoted264 = phi i32 [ %inc234, %if.then233 ], [ %a.promoted266272, %for.cond225.preheader ]
%cmp240 = icmp sgt i32 %32, %b.promoted270271
br i1 %cmp240, label %if.then241, label %for.inc
if.then241: ; preds = %if.end235
store i32 %32, ptr @b, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.end235, %if.then241
%b.promoted268 = phi i32 [ %b.promoted270271, %if.end235 ], [ %32, %if.then241 ]
%arrayidx231.1 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 3
%33 = load i32, ptr %arrayidx231.1, align 4, !tbaa !5
%cmp232.1 = icmp eq i32 %33, 0
br i1 %cmp232.1, label %if.then233.1, label %if.end235.1
if.then233.1: ; preds = %for.inc
%inc234.1 = add nsw i32 %a.promoted264, 1
store i32 %inc234.1, ptr @a, align 4, !tbaa !5
br label %if.end235.1
if.end235.1: ; preds = %if.then233.1, %for.inc
%a.promoted264.1 = phi i32 [ %inc234.1, %if.then233.1 ], [ %a.promoted264, %for.inc ]
%cmp240.1 = icmp sgt i32 %33, %b.promoted268
br i1 %cmp240.1, label %if.then241.1, label %for.inc.1
if.then241.1: ; preds = %if.end235.1
store i32 %33, ptr @b, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then241.1, %if.end235.1
%b.promoted268.1 = phi i32 [ %b.promoted268, %if.end235.1 ], [ %33, %if.then241.1 ]
%arrayidx231.2 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 4
%34 = load i32, ptr %arrayidx231.2, align 8, !tbaa !5
%cmp232.2 = icmp eq i32 %34, 0
br i1 %cmp232.2, label %if.then233.2, label %if.end235.2
if.then233.2: ; preds = %for.inc.1
%inc234.2 = add nsw i32 %a.promoted264.1, 1
store i32 %inc234.2, ptr @a, align 4, !tbaa !5
br label %if.end235.2
if.end235.2: ; preds = %if.then233.2, %for.inc.1
%a.promoted264.2 = phi i32 [ %inc234.2, %if.then233.2 ], [ %a.promoted264.1, %for.inc.1 ]
%cmp240.2 = icmp sgt i32 %34, %b.promoted268.1
br i1 %cmp240.2, label %if.then241.2, label %for.inc.2
if.then241.2: ; preds = %if.end235.2
store i32 %34, ptr @b, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then241.2, %if.end235.2
%b.promoted268.2 = phi i32 [ %b.promoted268.1, %if.end235.2 ], [ %34, %if.then241.2 ]
%arrayidx231.3 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 5
%35 = load i32, ptr %arrayidx231.3, align 4, !tbaa !5
%cmp232.3 = icmp eq i32 %35, 0
br i1 %cmp232.3, label %if.then233.3, label %if.end235.3
if.then233.3: ; preds = %for.inc.2
%inc234.3 = add nsw i32 %a.promoted264.2, 1
store i32 %inc234.3, ptr @a, align 4, !tbaa !5
br label %if.end235.3
if.end235.3: ; preds = %if.then233.3, %for.inc.2
%a.promoted264.3 = phi i32 [ %inc234.3, %if.then233.3 ], [ %a.promoted264.2, %for.inc.2 ]
%cmp240.3 = icmp sgt i32 %35, %b.promoted268.2
br i1 %cmp240.3, label %if.then241.3, label %for.inc.3
if.then241.3: ; preds = %if.end235.3
store i32 %35, ptr @b, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.then241.3, %if.end235.3
%b.promoted268.3 = phi i32 [ %b.promoted268.2, %if.end235.3 ], [ %35, %if.then241.3 ]
%arrayidx231.4 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 6
%36 = load i32, ptr %arrayidx231.4, align 8, !tbaa !5
%cmp232.4 = icmp eq i32 %36, 0
br i1 %cmp232.4, label %if.then233.4, label %if.end235.4
if.then233.4: ; preds = %for.inc.3
%inc234.4 = add nsw i32 %a.promoted264.3, 1
store i32 %inc234.4, ptr @a, align 4, !tbaa !5
br label %if.end235.4
if.end235.4: ; preds = %if.then233.4, %for.inc.3
%a.promoted264.4 = phi i32 [ %inc234.4, %if.then233.4 ], [ %a.promoted264.3, %for.inc.3 ]
%cmp240.4 = icmp sgt i32 %36, %b.promoted268.3
br i1 %cmp240.4, label %if.then241.4, label %for.inc.4
if.then241.4: ; preds = %if.end235.4
store i32 %36, ptr @b, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.then241.4, %if.end235.4
%b.promoted268.4 = phi i32 [ %b.promoted268.3, %if.end235.4 ], [ %36, %if.then241.4 ]
%arrayidx231.5 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 7
%37 = load i32, ptr %arrayidx231.5, align 4, !tbaa !5
%cmp232.5 = icmp eq i32 %37, 0
br i1 %cmp232.5, label %if.then233.5, label %if.end235.5
if.then233.5: ; preds = %for.inc.4
%inc234.5 = add nsw i32 %a.promoted264.4, 1
store i32 %inc234.5, ptr @a, align 4, !tbaa !5
br label %if.end235.5
if.end235.5: ; preds = %if.then233.5, %for.inc.4
%a.promoted264.5 = phi i32 [ %inc234.5, %if.then233.5 ], [ %a.promoted264.4, %for.inc.4 ]
%cmp240.5 = icmp sgt i32 %37, %b.promoted268.4
br i1 %cmp240.5, label %if.then241.5, label %for.inc.5
if.then241.5: ; preds = %if.end235.5
store i32 %37, ptr @b, align 4, !tbaa !5
br label %for.inc.5
for.inc.5: ; preds = %if.then241.5, %if.end235.5
%b.promoted268.5 = phi i32 [ %b.promoted268.4, %if.end235.5 ], [ %37, %if.then241.5 ]
%arrayidx231.6 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 8
%38 = load i32, ptr %arrayidx231.6, align 8, !tbaa !5
%cmp232.6 = icmp eq i32 %38, 0
br i1 %cmp232.6, label %if.then233.6, label %if.end235.6
if.then233.6: ; preds = %for.inc.5
%inc234.6 = add nsw i32 %a.promoted264.5, 1
store i32 %inc234.6, ptr @a, align 4, !tbaa !5
br label %if.end235.6
if.end235.6: ; preds = %if.then233.6, %for.inc.5
%a.promoted264.6 = phi i32 [ %inc234.6, %if.then233.6 ], [ %a.promoted264.5, %for.inc.5 ]
%cmp240.6 = icmp sgt i32 %38, %b.promoted268.5
br i1 %cmp240.6, label %if.then241.6, label %for.inc.6
if.then241.6: ; preds = %if.end235.6
store i32 %38, ptr @b, align 4, !tbaa !5
br label %for.inc.6
for.inc.6: ; preds = %if.then241.6, %if.end235.6
%b.promoted268.6 = phi i32 [ %b.promoted268.5, %if.end235.6 ], [ %38, %if.then241.6 ]
%arrayidx231.7 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 9
%39 = load i32, ptr %arrayidx231.7, align 4, !tbaa !5
%cmp232.7 = icmp eq i32 %39, 0
br i1 %cmp232.7, label %if.then233.7, label %if.end235.7
if.then233.7: ; preds = %for.inc.6
%inc234.7 = add nsw i32 %a.promoted264.6, 1
store i32 %inc234.7, ptr @a, align 4, !tbaa !5
br label %if.end235.7
if.end235.7: ; preds = %if.then233.7, %for.inc.6
%a.promoted264.7 = phi i32 [ %inc234.7, %if.then233.7 ], [ %a.promoted264.6, %for.inc.6 ]
%cmp240.7 = icmp sgt i32 %39, %b.promoted268.6
br i1 %cmp240.7, label %if.then241.7, label %for.inc.7
if.then241.7: ; preds = %if.end235.7
store i32 %39, ptr @b, align 4, !tbaa !5
br label %for.inc.7
for.inc.7: ; preds = %if.then241.7, %if.end235.7
%b.promoted268.7 = phi i32 [ %b.promoted268.6, %if.end235.7 ], [ %39, %if.then241.7 ]
%arrayidx231.8 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 10
%40 = load i32, ptr %arrayidx231.8, align 8, !tbaa !5
%cmp232.8 = icmp eq i32 %40, 0
br i1 %cmp232.8, label %if.then233.8, label %if.end235.8
if.then233.8: ; preds = %for.inc.7
%inc234.8 = add nsw i32 %a.promoted264.7, 1
store i32 %inc234.8, ptr @a, align 4, !tbaa !5
br label %if.end235.8
if.end235.8: ; preds = %if.then233.8, %for.inc.7
%a.promoted264.8 = phi i32 [ %inc234.8, %if.then233.8 ], [ %a.promoted264.7, %for.inc.7 ]
%cmp240.8 = icmp sgt i32 %40, %b.promoted268.7
br i1 %cmp240.8, label %if.then241.8, label %for.inc.8
if.then241.8: ; preds = %if.end235.8
store i32 %40, ptr @b, align 4, !tbaa !5
br label %for.inc.8
for.inc.8: ; preds = %if.then241.8, %if.end235.8
%b.promoted268.8 = phi i32 [ %b.promoted268.7, %if.end235.8 ], [ %40, %if.then241.8 ]
%arrayidx231.9 = getelementptr inbounds [18 x [18 x i32]], ptr @m, i64 0, i64 %indvars.iv, i64 11
%41 = load i32, ptr %arrayidx231.9, align 4, !tbaa !5
%cmp232.9 = icmp eq i32 %41, 0
br i1 %cmp232.9, label %if.then233.9, label %if.end235.9
if.then233.9: ; preds = %for.inc.8
%inc234.9 = add nsw i32 %a.promoted264.8, 1
store i32 %inc234.9, ptr @a, align 4, !tbaa !5
br label %if.end235.9
if.end235.9: ; preds = %if.then233.9, %for.inc.8
%42 = phi i32 [ %inc234.9, %if.then233.9 ], [ %a.promoted264.8, %for.inc.8 ]
%cmp240.9 = icmp sgt i32 %41, %b.promoted268.8
br i1 %cmp240.9, label %if.then241.9, label %for.inc.9
if.then241.9: ; preds = %if.end235.9
store i32 %41, ptr @b, align 4, !tbaa !5
br label %for.inc.9
for.inc.9: ; preds = %if.then241.9, %if.end235.9
%43 = phi i32 [ %b.promoted268.8, %if.end235.9 ], [ %41, %if.then241.9 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 12
br i1 %exitcond.not, label %for.end250, label %for.cond225.preheader, !llvm.loop !11
for.end250: ; preds = %for.inc.9
store i32 12, ptr @i, align 4, !tbaa !5
store i32 12, ptr @j, align 4, !tbaa !5
%call251 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %42, i32 noundef %43)
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) #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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main( void ) {
int paper[10][10], x, y, size, n = 0, m = 0;
for ( y = 0; y < 10; y++ ) { for ( x = 0; x < 10; x++ ) { paper[y][x] = 0; } }
while ( scanf( "%d,%d,%d", &x, &y, &size ) != EOF ) {
switch ( size ) {
case 3:
if ( y - 2 >= 0 ) { paper[y-2][x]++; }
if ( x - 2 >= 0 ) { paper[y][x-2]++; }
if ( x + 2 < 10 ) { paper[y][x+2]++; }
if ( y + 2 < 10 ) { paper[y+2][x]++; }
case 2:
if ( y - 1 >= 0 && x - 1 >= 0 ) { paper[y-1][x-1]++; }
if ( y - 1 >= 0 && x + 1 < 10 ) { paper[y-1][x+1]++; }
if ( y + 1 < 10 && x - 1 >= 0 ) { paper[y+1][x-1]++; }
if ( y + 1 < 10 && x + 1 < 10 ) { paper[y+1][x+1]++; }
case 1:
if ( y - 1 >= 0 ) { paper[y-1][x]++; }
if ( x - 1 >= 0 ) { paper[y][x-1]++; }
if ( x + 1 < 10 ) { paper[y][x+1]++; }
if ( y + 1 < 10 ) { paper[y+1][x]++; }
paper[y][x]++;
break;
}
}
for ( y = 0; y < 10; y++ ) {
for ( x = 0; x < 10; x++ ) {
if ( paper[y][x] == 0 ) { n++; }
if ( paper[y][x] > m ) { m = paper[y][x]; }
}
}
printf( "%d\n%d\n", n, m );
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320285/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320285/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d\0A%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%paper = alloca [10 x [10 x i32]], align 16
%x = alloca i32, align 4
%y = alloca i32, align 4
%size = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %paper) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %size) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %paper, i8 0, i64 400, i1 false), !tbaa !5
store i32 10, ptr %y, align 4, !tbaa !5
store i32 10, ptr %x, align 4, !tbaa !5
%call204 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %size)
%cmp9.not205 = icmp eq i32 %call204, -1
br i1 %cmp9.not205, label %for.cond151.preheader.preheader, label %while.body
while.body: ; preds = %entry, %sw.epilog
%0 = load i32, ptr %size, align 4, !tbaa !5
switch i32 %0, label %sw.epilog [
i32 3, label %sw.bb
i32 2, label %while.body.sw.bb46_crit_edge
i32 1, label %while.body.sw.bb102_crit_edge
]
while.body.sw.bb102_crit_edge: ; preds = %while.body
%.pre219 = load i32, ptr %y, align 4, !tbaa !5
%.pre220.pre = load i32, ptr %x, align 4, !tbaa !5
br label %sw.bb102
while.body.sw.bb46_crit_edge: ; preds = %while.body
%.pre217 = load i32, ptr %y, align 4, !tbaa !5
%.pre218.pre = load i32, ptr %x, align 4, !tbaa !5
br label %sw.bb46
sw.bb: ; preds = %while.body
%1 = load i32, ptr %y, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %1, 1
%.pre = load i32, ptr %x, align 4, !tbaa !5
br i1 %cmp10, label %if.then, label %if.end
if.then: ; preds = %sw.bb
%sub = add nsw i32 %1, -2
%idxprom12 = zext i32 %sub to i64
%idxprom14 = sext i32 %.pre to i64
%arrayidx15 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom12, i64 %idxprom14
%2 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%inc16 = add nsw i32 %2, 1
store i32 %inc16, ptr %arrayidx15, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %sw.bb
%cmp18 = icmp sgt i32 %.pre, 1
br i1 %cmp18, label %if.end26, label %if.end.if.then28_crit_edge
if.end.if.then28_crit_edge: ; preds = %if.end
%.pre223 = sext i32 %1 to i64
br label %if.then28
if.end26: ; preds = %if.end
%sub17 = add nsw i32 %.pre, -2
%idxprom20 = sext i32 %1 to i64
%idxprom23 = zext i32 %sub17 to i64
%arrayidx24 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom20, i64 %idxprom23
%3 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%inc25 = add nsw i32 %3, 1
store i32 %inc25, ptr %arrayidx24, align 4, !tbaa !5
%cmp27 = icmp ult i32 %.pre, 8
br i1 %cmp27, label %if.then28, label %if.end35
if.then28: ; preds = %if.end.if.then28_crit_edge, %if.end26
%idxprom29.pre-phi = phi i64 [ %.pre223, %if.end.if.then28_crit_edge ], [ %idxprom20, %if.end26 ]
%add = add nsw i32 %.pre, 2
%idxprom32 = sext i32 %add to i64
%arrayidx33 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom29.pre-phi, i64 %idxprom32
%4 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%inc34 = add nsw i32 %4, 1
store i32 %inc34, ptr %arrayidx33, align 4, !tbaa !5
br label %if.end35
if.end35: ; preds = %if.then28, %if.end26
%cmp37 = icmp slt i32 %1, 8
br i1 %cmp37, label %if.then38, label %land.lhs.true
if.then38: ; preds = %if.end35
%add36 = add nsw i32 %1, 2
%idxprom40 = sext i32 %add36 to i64
%idxprom42 = sext i32 %.pre to i64
%arrayidx43 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom40, i64 %idxprom42
%5 = load i32, ptr %arrayidx43, align 4, !tbaa !5
%inc44 = add nsw i32 %5, 1
store i32 %inc44, ptr %arrayidx43, align 4, !tbaa !5
br label %sw.bb46
sw.bb46: ; preds = %while.body.sw.bb46_crit_edge, %if.then38
%.pre218 = phi i32 [ %.pre218.pre, %while.body.sw.bb46_crit_edge ], [ %.pre, %if.then38 ]
%6 = phi i32 [ %.pre217, %while.body.sw.bb46_crit_edge ], [ %1, %if.then38 ]
%cmp48 = icmp sgt i32 %6, 0
br i1 %cmp48, label %land.lhs.true, label %land.lhs.true76
land.lhs.true: ; preds = %if.end35, %sw.bb46
%7 = phi i32 [ %6, %sw.bb46 ], [ %1, %if.end35 ]
%.pre218232 = phi i32 [ %.pre218, %sw.bb46 ], [ %.pre, %if.end35 ]
%sub47233 = add nsw i32 %7, -1
%cmp50 = icmp sgt i32 %.pre218232, 0
br i1 %cmp50, label %land.lhs.true62, label %land.lhs.true.if.then65_crit_edge
land.lhs.true.if.then65_crit_edge: ; preds = %land.lhs.true
%.pre224 = zext i32 %sub47233 to i64
br label %if.then65
land.lhs.true62: ; preds = %land.lhs.true
%sub49 = add nsw i32 %.pre218232, -1
%idxprom53 = zext i32 %sub47233 to i64
%idxprom56 = zext i32 %sub49 to i64
%arrayidx57 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom53, i64 %idxprom56
%8 = load i32, ptr %arrayidx57, align 4, !tbaa !5
%inc58 = add nsw i32 %8, 1
store i32 %inc58, ptr %arrayidx57, align 4, !tbaa !5
%cmp64 = icmp ult i32 %.pre218232, 9
br i1 %cmp64, label %if.then65, label %if.end73
if.then65: ; preds = %land.lhs.true.if.then65_crit_edge, %land.lhs.true62
%idxprom67.pre-phi = phi i64 [ %.pre224, %land.lhs.true.if.then65_crit_edge ], [ %idxprom53, %land.lhs.true62 ]
%add63 = add nsw i32 %.pre218232, 1
%idxprom70 = sext i32 %add63 to i64
%arrayidx71 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom67.pre-phi, i64 %idxprom70
%9 = load i32, ptr %arrayidx71, align 4, !tbaa !5
%inc72 = add nsw i32 %9, 1
store i32 %inc72, ptr %arrayidx71, align 4, !tbaa !5
br label %if.end73
if.end73: ; preds = %if.then65, %land.lhs.true62
%cmp75 = icmp ult i32 %7, 9
br i1 %cmp75, label %land.lhs.true76, label %if.then105
land.lhs.true76: ; preds = %sw.bb46, %if.end73
%10 = phi i32 [ %6, %sw.bb46 ], [ %7, %if.end73 ]
%.pre218231 = phi i32 [ %.pre218, %sw.bb46 ], [ %.pre218232, %if.end73 ]
%add74191 = add nsw i32 %10, 1
%cmp78 = icmp sgt i32 %.pre218231, 0
br i1 %cmp78, label %land.lhs.true90, label %land.lhs.true76.if.then93_crit_edge
land.lhs.true76.if.then93_crit_edge: ; preds = %land.lhs.true76
%.pre225 = sext i32 %add74191 to i64
br label %if.then93
land.lhs.true90: ; preds = %land.lhs.true76
%sub77 = add nsw i32 %.pre218231, -1
%idxprom81 = sext i32 %add74191 to i64
%idxprom84 = zext i32 %sub77 to i64
%arrayidx85 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom81, i64 %idxprom84
%11 = load i32, ptr %arrayidx85, align 4, !tbaa !5
%inc86 = add nsw i32 %11, 1
store i32 %inc86, ptr %arrayidx85, align 4, !tbaa !5
%cmp92 = icmp ult i32 %.pre218231, 9
br i1 %cmp92, label %if.then93, label %sw.bb102
if.then93: ; preds = %land.lhs.true76.if.then93_crit_edge, %land.lhs.true90
%idxprom95.pre-phi = phi i64 [ %.pre225, %land.lhs.true76.if.then93_crit_edge ], [ %idxprom81, %land.lhs.true90 ]
%add91 = add nsw i32 %.pre218231, 1
%idxprom98 = sext i32 %add91 to i64
%arrayidx99 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom95.pre-phi, i64 %idxprom98
%12 = load i32, ptr %arrayidx99, align 4, !tbaa !5
%inc100 = add nsw i32 %12, 1
store i32 %inc100, ptr %arrayidx99, align 4, !tbaa !5
br label %sw.bb102
sw.bb102: ; preds = %while.body.sw.bb102_crit_edge, %land.lhs.true90, %if.then93
%.pre220 = phi i32 [ %.pre220.pre, %while.body.sw.bb102_crit_edge ], [ %.pre218231, %land.lhs.true90 ], [ %.pre218231, %if.then93 ]
%13 = phi i32 [ %.pre219, %while.body.sw.bb102_crit_edge ], [ %10, %land.lhs.true90 ], [ %10, %if.then93 ]
%cmp104 = icmp sgt i32 %13, 0
br i1 %cmp104, label %if.then105, label %if.end112
if.then105: ; preds = %if.end73, %sw.bb102
%14 = phi i32 [ %13, %sw.bb102 ], [ %7, %if.end73 ]
%.pre220237 = phi i32 [ %.pre220, %sw.bb102 ], [ %.pre218232, %if.end73 ]
%sub103 = add nsw i32 %14, -1
%idxprom107 = zext i32 %sub103 to i64
%idxprom109 = sext i32 %.pre220237 to i64
%arrayidx110 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom107, i64 %idxprom109
%15 = load i32, ptr %arrayidx110, align 4, !tbaa !5
%inc111 = add nsw i32 %15, 1
store i32 %inc111, ptr %arrayidx110, align 4, !tbaa !5
br label %if.end112
if.end112: ; preds = %if.then105, %sw.bb102
%16 = phi i32 [ %14, %if.then105 ], [ %13, %sw.bb102 ]
%.pre220236 = phi i32 [ %.pre220237, %if.then105 ], [ %.pre220, %sw.bb102 ]
%cmp114 = icmp sgt i32 %.pre220236, 0
br i1 %cmp114, label %if.end122, label %if.end112.if.then125_crit_edge
if.end112.if.then125_crit_edge: ; preds = %if.end112
%.pre226 = sext i32 %16 to i64
br label %if.then125
if.end122: ; preds = %if.end112
%sub113 = add nsw i32 %.pre220236, -1
%idxprom116 = sext i32 %16 to i64
%idxprom119 = zext i32 %sub113 to i64
%arrayidx120 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom116, i64 %idxprom119
%17 = load i32, ptr %arrayidx120, align 4, !tbaa !5
%inc121 = add nsw i32 %17, 1
store i32 %inc121, ptr %arrayidx120, align 4, !tbaa !5
%cmp124 = icmp ult i32 %.pre220236, 9
br i1 %cmp124, label %if.then125, label %if.end132
if.then125: ; preds = %if.end112.if.then125_crit_edge, %if.end122
%idxprom126.pre-phi = phi i64 [ %.pre226, %if.end112.if.then125_crit_edge ], [ %idxprom116, %if.end122 ]
%add123 = add nsw i32 %.pre220236, 1
%idxprom129 = sext i32 %add123 to i64
%arrayidx130 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom126.pre-phi, i64 %idxprom129
%18 = load i32, ptr %arrayidx130, align 4, !tbaa !5
%inc131 = add nsw i32 %18, 1
store i32 %inc131, ptr %arrayidx130, align 4, !tbaa !5
br label %if.end132
if.end132: ; preds = %if.then125, %if.end122
%cmp134 = icmp slt i32 %16, 9
br i1 %cmp134, label %if.then135, label %if.end132.if.end142_crit_edge
if.end132.if.end142_crit_edge: ; preds = %if.end132
%.pre227 = sext i32 %.pre220236 to i64
br label %if.end142
if.then135: ; preds = %if.end132
%add133 = add nsw i32 %16, 1
%idxprom137 = sext i32 %add133 to i64
%idxprom139 = sext i32 %.pre220236 to i64
%arrayidx140 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom137, i64 %idxprom139
%19 = load i32, ptr %arrayidx140, align 4, !tbaa !5
%inc141 = add nsw i32 %19, 1
store i32 %inc141, ptr %arrayidx140, align 4, !tbaa !5
br label %if.end142
if.end142: ; preds = %if.end132.if.end142_crit_edge, %if.then135
%idxprom145.pre-phi = phi i64 [ %.pre227, %if.end132.if.end142_crit_edge ], [ %idxprom139, %if.then135 ]
%idxprom143 = sext i32 %16 to i64
%arrayidx146 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %idxprom143, i64 %idxprom145.pre-phi
%20 = load i32, ptr %arrayidx146, align 4, !tbaa !5
%inc147 = add nsw i32 %20, 1
store i32 %inc147, ptr %arrayidx146, align 4, !tbaa !5
br label %sw.epilog
sw.epilog: ; preds = %while.body, %if.end142
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y, ptr noundef nonnull %size)
%cmp9.not = icmp eq i32 %call, -1
br i1 %cmp9.not, label %for.cond151.preheader.preheader, label %while.body, !llvm.loop !9
for.cond151.preheader.preheader: ; preds = %sw.epilog, %entry
br label %for.cond151.preheader
for.cond151.preheader: ; preds = %for.cond151.preheader.preheader, %for.cond151.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond151.preheader ], [ 0, %for.cond151.preheader.preheader ]
%m.0212 = phi i32 [ %m.2.9, %for.cond151.preheader ], [ 0, %for.cond151.preheader.preheader ]
%n.0211 = phi i32 [ %spec.select.9, %for.cond151.preheader ], [ 0, %for.cond151.preheader.preheader ]
%arrayidx157 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %indvars.iv, i64 0
%21 = load i32, ptr %arrayidx157, align 8, !tbaa !5
%cmp158 = icmp eq i32 %21, 0
%inc160 = zext i1 %cmp158 to i32
%spec.select = add nsw i32 %n.0211, %inc160
%m.2 = call i32 @llvm.smax.i32(i32 %21, i32 %m.0212)
%arrayidx157.1 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %indvars.iv, i64 1
%22 = load i32, ptr %arrayidx157.1, align 4, !tbaa !5
%cmp158.1 = icmp eq i32 %22, 0
%inc160.1 = zext i1 %cmp158.1 to i32
%spec.select.1 = add nsw i32 %spec.select, %inc160.1
%m.2.1 = call i32 @llvm.smax.i32(i32 %22, i32 %m.2)
%arrayidx157.2 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %indvars.iv, i64 2
%23 = load i32, ptr %arrayidx157.2, align 8, !tbaa !5
%cmp158.2 = icmp eq i32 %23, 0
%inc160.2 = zext i1 %cmp158.2 to i32
%spec.select.2 = add nsw i32 %spec.select.1, %inc160.2
%m.2.2 = call i32 @llvm.smax.i32(i32 %23, i32 %m.2.1)
%arrayidx157.3 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %indvars.iv, i64 3
%24 = load i32, ptr %arrayidx157.3, align 4, !tbaa !5
%cmp158.3 = icmp eq i32 %24, 0
%inc160.3 = zext i1 %cmp158.3 to i32
%spec.select.3 = add nsw i32 %spec.select.2, %inc160.3
%m.2.3 = call i32 @llvm.smax.i32(i32 %24, i32 %m.2.2)
%arrayidx157.4 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %indvars.iv, i64 4
%25 = load i32, ptr %arrayidx157.4, align 8, !tbaa !5
%cmp158.4 = icmp eq i32 %25, 0
%inc160.4 = zext i1 %cmp158.4 to i32
%spec.select.4 = add nsw i32 %spec.select.3, %inc160.4
%m.2.4 = call i32 @llvm.smax.i32(i32 %25, i32 %m.2.3)
%arrayidx157.5 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %indvars.iv, i64 5
%26 = load i32, ptr %arrayidx157.5, align 4, !tbaa !5
%cmp158.5 = icmp eq i32 %26, 0
%inc160.5 = zext i1 %cmp158.5 to i32
%spec.select.5 = add nsw i32 %spec.select.4, %inc160.5
%m.2.5 = call i32 @llvm.smax.i32(i32 %26, i32 %m.2.4)
%arrayidx157.6 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %indvars.iv, i64 6
%27 = load i32, ptr %arrayidx157.6, align 8, !tbaa !5
%cmp158.6 = icmp eq i32 %27, 0
%inc160.6 = zext i1 %cmp158.6 to i32
%spec.select.6 = add nsw i32 %spec.select.5, %inc160.6
%m.2.6 = call i32 @llvm.smax.i32(i32 %27, i32 %m.2.5)
%arrayidx157.7 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %indvars.iv, i64 7
%28 = load i32, ptr %arrayidx157.7, align 4, !tbaa !5
%cmp158.7 = icmp eq i32 %28, 0
%inc160.7 = zext i1 %cmp158.7 to i32
%spec.select.7 = add nsw i32 %spec.select.6, %inc160.7
%m.2.7 = call i32 @llvm.smax.i32(i32 %28, i32 %m.2.6)
%arrayidx157.8 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %indvars.iv, i64 8
%29 = load i32, ptr %arrayidx157.8, align 8, !tbaa !5
%cmp158.8 = icmp eq i32 %29, 0
%inc160.8 = zext i1 %cmp158.8 to i32
%spec.select.8 = add nsw i32 %spec.select.7, %inc160.8
%m.2.8 = call i32 @llvm.smax.i32(i32 %29, i32 %m.2.7)
%arrayidx157.9 = getelementptr inbounds [10 x [10 x i32]], ptr %paper, i64 0, i64 %indvars.iv, i64 9
%30 = load i32, ptr %arrayidx157.9, align 4, !tbaa !5
%cmp158.9 = icmp eq i32 %30, 0
%inc160.9 = zext i1 %cmp158.9 to i32
%spec.select.9 = add nsw i32 %spec.select.8, %inc160.9
%m.2.9 = call i32 @llvm.smax.i32(i32 %30, i32 %m.2.8)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 10
br i1 %exitcond.not, label %for.end178, label %for.cond151.preheader, !llvm.loop !11
for.end178: ; preds = %for.cond151.preheader
store i32 10, ptr %y, align 4, !tbaa !5
store i32 10, ptr %x, align 4, !tbaa !5
%call179 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select.9, i32 noundef %m.2.9)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %size) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %paper) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int fi[1001];
int b1 = 1, b2 = 1, now;
int k;
int V, d;
int j, last = -1;
int ans = 1;
int i=0;
while(scanf("%d %d", &V, &d) != EOF)
{
for(i=0; i<1001; i++)
{
fi[i] = 0;
}
for(k=0; k<V; k++)
{
now = (b1 + b2) % 1001;
fi[now] = 1;
b2 = b1;
b1 = now;
}
for(j=0; j<=1000; j++)
{
if(fi[j]==1)
{
if(last >= 0 && j - last >= d)
{
ans++;
last = j;
}
else
{
last = j;
}
}
}
printf("%d\n", ans);
b1 = 1;
b2 = 1;
last = -1;
ans = 1;
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320335/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320335/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%fi = alloca [1001 x i32], align 16
%V = alloca i32, align 4
%d = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %fi) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %V) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
%call45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %V, ptr noundef nonnull %d)
%cmp.not46 = icmp eq i32 %call45, -1
br i1 %cmp.not46, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end23
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %fi, i8 0, i64 4004, i1 false), !tbaa !5
%0 = load i32, ptr %V, align 4, !tbaa !5
%cmp338 = icmp sgt i32 %0, 0
br i1 %cmp338, label %for.body4.preheader, label %for.cond10.preheader
for.body4.preheader: ; preds = %for.cond.preheader
%xtraiter = and i32 %0, 1
%1 = icmp eq i32 %0, 1
br i1 %1, label %for.cond10.preheader.loopexit.unr-lcssa, label %for.body4.preheader.new
for.body4.preheader.new: ; preds = %for.body4.preheader
%unroll_iter = and i32 %0, -2
br label %for.body4
for.cond10.preheader.loopexit.unr-lcssa: ; preds = %for.body4, %for.body4.preheader
%b1.140.unr = phi i32 [ 1, %for.body4.preheader ], [ %rem.1, %for.body4 ]
%b2.139.unr = phi i32 [ 1, %for.body4.preheader ], [ %rem, %for.body4 ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond10.preheader, label %for.body4.epil
for.body4.epil: ; preds = %for.cond10.preheader.loopexit.unr-lcssa
%add.epil = add nsw i32 %b1.140.unr, %b2.139.unr
%rem.epil = srem i32 %add.epil, 1001
%idxprom5.epil = sext i32 %rem.epil to i64
%arrayidx6.epil = getelementptr inbounds [1001 x i32], ptr %fi, i64 0, i64 %idxprom5.epil
store i32 1, ptr %arrayidx6.epil, align 4, !tbaa !5
br label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.body4.epil, %for.cond10.preheader.loopexit.unr-lcssa, %for.cond.preheader
%2 = load i32, ptr %d, align 4
br label %for.body12
for.body4: ; preds = %for.body4, %for.body4.preheader.new
%b1.140 = phi i32 [ 1, %for.body4.preheader.new ], [ %rem.1, %for.body4 ]
%b2.139 = phi i32 [ 1, %for.body4.preheader.new ], [ %rem, %for.body4 ]
%niter = phi i32 [ 0, %for.body4.preheader.new ], [ %niter.next.1, %for.body4 ]
%add = add nsw i32 %b1.140, %b2.139
%rem = srem i32 %add, 1001
%idxprom5 = sext i32 %rem to i64
%arrayidx6 = getelementptr inbounds [1001 x i32], ptr %fi, i64 0, i64 %idxprom5
store i32 1, ptr %arrayidx6, align 4, !tbaa !5
%add.1 = add nsw i32 %rem, %b1.140
%rem.1 = srem i32 %add.1, 1001
%idxprom5.1 = sext i32 %rem.1 to i64
%arrayidx6.1 = getelementptr inbounds [1001 x i32], ptr %fi, i64 0, i64 %idxprom5.1
store i32 1, ptr %arrayidx6.1, align 4, !tbaa !5
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond10.preheader.loopexit.unr-lcssa, label %for.body4, !llvm.loop !9
for.body12: ; preds = %for.inc21.1, %for.cond10.preheader
%indvars.iv = phi i64 [ 0, %for.cond10.preheader ], [ %indvars.iv.next.1, %for.inc21.1 ]
%ans.144 = phi i32 [ 1, %for.cond10.preheader ], [ %ans.2.1, %for.inc21.1 ]
%last.143 = phi i32 [ -1, %for.cond10.preheader ], [ %last.2.1, %for.inc21.1 ]
%arrayidx14 = getelementptr inbounds [1001 x i32], ptr %fi, i64 0, i64 %indvars.iv
%3 = load i32, ptr %arrayidx14, align 8, !tbaa !5
%cmp15 = icmp eq i32 %3, 1
br i1 %cmp15, label %if.then, label %for.inc21
if.then: ; preds = %for.body12
%cmp16 = icmp sgt i32 %last.143, -1
%4 = trunc i64 %indvars.iv to i32
br i1 %cmp16, label %land.lhs.true, label %for.inc21
land.lhs.true: ; preds = %if.then
%sub = sub nsw i32 %4, %last.143
%cmp17.not = icmp sge i32 %sub, %2
%inc19 = zext i1 %cmp17.not to i32
%spec.select = add nsw i32 %ans.144, %inc19
br label %for.inc21
for.inc21: ; preds = %land.lhs.true, %if.then, %for.body12
%last.2 = phi i32 [ %last.143, %for.body12 ], [ %4, %if.then ], [ %4, %land.lhs.true ]
%ans.2 = phi i32 [ %ans.144, %for.body12 ], [ %ans.144, %if.then ], [ %spec.select, %land.lhs.true ]
%indvars.iv.next = or i64 %indvars.iv, 1
%exitcond49.not = icmp eq i64 %indvars.iv.next, 1001
br i1 %exitcond49.not, label %for.end23, label %for.body12.1, !llvm.loop !11
for.body12.1: ; preds = %for.inc21
%arrayidx14.1 = getelementptr inbounds [1001 x i32], ptr %fi, i64 0, i64 %indvars.iv.next
%5 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5
%cmp15.1 = icmp eq i32 %5, 1
br i1 %cmp15.1, label %if.then.1, label %for.inc21.1
if.then.1: ; preds = %for.body12.1
%cmp16.1 = icmp sgt i32 %last.2, -1
%6 = trunc i64 %indvars.iv.next to i32
br i1 %cmp16.1, label %land.lhs.true.1, label %for.inc21.1
land.lhs.true.1: ; preds = %if.then.1
%sub.1 = sub nsw i32 %6, %last.2
%cmp17.not.1 = icmp sge i32 %sub.1, %2
%inc19.1 = zext i1 %cmp17.not.1 to i32
%spec.select.1 = add nsw i32 %ans.2, %inc19.1
br label %for.inc21.1
for.inc21.1: ; preds = %land.lhs.true.1, %if.then.1, %for.body12.1
%last.2.1 = phi i32 [ %last.2, %for.body12.1 ], [ %6, %if.then.1 ], [ %6, %land.lhs.true.1 ]
%ans.2.1 = phi i32 [ %ans.2, %for.body12.1 ], [ %ans.2, %if.then.1 ], [ %spec.select.1, %land.lhs.true.1 ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
br label %for.body12
for.end23: ; preds = %for.inc21
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.2)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %V, ptr noundef nonnull %d)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12
while.end: ; preds = %for.end23, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %V) #4
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %fi) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
/* 最大公約数を返す */
int gcd(int a, int b) {
int r;
while (b != 0) { r = a % b; a = b; b = r; }
return (a < 0) ? -a : a;
}
/* 値を入れ換える */
void swap(int *a, int *b) {
int c = *a; *a = *b; *b = c;
}
int main(void) {
int a, b, c; /* 与えられる値 */
int p, q, r, s;
int f; /* 解が存在するか */
/* データセット毎の処理 */
while (scanf("%d%d%d", &a, &b, &c) == 3 && a > 0) {
int d = b * b - 4 * a * c; /* 二次方程式の判別式D */
f = 0;
if (d == 0) {
int g;
/* 重解 -b / 2a */
f = 1;
p = 2 * a;
q = b; /* 符号に注意 */
/* 約分 */
g = gcd(p, q);
p /= g;
q /= g;
r = p;
s = q;
} else if (d > 0) {
/* 異なる二つの実数解 (-b +- √d) / 2a */
int i;
for (i = 1; i * i < d; i++); /* D の正整数平方根を求める */
/* Dの平方根が整数であるなら整数 p, q, r, s が存在する */
if (i * i == d) {
int g;
f = 1;
p = 2 * a;
r = 2 * a;
q = -(-b - i);
s = -(-b + i);
/* 約分 */
g = gcd(p, q);
p /= g;
q /= g;
g = gcd(r, s);
r /= g;
s /= g;
/* 問題の条件に合わせて解の順番を入れ換える */
if (!(p > r || (p == r && q >= s))) {
swap(&p, &r);
swap(&q, &s);
}
}
}
/* 結果を出力する */
if (f) printf("%d %d %d %d\n", p, q, r, s);
else printf("Impossible\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320407/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320407/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%d %d %d %d\0A\00", align 1
@str = private unnamed_addr constant [11 x i8] c"Impossible\00", align 1
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cmp.not7 = icmp eq i32 %b, 0
br i1 %cmp.not7, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.09 = phi i32 [ %b.addr.08, %while.body ], [ %a, %entry ]
%b.addr.08 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.09, %b.addr.08
%cmp.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.08, %while.body ]
%cond = tail call i32 @llvm.abs.i32(i32 %a.addr.0.lcssa, i1 true)
ret i32 %cond
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !7
%1 = load i32, ptr %b, align 4, !tbaa !7
store i32 %1, ptr %a, align 4, !tbaa !7
store i32 %0, ptr %b, align 4, !tbaa !7
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #7
%call103 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%cmp104 = icmp eq i32 %call103, 3
%0 = load i32, ptr %a, align 4
%cmp1105 = icmp sgt i32 %0, 0
%1 = select i1 %cmp104, i1 %cmp1105, i1 false
br i1 %1, label %while.body, label %while.end
while.body: ; preds = %entry, %if.end40
%2 = phi i32 [ %6, %if.end40 ], [ %0, %entry ]
%3 = load i32, ptr %b, align 4, !tbaa !7
%mul = mul nsw i32 %3, %3
%mul2 = shl nsw i32 %2, 2
%4 = load i32, ptr %c, align 4, !tbaa !7
%mul3 = mul nsw i32 %4, %mul2
%sub = sub nsw i32 %mul, %mul3
%cmp4 = icmp eq i32 %mul, %mul3
br i1 %cmp4, label %if.then, label %if.else
if.then: ; preds = %while.body
%mul5 = shl nuw nsw i32 %2, 1
%cmp.not7.i = icmp eq i32 %3, 0
br i1 %cmp.not7.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %if.then, %while.body.i
%a.addr.09.i = phi i32 [ %b.addr.08.i, %while.body.i ], [ %mul5, %if.then ]
%b.addr.08.i = phi i32 [ %rem.i, %while.body.i ], [ %3, %if.then ]
%rem.i = srem i32 %a.addr.09.i, %b.addr.08.i
%cmp.not.i = icmp eq i32 %rem.i, 0
br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5
gcd.exit: ; preds = %while.body.i, %if.then
%a.addr.0.lcssa.i = phi i32 [ %mul5, %if.then ], [ %b.addr.08.i, %while.body.i ]
%cond.i = call i32 @llvm.abs.i32(i32 %a.addr.0.lcssa.i, i1 true)
%div = udiv i32 %mul5, %cond.i
%div7 = sdiv i32 %3, %cond.i
br label %if.then36
if.else: ; preds = %while.body
%cmp8 = icmp sgt i32 %sub, 0
br i1 %cmp8, label %for.cond, label %if.else38
for.cond: ; preds = %if.else, %for.cond
%i.0 = phi i32 [ %inc, %for.cond ], [ 1, %if.else ]
%mul10 = mul nsw i32 %i.0, %i.0
%cmp11 = icmp slt i32 %mul10, %sub
%inc = add nuw nsw i32 %i.0, 1
br i1 %cmp11, label %for.cond, label %for.end, !llvm.loop !11
for.end: ; preds = %for.cond
%cmp13 = icmp eq i32 %mul10, %sub
br i1 %cmp13, label %if.then14, label %if.else38
if.then14: ; preds = %for.end
%mul16 = shl nsw i32 %2, 1
%5 = add i32 %i.0, %3
%add.neg = sub i32 %3, %i.0
%cmp.not7.i56 = icmp eq i32 %5, 0
br i1 %cmp.not7.i56, label %gcd.exit64, label %while.body.i57
while.body.i57: ; preds = %if.then14, %while.body.i57
%a.addr.09.i58 = phi i32 [ %b.addr.08.i59, %while.body.i57 ], [ %mul16, %if.then14 ]
%b.addr.08.i59 = phi i32 [ %rem.i60, %while.body.i57 ], [ %5, %if.then14 ]
%rem.i60 = srem i32 %a.addr.09.i58, %b.addr.08.i59
%cmp.not.i61 = icmp eq i32 %rem.i60, 0
br i1 %cmp.not.i61, label %gcd.exit64, label %while.body.i57, !llvm.loop !5
gcd.exit64: ; preds = %while.body.i57, %if.then14
%a.addr.0.lcssa.i62 = phi i32 [ %mul16, %if.then14 ], [ %b.addr.08.i59, %while.body.i57 ]
%cond.i63 = call i32 @llvm.abs.i32(i32 %a.addr.0.lcssa.i62, i1 true)
%div24 = sdiv i32 %mul16, %cond.i63
%div25 = sdiv i32 %5, %cond.i63
%cmp.not7.i65 = icmp eq i32 %add.neg, 0
br i1 %cmp.not7.i65, label %gcd.exit73, label %while.body.i66
while.body.i66: ; preds = %gcd.exit64, %while.body.i66
%a.addr.09.i67 = phi i32 [ %b.addr.08.i68, %while.body.i66 ], [ %mul16, %gcd.exit64 ]
%b.addr.08.i68 = phi i32 [ %rem.i69, %while.body.i66 ], [ %add.neg, %gcd.exit64 ]
%rem.i69 = srem i32 %a.addr.09.i67, %b.addr.08.i68
%cmp.not.i70 = icmp eq i32 %rem.i69, 0
br i1 %cmp.not.i70, label %gcd.exit73, label %while.body.i66, !llvm.loop !5
gcd.exit73: ; preds = %while.body.i66, %gcd.exit64
%a.addr.0.lcssa.i71 = phi i32 [ %mul16, %gcd.exit64 ], [ %b.addr.08.i68, %while.body.i66 ]
%cond.i72 = call i32 @llvm.abs.i32(i32 %a.addr.0.lcssa.i71, i1 true)
%div27 = sdiv i32 %mul16, %cond.i72
%div28 = sdiv i32 %add.neg, %cond.i72
%cmp29 = icmp sgt i32 %div24, %div27
br i1 %cmp29, label %if.then36, label %lor.lhs.false
lor.lhs.false: ; preds = %gcd.exit73
%cmp30 = icmp ne i32 %div24, %div27
%cmp31.not = icmp slt i32 %div25, %div28
%or.cond = or i1 %cmp30, %cmp31.not
br i1 %or.cond, label %if.then32, label %if.then36
if.then32: ; preds = %lor.lhs.false
br label %if.then36
if.then36: ; preds = %gcd.exit, %lor.lhs.false, %if.then32, %gcd.exit73
%p.1.ph = phi i32 [ %div24, %lor.lhs.false ], [ %div27, %if.then32 ], [ %div24, %gcd.exit73 ], [ %div, %gcd.exit ]
%q.1.ph = phi i32 [ %div25, %lor.lhs.false ], [ %div28, %if.then32 ], [ %div25, %gcd.exit73 ], [ %div7, %gcd.exit ]
%r.1.ph = phi i32 [ %div24, %lor.lhs.false ], [ %div24, %if.then32 ], [ %div27, %gcd.exit73 ], [ %div, %gcd.exit ]
%s.1.ph = phi i32 [ %div28, %lor.lhs.false ], [ %div25, %if.then32 ], [ %div28, %gcd.exit73 ], [ %div7, %gcd.exit ]
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %p.1.ph, i32 noundef %q.1.ph, i32 noundef %r.1.ph, i32 noundef %s.1.ph)
br label %if.end40
if.else38: ; preds = %if.else, %for.end
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end40
if.end40: ; preds = %if.else38, %if.then36
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%cmp = icmp eq i32 %call, 3
%6 = load i32, ptr %a, align 4
%cmp1 = icmp sgt i32 %6, 0
%7 = select i1 %cmp, i1 %cmp1, i1 false
br i1 %7, label %while.body, label %while.end, !llvm.loop !12
while.end: ; preds = %if.end40, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nofree nounwind }
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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
!12 = distinct !{!12, !6}
|
#include <stdio.h>
int main(void){
int n, k;
int ans;
scanf("%d %d", &n, &k);
ans=n-k+1;
if(ans<=0){
printf("0\n");
}else{
printf("%d\n", ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320472/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320472/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%cmp = icmp slt i32 %sub, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry
%add = add nuw nsw i32 %sub, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int N;
scanf("%d",&N);
int K;
scanf("%d",&K);
printf("%d",N-K+1);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320522/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320522/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%K = 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)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %K, align 4, !tbaa !5
%sub = add i32 %0, 1
%add = sub i32 %sub, %1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
unsigned long long int n,k;
scanf("%llu %llu",&n,&k);
printf("%llu\n",n-k+1);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320566/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320566/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%llu %llu\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%llu\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = load i64, ptr %k, align 8, !tbaa !5
%sub = add i64 %0, 1
%add = sub i64 %sub, %1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void)
{
int N,K;
scanf("%d %d",&N,&K);
printf("%d\n",N - K + 1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320609/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320609/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = 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 %K) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %K, align 4, !tbaa !5
%sub = add i32 %0, 1
%add = sub i32 %sub, %1
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define MAX 100000
int partition(int A[], int p, int r){
int x,i,j,t;
x = A[r];
i = p - 1;
for(j=p;j<r;j++){
if(A[j] <= x){
i++;
t = A[i];
A[i] = A[j];
A[j] = t;
}
}
t = A[i+1];
A[i+1] = A[r];
A[r] = t;
return (i + 1);
}
int main(){
int A[MAX],n,i,q;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
q = partition(A,0,n-1);
for(i=0;i<n;i++){
if(i){
printf(" ");
}
if(i == q){
printf("[");
}
printf("%d",A[i]);
if(i == q){
printf("]");
}
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320652/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320652/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
%cmp3.not.prol = icmp sgt i32 %3, %0
br i1 %cmp3.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom4.prol = sext i32 %p to i64
%arrayidx5.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom4.prol
%4 = load i32, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.047 = phi i32 [ %i.047.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %8, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.047, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%9 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %10, %0
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %inc.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%11 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%12 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%13 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %12, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds i32, ptr %A, i64 %idxprom13
%14 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %13, ptr %arrayidx14, align 4, !tbaa !5
store i32 %14, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%A = alloca [100000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
%idxprom.i45 = sext i32 %sub44 to i64
%arrayidx.i46 = getelementptr inbounds i32, ptr %A, i64 %idxprom.i45
%1 = load i32, ptr %arrayidx.i46, align 4, !tbaa !5
%2 = load i32, ptr %A, align 16, !tbaa !5
store i32 %1, ptr %A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i46, align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp46.i = icmp sgt i32 %3, 1
br i1 %cmp46.i, label %for.body.i.preheader, label %partition.exit.thread54
for.body.i.preheader: ; preds = %for.end
%xtraiter = and i64 %idxprom.i, 1
%6 = icmp eq i32 %sub, 1
br i1 %6, label %partition.exit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %idxprom.i, -2
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i = phi i32 [ -1, %for.body.i.preheader.new ], [ %i.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx2.i, align 8, !tbaa !5
%cmp3.not.i = icmp sgt i32 %7, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i
%8 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx2.i, align 8, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next.i
%9 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp3.not.i.1 = icmp sgt i32 %9, %5
br i1 %cmp3.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom4.i.1 = sext i32 %inc.i.1 to i64
%arrayidx5.i.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i.1
%10 = load i32, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx2.i.1, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%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 %partition.exit.unr-lcssa, label %for.body.i, !llvm.loop !9
partition.exit.unr-lcssa: ; preds = %for.inc.i.1, %for.body.i.preheader
%i.1.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i.unr = phi i32 [ -1, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %partition.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %partition.exit.unr-lcssa
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.unr
%11 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp3.not.i.epil = icmp sgt i32 %11, %5
br i1 %cmp3.not.i.epil, label %partition.exit, label %if.then.i.epil
if.then.i.epil: ; preds = %for.body.i.epil
%inc.i.epil = add nsw i32 %i.047.i.unr, 1
%idxprom4.i.epil = sext i32 %inc.i.epil to i64
%arrayidx5.i.epil = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i.epil
%12 = load i32, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %11, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %12, ptr %arrayidx2.i.epil, align 4, !tbaa !5
br label %partition.exit
partition.exit: ; preds = %for.body.i.epil, %if.then.i.epil, %partition.exit.unr-lcssa
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.ph, %partition.exit.unr-lcssa ], [ %inc.i.epil, %if.then.i.epil ], [ %i.047.i.unr, %for.body.i.epil ]
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%13 = add nsw i32 %i.1.i.lcssa, 1
%idxprom13.i = sext i32 %13 to i64
%arrayidx14.i = getelementptr inbounds i32, ptr %A, i64 %idxprom13.i
%14 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %.pre.i, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %14, ptr %arrayidx.i, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %if.end.peel, label %for.end20
partition.exit.thread54: ; preds = %for.end
%15 = load i32, ptr %A, align 16, !tbaa !5
store i32 %5, ptr %A, align 16, !tbaa !5
store i32 %15, ptr %arrayidx.i, align 4, !tbaa !5
%cmp43659 = icmp eq i32 %3, 1
br i1 %cmp43659, label %if.then8.peel, label %for.end20
if.end.peel: ; preds = %partition.exit
%cmp7.peel = icmp eq i32 %13, 0
br i1 %cmp7.peel, label %if.then8.peel, label %for.inc18.critedge.peel
for.inc18.critedge.peel: ; preds = %if.end.peel
%16 = zext i32 %13 to i64
%17 = load i32, ptr %A, align 16, !tbaa !5
%call13.c.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17)
br label %for.inc18.peel
if.then8.peel: ; preds = %partition.exit.thread54, %if.end.peel
%putchar32.peel = call i32 @putchar(i32 91)
%18 = load i32, ptr %A, align 16, !tbaa !5
%call13.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %18)
%putchar33.peel = call i32 @putchar(i32 93)
br label %for.inc18.peel
for.inc18.peel: ; preds = %if.then8.peel, %for.inc18.critedge.peel
%19 = phi i64 [ 0, %if.then8.peel ], [ %16, %for.inc18.critedge.peel ]
%20 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %20, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end20
for.body5.peel.next: ; preds = %for.inc18.peel
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %19
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc18
%indvars.iv40 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next41, %for.inc18 ]
%putchar31 = call i32 @putchar(i32 32)
%cmp7 = icmp eq i64 %indvars.iv40, %19
br i1 %cmp7, label %if.then8, label %for.inc18.critedge
if.then8: ; preds = %if.end
%putchar32 = call i32 @putchar(i32 91)
%21 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %21)
%putchar33 = call i32 @putchar(i32 93)
br label %for.inc18
for.inc18.critedge: ; preds = %if.end
%arrayidx12.c = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv40
%22 = load i32, ptr %arrayidx12.c, align 4, !tbaa !5
%call13.c = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22)
br label %for.inc18
for.inc18: ; preds = %for.inc18.critedge, %if.then8
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%23 = load i32, ptr %n, align 4, !tbaa !5
%24 = sext i32 %23 to i64
%cmp4 = icmp slt i64 %indvars.iv.next41, %24
br i1 %cmp4, label %if.end, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.inc18.peel, %partition.exit.thread54, %partition.exit.thread, %partition.exit
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 400000, 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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
int main()
{
int n;
scanf("%d",&n);
char a[100010];
scanf("%s",a);
printf("%d\n",n+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_32071/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_32071/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [100010 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
call void @llvm.lifetime.start.p0(i64 100010, ptr nonnull %a) #3
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 100010, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define MAX 100000
int partition(int *A,int p,int r){
int x,i,j,tmp;
x = A[r];
i = p-1;
for(j=p;j<r;j++){
if(A[j] <= x){
i++;
tmp = A[i];
A[i] = A[j];
A[j] = tmp;
}
}
tmp = A[i+1];
A[i+1] = A[r];
A[r] = tmp;
return i+1;
}
int main(){
int i,n,A[MAX],q;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&A[i]);
q = partition(A,0,n-1);
for(i=0;i<n;i++){
if(i)printf(" ");
if(i==q)printf("[");
printf("%d",A[i]);
if(i==q)printf("]");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320760/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320760/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
%cmp3.not.prol = icmp sgt i32 %3, %0
br i1 %cmp3.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom4.prol = sext i32 %p to i64
%arrayidx5.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom4.prol
%4 = load i32, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.047 = phi i32 [ %i.047.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %8, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.047, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%9 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %10, %0
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %inc.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%11 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%12 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%13 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %12, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds i32, ptr %A, i64 %idxprom13
%14 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %13, ptr %arrayidx14, align 4, !tbaa !5
store i32 %14, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%A = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %A) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
%idxprom.i45 = sext i32 %sub44 to i64
%arrayidx.i46 = getelementptr inbounds i32, ptr %A, i64 %idxprom.i45
%1 = load i32, ptr %arrayidx.i46, align 4, !tbaa !5
%2 = load i32, ptr %A, align 16, !tbaa !5
store i32 %1, ptr %A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i46, align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp46.i = icmp sgt i32 %3, 1
br i1 %cmp46.i, label %for.body.i.preheader, label %partition.exit.thread54
for.body.i.preheader: ; preds = %for.end
%xtraiter = and i64 %idxprom.i, 1
%6 = icmp eq i32 %sub, 1
br i1 %6, label %partition.exit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %idxprom.i, -2
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i = phi i32 [ -1, %for.body.i.preheader.new ], [ %i.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx2.i, align 8, !tbaa !5
%cmp3.not.i = icmp sgt i32 %7, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i
%8 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx2.i, align 8, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next.i
%9 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp3.not.i.1 = icmp sgt i32 %9, %5
br i1 %cmp3.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom4.i.1 = sext i32 %inc.i.1 to i64
%arrayidx5.i.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i.1
%10 = load i32, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx2.i.1, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%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 %partition.exit.unr-lcssa, label %for.body.i, !llvm.loop !9
partition.exit.unr-lcssa: ; preds = %for.inc.i.1, %for.body.i.preheader
%i.1.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i.unr = phi i32 [ -1, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %partition.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %partition.exit.unr-lcssa
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.unr
%11 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp3.not.i.epil = icmp sgt i32 %11, %5
br i1 %cmp3.not.i.epil, label %partition.exit, label %if.then.i.epil
if.then.i.epil: ; preds = %for.body.i.epil
%inc.i.epil = add nsw i32 %i.047.i.unr, 1
%idxprom4.i.epil = sext i32 %inc.i.epil to i64
%arrayidx5.i.epil = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i.epil
%12 = load i32, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %11, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %12, ptr %arrayidx2.i.epil, align 4, !tbaa !5
br label %partition.exit
partition.exit: ; preds = %for.body.i.epil, %if.then.i.epil, %partition.exit.unr-lcssa
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.ph, %partition.exit.unr-lcssa ], [ %inc.i.epil, %if.then.i.epil ], [ %i.047.i.unr, %for.body.i.epil ]
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%13 = add nsw i32 %i.1.i.lcssa, 1
%idxprom13.i = sext i32 %13 to i64
%arrayidx14.i = getelementptr inbounds i32, ptr %A, i64 %idxprom13.i
%14 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %.pre.i, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %14, ptr %arrayidx.i, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %if.end.peel, label %for.end20
partition.exit.thread54: ; preds = %for.end
%15 = load i32, ptr %A, align 16, !tbaa !5
store i32 %5, ptr %A, align 16, !tbaa !5
store i32 %15, ptr %arrayidx.i, align 4, !tbaa !5
%cmp43659 = icmp eq i32 %3, 1
br i1 %cmp43659, label %if.then8.peel, label %for.end20
if.end.peel: ; preds = %partition.exit
%cmp7.peel = icmp eq i32 %13, 0
br i1 %cmp7.peel, label %if.then8.peel, label %for.inc18.critedge.peel
for.inc18.critedge.peel: ; preds = %if.end.peel
%16 = zext i32 %13 to i64
%17 = load i32, ptr %A, align 16, !tbaa !5
%call13.c.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17)
br label %for.inc18.peel
if.then8.peel: ; preds = %partition.exit.thread54, %if.end.peel
%putchar32.peel = call i32 @putchar(i32 91)
%18 = load i32, ptr %A, align 16, !tbaa !5
%call13.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %18)
%putchar33.peel = call i32 @putchar(i32 93)
br label %for.inc18.peel
for.inc18.peel: ; preds = %if.then8.peel, %for.inc18.critedge.peel
%19 = phi i64 [ 0, %if.then8.peel ], [ %16, %for.inc18.critedge.peel ]
%20 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %20, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end20
for.body5.peel.next: ; preds = %for.inc18.peel
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %19
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc18
%indvars.iv40 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next41, %for.inc18 ]
%putchar31 = call i32 @putchar(i32 32)
%cmp7 = icmp eq i64 %indvars.iv40, %19
br i1 %cmp7, label %if.then8, label %for.inc18.critedge
if.then8: ; preds = %if.end
%putchar32 = call i32 @putchar(i32 91)
%21 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %21)
%putchar33 = call i32 @putchar(i32 93)
br label %for.inc18
for.inc18.critedge: ; preds = %if.end
%arrayidx12.c = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv40
%22 = load i32, ptr %arrayidx12.c, align 4, !tbaa !5
%call13.c = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22)
br label %for.inc18
for.inc18: ; preds = %for.inc18.critedge, %if.then8
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%23 = load i32, ptr %n, align 4, !tbaa !5
%24 = sext i32 %23 to i64
%cmp4 = icmp slt i64 %indvars.iv.next41, %24
br i1 %cmp4, label %if.end, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.inc18.peel, %partition.exit.thread54, %partition.exit.thread, %partition.exit
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#define N 100001
int partition(int *, int, int);
int main () {
int A[N], i, n = 0, p = 0;
scanf("%d",&n);
for(i = 0 ; i < n ; i++) {
scanf("%d",&A[i]);
}
p = partition(A, 0, n - 1);
for(i = 0 ; i < n ; i++) {
if(i == p && i == n - 1) printf("[%d]\n",A[i]);
else if(i == p) printf("[%d] ",A[i]);
else if(i < n - 1) printf("%d ",A[i]);
else printf("%d\n",A[i]);
}
return 0;
}
int partition(int *A, int p, int r) {
int i, j, x = 0, tmp = 0;
x = A[r];
i = p - 1;
for(j = p ; j < r ; j++) {
if(A[j] <= x) {
i++;
tmp = A[i];
A[i] = A[j];
A[j] = tmp;
}
}
tmp = A[i+1];
A[i+1] = A[r];
A[r] = tmp;
return i+1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320810/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320810/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"[%d]\0A\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"[%d] \00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [100001 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
store i32 0, ptr %n, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp47 = icmp sgt i32 %0, 0
br i1 %cmp47, label %for.body, label %for.end32
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%sub = add nsw i32 %1, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp46.i = icmp sgt i32 %1, 1
br i1 %cmp46.i, label %for.body.i.preheader, label %partition.exit
for.body.i.preheader: ; preds = %for.end
%xtraiter = and i64 %idxprom.i, 1
%4 = icmp eq i32 %sub, 1
br i1 %4, label %for.end.loopexit.i.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %idxprom.i, -2
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i = phi i32 [ -1, %for.body.i.preheader.new ], [ %i.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx2.i, align 8, !tbaa !5
%cmp3.not.i = icmp sgt i32 %5, %3
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i
%6 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx2.i, align 8, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next.i
%7 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp3.not.i.1 = icmp sgt i32 %7, %3
br i1 %cmp3.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom4.i.1 = sext i32 %inc.i.1 to i64
%arrayidx5.i.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i.1
%8 = load i32, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %7, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %8, ptr %arrayidx2.i.1, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%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.end.loopexit.i.unr-lcssa, label %for.body.i, !llvm.loop !11
for.end.loopexit.i.unr-lcssa: ; preds = %for.inc.i.1, %for.body.i.preheader
%i.1.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i.unr = phi i32 [ -1, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.loopexit.i, label %for.body.i.epil
for.body.i.epil: ; preds = %for.end.loopexit.i.unr-lcssa
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.unr
%9 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp3.not.i.epil = icmp sgt i32 %9, %3
br i1 %cmp3.not.i.epil, label %for.end.loopexit.i, label %if.then.i.epil
if.then.i.epil: ; preds = %for.body.i.epil
%inc.i.epil = add nsw i32 %i.047.i.unr, 1
%idxprom4.i.epil = sext i32 %inc.i.epil to i64
%arrayidx5.i.epil = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i.epil
%10 = load i32, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %9, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %10, ptr %arrayidx2.i.epil, align 4, !tbaa !5
br label %for.end.loopexit.i
for.end.loopexit.i: ; preds = %for.body.i.epil, %if.then.i.epil, %for.end.loopexit.i.unr-lcssa
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.ph, %for.end.loopexit.i.unr-lcssa ], [ %inc.i.epil, %if.then.i.epil ], [ %i.047.i.unr, %for.body.i.epil ]
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%11 = add nsw i32 %i.1.i.lcssa, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%12 = phi i32 [ %3, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %11, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds i32, ptr %A, i64 %idxprom13.i
%13 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %12, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %13, ptr %arrayidx.i, align 4, !tbaa !5
%cmp449 = icmp sgt i32 %1, 0
br i1 %cmp449, label %for.body5.preheader, label %for.end32
for.body5.preheader: ; preds = %partition.exit
%14 = zext i32 %i.0.lcssa.i to i64
%arrayidx15 = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %14
%arrayidx10 = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %14
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.inc30
%indvars.iv53 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next54, %for.inc30 ]
%15 = phi i32 [ %1, %for.body5.preheader ], [ %21, %for.inc30 ]
%cmp6 = icmp eq i64 %indvars.iv53, %14
%sub7 = add nsw i32 %15, -1
%16 = zext i32 %sub7 to i64
%cmp8 = icmp eq i64 %indvars.iv53, %16
%or.cond = select i1 %cmp6, i1 %cmp8, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %for.body5
%17 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17)
br label %for.inc30
if.else: ; preds = %for.body5
br i1 %cmp6, label %if.then13, label %if.else17
if.then13: ; preds = %if.else
%18 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %18)
br label %for.inc30
if.else17: ; preds = %if.else
%19 = sext i32 %sub7 to i64
%cmp19 = icmp slt i64 %indvars.iv53, %19
%arrayidx22 = getelementptr inbounds [100001 x i32], ptr %A, i64 0, i64 %indvars.iv53
%20 = load i32, ptr %arrayidx22, align 4, !tbaa !5
br i1 %cmp19, label %if.then20, label %if.else24
if.then20: ; preds = %if.else17
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %20)
br label %for.inc30
if.else24: ; preds = %if.else17
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %20)
br label %for.inc30
for.inc30: ; preds = %if.then, %if.then20, %if.else24, %if.then13
%indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
%21 = load i32, ptr %n, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp4 = icmp slt i64 %indvars.iv.next54, %22
br i1 %cmp4, label %for.body5, label %for.end32, !llvm.loop !12
for.end32: ; preds = %for.inc30, %entry, %partition.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
%cmp3.not.prol = icmp sgt i32 %3, %0
br i1 %cmp3.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom4.prol = sext i32 %p to i64
%arrayidx5.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom4.prol
%4 = load i32, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.047 = phi i32 [ %i.047.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %8, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.047, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%9 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %10, %0
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %inc.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%11 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !11
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%12 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%13 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %12, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds i32, ptr %A, i64 %idxprom13
%14 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %13, ptr %arrayidx14, align 4, !tbaa !5
store i32 %14, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: 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 #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#include <stdlib.h>
int partition(int *,int);
void swapping(int *,int *,int *);
int main(){
int *A,n,i,box;
scanf("%d",&n);
A = (int *)malloc(1 + n * sizeof(int));
for(i = 1;i < n + 1;i++) scanf("%d",&A[i]);
box = partition(A,n);
for(i = 1;i < box;i++) printf("%d ",A[i]);
printf("[%d] ",A[box]);
for(i = box + 1;i < n + 1;i++){
printf("%d",A[i]);
if(i != n) printf(" ");
}
printf("\n");
free(A);
return 0;
}
int partition(int *A,int n){
int x,i,j,hako = 0;
x = A[n];
i = -1;
for(j = 0;j < n;j++){
if(A[j] <= x){
i += 1;
swapping(&A[i],&A[j],&hako);
}
}
swapping(&A[i + 1],&A[n],&hako);
return i + 1;
}
void swapping(int *A,int *AA,int *dust){
*dust = *A;
*A = *AA;
*AA = *dust;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320854/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320854/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"[%d] \00", align 1
; Function Attrs: 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) #8
%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 = shl nsw i64 %conv, 2
%add = or i64 %mul, 1
%call1 = call noalias ptr @malloc(i64 noundef %add) #9
%cmp.not52 = icmp slt i32 %0, 1
br i1 %cmp.not52, label %for.end.thread, label %for.body
for.end.thread: ; preds = %entry
%arrayidx.i68 = getelementptr inbounds i32, ptr %call1, i64 %conv
%1 = load i32, ptr %arrayidx.i68, align 4, !tbaa !5
br label %partition.exit.thread
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%.pr = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %.pr to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%arrayidx.i = getelementptr inbounds i32, ptr %call1, i64 %2
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp28.i = icmp sgt i32 %.pr, 0
br i1 %cmp28.i, label %for.body.preheader.i, label %partition.exit.thread
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %.pr to i64
%xtraiter = and i64 %wide.trip.count.i, 1
%4 = icmp eq i32 %.pr, 1
br i1 %4, label %partition.exit.unr-lcssa, label %for.body.preheader.i.new
for.body.preheader.i.new: ; preds = %for.body.preheader.i
%unroll_iter = and i64 %wide.trip.count.i, 4294967294
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.preheader.i.new
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.029.i = phi i32 [ -1, %for.body.preheader.i.new ], [ %i.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %5, %3
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%add.i = add nsw i32 %i.029.i, 1
%idxprom4.i = sext i32 %add.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom4.i
%6 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.029.i, %for.body.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next.i
%7 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp3.not.i.1 = icmp sgt i32 %7, %3
br i1 %cmp3.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%add.i.1 = add nsw i32 %i.1.i, 1
%idxprom4.i.1 = sext i32 %add.i.1 to i64
%arrayidx5.i.1 = getelementptr inbounds i32, ptr %call1, i64 %idxprom4.i.1
%8 = load i32, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %7, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %8, ptr %arrayidx2.i.1, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %add.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%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 %partition.exit.unr-lcssa, label %for.body.i, !llvm.loop !11
partition.exit.thread: ; preds = %for.end, %for.end.thread
%arrayidx.i70.ph = phi ptr [ %arrayidx.i68, %for.end.thread ], [ %arrayidx.i, %for.end ]
%.ph = phi i32 [ %1, %for.end.thread ], [ %3, %for.end ]
%9 = load i32, ptr %call1, align 4, !tbaa !5
store i32 %.ph, ptr %call1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx.i70.ph, align 4, !tbaa !5
br label %for.end15
partition.exit.unr-lcssa: ; preds = %for.inc.i.1, %for.body.preheader.i
%i.1.i.lcssa.ph = phi i32 [ undef, %for.body.preheader.i ], [ %i.1.i.1, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.029.i.unr = phi i32 [ -1, %for.body.preheader.i ], [ %i.1.i.1, %for.inc.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %partition.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %partition.exit.unr-lcssa
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i.unr
%10 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp3.not.i.epil = icmp sgt i32 %10, %3
br i1 %cmp3.not.i.epil, label %partition.exit, label %if.then.i.epil
if.then.i.epil: ; preds = %for.body.i.epil
%add.i.epil = add nsw i32 %i.029.i.unr, 1
%idxprom4.i.epil = sext i32 %add.i.epil to i64
%arrayidx5.i.epil = getelementptr inbounds i32, ptr %call1, i64 %idxprom4.i.epil
%11 = load i32, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %11, ptr %arrayidx2.i.epil, align 4, !tbaa !5
br label %partition.exit
partition.exit: ; preds = %for.body.i.epil, %if.then.i.epil, %partition.exit.unr-lcssa
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.ph, %partition.exit.unr-lcssa ], [ %add.i.epil, %if.then.i.epil ], [ %i.029.i.unr, %for.body.i.epil ]
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%12 = add nsw i32 %i.1.i.lcssa, 1
%idxprom9.i = sext i32 %12 to i64
%arrayidx10.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom9.i
%13 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5
store i32 %.pre.i, ptr %arrayidx10.i, align 4, !tbaa !5
store i32 %13, ptr %arrayidx.i, align 4, !tbaa !5
%cmp754 = icmp sgt i32 %i.1.i.lcssa, 0
br i1 %cmp754, label %for.body9.preheader, label %for.end15
for.body9.preheader: ; preds = %partition.exit
%wide.trip.count = zext i32 %12 to i64
br label %for.body9
for.body9: ; preds = %for.body9.preheader, %for.body9
%indvars.iv60 = phi i64 [ 1, %for.body9.preheader ], [ %indvars.iv.next61, %for.body9 ]
%arrayidx11 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv60
%14 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
%indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
%exitcond.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count
br i1 %exitcond.not, label %for.end15, label %for.body9, !llvm.loop !12
for.end15: ; preds = %for.body9, %partition.exit.thread, %partition.exit
%arrayidx10.i78 = phi ptr [ %call1, %partition.exit.thread ], [ %arrayidx10.i, %partition.exit ], [ %arrayidx10.i, %for.body9 ]
%idxprom9.i77 = phi i64 [ 0, %partition.exit.thread ], [ %idxprom9.i, %partition.exit ], [ %idxprom9.i, %for.body9 ]
%i.0.lcssa.i76 = phi i32 [ 0, %partition.exit.thread ], [ %12, %partition.exit ], [ %12, %for.body9 ]
%15 = load i32, ptr %arrayidx10.i78, align 4, !tbaa !5
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp2257 = icmp slt i32 %i.0.lcssa.i76, %16
br i1 %cmp2257, label %for.body24, label %for.end33
for.body24: ; preds = %for.end15, %for.inc31
%indvars.iv63 = phi i64 [ %indvars.iv.next64, %for.inc31 ], [ %idxprom9.i77, %for.end15 ]
%indvars.iv.next64 = add nsw i64 %indvars.iv63, 1
%arrayidx26 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next64
%17 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17)
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = trunc i64 %indvars.iv.next64 to i32
%cmp28.not = icmp eq i32 %18, %19
br i1 %cmp28.not, label %for.inc31, label %if.then
if.then: ; preds = %for.body24
%putchar51 = call i32 @putchar(i32 32)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc31
for.inc31: ; preds = %for.body24, %if.then
%20 = phi i32 [ %18, %for.body24 ], [ %.pre, %if.then ]
%21 = sext i32 %20 to i64
%cmp22 = icmp slt i64 %indvars.iv.next64, %21
br i1 %cmp22, label %for.body24, label %for.end33, !llvm.loop !13
for.end33: ; preds = %for.inc31, %for.end15
%putchar = call i32 @putchar(i32 10)
call void @free(ptr noundef nonnull %call1) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp28 = icmp sgt i32 %n, 0
br i1 %cmp28, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %n, 1
br i1 %1, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.029 = phi i32 [ -1, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %2, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%add = add nsw i32 %i.029, 1
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.029, %for.body ]
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx2.1 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next
%4 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %4, %0
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%add.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %add.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%5 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %4, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %5, ptr %arrayidx2.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !11
for.end.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader
%i.1.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %i.1.1, %for.inc.1 ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.029.unr = phi i32 [ -1, %for.body.preheader ], [ %i.1.1, %for.inc.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.loopexit, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa
%arrayidx2.epil = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.unr
%6 = load i32, ptr %arrayidx2.epil, align 4, !tbaa !5
%cmp3.not.epil = icmp sgt i32 %6, %0
br i1 %cmp3.not.epil, label %for.end.loopexit, label %if.then.epil
if.then.epil: ; preds = %for.body.epil
%add.epil = add nsw i32 %i.029.unr, 1
%idxprom4.epil = sext i32 %add.epil to i64
%arrayidx5.epil = getelementptr inbounds i32, ptr %A, i64 %idxprom4.epil
%7 = load i32, ptr %arrayidx5.epil, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.epil, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.epil, align 4, !tbaa !5
br label %for.end.loopexit
for.end.loopexit: ; preds = %for.body.epil, %if.then.epil, %for.end.loopexit.unr-lcssa
%i.1.lcssa = phi i32 [ %i.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %add.epil, %if.then.epil ], [ %i.029.unr, %for.body.epil ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%8 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%9 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ 0, %entry ], [ %8, %for.end.loopexit ]
%idxprom9 = sext i32 %i.0.lcssa to i64
%arrayidx10 = getelementptr inbounds i32, ptr %A, i64 %idxprom9
%10 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %9, ptr %arrayidx10, align 4, !tbaa !5
store i32 %10, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swapping(ptr nocapture noundef %A, ptr nocapture noundef %AA, ptr nocapture noundef %dust) local_unnamed_addr #6 {
entry:
%0 = load i32, ptr %A, align 4, !tbaa !5
store i32 %0, ptr %dust, align 4, !tbaa !5
%1 = load i32, ptr %AA, align 4, !tbaa !5
store i32 %1, ptr %A, align 4, !tbaa !5
%2 = load i32, ptr %dust, align 4, !tbaa !5
store i32 %2, ptr %AA, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#define N 100000
int a[N], num;
int par(int p, int r){
int x,i,j,f;
x=a[r];
i=p-1;
for(j=p;j<r;j++){
if(a[j]<=x){
i++;
f=a[i];
a[i]=a[j];
a[j]=f;
}
}
f=a[i+1];
a[i+1]=a[r];
a[r]=f;
return i+1;
}
int main(){
int i,s;
scanf("%d",&num);
for(i=0;i<num;i++){
scanf("%d",&a[i]);
}
s=par(0,num-1);
for(i=0;i<num;i++){
if(i)
printf(" ");
if(i==s)
printf("[");
printf("%d",a[i]);
if(i==s)
printf("]");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320898/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320898/source.c"
target datalayout = "e-m:e-p270: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 [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@num = dso_local global i32 0, align 4
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @par(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp37 = icmp slt i32 %p, %r
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.038 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %2, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.038, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.038, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%5 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom13
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @num)
%0 = load i32, ptr @num, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %par.exit.thread
par.exit.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
%idxprom.i45 = sext i32 %sub44 to i64
%arrayidx.i46 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom.i45
%1 = load i32, ptr %arrayidx.i46, align 4, !tbaa !5
%2 = load i32, ptr @a, align 16, !tbaa !5
store i32 %1, ptr @a, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i46, align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @num, 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 !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp37.i = icmp sgt i32 %3, 1
br i1 %cmp37.i, label %for.body.i, label %par.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.038.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %6, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.038.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom4.i
%7 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.038.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !9
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
br label %par.exit
par.exit: ; preds = %for.end, %for.end.loopexit.i
%9 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %8, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %idxprom13.i
%10 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.i, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %if.end.peel, label %for.end20
if.end.peel: ; preds = %par.exit
%11 = zext i32 %i.0.lcssa.i to i64
%cmp7.peel = icmp eq i32 %i.0.lcssa.i, 0
br i1 %cmp7.peel, label %if.then8.peel, label %for.inc18.critedge.peel
for.inc18.critedge.peel: ; preds = %if.end.peel
%12 = load i32, ptr @a, align 16, !tbaa !5
%call13.c.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
br label %for.inc18.peel
if.then8.peel: ; preds = %if.end.peel
%putchar32.peel = tail call i32 @putchar(i32 91)
%13 = load i32, ptr @a, align 16, !tbaa !5
%call13.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%putchar33.peel = tail call i32 @putchar(i32 93)
br label %for.inc18.peel
for.inc18.peel: ; preds = %if.then8.peel, %for.inc18.critedge.peel
%14 = load i32, ptr @num, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %14, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end20
for.body5.peel.next: ; preds = %for.inc18.peel
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %11
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc18
%indvars.iv40 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next41, %for.inc18 ]
%putchar31 = tail call i32 @putchar(i32 32)
%cmp7 = icmp eq i64 %indvars.iv40, %11
br i1 %cmp7, label %if.then8, label %for.inc18.critedge
if.then8: ; preds = %if.end
%putchar32 = tail call i32 @putchar(i32 91)
%15 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%putchar33 = tail call i32 @putchar(i32 93)
br label %for.inc18
for.inc18.critedge: ; preds = %if.end
%arrayidx12.c = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv40
%16 = load i32, ptr %arrayidx12.c, align 4, !tbaa !5
%call13.c = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
br label %for.inc18
for.inc18: ; preds = %for.inc18.critedge, %if.then8
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%17 = load i32, ptr @num, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp4 = icmp slt i64 %indvars.iv.next41, %18
br i1 %cmp4, label %if.end, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.inc18.peel, %par.exit.thread, %par.exit
%putchar = tail call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
#include<stdlib.h>
int n,x,a;
void pertition(int *A,int p,int r){
int i,j,tmp;
x=A[r];
i=p-1;
for(j=p;j<r;j++){
if(A[j]<=x){
i++;
tmp=A[i];
A[i]=A[j];
A[j]=tmp;
}
}
tmp=A[i+1];
A[i+1]=A[r];
A[r]=tmp;
a=i+1;
}
int main(void){
int i;
int *A;
scanf("%d",&n);
A=malloc(n*sizeof(int));
for(i=0;i<n;i++) scanf("%d",&A[i]);
pertition(A,0,n-1);
for(i=0;i<n;i++){
if(i==a) printf("[%d]",A[i]);
else printf("%d",A[i]);
if(i!=n-1) printf(" ");
}
printf("\n");
free(A);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_320948/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_320948/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@x = dso_local local_unnamed_addr global i32 0, align 4
@a = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [5 x i8] c"[%d]\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @pertition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
store i32 %0, ptr @x, align 4, !tbaa !5
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
%cmp3.not.prol = icmp sgt i32 %3, %0
br i1 %cmp3.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom4.prol = sext i32 %p to i64
%arrayidx5.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom4.prol
%4 = load i32, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.prol, align 4, !tbaa !5
%.pre.prol = load i32, ptr @x, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%5 = phi i32 [ %.pre.prol, %if.then.prol ], [ %0, %for.body.prol ]
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%.unr = phi i32 [ %0, %for.body.preheader ], [ %5, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%6 = sub nsw i64 0, %idxprom
%7 = xor i64 %1, %6
%8 = icmp eq i64 %7, -1
br i1 %8, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%9 = phi i32 [ %.unr, %for.body.preheader.new ], [ %15, %for.inc.1 ]
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.047 = phi i32 [ %i.047.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%10 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %10, %9
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.047, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%11 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5, align 4, !tbaa !5
store i32 %11, ptr %arrayidx2, align 4, !tbaa !5
%.pre = load i32, ptr @x, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%12 = phi i32 [ %.pre, %if.then ], [ %9, %for.body ]
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%13 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %13, %12
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %inc.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%14 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %13, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %14, ptr %gep, align 4, !tbaa !5
%.pre.1 = load i32, ptr @x, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%15 = phi i32 [ %.pre.1, %if.then.1 ], [ %12, %for.inc ]
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%16 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i32 [ %p, %entry ], [ %16, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds i32, ptr %A, i64 %idxprom13
%17 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%18 = load i32, ptr %arrayidx, align 4, !tbaa !5
store i32 %18, ptr %arrayidx14, align 4, !tbaa !5
store i32 %17, ptr %arrayidx, align 4, !tbaa !5
store i32 %i.0.lcssa, ptr @a, align 4, !tbaa !5
ret void
}
; Function Attrs: 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
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = tail call noalias ptr @malloc(i64 noundef %mul) #6
%cmp39 = icmp sgt i32 %0, 0
br i1 %cmp39, label %for.body, label %pertition.exit.thread
pertition.exit.thread: ; preds = %entry
%sub49 = add nsw i32 %0, -1
%idxprom.i50 = sext i32 %sub49 to i64
%arrayidx.i51 = getelementptr inbounds i32, ptr %call1, i64 %idxprom.i50
%1 = load i32, ptr %arrayidx.i51, align 4, !tbaa !5
store i32 %1, ptr @x, align 4, !tbaa !5
%2 = load i32, ptr %call1, align 4, !tbaa !5
store i32 %1, ptr %call1, align 4, !tbaa !5
store i32 %2, ptr %arrayidx.i51, align 4, !tbaa !5
store i32 0, ptr @a, align 4, !tbaa !5
br label %for.end24
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %5, ptr @x, align 4, !tbaa !5
%cmp46.i = icmp sgt i32 %3, 1
br i1 %cmp46.i, label %for.body.i.preheader, label %pertition.exit
for.body.i.preheader: ; preds = %for.end
%xtraiter = and i64 %idxprom.i, 1
%6 = icmp eq i32 %sub, 1
br i1 %6, label %for.end.loopexit.i.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %idxprom.i, -2
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i = phi i32 [ -1, %for.body.i.preheader.new ], [ %i.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %7, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom4.i
%8 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next.i
%9 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp3.not.i.1 = icmp sgt i32 %9, %5
br i1 %cmp3.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom4.i.1 = sext i32 %inc.i.1 to i64
%arrayidx5.i.1 = getelementptr inbounds i32, ptr %call1, i64 %idxprom4.i.1
%10 = load i32, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx2.i.1, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%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.end.loopexit.i.unr-lcssa, label %for.body.i, !llvm.loop !9
for.end.loopexit.i.unr-lcssa: ; preds = %for.inc.i.1, %for.body.i.preheader
%i.1.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i.unr = phi i32 [ -1, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.loopexit.i, label %for.body.i.epil
for.body.i.epil: ; preds = %for.end.loopexit.i.unr-lcssa
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i.unr
%11 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp3.not.i.epil = icmp sgt i32 %11, %5
br i1 %cmp3.not.i.epil, label %for.end.loopexit.i, label %if.then.i.epil
if.then.i.epil: ; preds = %for.body.i.epil
%inc.i.epil = add nsw i32 %i.047.i.unr, 1
%idxprom4.i.epil = sext i32 %inc.i.epil to i64
%arrayidx5.i.epil = getelementptr inbounds i32, ptr %call1, i64 %idxprom4.i.epil
%12 = load i32, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %11, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %12, ptr %arrayidx2.i.epil, align 4, !tbaa !5
br label %for.end.loopexit.i
for.end.loopexit.i: ; preds = %for.body.i.epil, %if.then.i.epil, %for.end.loopexit.i.unr-lcssa
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.ph, %for.end.loopexit.i.unr-lcssa ], [ %inc.i.epil, %if.then.i.epil ], [ %i.047.i.unr, %for.body.i.epil ]
%13 = add nsw i32 %i.1.i.lcssa, 1
%.pre = load i32, ptr %arrayidx.i, align 4, !tbaa !5
br label %pertition.exit
pertition.exit: ; preds = %for.end, %for.end.loopexit.i
%14 = phi i32 [ %5, %for.end ], [ %.pre, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %13, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom13.i
%15 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %14, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %15, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %i.0.lcssa.i, ptr @a, align 4, !tbaa !5
%cmp541 = icmp sgt i32 %3, 0
br i1 %cmp541, label %for.body7, label %for.end24
for.body7: ; preds = %pertition.exit, %for.inc22
%indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.inc22 ], [ 0, %pertition.exit ]
%16 = load i32, ptr @a, align 4, !tbaa !5
%17 = zext i32 %16 to i64
%cmp8 = icmp eq i64 %indvars.iv45, %17
%arrayidx11 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv45
%18 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%.str.1..str = select i1 %cmp8, ptr @.str.1, ptr @.str
%call15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str, i32 noundef %18)
%19 = load i32, ptr @n, align 4, !tbaa !5
%sub16 = add nsw i32 %19, -1
%20 = zext i32 %sub16 to i64
%cmp17.not = icmp eq i64 %indvars.iv45, %20
br i1 %cmp17.not, label %for.inc22, label %if.then19
if.then19: ; preds = %for.body7
%putchar38 = tail call i32 @putchar(i32 32)
%.pre48 = load i32, ptr @n, align 4, !tbaa !5
br label %for.inc22
for.inc22: ; preds = %for.body7, %if.then19
%21 = phi i32 [ %19, %for.body7 ], [ %.pre48, %if.then19 ]
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%22 = sext i32 %21 to i64
%cmp5 = icmp slt i64 %indvars.iv.next46, %22
br i1 %cmp5, label %for.body7, label %for.end24, !llvm.loop !12
for.end24: ; preds = %for.inc22, %pertition.exit.thread, %pertition.exit
%putchar = tail call i32 @putchar(i32 10)
tail call void @free(ptr noundef nonnull %call1) #7
ret i32 0
}
; 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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { nofree norecurse nosync nounwind memory(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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int Partition(int*,int,int);
int main(){
int n,i,mid;
int A[100000];
scanf("%d",&n);
for(i = 0; i < n; i++){
scanf("%d",&A[i]);
}
mid = Partition(A,0,n-1);
for(i = 0; i < n-1; i++){
if(i == mid) printf("[%d] ",A[i]);
else printf("%d ",A[i]);
}
printf("%d\n",A[i]);
return 0;
}
int Partition(int* A,int p,int r){
int x;
int tmp,j,i;
x = A[r];
i = p-1;
for(j = p; j < r; j++){
if(A[j] <= x){
i = i + 1;
tmp = A[i];
A[i] = A[j];
A[j] = tmp;
}
}
tmp = A[i+1];
A[i+1] = A[r];
A[r] = tmp;
return i+1;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321019/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321019/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"[%d] \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%A = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400000, 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
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub39 = add nsw i32 %0, -1
%idxprom.i40 = sext i32 %sub39 to i64
%arrayidx.i41 = getelementptr inbounds i32, ptr %A, i64 %idxprom.i40
%1 = load i32, ptr %arrayidx.i41, align 4, !tbaa !5
br label %Partition.exit.thread
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%sub = add nsw i32 %2, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp46.i = icmp sgt i32 %2, 1
br i1 %cmp46.i, label %for.body.i.preheader, label %Partition.exit.thread
for.body.i.preheader: ; preds = %for.end
%xtraiter = and i64 %idxprom.i, 1
%5 = icmp eq i32 %sub, 1
br i1 %5, label %Partition.exit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %idxprom.i, -2
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.048.i = phi i32 [ -1, %for.body.i.preheader.new ], [ %i.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 8, !tbaa !5
%cmp3.not.i = icmp sgt i32 %6, %4
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%add.i = add nsw i32 %i.048.i, 1
%idxprom4.i = sext i32 %add.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i
%7 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i, align 8, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.048.i, %for.body.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next.i
%8 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp3.not.i.1 = icmp sgt i32 %8, %4
br i1 %cmp3.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%add.i.1 = add nsw i32 %i.1.i, 1
%idxprom4.i.1 = sext i32 %add.i.1 to i64
%arrayidx5.i.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i.1
%9 = load i32, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2.i.1, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %add.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%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 %Partition.exit.unr-lcssa, label %for.body.i, !llvm.loop !11
Partition.exit.thread: ; preds = %for.end, %for.end.thread
%arrayidx.i43.ph = phi ptr [ %arrayidx.i41, %for.end.thread ], [ %arrayidx.i, %for.end ]
%.ph = phi i32 [ %1, %for.end.thread ], [ %4, %for.end ]
%10 = load i32, ptr %A, align 16, !tbaa !5
store i32 %.ph, ptr %A, align 16, !tbaa !5
store i32 %10, ptr %arrayidx.i43.ph, align 4, !tbaa !5
br label %for.end16
Partition.exit.unr-lcssa: ; preds = %for.inc.i.1, %for.body.i.preheader
%i.1.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.048.i.unr = phi i32 [ -1, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %Partition.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %Partition.exit.unr-lcssa
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.unr
%11 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp3.not.i.epil = icmp sgt i32 %11, %4
br i1 %cmp3.not.i.epil, label %Partition.exit, label %if.then.i.epil
if.then.i.epil: ; preds = %for.body.i.epil
%add.i.epil = add nsw i32 %i.048.i.unr, 1
%idxprom4.i.epil = sext i32 %add.i.epil to i64
%arrayidx5.i.epil = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i.epil
%12 = load i32, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %11, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %12, ptr %arrayidx2.i.epil, align 4, !tbaa !5
br label %Partition.exit
Partition.exit: ; preds = %for.body.i.epil, %if.then.i.epil, %Partition.exit.unr-lcssa
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.ph, %Partition.exit.unr-lcssa ], [ %add.i.epil, %if.then.i.epil ], [ %i.048.i.unr, %for.body.i.epil ]
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%13 = add nsw i32 %i.1.i.lcssa, 1
%idxprom13.i = sext i32 %13 to i64
%arrayidx14.i = getelementptr inbounds i32, ptr %A, i64 %idxprom13.i
%14 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %.pre.i, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %14, ptr %arrayidx.i, align 4, !tbaa !5
br i1 %cmp46.i, label %for.body6.preheader, label %for.end16
for.body6.preheader: ; preds = %Partition.exit
%15 = zext i32 %13 to i64
%arrayidx9 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %15
br label %for.body6
for.body6: ; preds = %for.body6.preheader, %for.body6
%indvars.iv36 = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next37, %for.body6 ]
%cmp7 = icmp eq i64 %indvars.iv36, %15
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv36
%arrayidx9.sink = select i1 %cmp7, ptr %arrayidx9, ptr %arrayidx12
%.str.1.sink = select i1 %cmp7, ptr @.str.1, ptr @.str.2
%16 = load i32, ptr %arrayidx9.sink, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink, i32 noundef %16)
%indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%sub4 = add nsw i32 %17, -1
%18 = sext i32 %sub4 to i64
%cmp5 = icmp slt i64 %indvars.iv.next37, %18
br i1 %cmp5, label %for.body6, label %for.end16.loopexit, !llvm.loop !12
for.end16.loopexit: ; preds = %for.body6
%19 = and i64 %indvars.iv.next37, 4294967295
br label %for.end16
for.end16: ; preds = %Partition.exit.thread, %for.end16.loopexit, %Partition.exit
%i.1.lcssa = phi i64 [ 0, %Partition.exit ], [ %19, %for.end16.loopexit ], [ 0, %Partition.exit.thread ]
%arrayidx18 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %i.1.lcssa
%20 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %20)
call void @llvm.lifetime.end.p0(i64 400000, 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 norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @Partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
%cmp3.not.prol = icmp sgt i32 %3, %0
br i1 %cmp3.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom4.prol = sext i32 %p to i64
%arrayidx5.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom4.prol
%4 = load i32, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.048.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.048 = phi i32 [ %i.048.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %8, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%add = add nsw i32 %i.048, 1
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%9 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.048, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %10, %0
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%add.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %add.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%11 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !11
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%12 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%13 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %12, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds i32, ptr %A, i64 %idxprom13
%14 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %13, ptr %arrayidx14, align 4, !tbaa !5
store i32 %14, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: 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 #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
int partition(int *, int, int);
int A[100000];
int main(){
int i,n,j;
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",&A[i]);
j=partition(A,0,n-1);
for(i=0;i<j;i++)
printf("%d ",A[i]);
printf("[%d] ",A[j]);
for(i=j+1;i<n-1;i++)
printf("%d ",A[i]);
printf("%d\n",A[n-1]);
return 0;
}
int partition(int A[], int p, int r){
int x,i,j,c;
x = A[r];
i = p-1;
for (j = p ;j<r;j++){
if (A[j] <= x){
i = i+1;
c=A[i];
A[i]=A[j];
A[j]=c ;
}
}
c=A[i+1];
A[i+1]=A[r];
A[r]=c ;
return i+1;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321062/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321062/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100000 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"[%d] \00", align 1
@.str.3 = 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
%cmp39 = icmp sgt i32 %0, 0
br i1 %cmp39, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub58 = add nsw i32 %0, -1
%idxprom.i59 = sext i32 %sub58 to i64
%arrayidx.i60 = getelementptr inbounds i32, ptr @A, i64 %idxprom.i59
%1 = load i32, ptr %arrayidx.i60, align 4, !tbaa !5
br label %partition.exit.thread
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%sub = add nsw i32 %2, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr @A, i64 %idxprom.i
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp46.i = icmp sgt i32 %2, 1
br i1 %cmp46.i, label %for.body.i, label %partition.exit.thread
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.047.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds i32, ptr @A, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %5, %4
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%add.i = add nsw i32 %i.047.i, 1
%idxprom4.i = sext i32 %add.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr @A, i64 %idxprom4.i
%6 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %partition.exit, label %for.body.i, !llvm.loop !11
partition.exit.thread: ; preds = %for.end, %for.end.thread
%arrayidx.i62.ph = phi ptr [ %arrayidx.i60, %for.end.thread ], [ %arrayidx.i, %for.end ]
%.ph = phi i32 [ %1, %for.end.thread ], [ %4, %for.end ]
%7 = load i32, ptr @A, align 16, !tbaa !5
store i32 %.ph, ptr @A, align 16, !tbaa !5
store i32 %7, ptr %arrayidx.i62.ph, align 4, !tbaa !5
br label %for.end11
partition.exit: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
%idxprom13.i = sext i32 %8 to i64
%arrayidx14.i = getelementptr inbounds i32, ptr @A, i64 %idxprom13.i
%9 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %.pre.i, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx.i, align 4, !tbaa !5
%cmp441 = icmp sgt i32 %i.1.i, -1
br i1 %cmp441, label %for.body5.preheader, label %for.end11
for.body5.preheader: ; preds = %partition.exit
%wide.trip.count = zext i32 %8 to i64
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv51 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next52, %for.body5 ]
%arrayidx7 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv51
%10 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10)
%indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
%exitcond.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count
br i1 %exitcond.not, label %for.end11, label %for.body5, !llvm.loop !12
for.end11: ; preds = %for.body5, %partition.exit.thread, %partition.exit
%arrayidx14.i69 = phi ptr [ @A, %partition.exit.thread ], [ %arrayidx14.i, %partition.exit ], [ %arrayidx14.i, %for.body5 ]
%i.0.lcssa.i68 = phi i32 [ 0, %partition.exit.thread ], [ %8, %partition.exit ], [ %8, %for.body5 ]
%11 = load i32, ptr %arrayidx14.i69, align 4, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
%i.243 = add nsw i32 %i.0.lcssa.i68, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%sub1644 = add nsw i32 %12, -1
%cmp1745 = icmp slt i32 %i.243, %sub1644
br i1 %cmp1745, label %for.body18.preheader, label %for.end11.for.end24_crit_edge
for.end11.for.end24_crit_edge: ; preds = %for.end11
%.pre = sext i32 %sub1644 to i64
br label %for.end24
for.body18.preheader: ; preds = %for.end11
%13 = sext i32 %i.243 to i64
br label %for.body18
for.body18: ; preds = %for.body18.preheader, %for.body18
%indvars.iv54 = phi i64 [ %13, %for.body18.preheader ], [ %indvars.iv.next55, %for.body18 ]
%arrayidx20 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv54
%14 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
%indvars.iv.next55 = add nsw i64 %indvars.iv54, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%sub16 = add nsw i32 %15, -1
%16 = sext i32 %sub16 to i64
%cmp17 = icmp slt i64 %indvars.iv.next55, %16
br i1 %cmp17, label %for.body18, label %for.end24, !llvm.loop !13
for.end24: ; preds = %for.body18, %for.end11.for.end24_crit_edge
%idxprom26.pre-phi = phi i64 [ %.pre, %for.end11.for.end24_crit_edge ], [ %16, %for.body18 ]
%arrayidx27 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom26.pre-phi
%17 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %17)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
%cmp3.not.prol = icmp sgt i32 %3, %0
br i1 %cmp3.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom4.prol = sext i32 %p to i64
%arrayidx5.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom4.prol
%4 = load i32, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.047 = phi i32 [ %i.047.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %8, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%add = add nsw i32 %i.047, 1
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%9 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.047, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %10, %0
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%add.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %add.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%11 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !11
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%12 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%13 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %12, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds i32, ptr %A, i64 %idxprom13
%14 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %13, ptr %arrayidx14, align 4, !tbaa !5
store i32 %14, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: 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 #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <stdlib.h>
int partition(int *,int,int);
int main(void){
int i,n,*A,p=0,r,mid;
scanf("%d",&n);
A=(int *)malloc(sizeof(int)*n);
for(i=0;i<n;i++)scanf("%d",&A[i]);
r=n-1;
mid=partition(A,p,r);
for(i=0;i<n;i++){
if(i==mid)printf("[");
printf("%d",A[i]);
if(i==mid)printf("]");
if(i!=n-1)printf(" ");
}
printf("\n");
return 0;
}
int partition(int *A,int p,int r){
int x,i,j,temp;
x=A[r];
i=p-1;
for(j=p;j<r;j++){
if(A[j]<=x){
i++;
temp=A[i];
A[i]=A[j];
A[j]=temp;
}
}
temp=A[i+1];
A[i+1]=A[r];
A[r]=temp;
return i+1;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321105/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321105/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #6
%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 = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #7
%cmp44 = icmp sgt i32 %0, 0
br i1 %cmp44, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub53 = add nsw i32 %0, -1
%idxprom.i54 = sext i32 %sub53 to i64
%arrayidx.i55 = getelementptr inbounds i32, ptr %call1, i64 %idxprom.i54
%1 = load i32, ptr %arrayidx.i55, align 4, !tbaa !5
%2 = load i32, ptr %call1, align 4, !tbaa !5
store i32 %1, ptr %call1, align 4, !tbaa !5
store i32 %2, ptr %arrayidx.i55, align 4, !tbaa !5
br label %for.end28
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp46.i = icmp sgt i32 %3, 1
br i1 %cmp46.i, label %for.body.i.preheader, label %partition.exit
for.body.i.preheader: ; preds = %for.end
%xtraiter = and i64 %idxprom.i, 1
%6 = icmp eq i32 %sub, 1
br i1 %6, label %for.end.loopexit.i.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %idxprom.i, -2
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i = phi i32 [ -1, %for.body.i.preheader.new ], [ %i.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %7, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom4.i
%8 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next.i
%9 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp3.not.i.1 = icmp sgt i32 %9, %5
br i1 %cmp3.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom4.i.1 = sext i32 %inc.i.1 to i64
%arrayidx5.i.1 = getelementptr inbounds i32, ptr %call1, i64 %idxprom4.i.1
%10 = load i32, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx2.i.1, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%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.end.loopexit.i.unr-lcssa, label %for.body.i, !llvm.loop !11
for.end.loopexit.i.unr-lcssa: ; preds = %for.inc.i.1, %for.body.i.preheader
%i.1.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i.unr = phi i32 [ -1, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.loopexit.i, label %for.body.i.epil
for.body.i.epil: ; preds = %for.end.loopexit.i.unr-lcssa
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i.unr
%11 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp3.not.i.epil = icmp sgt i32 %11, %5
br i1 %cmp3.not.i.epil, label %for.end.loopexit.i, label %if.then.i.epil
if.then.i.epil: ; preds = %for.body.i.epil
%inc.i.epil = add nsw i32 %i.047.i.unr, 1
%idxprom4.i.epil = sext i32 %inc.i.epil to i64
%arrayidx5.i.epil = getelementptr inbounds i32, ptr %call1, i64 %idxprom4.i.epil
%12 = load i32, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %11, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %12, ptr %arrayidx2.i.epil, align 4, !tbaa !5
br label %for.end.loopexit.i
for.end.loopexit.i: ; preds = %for.body.i.epil, %if.then.i.epil, %for.end.loopexit.i.unr-lcssa
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.ph, %for.end.loopexit.i.unr-lcssa ], [ %inc.i.epil, %if.then.i.epil ], [ %i.047.i.unr, %for.body.i.epil ]
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%13 = add nsw i32 %i.1.i.lcssa, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%14 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %13, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom13.i
%15 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %14, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %15, ptr %arrayidx.i, align 4, !tbaa !5
%cmp646 = icmp sgt i32 %3, 0
br i1 %cmp646, label %for.body8.preheader, label %for.end28
for.body8.preheader: ; preds = %partition.exit
%16 = zext i32 %i.0.lcssa.i to i64
%arrayidx13 = getelementptr inbounds i32, ptr %call1, i64 %16
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.inc26
%indvars.iv50 = phi i64 [ 0, %for.body8.preheader ], [ %indvars.iv.next51, %for.inc26 ]
%cmp9 = icmp eq i64 %indvars.iv50, %16
br i1 %cmp9, label %if.then, label %if.end19.critedge
if.then: ; preds = %for.body8
%putchar41 = call i32 @putchar(i32 91)
%17 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17)
%putchar42 = call i32 @putchar(i32 93)
br label %if.end19
if.end19.critedge: ; preds = %for.body8
%arrayidx13.c = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv50
%18 = load i32, ptr %arrayidx13.c, align 4, !tbaa !5
%call14.c = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %18)
br label %if.end19
if.end19: ; preds = %if.end19.critedge, %if.then
%19 = load i32, ptr %n, align 4, !tbaa !5
%sub20 = add nsw i32 %19, -1
%20 = zext i32 %sub20 to i64
%cmp21.not = icmp eq i64 %indvars.iv50, %20
br i1 %cmp21.not, label %for.inc26, label %if.then23
if.then23: ; preds = %if.end19
%putchar43 = call i32 @putchar(i32 32)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc26
for.inc26: ; preds = %if.end19, %if.then23
%21 = phi i32 [ %19, %if.end19 ], [ %.pre, %if.then23 ]
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%22 = sext i32 %21 to i64
%cmp6 = icmp slt i64 %indvars.iv.next51, %22
br i1 %cmp6, label %for.body8, label %for.end28, !llvm.loop !12
for.end28: ; preds = %for.inc26, %partition.exit.thread, %partition.exit
%putchar = call i32 @putchar(i32 10)
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 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 norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
%cmp3.not.prol = icmp sgt i32 %3, %0
br i1 %cmp3.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom4.prol = sext i32 %p to i64
%arrayidx5.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom4.prol
%4 = load i32, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.047 = phi i32 [ %i.047.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %8, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.047, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%9 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %10, %0
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %inc.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%11 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !11
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%12 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%13 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %12, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds i32, ptr %A, i64 %idxprom13
%14 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %13, ptr %arrayidx14, align 4, !tbaa !5
store i32 %14, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn 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 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
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 = !{!"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 max 100000
int A[max],n;
int partition(int p,int r){
int x,i,j,t;
x=A[r];
i=p-1;
for(j=p;j<=r-1;j++){
if(A[j]<=x){
i++;
t=A[i];
A[i]=A[j];
A[j]=t;
}
}
t=A[i+1];
A[i+1]=A[r];
A[r]=t;
return i+1;
}
int main(){
scanf("%d",&n);
int i;
for(i=0;i<=n-1;i++)scanf("%d",&A[i]);
int q;
q=partition(0,n-1);
for(i=0;i<=n-1;i++){
if(i)printf(" ");
if(i==q)printf("[");
printf("%d",A[i]);
if(i==q)printf("]");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321149/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321149/source.c"
target datalayout = "e-m:e-p270: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 [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not.not38 = icmp slt i32 %p, %r
br i1 %cmp.not.not38, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.039 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx3 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %2, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.039, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom5
%3 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %2, ptr %arrayidx6, align 4, !tbaa !5
store i32 %3, ptr %arrayidx3, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.039, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%5 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ]
%idxprom14 = sext i32 %i.0.lcssa to i64
%arrayidx15 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom14
%6 = load i32, ptr %arrayidx15, align 4, !tbaa !5
store i32 %5, ptr %arrayidx15, align 4, !tbaa !5
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not.not36 = icmp sgt i32 %0, 0
br i1 %cmp.not.not36, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub46 = add nsw i32 %0, -1
%idxprom.i47 = sext i32 %sub46 to i64
%arrayidx.i48 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i47
%1 = load i32, ptr %arrayidx.i48, align 4, !tbaa !5
%2 = load i32, ptr @A, align 16, !tbaa !5
store i32 %1, ptr @A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i48, align 4, !tbaa !5
br label %for.end22
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp.not.not = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.not.not38.i = icmp sgt i32 %3, 1
br i1 %cmp.not.not38.i, label %for.body.i, label %partition.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.039.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx3.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.not.i = icmp sgt i32 %6, %5
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.039.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom5.i
%7 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx3.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.039.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !9
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%9 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %8, %for.end.loopexit.i ]
%idxprom14.i = sext i32 %i.0.lcssa.i to i64
%arrayidx15.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom14.i
%10 = load i32, ptr %arrayidx15.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx15.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.i, align 4, !tbaa !5
%cmp6.not.not38 = icmp sgt i32 %3, 0
br i1 %cmp6.not.not38, label %if.end.peel, label %for.end22
if.end.peel: ; preds = %partition.exit
%11 = zext i32 %i.0.lcssa.i to i64
%cmp9.peel = icmp eq i32 %i.0.lcssa.i, 0
br i1 %cmp9.peel, label %if.then10.peel, label %for.inc20.critedge.peel
for.inc20.critedge.peel: ; preds = %if.end.peel
%12 = load i32, ptr @A, align 16, !tbaa !5
%call15.c.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
br label %for.inc20.peel
if.then10.peel: ; preds = %if.end.peel
%putchar34.peel = tail call i32 @putchar(i32 91)
%13 = load i32, ptr @A, align 16, !tbaa !5
%call15.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%putchar35.peel = tail call i32 @putchar(i32 93)
br label %for.inc20.peel
for.inc20.peel: ; preds = %if.then10.peel, %for.inc20.critedge.peel
%14 = load i32, ptr @n, align 4, !tbaa !5
%cmp6.not.not.peel = icmp sgt i32 %14, 1
br i1 %cmp6.not.not.peel, label %for.body7.peel.next, label %for.end22
for.body7.peel.next: ; preds = %for.inc20.peel
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %11
br label %if.end
if.end: ; preds = %for.body7.peel.next, %for.inc20
%indvars.iv42 = phi i64 [ 1, %for.body7.peel.next ], [ %indvars.iv.next43, %for.inc20 ]
%putchar33 = tail call i32 @putchar(i32 32)
%cmp9 = icmp eq i64 %indvars.iv42, %11
br i1 %cmp9, label %if.then10, label %for.inc20.critedge
if.then10: ; preds = %if.end
%putchar34 = tail call i32 @putchar(i32 91)
%15 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%call15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%putchar35 = tail call i32 @putchar(i32 93)
br label %for.inc20
for.inc20.critedge: ; preds = %if.end
%arrayidx14.c = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv42
%16 = load i32, ptr %arrayidx14.c, align 4, !tbaa !5
%call15.c = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
br label %for.inc20
for.inc20: ; preds = %for.inc20.critedge, %if.then10
%indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1
%17 = load i32, ptr @n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp6.not.not = icmp slt i64 %indvars.iv.next43, %18
br i1 %cmp6.not.not, label %if.end, label %for.end22, !llvm.loop !12
for.end22: ; preds = %for.inc20, %for.inc20.peel, %partition.exit.thread, %partition.exit
%putchar = tail call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#define MAX 100000
int A[MAX];
int partition(int p,int r){
int x=A[r];
int i=p-1;
int j,store;
for(j=p;j<r;j++){
if(A[j]<=x){
i+=1;
store=A[i];
A[i]=A[j];
A[j]=store;
}
}
store=A[i+1];
A[i+1]=A[r];
A[r]=store;
return i+1;
}
int main(){
int n,i;
int prt;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
prt=partition(0,n-1);
for(i=0;i<n;i++){
if(i==prt) printf("[%d]",A[i]);
else printf("%d",A[i]);
if(i>=0&&i<n-1) printf(" ");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321213/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321213/source.c"
target datalayout = "e-m:e-p270: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 [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"[%d]\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp37 = icmp slt i32 %p, %r
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.038 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %2, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%add = add nsw i32 %i.038, 1
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.038, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%5 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%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
%cmp33 = icmp sgt i32 %0, 0
br i1 %cmp33, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub42 = add nsw i32 %0, -1
%idxprom.i43 = sext i32 %sub42 to i64
%arrayidx.i44 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i43
%1 = load i32, ptr %arrayidx.i44, align 4, !tbaa !5
%2 = load i32, ptr @A, align 16, !tbaa !5
store i32 %1, ptr @A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i44, align 4, !tbaa !5
br label %for.end21
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp37.i = icmp sgt i32 %3, 1
br i1 %cmp37.i, label %for.body.i, label %partition.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.038.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %6, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%add.i = add nsw i32 %i.038.i, 1
%idxprom4.i = sext i32 %add.i to i64
%arrayidx5.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4.i
%7 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.038.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !9
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%9 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %8, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13.i
%10 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.i, align 4, !tbaa !5
%cmp435 = icmp sgt i32 %3, 0
br i1 %cmp435, label %for.body5.preheader, label %for.end21
for.body5.preheader: ; preds = %partition.exit
%11 = zext i32 %i.0.lcssa.i to i64
%arrayidx8 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %11
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.inc19
%indvars.iv39 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next40, %for.inc19 ]
%cmp6 = icmp eq i64 %indvars.iv39, %11
%arrayidx11 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv39
%arrayidx8.sink = select i1 %cmp6, ptr %arrayidx8, ptr %arrayidx11
%.str.1.sink = select i1 %cmp6, ptr @.str.1, ptr @.str
%12 = load i32, ptr %arrayidx8.sink, align 4, !tbaa !5
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink, i32 noundef %12)
%13 = load i32, ptr %n, align 4, !tbaa !5
%sub14 = add nsw i32 %13, -1
%14 = sext i32 %sub14 to i64
%cmp15 = icmp slt i64 %indvars.iv39, %14
br i1 %cmp15, label %if.then16, label %for.inc19
if.then16: ; preds = %for.body5
%putchar32 = call i32 @putchar(i32 32)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc19
for.inc19: ; preds = %for.body5, %if.then16
%15 = phi i32 [ %13, %for.body5 ], [ %.pre, %if.then16 ]
%indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
%16 = sext i32 %15 to i64
%cmp4 = icmp slt i64 %indvars.iv.next40, %16
br i1 %cmp4, label %for.body5, label %for.end21, !llvm.loop !12
for.end21: ; preds = %for.inc19, %partition.exit.thread, %partition.exit
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 MAX 100000
int A[MAX], n;
int partition(int p, int r){
int x, i, j, t;
x = A[r];
i = p - 1;
for(j = p ; j < r ; j++){
if(A[j] <= x){
i++;
t = A[i]; A[i] = A[j]; A[j] = t;
}
}
t = A[i + 1]; A[i + 1] = A[r]; A[r] = t;
return i + 1;
}
int main(){
int i, q;
scanf("%d", &n);
for(i = 0 ; i < n ; i++){
scanf("%d",&A[i]);
}
q = partition(0, n-1);
for(i = 0 ; i < n ; i++){
if(i) printf(" ");
if(i == q) printf("[");
printf("%d", A[i]);
if(i == q) printf("]");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321264/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321264/source.c"
target datalayout = "e-m:e-p270: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 [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp37 = icmp slt i32 %p, %r
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.038 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %2, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.038, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.038, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%5 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
%idxprom.i45 = sext i32 %sub44 to i64
%arrayidx.i46 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i45
%1 = load i32, ptr %arrayidx.i46, align 4, !tbaa !5
%2 = load i32, ptr @A, align 16, !tbaa !5
store i32 %1, ptr @A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i46, align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp37.i = icmp sgt i32 %3, 1
br i1 %cmp37.i, label %for.body.i, label %partition.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.038.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %6, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.038.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4.i
%7 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.038.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !9
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%9 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %8, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13.i
%10 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.i, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %if.end.peel, label %for.end20
if.end.peel: ; preds = %partition.exit
%11 = zext i32 %i.0.lcssa.i to i64
%cmp7.peel = icmp eq i32 %i.0.lcssa.i, 0
br i1 %cmp7.peel, label %if.then8.peel, label %for.inc18.critedge.peel
for.inc18.critedge.peel: ; preds = %if.end.peel
%12 = load i32, ptr @A, align 16, !tbaa !5
%call13.c.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
br label %for.inc18.peel
if.then8.peel: ; preds = %if.end.peel
%putchar32.peel = tail call i32 @putchar(i32 91)
%13 = load i32, ptr @A, align 16, !tbaa !5
%call13.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%putchar33.peel = tail call i32 @putchar(i32 93)
br label %for.inc18.peel
for.inc18.peel: ; preds = %if.then8.peel, %for.inc18.critedge.peel
%14 = load i32, ptr @n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %14, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end20
for.body5.peel.next: ; preds = %for.inc18.peel
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %11
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc18
%indvars.iv40 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next41, %for.inc18 ]
%putchar31 = tail call i32 @putchar(i32 32)
%cmp7 = icmp eq i64 %indvars.iv40, %11
br i1 %cmp7, label %if.then8, label %for.inc18.critedge
if.then8: ; preds = %if.end
%putchar32 = tail call i32 @putchar(i32 91)
%15 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%putchar33 = tail call i32 @putchar(i32 93)
br label %for.inc18
for.inc18.critedge: ; preds = %if.end
%arrayidx12.c = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv40
%16 = load i32, ptr %arrayidx12.c, align 4, !tbaa !5
%call13.c = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
br label %for.inc18
for.inc18: ; preds = %for.inc18.critedge, %if.then8
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%17 = load i32, ptr @n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp4 = icmp slt i64 %indvars.iv.next41, %18
br i1 %cmp4, label %if.end, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.inc18.peel, %partition.exit.thread, %partition.exit
%putchar = tail call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#define MAX 100000
int A[MAX], n;
int partition(int p, int r) {
int x, i, j, t;
x = A[r];
i = p-1;
for(j=p; j<r; j++) {
if(A[j] <= x) {
i++;
t=A[i]; A[i]=A[j]; A[j]=t;
}
}
t=A[i+1]; A[i+1]=A[r]; A[r]=t;
return i+1;
}
int main(void) {
int i, q;
scanf("%d", &n);
for(i=0; i<n; i++) scanf("%d",&A[i]);
q = partition(0,n-1);
for(i=0; i<n; i++) {
if(i) printf(" ");
if(i==q) printf("[");
printf("%d",A[i]);
if(i==q) printf("]");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321307/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321307/source.c"
target datalayout = "e-m:e-p270: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 [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp37 = icmp slt i32 %p, %r
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.038 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %2, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.038, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.038, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%5 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
%idxprom.i45 = sext i32 %sub44 to i64
%arrayidx.i46 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i45
%1 = load i32, ptr %arrayidx.i46, align 4, !tbaa !5
%2 = load i32, ptr @A, align 16, !tbaa !5
store i32 %1, ptr @A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i46, align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp37.i = icmp sgt i32 %3, 1
br i1 %cmp37.i, label %for.body.i, label %partition.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.038.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %6, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.038.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4.i
%7 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.038.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !9
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%9 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %8, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13.i
%10 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.i, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %if.end.peel, label %for.end20
if.end.peel: ; preds = %partition.exit
%11 = zext i32 %i.0.lcssa.i to i64
%cmp7.peel = icmp eq i32 %i.0.lcssa.i, 0
br i1 %cmp7.peel, label %if.then8.peel, label %for.inc18.critedge.peel
for.inc18.critedge.peel: ; preds = %if.end.peel
%12 = load i32, ptr @A, align 16, !tbaa !5
%call13.c.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
br label %for.inc18.peel
if.then8.peel: ; preds = %if.end.peel
%putchar32.peel = tail call i32 @putchar(i32 91)
%13 = load i32, ptr @A, align 16, !tbaa !5
%call13.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%putchar33.peel = tail call i32 @putchar(i32 93)
br label %for.inc18.peel
for.inc18.peel: ; preds = %if.then8.peel, %for.inc18.critedge.peel
%14 = load i32, ptr @n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %14, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end20
for.body5.peel.next: ; preds = %for.inc18.peel
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %11
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc18
%indvars.iv40 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next41, %for.inc18 ]
%putchar31 = tail call i32 @putchar(i32 32)
%cmp7 = icmp eq i64 %indvars.iv40, %11
br i1 %cmp7, label %if.then8, label %for.inc18.critedge
if.then8: ; preds = %if.end
%putchar32 = tail call i32 @putchar(i32 91)
%15 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%putchar33 = tail call i32 @putchar(i32 93)
br label %for.inc18
for.inc18.critedge: ; preds = %if.end
%arrayidx12.c = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv40
%16 = load i32, ptr %arrayidx12.c, align 4, !tbaa !5
%call13.c = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
br label %for.inc18
for.inc18: ; preds = %for.inc18.critedge, %if.then8
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%17 = load i32, ptr @n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp4 = icmp slt i64 %indvars.iv.next41, %18
br i1 %cmp4, label %if.end, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.inc18.peel, %partition.exit.thread, %partition.exit
%putchar = tail call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#define MAX 100000
int Partition(int[],int,int);
int Partition(int A[],int p,int r){
int x=A[r];
int i=p-1,j,k;
for(j=p; j<r; j++) {
if(A[j]<=x) {
i++;
k=A[i];
A[i]=A[j];
A[j]=k;
}
}
k=A[i+1];
A[i+1]=A[r];
A[r]=k;
return i+1;
}
int main(){
int A[MAX];
int n,i,q;
scanf("%d",&n);
for(i=0; i<n; i++) {
scanf("%d",&A[i]);
}
q=Partition(A,0,n-1);
for(i=0; i<n; i++) {
if(i) printf(" ");
if(i==q) {
printf("[");
}
printf("%d",A[i]);
if(i==q) {
printf("]");
}
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321350/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321350/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @Partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
%cmp3.not.prol = icmp sgt i32 %3, %0
br i1 %cmp3.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom4.prol = sext i32 %p to i64
%arrayidx5.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom4.prol
%4 = load i32, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.047 = phi i32 [ %i.047.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %8, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.047, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%9 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %10, %0
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %inc.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%11 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%12 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%13 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %12, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds i32, ptr %A, i64 %idxprom13
%14 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %13, ptr %arrayidx14, align 4, !tbaa !5
store i32 %14, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%A = alloca [100000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %Partition.exit.thread
Partition.exit.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
%idxprom.i45 = sext i32 %sub44 to i64
%arrayidx.i46 = getelementptr inbounds i32, ptr %A, i64 %idxprom.i45
%1 = load i32, ptr %arrayidx.i46, align 4, !tbaa !5
%2 = load i32, ptr %A, align 16, !tbaa !5
store i32 %1, ptr %A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i46, align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp46.i = icmp sgt i32 %3, 1
br i1 %cmp46.i, label %for.body.i.preheader, label %Partition.exit.thread54
for.body.i.preheader: ; preds = %for.end
%xtraiter = and i64 %idxprom.i, 1
%6 = icmp eq i32 %sub, 1
br i1 %6, label %Partition.exit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %idxprom.i, -2
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i = phi i32 [ -1, %for.body.i.preheader.new ], [ %i.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx2.i, align 8, !tbaa !5
%cmp3.not.i = icmp sgt i32 %7, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i
%8 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx2.i, align 8, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx2.i.1 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next.i
%9 = load i32, ptr %arrayidx2.i.1, align 4, !tbaa !5
%cmp3.not.i.1 = icmp sgt i32 %9, %5
br i1 %cmp3.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom4.i.1 = sext i32 %inc.i.1 to i64
%arrayidx5.i.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i.1
%10 = load i32, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx5.i.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx2.i.1, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%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 %Partition.exit.unr-lcssa, label %for.body.i, !llvm.loop !9
Partition.exit.unr-lcssa: ; preds = %for.inc.i.1, %for.body.i.preheader
%i.1.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.047.i.unr = phi i32 [ -1, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %Partition.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %Partition.exit.unr-lcssa
%arrayidx2.i.epil = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.unr
%11 = load i32, ptr %arrayidx2.i.epil, align 4, !tbaa !5
%cmp3.not.i.epil = icmp sgt i32 %11, %5
br i1 %cmp3.not.i.epil, label %Partition.exit, label %if.then.i.epil
if.then.i.epil: ; preds = %for.body.i.epil
%inc.i.epil = add nsw i32 %i.047.i.unr, 1
%idxprom4.i.epil = sext i32 %inc.i.epil to i64
%arrayidx5.i.epil = getelementptr inbounds i32, ptr %A, i64 %idxprom4.i.epil
%12 = load i32, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %11, ptr %arrayidx5.i.epil, align 4, !tbaa !5
store i32 %12, ptr %arrayidx2.i.epil, align 4, !tbaa !5
br label %Partition.exit
Partition.exit: ; preds = %for.body.i.epil, %if.then.i.epil, %Partition.exit.unr-lcssa
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.ph, %Partition.exit.unr-lcssa ], [ %inc.i.epil, %if.then.i.epil ], [ %i.047.i.unr, %for.body.i.epil ]
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%13 = add nsw i32 %i.1.i.lcssa, 1
%idxprom13.i = sext i32 %13 to i64
%arrayidx14.i = getelementptr inbounds i32, ptr %A, i64 %idxprom13.i
%14 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %.pre.i, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %14, ptr %arrayidx.i, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %if.end.peel, label %for.end20
Partition.exit.thread54: ; preds = %for.end
%15 = load i32, ptr %A, align 16, !tbaa !5
store i32 %5, ptr %A, align 16, !tbaa !5
store i32 %15, ptr %arrayidx.i, align 4, !tbaa !5
%cmp43659 = icmp eq i32 %3, 1
br i1 %cmp43659, label %if.then8.peel, label %for.end20
if.end.peel: ; preds = %Partition.exit
%cmp7.peel = icmp eq i32 %13, 0
br i1 %cmp7.peel, label %if.then8.peel, label %for.inc18.critedge.peel
for.inc18.critedge.peel: ; preds = %if.end.peel
%16 = zext i32 %13 to i64
%17 = load i32, ptr %A, align 16, !tbaa !5
%call13.c.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17)
br label %for.inc18.peel
if.then8.peel: ; preds = %Partition.exit.thread54, %if.end.peel
%putchar32.peel = call i32 @putchar(i32 91)
%18 = load i32, ptr %A, align 16, !tbaa !5
%call13.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %18)
%putchar33.peel = call i32 @putchar(i32 93)
br label %for.inc18.peel
for.inc18.peel: ; preds = %if.then8.peel, %for.inc18.critedge.peel
%19 = phi i64 [ 0, %if.then8.peel ], [ %16, %for.inc18.critedge.peel ]
%20 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %20, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end20
for.body5.peel.next: ; preds = %for.inc18.peel
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %19
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc18
%indvars.iv40 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next41, %for.inc18 ]
%putchar31 = call i32 @putchar(i32 32)
%cmp7 = icmp eq i64 %indvars.iv40, %19
br i1 %cmp7, label %if.then8, label %for.inc18.critedge
if.then8: ; preds = %if.end
%putchar32 = call i32 @putchar(i32 91)
%21 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %21)
%putchar33 = call i32 @putchar(i32 93)
br label %for.inc18
for.inc18.critedge: ; preds = %if.end
%arrayidx12.c = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv40
%22 = load i32, ptr %arrayidx12.c, align 4, !tbaa !5
%call13.c = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %22)
br label %for.inc18
for.inc18: ; preds = %for.inc18.critedge, %if.then8
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%23 = load i32, ptr %n, align 4, !tbaa !5
%24 = sext i32 %23 to i64
%cmp4 = icmp slt i64 %indvars.iv.next41, %24
br i1 %cmp4, label %if.end, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.inc18.peel, %Partition.exit.thread54, %Partition.exit.thread, %Partition.exit
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 400000, 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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#include <stdlib.h>
#define MAX 100000
int A[MAX],n;
int partition(int, int);
int main(){
int i,q;
scanf("%d",&n);
if(n < 1 || n > 100000)
exit(1);
for(i = 0; i < n; i++){
scanf("%d",&A[i]);
if(A[i] < 0 || A[i] > 100000)
exit(1);
}
q = partition(0,n-1);
for(i = 0; i < n; i++){
if(i)
printf(" ");
if(i == q)
printf("[");
printf("%d",A[i]);
if(i == q)
printf("]");
}
printf("\n");
return 0;
}
int partition(int p, int r){
int x, i, j, t;
x = A[r];
i = p - 1;
for(j = p; j < r; j++){
if(A[j] <= x){
i++;
t = A[i];
A[i] = A[j];
A[j] = t;
}
}
t = A[i+1];
A[i+1] = A[r];
A[r] = t;
return i+1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321394/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321394/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@A = dso_local global [100000 x i32] zeroinitializer, align 16
; Function Attrs: 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
%1 = add i32 %0, -100001
%or.cond = icmp ult i32 %1, -100000
br i1 %or.cond, label %if.then, label %for.body
if.then: ; preds = %entry
tail call void @exit(i32 noundef 1) #5
unreachable
for.cond: ; preds = %for.body
%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.body, label %for.end, !llvm.loop !9
for.body: ; preds = %entry, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%4 = load i32, ptr %arrayidx, align 4, !tbaa !5
%or.cond50 = icmp ugt i32 %4, 100000
br i1 %or.cond50, label %if.then11, label %for.cond
if.then11: ; preds = %for.body
tail call void @exit(i32 noundef 1) #5
unreachable
for.end: ; preds = %for.cond
%sub = add nsw i32 %2, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp37.i = icmp sgt i32 %2, 1
br i1 %cmp37.i, label %for.body.i, label %partition.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.038.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %6, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.038.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4.i
%7 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.038.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !11
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%9 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %8, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13.i
%10 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.i, align 4, !tbaa !5
%cmp1554 = icmp sgt i32 %2, 0
br i1 %cmp1554, label %if.end19.peel, label %for.end33
if.end19.peel: ; preds = %partition.exit
%11 = zext i32 %i.0.lcssa.i to i64
%cmp20.peel = icmp eq i32 %i.0.lcssa.i, 0
br i1 %cmp20.peel, label %if.then21.peel, label %for.inc31.critedge.peel
for.inc31.critedge.peel: ; preds = %if.end19.peel
%12 = load i32, ptr @A, align 16, !tbaa !5
%call26.c.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
br label %for.inc31.peel
if.then21.peel: ; preds = %if.end19.peel
%putchar48.peel = tail call i32 @putchar(i32 91)
%13 = load i32, ptr @A, align 16, !tbaa !5
%call26.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%putchar49.peel = tail call i32 @putchar(i32 93)
br label %for.inc31.peel
for.inc31.peel: ; preds = %if.then21.peel, %for.inc31.critedge.peel
%14 = load i32, ptr @n, align 4, !tbaa !5
%cmp15.peel = icmp sgt i32 %14, 1
br i1 %cmp15.peel, label %for.body16.peel.next, label %for.end33
for.body16.peel.next: ; preds = %for.inc31.peel
%arrayidx25 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %11
br label %if.end19
if.end19: ; preds = %for.body16.peel.next, %for.inc31
%indvars.iv58 = phi i64 [ 1, %for.body16.peel.next ], [ %indvars.iv.next59, %for.inc31 ]
%putchar47 = tail call i32 @putchar(i32 32)
%cmp20 = icmp eq i64 %indvars.iv58, %11
br i1 %cmp20, label %if.then21, label %for.inc31.critedge
if.then21: ; preds = %if.end19
%putchar48 = tail call i32 @putchar(i32 91)
%15 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%call26 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%putchar49 = tail call i32 @putchar(i32 93)
br label %for.inc31
for.inc31.critedge: ; preds = %if.end19
%arrayidx25.c = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv58
%16 = load i32, ptr %arrayidx25.c, align 4, !tbaa !5
%call26.c = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
br label %for.inc31
for.inc31: ; preds = %for.inc31.critedge, %if.then21
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%17 = load i32, ptr @n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp15 = icmp slt i64 %indvars.iv.next59, %18
br i1 %cmp15, label %if.end19, label %for.end33, !llvm.loop !12
for.end33: ; preds = %for.inc31, %for.inc31.peel, %partition.exit
%putchar = tail call i32 @putchar(i32 10)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp37 = icmp slt i32 %p, %r
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.038 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %2, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.038, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.038, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !11
for.end.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%5 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { nofree nounwind }
attributes #5 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
#define N 100001
int A[N];
int Partition(int A[], int p, int r){
int x, i, j, temp;
x = A[r];
i = p - 1;
for(j = p; j < r; j++){
if(A[j] <= x){
i++;
temp = A[i];
A[i] = A[j];
A[j] = temp;
}
}
temp = A[i + 1];
A[i + 1] = A[r];
A[r] = temp;
return i + 1;
}
int main(){
int n, i, q;
scanf("%d", &n);
for(i = 0; i < n; i++) scanf("%d", &A[i]);
q = Partition(A, 0, i - 1);
for(i = 0; i < n; i++){
if(i == q) printf("[%d]", A[i]);
else printf("%d", A[i]);
if(i < n - 1)printf(" ");
}
printf("\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321451/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321451/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100001 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [5 x i8] c"[%d]\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @Partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp46 = icmp slt i32 %p, %r
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
%cmp3.not.prol = icmp sgt i32 %3, %0
br i1 %cmp3.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom4.prol = sext i32 %p to i64
%arrayidx5.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom4.prol
%4 = load i32, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.047.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.047 = phi i32 [ %i.047.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%8 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %8, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.047, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%9 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.047, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %10, %0
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %inc.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%11 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%12 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%13 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %12, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds i32, ptr %A, i64 %idxprom13
%14 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %13, ptr %arrayidx14, align 4, !tbaa !5
store i32 %14, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%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
%cmp32 = icmp sgt i32 %0, 0
br i1 %cmp32, label %for.body, label %Partition.exit.thread
Partition.exit.thread: ; preds = %entry
%1 = load <2 x i32>, ptr getelementptr inbounds ([100001 x i32], ptr @A, i64 -1, i64 100000), align 4, !tbaa !5
%2 = shufflevector <2 x i32> %1, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
store <2 x i32> %2, ptr getelementptr inbounds ([100001 x i32], ptr @A, i64 -1, i64 100000), align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100001 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%5 = icmp sgt i32 %3, 0
%sext = shl i64 %indvars.iv, 32
%idxprom.i = ashr exact i64 %sext, 32
%arrayidx.i = getelementptr inbounds i32, ptr @A, i64 %idxprom.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%7 = and i64 %indvars.iv.next, 4294967294
%cmp46.i.not = icmp eq i64 %7, 0
br i1 %cmp46.i.not, label %Partition.exit, label %for.body.i
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.047.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds i32, ptr @A, i64 %indvars.iv.i
%8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %8, %6
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.047.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr @A, i64 %idxprom4.i
%9 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.047.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !9
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%10 = add nsw i32 %i.1.i, 1
%idxprom13.i53 = sext i32 %10 to i64
%arrayidx14.i54 = getelementptr inbounds i32, ptr @A, i64 %idxprom13.i53
%11 = load i32, ptr %arrayidx14.i54, align 4, !tbaa !5
store i32 %.pre.i, ptr %arrayidx14.i54, align 4, !tbaa !5
store i32 %11, ptr %arrayidx.i, align 4, !tbaa !5
br i1 %5, label %for.body5.preheader, label %for.end20
Partition.exit: ; preds = %for.end
%12 = load i32, ptr @A, align 16, !tbaa !5
store i32 %6, ptr @A, align 16, !tbaa !5
store i32 %12, ptr %arrayidx.i, align 4, !tbaa !5
br i1 %5, label %for.body5.preheader, label %for.end20
for.body5.preheader: ; preds = %for.end.loopexit.i, %Partition.exit
%i.0.lcssa.i55 = phi i32 [ %10, %for.end.loopexit.i ], [ 0, %Partition.exit ]
%13 = zext i32 %i.0.lcssa.i55 to i64
%arrayidx8 = getelementptr inbounds [100001 x i32], ptr @A, i64 0, i64 %13
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.inc18
%indvars.iv37 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next38, %for.inc18 ]
%cmp6 = icmp eq i64 %indvars.iv37, %13
%arrayidx11 = getelementptr inbounds [100001 x i32], ptr @A, i64 0, i64 %indvars.iv37
%arrayidx11.sink = select i1 %cmp6, ptr %arrayidx8, ptr %arrayidx11
%.str.sink = select i1 %cmp6, ptr @.str.1, ptr @.str
%14 = load i32, ptr %arrayidx11.sink, align 4, !tbaa !5
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.sink, i32 noundef %14)
%15 = load i32, ptr %n, align 4, !tbaa !5
%sub13 = add nsw i32 %15, -1
%16 = sext i32 %sub13 to i64
%cmp14 = icmp slt i64 %indvars.iv37, %16
br i1 %cmp14, label %if.then15, label %for.inc18
if.then15: ; preds = %for.body5
%putchar31 = call i32 @putchar(i32 32)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc18
for.inc18: ; preds = %for.body5, %if.then15
%17 = phi i32 [ %15, %for.body5 ], [ %.pre, %if.then15 ]
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%18 = sext i32 %17 to i64
%cmp4 = icmp slt i64 %indvars.iv.next38, %18
br i1 %cmp4, label %for.body5, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.end.loopexit.i, %Partition.exit.thread, %Partition.exit
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree 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}
|
#define N 100005
#include <stdio.h>
int A[N];
void showArray(int A[], int n, int pos) {
for (int i = 0; i < n; i++) {
if (i == pos) {
printf(" [%d]" + !i, A[i]);
}
else {
printf(" %d" + !i, A[i]);
}
}
printf("\n");
}
void swap(int *a, int *b) {
int tmp = *a;
*a = *b;
*b = tmp;
}
int partition(int A[], int p, int r) {
int x = A[r];
int i = p - 1;
for (int j = p; j < r; j++) {
if (A[j] <= x) {
i = i + 1;
swap(&A[i], &A[j]);
}
}
swap(&A[i + 1], &A[r]);
return i + 1;
}
int main() {
int n = 0;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d", &A[i]);
}
int pos = partition(A, 0, n - 1);
showArray(A, n, pos);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321501/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321501/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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]\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@A = dso_local global [100005 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local void @showArray(ptr nocapture noundef readonly %A, i32 noundef %n, i32 noundef %pos) local_unnamed_addr #0 {
entry:
%cmp18 = icmp sgt i32 %n, 0
br i1 %cmp18, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%0 = zext i32 %pos to i64
%wide.trip.count = zext i32 %n to i64
%tobool.not = icmp eq i32 %pos, 0
%idx.ext = zext i1 %tobool.not to i64
%add.ptr = getelementptr inbounds i8, ptr @.str, i64 %idx.ext
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%cmp1 = icmp eq i64 %indvars.iv, %0
%tobool2.not = icmp eq i64 %indvars.iv, 0
%idx.ext5 = zext i1 %tobool2.not to i64
%add.ptr6 = getelementptr inbounds i8, ptr @.str.1, i64 %idx.ext5
%arrayidx.sink = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%add.ptr.sink = select i1 %cmp1, ptr %add.ptr, ptr %add.ptr6
%1 = load i32, ptr %arrayidx.sink, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %add.ptr.sink, i32 noundef %1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
store i32 %1, ptr %a, align 4, !tbaa !5
store i32 %0, ptr %b, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp28 = icmp slt i32 %p, %r
br i1 %cmp28, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx2.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5
%cmp3.not.prol = icmp sgt i32 %3, %0
br i1 %cmp3.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom4.prol = sext i32 %p to i64
%arrayidx5.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom4.prol
%4 = load i32, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx2.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.029.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.cond.cleanup.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.cond.cleanup.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%8 = add nsw i32 %i.1.lcssa, 1
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%9 = phi i32 [ %0, %entry ], [ %.pre, %for.cond.cleanup.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %8, %for.cond.cleanup.loopexit ]
%idxprom9 = sext i32 %i.0.lcssa to i64
%arrayidx10 = getelementptr inbounds i32, ptr %A, i64 %idxprom9
%10 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %9, ptr %arrayidx10, align 4, !tbaa !5
store i32 %10, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.029 = phi i32 [ %i.029.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%11 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %11, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%add = add nsw i32 %i.029, 1
%idxprom4 = sext i32 %add to i64
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 %idxprom4
%12 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %11, ptr %arrayidx5, align 4, !tbaa !5
store i32 %12, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %add, %if.then ], [ %i.029, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%13 = load i32, ptr %gep, align 4, !tbaa !5
%cmp3.not.1 = icmp sgt i32 %13, %0
br i1 %cmp3.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%add.1 = add nsw i32 %i.1, 1
%idxprom4.1 = sext i32 %add.1 to i64
%arrayidx5.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom4.1
%14 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %13, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %14, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %add.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !11
}
; 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
store i32 0, ptr %n, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %0, 0
br i1 %cmp10, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub15 = add nsw i32 %0, -1
%idxprom.i16 = sext i32 %sub15 to i64
%arrayidx.i17 = getelementptr inbounds i32, ptr @A, i64 %idxprom.i16
%1 = load i32, ptr %arrayidx.i17, align 4, !tbaa !5
%2 = load i32, ptr @A, align 16, !tbaa !5
store i32 %1, ptr @A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i17, align 4, !tbaa !5
br label %showArray.exit
for.cond.cleanup: ; preds = %for.body
%sub = add nsw i32 %11, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr @A, i64 %idxprom.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp28.i = icmp sgt i32 %11, 1
br i1 %cmp28.i, label %for.body.i, label %partition.exit
for.cond.cleanup.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%4 = add nsw i32 %i.1.i, 1
br label %partition.exit
for.body.i: ; preds = %for.cond.cleanup, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.cond.cleanup ]
%i.029.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.cond.cleanup ]
%arrayidx2.i = getelementptr inbounds i32, ptr @A, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %5, %3
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%add.i = add nsw i32 %i.029.i, 1
%idxprom4.i = sext i32 %add.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr @A, i64 %idxprom4.i
%6 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %add.i, %if.then.i ], [ %i.029.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.cond.cleanup.loopexit.i, label %for.body.i, !llvm.loop !11
partition.exit: ; preds = %for.cond.cleanup, %for.cond.cleanup.loopexit.i
%7 = phi i32 [ %3, %for.cond.cleanup ], [ %.pre.i, %for.cond.cleanup.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.cond.cleanup ], [ %4, %for.cond.cleanup.loopexit.i ]
%idxprom9.i = sext i32 %i.0.lcssa.i to i64
%arrayidx10.i = getelementptr inbounds i32, ptr @A, i64 %idxprom9.i
%8 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx10.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx.i, align 4, !tbaa !5
%cmp18.i = icmp sgt i32 %11, 0
br i1 %cmp18.i, label %for.body.preheader.i5, label %showArray.exit
for.body.preheader.i5: ; preds = %partition.exit
%9 = zext i32 %i.0.lcssa.i to i64
%wide.trip.count.i = zext i32 %11 to i64
%tobool.not.i = icmp eq i32 %i.0.lcssa.i, 0
%idx.ext.i = zext i1 %tobool.not.i to i64
%add.ptr.i = getelementptr inbounds i8, ptr @.str, i64 %idx.ext.i
br label %for.body.i6
for.body.i6: ; preds = %for.body.i6, %for.body.preheader.i5
%indvars.iv.i7 = phi i64 [ 0, %for.body.preheader.i5 ], [ %indvars.iv.next.i8, %for.body.i6 ]
%cmp1.i = icmp eq i64 %indvars.iv.i7, %9
%tobool2.not.i = icmp eq i64 %indvars.iv.i7, 0
%idx.ext5.i = zext i1 %tobool2.not.i to i64
%add.ptr6.i = getelementptr inbounds i8, ptr @.str.1, i64 %idx.ext5.i
%arrayidx.sink.i = getelementptr inbounds i32, ptr @A, i64 %indvars.iv.i7
%add.ptr.sink.i = select i1 %cmp1.i, ptr %add.ptr.i, ptr %add.ptr6.i
%10 = load i32, ptr %arrayidx.sink.i, align 4, !tbaa !5
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %add.ptr.sink.i, i32 noundef %10)
%indvars.iv.next.i8 = add nuw nsw i64 %indvars.iv.i7, 1
%exitcond.not.i9 = icmp eq i64 %indvars.iv.next.i8, %wide.trip.count.i
br i1 %exitcond.not.i9, label %showArray.exit, label %for.body.i6, !llvm.loop !9
showArray.exit: ; preds = %for.body.i6, %partition.exit.thread, %partition.exit
%putchar.i = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100005 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp, label %for.body, label %for.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 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#define N 100000
int n,A[N];
int partition(int p,int r){
int i,j,t,x;
x = A[r];
j = p-1;
for(i=0;i<r;i++){
if(A[i]<=A[r]){
j++;
t = A[i];
A[i] = A[j];
A[j] = t;
}
}
t = A[j+1];
A[j+1] = A[r];
A[r] = t;
return j+1;
}
int main(){
int i,q;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
q = partition(0,n-1);
for(i=0;i<n;i++){
if(i>0) printf(" ");
if(i == q) printf("[");
printf("%d",A[i]);
if(i == q) printf("]");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321545/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321545/source.c"
target datalayout = "e-m:e-p270: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 [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom
%cmp39 = icmp sgt i32 %r, 0
br i1 %cmp39, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%wide.trip.count = zext i32 %r 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 ]
%j.040 = phi i32 [ %sub, %for.body.preheader ], [ %j.1, %for.inc ]
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%0 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5.not = icmp sgt i32 %0, %1
br i1 %cmp5.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %j.040, 1
%idxprom8 = sext i32 %inc to i64
%arrayidx9 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom8
%2 = load i32, ptr %arrayidx9, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
store i32 %0, ptr %arrayidx9, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%j.1 = phi i32 [ %inc, %if.then ], [ %j.040, %for.body ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%3 = add nsw i32 %j.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%j.0.lcssa = phi i32 [ %p, %entry ], [ %3, %for.end.loopexit ]
%idxprom15 = sext i32 %j.0.lcssa to i64
%arrayidx16 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom15
%4 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
store i32 %5, ptr %arrayidx16, align 4, !tbaa !5
store i32 %4, ptr %arrayidx, align 4, !tbaa !5
ret i32 %j.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub45 = add nsw i32 %0, -1
%idxprom.i46 = sext i32 %sub45 to i64
%arrayidx.i47 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i46
br label %partition.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr @n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %1, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i
%cmp39.i = icmp sgt i32 %1, 1
br i1 %cmp39.i, label %for.body.preheader.i, label %partition.exit
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %sub to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%j.040.i = phi i32 [ -1, %for.body.preheader.i ], [ %j.1.i, %for.inc.i ]
%arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp5.not.i = icmp sgt i32 %3, %4
br i1 %cmp5.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %j.040.i, 1
%idxprom8.i = sext i32 %inc.i to i64
%arrayidx9.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom8.i
%5 = load i32, ptr %arrayidx9.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx2.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx9.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%j.1.i = phi i32 [ %inc.i, %if.then.i ], [ %j.040.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !9
for.end.loopexit.i: ; preds = %for.inc.i
%6 = add nsw i32 %j.1.i, 1
br label %partition.exit
partition.exit: ; preds = %for.end.thread, %for.end, %for.end.loopexit.i
%arrayidx.i49 = phi ptr [ %arrayidx.i, %for.end ], [ %arrayidx.i, %for.end.loopexit.i ], [ %arrayidx.i47, %for.end.thread ]
%7 = phi i32 [ %1, %for.end ], [ %1, %for.end.loopexit.i ], [ %0, %for.end.thread ]
%j.0.lcssa.i = phi i32 [ 0, %for.end ], [ %6, %for.end.loopexit.i ], [ 0, %for.end.thread ]
%idxprom15.i = sext i32 %j.0.lcssa.i to i64
%arrayidx16.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom15.i
%8 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5
%9 = load i32, ptr %arrayidx.i49, align 4, !tbaa !5
store i32 %9, ptr %arrayidx16.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx.i49, align 4, !tbaa !5
%cmp437 = icmp sgt i32 %7, 0
br i1 %cmp437, label %if.end.peel, label %for.end21
if.end.peel: ; preds = %partition.exit
%10 = zext i32 %j.0.lcssa.i to i64
%cmp8.peel = icmp eq i32 %j.0.lcssa.i, 0
br i1 %cmp8.peel, label %if.then9.peel, label %for.inc19.critedge.peel
for.inc19.critedge.peel: ; preds = %if.end.peel
%11 = load i32, ptr @A, align 16, !tbaa !5
%call14.c.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11)
br label %for.inc19.peel
if.then9.peel: ; preds = %if.end.peel
%putchar33.peel = tail call i32 @putchar(i32 91)
%12 = load i32, ptr @A, align 16, !tbaa !5
%call14.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
%putchar34.peel = tail call i32 @putchar(i32 93)
br label %for.inc19.peel
for.inc19.peel: ; preds = %if.then9.peel, %for.inc19.critedge.peel
%13 = load i32, ptr @n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %13, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end21
for.body5.peel.next: ; preds = %for.inc19.peel
%arrayidx13 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %10
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc19
%indvars.iv41 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next42, %for.inc19 ]
%putchar32 = tail call i32 @putchar(i32 32)
%cmp8 = icmp eq i64 %indvars.iv41, %10
br i1 %cmp8, label %if.then9, label %for.inc19.critedge
if.then9: ; preds = %if.end
%putchar33 = tail call i32 @putchar(i32 91)
%14 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14)
%putchar34 = tail call i32 @putchar(i32 93)
br label %for.inc19
for.inc19.critedge: ; preds = %if.end
%arrayidx13.c = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv41
%15 = load i32, ptr %arrayidx13.c, align 4, !tbaa !5
%call14.c = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
br label %for.inc19
for.inc19: ; preds = %for.inc19.critedge, %if.then9
%indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1
%16 = load i32, ptr @n, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp4 = icmp slt i64 %indvars.iv.next42, %17
br i1 %cmp4, label %if.end, label %for.end21, !llvm.loop !12
for.end21: ; preds = %for.inc19, %for.inc19.peel, %partition.exit
%putchar = tail call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#define N 100000
int hi[N];
int partition ( int a, int b);
int main()
{
int i,n,p;
scanf ("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&hi[i]);
p=partition(0,n-1);
for(i=0;i<n;i++){
if(i)
printf(" ");
if(i==p)
printf("[");
printf("%d",hi[i]);
if(i==p)
printf("]");
}
printf("\n");
return 0;
}
int partition (int a, int b){
int i,j,x,y;
x=hi[b];
i=a-1;
for(j=a;j<b;j++){
if(hi[j]<=x){
i++;
y=hi[i];
hi[i]=hi[j];
hi[j]=y;
}
}
y=hi[i+1];
hi[i+1]=hi[b];
hi[b]=y;
return i+1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321589/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321589/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@hi = dso_local global [100000 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
%idxprom.i45 = sext i32 %sub44 to i64
%arrayidx.i46 = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %idxprom.i45
%1 = load i32, ptr %arrayidx.i46, align 4, !tbaa !5
%2 = load i32, ptr @hi, align 16, !tbaa !5
store i32 %1, ptr @hi, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i46, align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp37.i = icmp sgt i32 %3, 1
br i1 %cmp37.i, label %for.body.i, label %partition.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.039.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %6, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.039.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %idxprom4.i
%7 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.039.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !11
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%9 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %8, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %idxprom13.i
%10 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.i, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %if.end.peel, label %for.end20
if.end.peel: ; preds = %partition.exit
%11 = zext i32 %i.0.lcssa.i to i64
%cmp7.peel = icmp eq i32 %i.0.lcssa.i, 0
br i1 %cmp7.peel, label %if.then8.peel, label %for.inc18.critedge.peel
for.inc18.critedge.peel: ; preds = %if.end.peel
%12 = load i32, ptr @hi, align 16, !tbaa !5
%call13.c.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
br label %for.inc18.peel
if.then8.peel: ; preds = %if.end.peel
%putchar32.peel = call i32 @putchar(i32 91)
%13 = load i32, ptr @hi, align 16, !tbaa !5
%call13.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%putchar33.peel = call i32 @putchar(i32 93)
br label %for.inc18.peel
for.inc18.peel: ; preds = %if.then8.peel, %for.inc18.critedge.peel
%14 = load i32, ptr %n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %14, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end20
for.body5.peel.next: ; preds = %for.inc18.peel
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %11
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc18
%indvars.iv40 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next41, %for.inc18 ]
%putchar31 = call i32 @putchar(i32 32)
%cmp7 = icmp eq i64 %indvars.iv40, %11
br i1 %cmp7, label %if.then8, label %for.inc18.critedge
if.then8: ; preds = %if.end
%putchar32 = call i32 @putchar(i32 91)
%15 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%putchar33 = call i32 @putchar(i32 93)
br label %for.inc18
for.inc18.critedge: ; preds = %if.end
%arrayidx12.c = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %indvars.iv40
%16 = load i32, ptr %arrayidx12.c, align 4, !tbaa !5
%call13.c = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
br label %for.inc18
for.inc18: ; preds = %for.inc18.critedge, %if.then8
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp4 = icmp slt i64 %indvars.iv.next41, %18
br i1 %cmp4, label %if.end, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.inc18.peel, %partition.exit.thread, %partition.exit
%putchar = call i32 @putchar(i32 10)
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 norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %b to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp37 = icmp slt i32 %a, %b
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %a, -1
%1 = sext i32 %a to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.039 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %2, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.039, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.039, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !11
for.end.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%5 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %a, %entry ], [ %4, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @hi, i64 0, i64 %idxprom13
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
int main(){
int N,A[100000];
int i,j,key,swt;
scanf("%d",&N);
for(i=0;i<N;i++) scanf("%d",&A[i]);
key=A[N-1];
i=-1;
for(j=0;j<N-1;j++){
if(key>=A[j]){
i++;
swt=A[i];
A[i]=A[j];
A[j]=swt;
}
}
key=A[i+1];
A[i+1]=A[N-1];
A[N-1]=key;
for(j=0;j<N-1;j++){
if(j==i+1) printf("[%d] ",A[j]);
else printf("%d ",A[j]);
}
printf("%d\n",A[N-1]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321631/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321631/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"[%d] \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%A = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp74 = icmp sgt i32 %0, 0
br i1 %cmp74, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub94 = add nsw i32 %0, -1
%idxprom295 = sext i32 %sub94 to i64
%arrayidx396 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %idxprom295
%1 = load i32, ptr %arrayidx396, align 4, !tbaa !5
br label %for.end22.thread
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%sub = add nsw i32 %2, -1
%idxprom2 = sext i32 %sub to i64
%arrayidx3 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %idxprom2
%4 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp676 = icmp sgt i32 %2, 1
br i1 %cmp676, label %for.body7.preheader, label %for.end22.thread
for.body7.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %sub to i64
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %sub, 1
br i1 %5, label %for.end22.unr-lcssa, label %for.body7.preheader.new
for.body7.preheader.new: ; preds = %for.body7.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body7
for.body7: ; preds = %for.inc20.1, %for.body7.preheader.new
%indvars.iv87 = phi i64 [ 0, %for.body7.preheader.new ], [ %indvars.iv.next88.1, %for.inc20.1 ]
%i.178 = phi i32 [ -1, %for.body7.preheader.new ], [ %i.2.1, %for.inc20.1 ]
%niter = phi i64 [ 0, %for.body7.preheader.new ], [ %niter.next.1, %for.inc20.1 ]
%arrayidx9 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv87
%6 = load i32, ptr %arrayidx9, align 8, !tbaa !5
%cmp10.not = icmp slt i32 %4, %6
br i1 %cmp10.not, label %for.inc20, label %if.then
if.then: ; preds = %for.body7
%inc11 = add nsw i32 %i.178, 1
%idxprom12 = sext i32 %inc11 to i64
%arrayidx13 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %idxprom12
%7 = load i32, ptr %arrayidx13, align 4, !tbaa !5
store i32 %6, ptr %arrayidx13, align 4, !tbaa !5
store i32 %7, ptr %arrayidx9, align 8, !tbaa !5
br label %for.inc20
for.inc20: ; preds = %for.body7, %if.then
%i.2 = phi i32 [ %inc11, %if.then ], [ %i.178, %for.body7 ]
%indvars.iv.next88 = or i64 %indvars.iv87, 1
%arrayidx9.1 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv.next88
%8 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%cmp10.not.1 = icmp slt i32 %4, %8
br i1 %cmp10.not.1, label %for.inc20.1, label %if.then.1
if.then.1: ; preds = %for.inc20
%inc11.1 = add nsw i32 %i.2, 1
%idxprom12.1 = sext i32 %inc11.1 to i64
%arrayidx13.1 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %idxprom12.1
%9 = load i32, ptr %arrayidx13.1, align 4, !tbaa !5
store i32 %8, ptr %arrayidx13.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx9.1, align 4, !tbaa !5
br label %for.inc20.1
for.inc20.1: ; preds = %if.then.1, %for.inc20
%i.2.1 = phi i32 [ %inc11.1, %if.then.1 ], [ %i.2, %for.inc20 ]
%indvars.iv.next88.1 = add nuw nsw i64 %indvars.iv87, 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.end22.unr-lcssa, label %for.body7, !llvm.loop !11
for.end22.thread: ; preds = %for.end, %for.end.thread
%arrayidx398.ph = phi ptr [ %arrayidx396, %for.end.thread ], [ %arrayidx3, %for.end ]
%.ph = phi i32 [ %1, %for.end.thread ], [ %4, %for.end ]
%10 = load i32, ptr %A, align 16, !tbaa !5
store i32 %.ph, ptr %A, align 16, !tbaa !5
store i32 %10, ptr %arrayidx398.ph, align 4, !tbaa !5
br label %for.end50
for.end22.unr-lcssa: ; preds = %for.inc20.1, %for.body7.preheader
%i.2.lcssa.ph = phi i32 [ undef, %for.body7.preheader ], [ %i.2.1, %for.inc20.1 ]
%indvars.iv87.unr = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next88.1, %for.inc20.1 ]
%i.178.unr = phi i32 [ -1, %for.body7.preheader ], [ %i.2.1, %for.inc20.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end22, label %for.body7.epil
for.body7.epil: ; preds = %for.end22.unr-lcssa
%arrayidx9.epil = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv87.unr
%11 = load i32, ptr %arrayidx9.epil, align 4, !tbaa !5
%cmp10.not.epil = icmp slt i32 %4, %11
br i1 %cmp10.not.epil, label %for.end22, label %if.then.epil
if.then.epil: ; preds = %for.body7.epil
%inc11.epil = add nsw i32 %i.178.unr, 1
%idxprom12.epil = sext i32 %inc11.epil to i64
%arrayidx13.epil = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %idxprom12.epil
%12 = load i32, ptr %arrayidx13.epil, align 4, !tbaa !5
store i32 %11, ptr %arrayidx13.epil, align 4, !tbaa !5
store i32 %12, ptr %arrayidx9.epil, align 4, !tbaa !5
br label %for.end22
for.end22: ; preds = %for.body7.epil, %if.then.epil, %for.end22.unr-lcssa
%i.2.lcssa = phi i32 [ %i.2.lcssa.ph, %for.end22.unr-lcssa ], [ %inc11.epil, %if.then.epil ], [ %i.178.unr, %for.body7.epil ]
%.pre = load i32, ptr %arrayidx3, align 4, !tbaa !5
%13 = add nsw i32 %i.2.lcssa, 1
%idxprom23 = sext i32 %13 to i64
%arrayidx24 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %idxprom23
%14 = load i32, ptr %arrayidx24, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx24, align 4, !tbaa !5
store i32 %14, ptr %arrayidx3, align 4, !tbaa !5
br i1 %cmp676, label %for.body37.preheader, label %for.end50
for.body37.preheader: ; preds = %for.end22
%15 = zext i32 %13 to i64
%arrayidx42 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %15
br label %for.body37
for.body37: ; preds = %for.body37.preheader, %for.body37
%indvars.iv90 = phi i64 [ 0, %for.body37.preheader ], [ %indvars.iv.next91, %for.body37 ]
%cmp39 = icmp eq i64 %indvars.iv90, %15
%arrayidx45 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv90
%arrayidx42.sink = select i1 %cmp39, ptr %arrayidx42, ptr %arrayidx45
%.str.1.sink = select i1 %cmp39, ptr @.str.1, ptr @.str.2
%16 = load i32, ptr %arrayidx42.sink, align 4, !tbaa !5
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink, i32 noundef %16)
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%17 = load i32, ptr %N, align 4, !tbaa !5
%sub35 = add nsw i32 %17, -1
%18 = sext i32 %sub35 to i64
%cmp36 = icmp slt i64 %indvars.iv.next91, %18
br i1 %cmp36, label %for.body37, label %for.end50.loopexit, !llvm.loop !12
for.end50.loopexit: ; preds = %for.body37
%arrayidx53.phi.trans.insert = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %18
%.pre93 = load i32, ptr %arrayidx53.phi.trans.insert, align 4, !tbaa !5
br label %for.end50
for.end50: ; preds = %for.end22.thread, %for.end50.loopexit, %for.end22
%19 = phi i32 [ %.pre93, %for.end50.loopexit ], [ %14, %for.end22 ], [ %10, %for.end22.thread ]
%call54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %19)
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include<stdio.h>
#define MAX 100000
int A[MAX], n;
int partition(int p,int r){
int x,i,j,t;
x=A[r];
i=p-1;
for(j=p;j<r;j++){
if(A[j]<=x){
i++;
t=A[i];
A[i]=A[j];
A[j]=t;
}
}
t=A[i+1];
A[i+1]=A[r];
A[r]=t;
return i+1;
}
int main(){
int i,q;
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",&A[i]);
q=partition(0,n-1);
for(i=0;i<n;i++){
if(i)printf(" ");
if(i==q)printf("[");
printf("%d",A[i]);
if(i==q)printf("]");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321682/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321682/source.c"
target datalayout = "e-m:e-p270: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 [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp37 = icmp slt i32 %p, %r
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.038 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %2, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.038, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.038, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%5 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
%idxprom.i45 = sext i32 %sub44 to i64
%arrayidx.i46 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i45
%1 = load i32, ptr %arrayidx.i46, align 4, !tbaa !5
%2 = load i32, ptr @A, align 16, !tbaa !5
store i32 %1, ptr @A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i46, align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp37.i = icmp sgt i32 %3, 1
br i1 %cmp37.i, label %for.body.i, label %partition.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.038.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %6, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.038.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4.i
%7 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.038.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !9
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%9 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %8, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13.i
%10 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.i, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %if.end.peel, label %for.end20
if.end.peel: ; preds = %partition.exit
%11 = zext i32 %i.0.lcssa.i to i64
%cmp7.peel = icmp eq i32 %i.0.lcssa.i, 0
br i1 %cmp7.peel, label %if.then8.peel, label %for.inc18.critedge.peel
for.inc18.critedge.peel: ; preds = %if.end.peel
%12 = load i32, ptr @A, align 16, !tbaa !5
%call13.c.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
br label %for.inc18.peel
if.then8.peel: ; preds = %if.end.peel
%putchar32.peel = tail call i32 @putchar(i32 91)
%13 = load i32, ptr @A, align 16, !tbaa !5
%call13.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%putchar33.peel = tail call i32 @putchar(i32 93)
br label %for.inc18.peel
for.inc18.peel: ; preds = %if.then8.peel, %for.inc18.critedge.peel
%14 = load i32, ptr @n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %14, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end20
for.body5.peel.next: ; preds = %for.inc18.peel
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %11
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc18
%indvars.iv40 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next41, %for.inc18 ]
%putchar31 = tail call i32 @putchar(i32 32)
%cmp7 = icmp eq i64 %indvars.iv40, %11
br i1 %cmp7, label %if.then8, label %for.inc18.critedge
if.then8: ; preds = %if.end
%putchar32 = tail call i32 @putchar(i32 91)
%15 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%putchar33 = tail call i32 @putchar(i32 93)
br label %for.inc18
for.inc18.critedge: ; preds = %if.end
%arrayidx12.c = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv40
%16 = load i32, ptr %arrayidx12.c, align 4, !tbaa !5
%call13.c = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
br label %for.inc18
for.inc18: ; preds = %for.inc18.critedge, %if.then8
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%17 = load i32, ptr @n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp4 = icmp slt i64 %indvars.iv.next41, %18
br i1 %cmp4, label %if.end, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.inc18.peel, %partition.exit.thread, %partition.exit
%putchar = tail call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int n;
int *A;
int x;
int i,j;
int p;
int r;
int change;
scanf("%d",&n);
A=(int *)malloc((n+1)*sizeof(int));
for(i=1;i<=n;i++)scanf("%d",&A[i]);
r=n;
x=A[r];
p=1;
i=p-1;
for(j=p;j<r;j++){
if(A[j]<=x){
i++;
change=A[i];
A[i]=A[j];
A[j]=change;
}
}
change=A[i+1];
A[i+1]=A[r];
A[r]=change;
for(j=1;j<i+1;j++)printf("%d ",A[j]);
printf("[%d] ",A[j]);
for(j=j+1;j<n;j++)printf("%d ",A[j]);
printf("%d\n",A[j]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321725/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321725/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"[%d] \00", align 1
@.str.3 = 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
%conv = sext i32 %add to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #5
%cmp.not105 = icmp slt i32 %0, 1
br i1 %cmp.not105, label %for.end.thread, label %for.body
for.end.thread: ; preds = %entry
%.pre132 = sext i32 %0 to i64
%arrayidx5135 = getelementptr inbounds i32, ptr %call1, i64 %.pre132
%1 = load i32, ptr %arrayidx5135, align 4, !tbaa !5
br label %for.end25.thread
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%arrayidx5 = getelementptr inbounds i32, ptr %call1, i64 %3
%4 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp7107 = icmp sgt i32 %2, 1
br i1 %cmp7107, label %for.body9.preheader, label %for.end25.thread
for.body9.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %2 to i64
%5 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %5, 1
%6 = icmp eq i32 %2, 2
br i1 %6, label %for.end25.unr-lcssa, label %for.body9.preheader.new
for.body9.preheader.new: ; preds = %for.body9.preheader
%unroll_iter = and i64 %5, -2
%invariant.gep = getelementptr i32, ptr %call1, i64 1
br label %for.body9
for.body9: ; preds = %for.inc23.1, %for.body9.preheader.new
%indvars.iv121 = phi i64 [ 1, %for.body9.preheader.new ], [ %indvars.iv.next122.1, %for.inc23.1 ]
%i.1109 = phi i32 [ 0, %for.body9.preheader.new ], [ %i.2.1, %for.inc23.1 ]
%niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.1, %for.inc23.1 ]
%arrayidx11 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv121
%7 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12.not = icmp sgt i32 %7, %4
br i1 %cmp12.not, label %for.inc23, label %if.then
if.then: ; preds = %for.body9
%inc14 = add nsw i32 %i.1109, 1
%idxprom15 = sext i32 %inc14 to i64
%arrayidx16 = getelementptr inbounds i32, ptr %call1, i64 %idxprom15
%8 = load i32, ptr %arrayidx16, align 4, !tbaa !5
store i32 %7, ptr %arrayidx16, align 4, !tbaa !5
store i32 %8, ptr %arrayidx11, align 4, !tbaa !5
br label %for.inc23
for.inc23: ; preds = %for.body9, %if.then
%i.2 = phi i32 [ %inc14, %if.then ], [ %i.1109, %for.body9 ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv121
%9 = load i32, ptr %gep, align 4, !tbaa !5
%cmp12.not.1 = icmp sgt i32 %9, %4
br i1 %cmp12.not.1, label %for.inc23.1, label %if.then.1
if.then.1: ; preds = %for.inc23
%inc14.1 = add nsw i32 %i.2, 1
%idxprom15.1 = sext i32 %inc14.1 to i64
%arrayidx16.1 = getelementptr inbounds i32, ptr %call1, i64 %idxprom15.1
%10 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx16.1, align 4, !tbaa !5
store i32 %10, ptr %gep, align 4, !tbaa !5
br label %for.inc23.1
for.inc23.1: ; preds = %if.then.1, %for.inc23
%i.2.1 = phi i32 [ %inc14.1, %if.then.1 ], [ %i.2, %for.inc23 ]
%indvars.iv.next122.1 = add nuw nsw i64 %indvars.iv121, 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.end25.unr-lcssa, label %for.body9, !llvm.loop !11
for.end25.thread: ; preds = %for.end, %for.end.thread
%arrayidx5137.ph = phi ptr [ %arrayidx5135, %for.end.thread ], [ %arrayidx5, %for.end ]
%.ph = phi i32 [ %1, %for.end.thread ], [ %4, %for.end ]
%arrayidx28142 = getelementptr inbounds i32, ptr %call1, i64 1
%11 = load i32, ptr %arrayidx28142, align 4, !tbaa !5
store i32 %.ph, ptr %arrayidx28142, align 4, !tbaa !5
store i32 %11, ptr %arrayidx5137.ph, align 4, !tbaa !5
br label %for.end46
for.end25.unr-lcssa: ; preds = %for.inc23.1, %for.body9.preheader
%i.2.lcssa.ph = phi i32 [ undef, %for.body9.preheader ], [ %i.2.1, %for.inc23.1 ]
%indvars.iv121.unr = phi i64 [ 1, %for.body9.preheader ], [ %indvars.iv.next122.1, %for.inc23.1 ]
%i.1109.unr = phi i32 [ 0, %for.body9.preheader ], [ %i.2.1, %for.inc23.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end25, label %for.body9.epil
for.body9.epil: ; preds = %for.end25.unr-lcssa
%arrayidx11.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv121.unr
%12 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5
%cmp12.not.epil = icmp sgt i32 %12, %4
br i1 %cmp12.not.epil, label %for.end25, label %if.then.epil
if.then.epil: ; preds = %for.body9.epil
%inc14.epil = add nsw i32 %i.1109.unr, 1
%idxprom15.epil = sext i32 %inc14.epil to i64
%arrayidx16.epil = getelementptr inbounds i32, ptr %call1, i64 %idxprom15.epil
%13 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
store i32 %12, ptr %arrayidx16.epil, align 4, !tbaa !5
store i32 %13, ptr %arrayidx11.epil, align 4, !tbaa !5
br label %for.end25
for.end25: ; preds = %for.body9.epil, %if.then.epil, %for.end25.unr-lcssa
%i.2.lcssa = phi i32 [ %i.2.lcssa.ph, %for.end25.unr-lcssa ], [ %inc14.epil, %if.then.epil ], [ %i.1109.unr, %for.body9.epil ]
%.pre = load i32, ptr %arrayidx5, align 4, !tbaa !5
%add26 = add i32 %i.2.lcssa, 1
%idxprom27 = sext i32 %add26 to i64
%arrayidx28 = getelementptr inbounds i32, ptr %call1, i64 %idxprom27
%14 = load i32, ptr %arrayidx28, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx28, align 4, !tbaa !5
store i32 %14, ptr %arrayidx5, align 4, !tbaa !5
%cmp38.not111 = icmp slt i32 %i.2.lcssa, 1
br i1 %cmp38.not111, label %for.end46, label %for.body40.preheader
for.body40.preheader: ; preds = %for.end25
%wide.trip.count127 = zext i32 %add26 to i64
br label %for.body40
for.body40: ; preds = %for.body40.preheader, %for.body40
%indvars.iv124 = phi i64 [ 1, %for.body40.preheader ], [ %indvars.iv.next125, %for.body40 ]
%arrayidx42 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv124
%15 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
%indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
%exitcond128.not = icmp eq i64 %indvars.iv.next125, %wide.trip.count127
br i1 %exitcond128.not, label %for.end46, label %for.body40, !llvm.loop !12
for.end46: ; preds = %for.body40, %for.end25, %for.end25.thread
%j.1.lcssa = phi i32 [ 1, %for.end25.thread ], [ 1, %for.end25 ], [ %add26, %for.body40 ]
%idxprom47 = zext i32 %j.1.lcssa to i64
%arrayidx48 = getelementptr inbounds i32, ptr %call1, i64 %idxprom47
%16 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%j.2114 = add nuw nsw i32 %j.1.lcssa, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%cmp52115 = icmp slt i32 %j.2114, %17
br i1 %cmp52115, label %for.body54.preheader, label %for.end60
for.body54.preheader: ; preds = %for.end46
%18 = add nuw nsw i64 %idxprom47, 1
br label %for.body54
for.body54: ; preds = %for.body54.preheader, %for.body54
%indvars.iv129 = phi i64 [ %18, %for.body54.preheader ], [ %indvars.iv.next130, %for.body54 ]
%arrayidx56 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv129
%19 = load i32, ptr %arrayidx56, align 4, !tbaa !5
%call57 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %19)
%indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1
%20 = load i32, ptr %n, align 4, !tbaa !5
%21 = trunc i64 %indvars.iv.next130 to i32
%cmp52 = icmp sgt i32 %20, %21
br i1 %cmp52, label %for.body54, label %for.end60, !llvm.loop !13
for.end60: ; preds = %for.body54, %for.end46
%j.2.lcssa = phi i32 [ %j.2114, %for.end46 ], [ %21, %for.body54 ]
%idxprom61 = zext i32 %j.2.lcssa to i64
%arrayidx62 = getelementptr inbounds i32, ptr %call1, i64 %idxprom61
%22 = load i32, ptr %arrayidx62, align 4, !tbaa !5
%call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %22)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nounwind }
attributes #5 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#define MAX 100000
int A[MAX], n;
int partition(int p, int r) {
int x, i, j, t;
x = A[r];
i = p-1;
for(j=p; j<r; j++) {
if(A[j] <= x) {
i++;
t=A[i]; A[i]=A[j]; A[j]=t;
}
}
t=A[i+1]; A[i+1]=A[r]; A[r]=t;
return i+1;
}
int main(void) {
int i, q;
scanf("%d", &n);
for(i=0; i<n; i++) scanf("%d",&A[i]);
q = partition(0,n-1);
for(i=0; i<n; i++) {
if(i) printf(" ");
if(i==q) printf("[");
printf("%d",A[i]);
if(i==q) printf("]");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321769/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321769/source.c"
target datalayout = "e-m:e-p270: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 [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp37 = icmp slt i32 %p, %r
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.038 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %2, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.038, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.038, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%5 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
%idxprom.i45 = sext i32 %sub44 to i64
%arrayidx.i46 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i45
%1 = load i32, ptr %arrayidx.i46, align 4, !tbaa !5
%2 = load i32, ptr @A, align 16, !tbaa !5
store i32 %1, ptr @A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i46, align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp37.i = icmp sgt i32 %3, 1
br i1 %cmp37.i, label %for.body.i, label %partition.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.038.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %6, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.038.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4.i
%7 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.038.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !9
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%9 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %8, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13.i
%10 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.i, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %if.end.peel, label %for.end20
if.end.peel: ; preds = %partition.exit
%11 = zext i32 %i.0.lcssa.i to i64
%cmp7.peel = icmp eq i32 %i.0.lcssa.i, 0
br i1 %cmp7.peel, label %if.then8.peel, label %for.inc18.critedge.peel
for.inc18.critedge.peel: ; preds = %if.end.peel
%12 = load i32, ptr @A, align 16, !tbaa !5
%call13.c.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
br label %for.inc18.peel
if.then8.peel: ; preds = %if.end.peel
%putchar32.peel = tail call i32 @putchar(i32 91)
%13 = load i32, ptr @A, align 16, !tbaa !5
%call13.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%putchar33.peel = tail call i32 @putchar(i32 93)
br label %for.inc18.peel
for.inc18.peel: ; preds = %if.then8.peel, %for.inc18.critedge.peel
%14 = load i32, ptr @n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %14, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end20
for.body5.peel.next: ; preds = %for.inc18.peel
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %11
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc18
%indvars.iv40 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next41, %for.inc18 ]
%putchar31 = tail call i32 @putchar(i32 32)
%cmp7 = icmp eq i64 %indvars.iv40, %11
br i1 %cmp7, label %if.then8, label %for.inc18.critedge
if.then8: ; preds = %if.end
%putchar32 = tail call i32 @putchar(i32 91)
%15 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%putchar33 = tail call i32 @putchar(i32 93)
br label %for.inc18
for.inc18.critedge: ; preds = %if.end
%arrayidx12.c = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv40
%16 = load i32, ptr %arrayidx12.c, align 4, !tbaa !5
%call13.c = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
br label %for.inc18
for.inc18: ; preds = %for.inc18.critedge, %if.then8
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%17 = load i32, ptr @n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp4 = icmp slt i64 %indvars.iv.next41, %18
br i1 %cmp4, label %if.end, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.inc18.peel, %partition.exit.thread, %partition.exit
%putchar = tail call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include <stdio.h>
#define MAX 100000
int Partition(int *, int, int);
int main()
{
int i, n;
int A[MAX];
scanf("%d", &n);
for (i = 0; i < n; i++) scanf("%d", &A[i]);
int pos = Partition(A, 0, n-1);
for (i = 0; i < n-1; i++) {
(i == pos)? printf("[%d] ", A[i]) : printf("%d ", A[i]);
}
printf("%d\n", A[i]);
}
int Partition(int *A, int p, int r){
int x = A[r];
int i = p-1;
int j;
for (j = p; j <= r-1; j++){
if (A[j] <= x){
i++;
int temp = A[i];
A[i] = A[j];
A[j] = temp;
}
}
int temp = A[i+1];
A[i+1] = A[r];
A[r] = temp;
return i+1;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321811/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321811/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"[%d] \00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%A = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400000, 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
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub39 = add nsw i32 %0, -1
%idxprom.i40 = sext i32 %sub39 to i64
%arrayidx.i41 = getelementptr inbounds i32, ptr %A, i64 %idxprom.i40
%1 = load i32, ptr %arrayidx.i41, align 4, !tbaa !5
br label %Partition.exit.thread
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%sub = add nsw i32 %2, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %idxprom.i
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.not.not47.i = icmp sgt i32 %2, 1
br i1 %cmp.not.not47.i, label %for.body.i.preheader, label %Partition.exit.thread
for.body.i.preheader: ; preds = %for.end
%xtraiter = and i64 %idxprom.i, 1
%5 = icmp eq i32 %sub, 1
br i1 %5, label %Partition.exit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %idxprom.i, -2
br label %for.body.i
for.body.i: ; preds = %for.inc.i.1, %for.body.i.preheader.new
%indvars.iv.i = phi i64 [ 0, %for.body.i.preheader.new ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.049.i = phi i32 [ -1, %for.body.i.preheader.new ], [ %i.1.i.1, %for.inc.i.1 ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.inc.i.1 ]
%arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx3.i, align 8, !tbaa !5
%cmp4.not.i = icmp sgt i32 %6, %4
br i1 %cmp4.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.049.i, 1
%idxprom5.i = sext i32 %inc.i to i64
%arrayidx6.i = getelementptr inbounds i32, ptr %A, i64 %idxprom5.i
%7 = load i32, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx6.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx3.i, align 8, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.049.i, %for.body.i ]
%indvars.iv.next.i = or i64 %indvars.iv.i, 1
%arrayidx3.i.1 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.next.i
%8 = load i32, ptr %arrayidx3.i.1, align 4, !tbaa !5
%cmp4.not.i.1 = icmp sgt i32 %8, %4
br i1 %cmp4.not.i.1, label %for.inc.i.1, label %if.then.i.1
if.then.i.1: ; preds = %for.inc.i
%inc.i.1 = add nsw i32 %i.1.i, 1
%idxprom5.i.1 = sext i32 %inc.i.1 to i64
%arrayidx6.i.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom5.i.1
%9 = load i32, ptr %arrayidx6.i.1, align 4, !tbaa !5
store i32 %8, ptr %arrayidx6.i.1, align 4, !tbaa !5
store i32 %9, ptr %arrayidx3.i.1, align 4, !tbaa !5
br label %for.inc.i.1
for.inc.i.1: ; preds = %if.then.i.1, %for.inc.i
%i.1.i.1 = phi i32 [ %inc.i.1, %if.then.i.1 ], [ %i.1.i, %for.inc.i ]
%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 %Partition.exit.unr-lcssa, label %for.body.i, !llvm.loop !11
Partition.exit.thread: ; preds = %for.end, %for.end.thread
%arrayidx.i43.ph = phi ptr [ %arrayidx.i41, %for.end.thread ], [ %arrayidx.i, %for.end ]
%.ph = phi i32 [ %1, %for.end.thread ], [ %4, %for.end ]
%10 = load i32, ptr %A, align 16, !tbaa !5
store i32 %.ph, ptr %A, align 16, !tbaa !5
store i32 %10, ptr %arrayidx.i43.ph, align 4, !tbaa !5
br label %for.end16
Partition.exit.unr-lcssa: ; preds = %for.inc.i.1, %for.body.i.preheader
%i.1.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%indvars.iv.i.unr = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.1, %for.inc.i.1 ]
%i.049.i.unr = phi i32 [ -1, %for.body.i.preheader ], [ %i.1.i.1, %for.inc.i.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %Partition.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %Partition.exit.unr-lcssa
%arrayidx3.i.epil = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.unr
%11 = load i32, ptr %arrayidx3.i.epil, align 4, !tbaa !5
%cmp4.not.i.epil = icmp sgt i32 %11, %4
br i1 %cmp4.not.i.epil, label %Partition.exit, label %if.then.i.epil
if.then.i.epil: ; preds = %for.body.i.epil
%inc.i.epil = add nsw i32 %i.049.i.unr, 1
%idxprom5.i.epil = sext i32 %inc.i.epil to i64
%arrayidx6.i.epil = getelementptr inbounds i32, ptr %A, i64 %idxprom5.i.epil
%12 = load i32, ptr %arrayidx6.i.epil, align 4, !tbaa !5
store i32 %11, ptr %arrayidx6.i.epil, align 4, !tbaa !5
store i32 %12, ptr %arrayidx3.i.epil, align 4, !tbaa !5
br label %Partition.exit
Partition.exit: ; preds = %for.body.i.epil, %if.then.i.epil, %Partition.exit.unr-lcssa
%i.1.i.lcssa = phi i32 [ %i.1.i.lcssa.ph, %Partition.exit.unr-lcssa ], [ %inc.i.epil, %if.then.i.epil ], [ %i.049.i.unr, %for.body.i.epil ]
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%13 = add nsw i32 %i.1.i.lcssa, 1
%idxprom15.i = sext i32 %13 to i64
%arrayidx16.i = getelementptr inbounds i32, ptr %A, i64 %idxprom15.i
%14 = load i32, ptr %arrayidx16.i, align 4, !tbaa !5
store i32 %.pre.i, ptr %arrayidx16.i, align 4, !tbaa !5
store i32 %14, ptr %arrayidx.i, align 4, !tbaa !5
br i1 %cmp.not.not47.i, label %for.body6.preheader, label %for.end16
for.body6.preheader: ; preds = %Partition.exit
%15 = zext i32 %13 to i64
%arrayidx9 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %15
br label %for.body6
for.body6: ; preds = %for.body6.preheader, %for.body6
%indvars.iv36 = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next37, %for.body6 ]
%cmp7 = icmp eq i64 %indvars.iv36, %15
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv36
%arrayidx9.sink = select i1 %cmp7, ptr %arrayidx9, ptr %arrayidx12
%.str.1.sink = select i1 %cmp7, ptr @.str.1, ptr @.str.2
%16 = load i32, ptr %arrayidx9.sink, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink, i32 noundef %16)
%indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%sub4 = add nsw i32 %17, -1
%18 = sext i32 %sub4 to i64
%cmp5 = icmp slt i64 %indvars.iv.next37, %18
br i1 %cmp5, label %for.body6, label %for.end16.loopexit, !llvm.loop !12
for.end16.loopexit: ; preds = %for.body6
%19 = and i64 %indvars.iv.next37, 4294967295
br label %for.end16
for.end16: ; preds = %Partition.exit.thread, %for.end16.loopexit, %Partition.exit
%i.1.lcssa = phi i64 [ 0, %Partition.exit ], [ %19, %for.end16.loopexit ], [ 0, %Partition.exit.thread ]
%arrayidx18 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %i.1.lcssa
%20 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %20)
call void @llvm.lifetime.end.p0(i64 400000, 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 norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local i32 @Partition(ptr nocapture noundef %A, i32 noundef %p, i32 noundef %r) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not.not47 = icmp slt i32 %p, %r
br i1 %cmp.not.not47, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
%2 = sub nsw i64 %idxprom, %1
%xtraiter = and i64 %2, 1
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol
for.body.prol: ; preds = %for.body.preheader
%arrayidx3.prol = getelementptr inbounds i32, ptr %A, i64 %1
%3 = load i32, ptr %arrayidx3.prol, align 4, !tbaa !5
%cmp4.not.prol = icmp sgt i32 %3, %0
br i1 %cmp4.not.prol, label %for.inc.prol, label %if.then.prol
if.then.prol: ; preds = %for.body.prol
%idxprom5.prol = sext i32 %p to i64
%arrayidx6.prol = getelementptr inbounds i32, ptr %A, i64 %idxprom5.prol
%4 = load i32, ptr %arrayidx6.prol, align 4, !tbaa !5
store i32 %3, ptr %arrayidx6.prol, align 4, !tbaa !5
store i32 %4, ptr %arrayidx3.prol, align 4, !tbaa !5
br label %for.inc.prol
for.inc.prol: ; preds = %if.then.prol, %for.body.prol
%i.1.prol = phi i32 [ %p, %if.then.prol ], [ %sub, %for.body.prol ]
%indvars.iv.next.prol = add nsw i64 %1, 1
br label %for.body.prol.loopexit
for.body.prol.loopexit: ; preds = %for.inc.prol, %for.body.preheader
%i.1.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%indvars.iv.unr = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next.prol, %for.inc.prol ]
%i.049.unr = phi i32 [ %sub, %for.body.preheader ], [ %i.1.prol, %for.inc.prol ]
%5 = sub nsw i64 0, %idxprom
%6 = xor i64 %1, %5
%7 = icmp eq i64 %6, -1
br i1 %7, label %for.end.loopexit, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.prol.loopexit
%invariant.gep = getelementptr i32, ptr %A, i64 1
br label %for.body
for.body: ; preds = %for.inc.1, %for.body.preheader.new
%indvars.iv = phi i64 [ %indvars.iv.unr, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.inc.1 ]
%i.049 = phi i32 [ %i.049.unr, %for.body.preheader.new ], [ %i.1.1, %for.inc.1 ]
%arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%8 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %8, %0
br i1 %cmp4.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.049, 1
%idxprom5 = sext i32 %inc to i64
%arrayidx6 = getelementptr inbounds i32, ptr %A, i64 %idxprom5
%9 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %8, ptr %arrayidx6, align 4, !tbaa !5
store i32 %9, ptr %arrayidx3, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.049, %for.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv
%10 = load i32, ptr %gep, align 4, !tbaa !5
%cmp4.not.1 = icmp sgt i32 %10, %0
br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1
if.then.1: ; preds = %for.inc
%inc.1 = add nsw i32 %i.1, 1
%idxprom5.1 = sext i32 %inc.1 to i64
%arrayidx6.1 = getelementptr inbounds i32, ptr %A, i64 %idxprom5.1
%11 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5
store i32 %10, ptr %arrayidx6.1, align 4, !tbaa !5
store i32 %11, ptr %gep, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%i.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %i.1, %for.inc ]
%indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
%exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %idxprom
br i1 %exitcond.not.1, label %for.end.loopexit, label %for.body, !llvm.loop !11
for.end.loopexit: ; preds = %for.inc.1, %for.body.prol.loopexit
%i.1.lcssa = phi i32 [ %i.1.lcssa.unr, %for.body.prol.loopexit ], [ %i.1.1, %for.inc.1 ]
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%12 = add nsw i32 %i.1.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%13 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %12, %for.end.loopexit ]
%idxprom15 = sext i32 %i.0.lcssa to i64
%arrayidx16 = getelementptr inbounds i32, ptr %A, i64 %idxprom15
%14 = load i32, ptr %arrayidx16, align 4, !tbaa !5
store i32 %13, ptr %arrayidx16, align 4, !tbaa !5
store i32 %14, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: 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 #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
|
#include <stdio.h>
#define MAX 100000
int A[MAX], n;
int partition(int p, int r){
int x,i,j,t;
x = A[r];
i = p - 1;
for(j=p;j<r;j++){
if(A[j] <= x){
i++;
t = A[i];
A[i] = A[j];
A[j] = t;
}
}
t = A[i+1];
A[i+1] = A[r];
A[r] = t;
return i+1;
}
int main(){
int i, q;
scanf("%d", &n);
for(i=0;i<n;i++) scanf("%d", &A[i]);
q = partition(0, n-1);
for(i=0;i<n;i++){
if(i)printf(" ");
if(i == q)printf("[");
printf("%d", A[i]);
if(i == q)printf("]");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321855/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321855/source.c"
target datalayout = "e-m:e-p270: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 [100000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @partition(i32 noundef %p, i32 noundef %r) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %r to i64
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp37 = icmp slt i32 %p, %r
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %p, -1
%1 = sext i32 %p to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%i.038 = phi i32 [ %sub, %for.body.preheader ], [ %i.1, %for.inc ]
%arrayidx2 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp3.not = icmp sgt i32 %2, %0
br i1 %cmp3.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %i.038, 1
%idxprom4 = sext i32 %inc to i64
%arrayidx5 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx2, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%i.1 = phi i32 [ %inc, %if.then ], [ %i.038, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %idxprom
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.inc
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
%4 = add nsw i32 %i.1, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%5 = phi i32 [ %0, %entry ], [ %.pre, %for.end.loopexit ]
%i.0.lcssa = phi i32 [ %p, %entry ], [ %4, %for.end.loopexit ]
%idxprom13 = sext i32 %i.0.lcssa to i64
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13
%6 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
store i32 %6, ptr %arrayidx, align 4, !tbaa !5
ret i32 %i.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %partition.exit.thread
partition.exit.thread: ; preds = %entry
%sub44 = add nsw i32 %0, -1
%idxprom.i45 = sext i32 %sub44 to i64
%arrayidx.i46 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i45
%1 = load i32, ptr %arrayidx.i46, align 4, !tbaa !5
%2 = load i32, ptr @A, align 16, !tbaa !5
store i32 %1, ptr @A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.i46, align 4, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body
%sub = add nsw i32 %3, -1
%idxprom.i = sext i32 %sub to i64
%arrayidx.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%cmp37.i = icmp sgt i32 %3, 1
br i1 %cmp37.i, label %for.body.i, label %partition.exit
for.body.i: ; preds = %for.end, %for.inc.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 0, %for.end ]
%i.038.i = phi i32 [ %i.1.i, %for.inc.i ], [ -1, %for.end ]
%arrayidx2.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp3.not.i = icmp sgt i32 %6, %5
br i1 %cmp3.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %i.038.i, 1
%idxprom4.i = sext i32 %inc.i to i64
%arrayidx5.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom4.i
%7 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%i.1.i = phi i32 [ %inc.i, %if.then.i ], [ %i.038.i, %for.body.i ]
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %idxprom.i
br i1 %exitcond.not.i, label %for.end.loopexit.i, label %for.body.i, !llvm.loop !9
for.end.loopexit.i: ; preds = %for.inc.i
%.pre.i = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = add nsw i32 %i.1.i, 1
br label %partition.exit
partition.exit: ; preds = %for.end, %for.end.loopexit.i
%9 = phi i32 [ %5, %for.end ], [ %.pre.i, %for.end.loopexit.i ]
%i.0.lcssa.i = phi i32 [ 0, %for.end ], [ %8, %for.end.loopexit.i ]
%idxprom13.i = sext i32 %i.0.lcssa.i to i64
%arrayidx14.i = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %idxprom13.i
%10 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx.i, align 4, !tbaa !5
%cmp436 = icmp sgt i32 %3, 0
br i1 %cmp436, label %if.end.peel, label %for.end20
if.end.peel: ; preds = %partition.exit
%11 = zext i32 %i.0.lcssa.i to i64
%cmp7.peel = icmp eq i32 %i.0.lcssa.i, 0
br i1 %cmp7.peel, label %if.then8.peel, label %for.inc18.critedge.peel
for.inc18.critedge.peel: ; preds = %if.end.peel
%12 = load i32, ptr @A, align 16, !tbaa !5
%call13.c.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %12)
br label %for.inc18.peel
if.then8.peel: ; preds = %if.end.peel
%putchar32.peel = tail call i32 @putchar(i32 91)
%13 = load i32, ptr @A, align 16, !tbaa !5
%call13.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13)
%putchar33.peel = tail call i32 @putchar(i32 93)
br label %for.inc18.peel
for.inc18.peel: ; preds = %if.then8.peel, %for.inc18.critedge.peel
%14 = load i32, ptr @n, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %14, 1
br i1 %cmp4.peel, label %for.body5.peel.next, label %for.end20
for.body5.peel.next: ; preds = %for.inc18.peel
%arrayidx12 = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %11
br label %if.end
if.end: ; preds = %for.body5.peel.next, %for.inc18
%indvars.iv40 = phi i64 [ 1, %for.body5.peel.next ], [ %indvars.iv.next41, %for.inc18 ]
%putchar31 = tail call i32 @putchar(i32 32)
%cmp7 = icmp eq i64 %indvars.iv40, %11
br i1 %cmp7, label %if.then8, label %for.inc18.critedge
if.then8: ; preds = %if.end
%putchar32 = tail call i32 @putchar(i32 91)
%15 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%putchar33 = tail call i32 @putchar(i32 93)
br label %for.inc18
for.inc18.critedge: ; preds = %if.end
%arrayidx12.c = getelementptr inbounds [100000 x i32], ptr @A, i64 0, i64 %indvars.iv40
%16 = load i32, ptr %arrayidx12.c, align 4, !tbaa !5
%call13.c = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
br label %for.inc18
for.inc18: ; preds = %for.inc18.critedge, %if.then8
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%17 = load i32, ptr @n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp4 = icmp slt i64 %indvars.iv.next41, %18
br i1 %cmp4, label %if.end, label %for.end20, !llvm.loop !12
for.end20: ; preds = %for.inc18, %for.inc18.peel, %partition.exit.thread, %partition.exit
%putchar = tail call i32 @putchar(i32 10)
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: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
int m(int);
int z[100000],a[100000];
int main()
{
int n;
int i,x,y;
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",&a[i]);
for(i=0;i<n;i++) z[i]=1000000000;
z[0]=0;
for(i=0;i<n;i++){
x=a[i]-a[i+1];
y=a[i]-a[i+2];
if(x<0) x=-x;
if(y<0) y=-y;
if(i+1<n){
if(x+z[i]<z[i+1]) z[i+1]=x+z[i];
}
if(i+2<n){
if(y+z[i]<z[i+2]) z[i+2]=y+z[i];
}
}
printf("%d\n",z[n-1]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_321899/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_321899/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [100000 x i32] zeroinitializer, align 16
@z = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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
%cmp101 = icmp sgt i32 %0, 0
br i1 %cmp101, label %for.body, label %for.end9.thread
for.cond2.preheader: ; preds = %for.body
%cmp3103 = icmp sgt i32 %4, 0
br i1 %cmp3103, label %for.body4.preheader, label %for.end9.thread
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %4 to i64
%min.iters.check = icmp ult i32 %4, 8
br i1 %min.iters.check, label %for.body4.preheader125, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%1 = getelementptr inbounds [100000 x i32], ptr @z, i64 0, i64 %index
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %1, align 16, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> <i32 1000000000, i32 1000000000, i32 1000000000, i32 1000000000>, ptr %2, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end9, label %for.body4.preheader125
for.body4.preheader125: ; preds = %for.body4.preheader, %middle.block
%indvars.iv109.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader125, %for.body4
%indvars.iv109 = phi i64 [ %indvars.iv.next110, %for.body4 ], [ %indvars.iv109.ph, %for.body4.preheader125 ]
%arrayidx6 = getelementptr inbounds [100000 x i32], ptr @z, i64 0, i64 %indvars.iv109
store i32 1000000000, ptr %arrayidx6, align 4, !tbaa !5
%indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
%exitcond.not = icmp eq i64 %indvars.iv.next110, %wide.trip.count
br i1 %exitcond.not, label %for.end9, label %for.body4, !llvm.loop !14
for.end9.thread: ; preds = %for.cond2.preheader, %entry
%.lcssa120.ph = phi i32 [ %4, %for.cond2.preheader ], [ %0, %entry ]
store i32 0, ptr @z, align 16, !tbaa !5
br label %for.end69
for.end9: ; preds = %for.body4, %middle.block
store i32 0, ptr @z, align 16, !tbaa !5
br i1 %cmp3103, label %for.body12.preheader, label %for.end69
for.body12.preheader: ; preds = %for.end9
%6 = zext i32 %4 to i64
%wide.trip.count116 = zext i32 %4 to i64
br label %for.body12
for.body12: ; preds = %for.body12.preheader, %for.inc67
%indvars.iv112 = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next113, %for.inc67 ]
%arrayidx14 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv112
%7 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%8 = add nuw nsw i64 %indvars.iv112, 2
%arrayidx21 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %8
%9 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%sub22 = sub nsw i32 %7, %9
%y.0 = call i32 @llvm.abs.i32(i32 %sub22, i1 true)
%cmp30 = icmp ult i64 %indvars.iv.next113, %6
br i1 %cmp30, label %if.then31, label %if.end47
if.then31: ; preds = %for.body12
%arrayidx16 = getelementptr inbounds [100000 x i32], ptr @a, i64 0, i64 %indvars.iv.next113
%10 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%sub = sub nsw i32 %7, %10
%spec.select = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%arrayidx33 = getelementptr inbounds [100000 x i32], ptr @z, i64 0, i64 %indvars.iv112
%11 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%add34 = add nsw i32 %spec.select, %11
%arrayidx37 = getelementptr inbounds [100000 x i32], ptr @z, i64 0, i64 %indvars.iv.next113
%12 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%cmp38 = icmp slt i32 %add34, %12
br i1 %cmp38, label %if.then39, label %if.end47
if.then39: ; preds = %if.then31
store i32 %add34, ptr %arrayidx37, align 4, !tbaa !5
br label %if.end47
if.end47: ; preds = %if.then31, %if.then39, %for.body12
%cmp49 = icmp ult i64 %8, %6
br i1 %cmp49, label %if.then50, label %for.inc67
if.then50: ; preds = %if.end47
%arrayidx52 = getelementptr inbounds [100000 x i32], ptr @z, i64 0, i64 %indvars.iv112
%13 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%add53 = add nsw i32 %13, %y.0
%arrayidx56 = getelementptr inbounds [100000 x i32], ptr @z, i64 0, i64 %8
%14 = load i32, ptr %arrayidx56, align 4, !tbaa !5
%cmp57 = icmp slt i32 %add53, %14
br i1 %cmp57, label %if.then58, label %for.inc67
if.then58: ; preds = %if.then50
store i32 %add53, ptr %arrayidx56, align 4, !tbaa !5
br label %for.inc67
for.inc67: ; preds = %if.end47, %if.then58, %if.then50
%exitcond117.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count116
br i1 %exitcond117.not, label %for.end69, label %for.body12, !llvm.loop !15
for.end69: ; preds = %for.inc67, %for.end9.thread, %for.end9
%.lcssa120124 = phi i32 [ %.lcssa120.ph, %for.end9.thread ], [ %4, %for.end9 ], [ %4, %for.inc67 ]
%sub70 = add nsw i32 %.lcssa120124, -1
%idxprom71 = sext i32 %sub70 to i64
%arrayidx72 = getelementptr inbounds [100000 x i32], ptr @z, i64 0, i64 %idxprom71
%15 = load i32, ptr %arrayidx72, align 4, !tbaa !5
%call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
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.abs.i32(i32, 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 nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
!15 = distinct !{!15, !10}
|