Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include<stdio.h>
#include<string.h>
int n,i,j,k,p,ans;
int a[6000];
int s[5202][5202];
char c[6000];
int main()
{
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s",c);
for(j=0;j<n/4;j++)
{
if(c[j]>='0'&&c[j]<='9')k=c[j]-48;
else k=c[j]-'A'+10;
a[4*j]=k/8;
a[4*j+1]=(k%8)/4;
a[4*j+2]=(k%4)/2;
a[4*j+3]=k%2;
}
for(j=1;j<=n;j++)
s[i+1][j]=s[i][j]+s[i+1][j-1]-s[i][j-1]+a[j-1];
}
//s[1][0]=a[0][0];
//for(i=1;i<n;i++)s[0][i]=s[0][i-1]+a[0][i];
//for(i=1;i<n;i++)s[i][0]=s[i-1][0]+a[i][0];
//for(i=0;i<n;i++)
//{
// for(j=0;j<n;j++)printf("%d",a[i][j]);
// printf("\n");
//}
//for(i=0;i<=n;i++)
//{
// for(j=0;j<=n;j++)printf("%d",s[i][j]);
// printf("\n");
//}
for(p=1;p<=n;p++)
{
if(n%p==0)
{
int flag=0;
for(i=1;i<=n/p;i++)
for(j=1;j<=n/p;j++)
{
if(0!=(s[i*p][j*p]+s[(i-1)*p][(j-1)*p]-s[(i-1)*p][j*p]-s[i*p][(j-1)*p])%(p*p))flag=1;
}
if(flag==0)ans=p;
}
}
printf("%d",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20570/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20570/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@n = dso_local global i32 0, align 4
@i = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@c = dso_local global [6000 x i8] zeroinitializer, align 16
@j = dso_local local_unnamed_addr global i32 0, align 4
@k = dso_local local_unnamed_addr global i32 0, align 4
@a = dso_local local_unnamed_addr global [6000 x i32] zeroinitializer, align 16
@s = dso_local local_unnamed_addr global [5202 x [5202 x i32]] zeroinitializer, align 16
@p = dso_local local_unnamed_addr global i32 0, align 4
@ans = dso_local local_unnamed_addr global i32 0, align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
store i32 0, ptr @i, align 4, !tbaa !5
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp170 = icmp sgt i32 %0, 0
br i1 %cmp170, label %for.body, label %for.end142
for.cond74.preheader: ; preds = %for.inc71
%cmp75.not184 = icmp slt i32 %2, 1
br i1 %cmp75.not184, label %for.end142, label %for.body77.preheader
for.body77.preheader: ; preds = %for.cond74.preheader
%1 = add nuw i32 %2, 1
%wide.trip.count218 = zext i32 %1 to i64
br label %for.body77
for.body: ; preds = %entry, %for.inc71
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @c)
%2 = load i32, ptr @n, align 4, !tbaa !5
%cmp3164 = icmp sgt i32 %2, 3
br i1 %cmp3164, label %for.body4.preheader, label %for.cond38.preheader
for.body4.preheader: ; preds = %for.body
%div = sdiv i32 %2, 4
%wide.trip.count = zext i32 %div to i64
%min.iters.check = icmp ult i32 %div, 4
br i1 %min.iters.check, label %for.body4.preheader228, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%3 = getelementptr inbounds [6000 x i8], ptr @c, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %3, align 4, !tbaa !9
%4 = sext <4 x i8> %wide.load to <4 x i32>
%5 = add <4 x i8> %wide.load, <i8 -48, i8 -48, i8 -48, i8 -48>
%6 = icmp ult <4 x i8> %5, <i8 10, i8 10, i8 10, i8 10>
%7 = select <4 x i1> %6, <4 x i32> <i32 -48, i32 -48, i32 -48, i32 -48>, <4 x i32> <i32 -55, i32 -55, i32 -55, i32 -55>
%8 = add nsw <4 x i32> %7, %4
%9 = trunc <4 x i32> %8 to <4 x i16>
%.frozen = freeze <4 x i16> %9
%10 = sdiv <4 x i16> %.frozen, <i16 8, i16 8, i16 8, i16 8>
%11 = sext <4 x i16> %10 to <4 x i32>
%12 = shl nsw i64 %index, 2
%13 = mul <4 x i16> %10, <i16 8, i16 8, i16 8, i16 8>
%.decomposed = sub <4 x i16> %.frozen, %13
%14 = trunc <4 x i16> %.decomposed to <4 x i8>
%15 = sdiv <4 x i8> %14, <i8 4, i8 4, i8 4, i8 4>
%16 = sext <4 x i8> %15 to <4 x i32>
%17 = srem <4 x i16> %9, <i16 4, i16 4, i16 4, i16 4>
%18 = trunc <4 x i16> %17 to <4 x i8>
%19 = sdiv <4 x i8> %18, <i8 2, i8 2, i8 2, i8 2>
%20 = sext <4 x i8> %19 to <4 x i32>
%21 = srem <4 x i16> %9, <i16 2, i16 2, i16 2, i16 2>
%22 = sext <4 x i16> %21 to <4 x i32>
%23 = or i64 %12, 3
%gep = getelementptr [6000 x i32], ptr getelementptr (i32, ptr @a, i64 -3), i64 0, i64 %23
%24 = shufflevector <4 x i32> %11, <4 x i32> %16, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%25 = shufflevector <4 x i32> %20, <4 x i32> %22, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
%interleaved.vec = shufflevector <8 x i32> %24, <8 x i32> %25, <16 x i32> <i32 0, i32 4, i32 8, i32 12, i32 1, i32 5, i32 9, i32 13, i32 2, i32 6, i32 10, i32 14, i32 3, i32 7, i32 11, i32 15>
store <16 x i32> %interleaved.vec, ptr %gep, align 16, !tbaa !5
%index.next = add nuw i64 %index, 4
%26 = icmp eq i64 %index.next, %n.vec
br i1 %26, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%27 = extractelement <4 x i32> %8, i64 3
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond2.for.cond38.preheader_crit_edge, label %for.body4.preheader228
for.body4.preheader228: ; preds = %for.body4.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body4.preheader ], [ %n.vec, %middle.block ]
br label %for.body4
for.cond2.for.cond38.preheader_crit_edge: ; preds = %for.body4, %middle.block
%storemerge153.lcssa = phi i32 [ %27, %middle.block ], [ %storemerge153, %for.body4 ]
store i32 %storemerge153.lcssa, ptr @k, align 4, !tbaa !5
br label %for.cond38.preheader
for.cond38.preheader: ; preds = %for.cond2.for.cond38.preheader_crit_edge, %for.body
%cmp39.not167 = icmp slt i32 %2, 1
%.pre221 = load i32, ptr @i, align 4, !tbaa !5
br i1 %cmp39.not167, label %for.cond38.preheader.for.inc71_crit_edge, label %for.body41.lr.ph
for.cond38.preheader.for.inc71_crit_edge: ; preds = %for.cond38.preheader
%.pre222 = add nsw i32 %.pre221, 1
br label %for.inc71
for.body41.lr.ph: ; preds = %for.cond38.preheader
%idxprom42 = sext i32 %.pre221 to i64
%add46 = add nsw i32 %.pre221, 1
%idxprom47 = sext i32 %add46 to i64
%28 = add nuw i32 %2, 1
%arrayidx51.phi.trans.insert = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %idxprom47, i64 0
%.pre = load i32, ptr %arrayidx51.phi.trans.insert, align 8, !tbaa !5
%arrayidx57.phi.trans.insert = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %idxprom42, i64 0
%.pre220 = load i32, ptr %arrayidx57.phi.trans.insert, align 8, !tbaa !5
%29 = zext i32 %2 to i64
%xtraiter = and i64 %29, 1
%30 = icmp eq i32 %28, 2
br i1 %30, label %for.inc71.loopexit.unr-lcssa, label %for.body41.lr.ph.new
for.body41.lr.ph.new: ; preds = %for.body41.lr.ph
%unroll_iter = and i64 %29, 4294967294
br label %for.body41
for.body4: ; preds = %for.body4.preheader228, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ %indvars.iv.ph, %for.body4.preheader228 ]
%arrayidx = getelementptr inbounds [6000 x i8], ptr @c, i64 0, i64 %indvars.iv
%31 = load i8, ptr %arrayidx, align 1, !tbaa !9
%conv = sext i8 %31 to i32
%32 = add i8 %31, -48
%or.cond = icmp ult i8 %32, 10
%storemerge153.v = select i1 %or.cond, i32 -48, i32 -55
%storemerge153 = add nsw i32 %storemerge153.v, %conv
%div19.lhs.trunc = trunc i32 %storemerge153 to i16
%div19154 = sdiv i16 %div19.lhs.trunc, 8
%div19.sext = sext i16 %div19154 to i32
%33 = shl nsw i64 %indvars.iv, 2
%arrayidx21 = getelementptr inbounds [6000 x i32], ptr @a, i64 0, i64 %33
store i32 %div19.sext, ptr %arrayidx21, align 16, !tbaa !5
%rem155 = srem i16 %div19.lhs.trunc, 8
%div22.lhs.trunc = trunc i16 %rem155 to i8
%div22156 = sdiv i8 %div22.lhs.trunc, 4
%div22.sext = sext i8 %div22156 to i32
%34 = or i64 %33, 1
%arrayidx26 = getelementptr inbounds [6000 x i32], ptr @a, i64 0, i64 %34
store i32 %div22.sext, ptr %arrayidx26, align 4, !tbaa !5
%rem27157 = srem i16 %div19.lhs.trunc, 4
%div28.lhs.trunc = trunc i16 %rem27157 to i8
%div28158 = sdiv i8 %div28.lhs.trunc, 2
%div28.sext = sext i8 %div28158 to i32
%35 = or i64 %33, 2
%arrayidx32 = getelementptr inbounds [6000 x i32], ptr @a, i64 0, i64 %35
store i32 %div28.sext, ptr %arrayidx32, align 8, !tbaa !5
%rem33159 = srem i16 %div19.lhs.trunc, 2
%rem33.sext = sext i16 %rem33159 to i32
%36 = or i64 %33, 3
%arrayidx37 = getelementptr inbounds [6000 x i32], ptr @a, i64 0, i64 %36
store i32 %rem33.sext, ptr %arrayidx37, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond2.for.cond38.preheader_crit_edge, label %for.body4, !llvm.loop !14
for.body41: ; preds = %for.body41, %for.body41.lr.ph.new
%37 = phi i32 [ %.pre220, %for.body41.lr.ph.new ], [ %42, %for.body41 ]
%38 = phi i32 [ %.pre, %for.body41.lr.ph.new ], [ %add62.1, %for.body41 ]
%indvars.iv192 = phi i64 [ 1, %for.body41.lr.ph.new ], [ %indvars.iv.next193.1, %for.body41 ]
%niter = phi i64 [ 0, %for.body41.lr.ph.new ], [ %niter.next.1, %for.body41 ]
%arrayidx45 = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %idxprom42, i64 %indvars.iv192
%39 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%40 = add nsw i64 %indvars.iv192, -1
%add52 = add nsw i32 %38, %39
%sub58 = sub i32 %add52, %37
%arrayidx61 = getelementptr inbounds [6000 x i32], ptr @a, i64 0, i64 %40
%41 = load i32, ptr %arrayidx61, align 4, !tbaa !5
%add62 = add nsw i32 %sub58, %41
%arrayidx67 = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %idxprom47, i64 %indvars.iv192
store i32 %add62, ptr %arrayidx67, align 4, !tbaa !5
%indvars.iv.next193 = add nuw nsw i64 %indvars.iv192, 1
%arrayidx45.1 = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %idxprom42, i64 %indvars.iv.next193
%42 = load i32, ptr %arrayidx45.1, align 4, !tbaa !5
%add52.1 = add nsw i32 %add62, %42
%sub58.1 = sub i32 %add52.1, %39
%arrayidx61.1 = getelementptr inbounds [6000 x i32], ptr @a, i64 0, i64 %indvars.iv192
%43 = load i32, ptr %arrayidx61.1, align 4, !tbaa !5
%add62.1 = add nsw i32 %sub58.1, %43
%arrayidx67.1 = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %idxprom47, i64 %indvars.iv.next193
store i32 %add62.1, ptr %arrayidx67.1, align 4, !tbaa !5
%indvars.iv.next193.1 = add nuw nsw i64 %indvars.iv192, 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.inc71.loopexit.unr-lcssa, label %for.body41, !llvm.loop !15
for.inc71.loopexit.unr-lcssa: ; preds = %for.body41, %for.body41.lr.ph
%.unr = phi i32 [ %.pre220, %for.body41.lr.ph ], [ %42, %for.body41 ]
%.unr231 = phi i32 [ %.pre, %for.body41.lr.ph ], [ %add62.1, %for.body41 ]
%indvars.iv192.unr = phi i64 [ 1, %for.body41.lr.ph ], [ %indvars.iv.next193.1, %for.body41 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.inc71, label %for.body41.epil
for.body41.epil: ; preds = %for.inc71.loopexit.unr-lcssa
%arrayidx45.epil = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %idxprom42, i64 %indvars.iv192.unr
%44 = load i32, ptr %arrayidx45.epil, align 4, !tbaa !5
%45 = add nsw i64 %indvars.iv192.unr, -1
%add52.epil = add nsw i32 %.unr231, %44
%sub58.epil = sub i32 %add52.epil, %.unr
%arrayidx61.epil = getelementptr inbounds [6000 x i32], ptr @a, i64 0, i64 %45
%46 = load i32, ptr %arrayidx61.epil, align 4, !tbaa !5
%add62.epil = add nsw i32 %sub58.epil, %46
%arrayidx67.epil = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %idxprom47, i64 %indvars.iv192.unr
store i32 %add62.epil, ptr %arrayidx67.epil, align 4, !tbaa !5
br label %for.inc71
for.inc71: ; preds = %for.body41.epil, %for.inc71.loopexit.unr-lcssa, %for.cond38.preheader.for.inc71_crit_edge
%inc72.pre-phi = phi i32 [ %.pre222, %for.cond38.preheader.for.inc71_crit_edge ], [ %add46, %for.inc71.loopexit.unr-lcssa ], [ %add46, %for.body41.epil ]
%storemerge152.lcssa = phi i32 [ 1, %for.cond38.preheader.for.inc71_crit_edge ], [ %28, %for.inc71.loopexit.unr-lcssa ], [ %28, %for.body41.epil ]
store i32 %storemerge152.lcssa, ptr @j, align 4, !tbaa !5
store i32 %inc72.pre-phi, ptr @i, align 4, !tbaa !5
%cmp = icmp slt i32 %inc72.pre-phi, %2
br i1 %cmp, label %for.body, label %for.cond74.preheader, !llvm.loop !16
for.body77: ; preds = %for.body77.preheader, %for.inc140
%indvars.iv214 = phi i64 [ 1, %for.body77.preheader ], [ %indvars.iv.next215, %for.inc140 ]
%47 = trunc i64 %indvars.iv214 to i32
%rem78 = srem i32 %2, %47
%div83 = sdiv i32 %2, %47
%cmp79 = icmp eq i32 %rem78, 0
br i1 %cmp79, label %for.cond82.preheader, label %for.inc140
for.cond82.preheader: ; preds = %for.body77
%cmp84.not177 = icmp slt i32 %div83, 1
br i1 %cmp84.not177, label %for.end134.thread, label %for.cond87.preheader.lr.ph
for.end134.thread: ; preds = %for.cond82.preheader
store i32 1, ptr @i, align 4, !tbaa !5
br label %if.then137
for.cond87.preheader.lr.ph: ; preds = %for.cond82.preheader
%48 = mul nsw i64 %indvars.iv214, %indvars.iv214
%49 = add nuw i32 %div83, 1
%wide.trip.count212 = zext i32 %49 to i64
%50 = trunc i64 %48 to i32
br label %for.cond87.preheader
for.cond87.preheader: ; preds = %for.cond87.preheader.lr.ph, %for.cond87.for.inc132_crit_edge
%indvars.iv206 = phi i64 [ 1, %for.cond87.preheader.lr.ph ], [ %indvars.iv.next207, %for.cond87.for.inc132_crit_edge ]
%flag.0179 = phi i32 [ 0, %for.cond87.preheader.lr.ph ], [ %spec.select, %for.cond87.for.inc132_crit_edge ]
%51 = mul nuw nsw i64 %indvars.iv206, %indvars.iv214
%52 = add nsw i64 %indvars.iv206, -1
%53 = mul nuw nsw i64 %52, %indvars.iv214
br label %for.body91
for.body91: ; preds = %for.cond87.preheader, %for.body91
%indvars.iv198 = phi i64 [ 1, %for.cond87.preheader ], [ %indvars.iv.next199, %for.body91 ]
%flag.1174 = phi i32 [ %flag.0179, %for.cond87.preheader ], [ %spec.select, %for.body91 ]
%54 = mul nuw nsw i64 %indvars.iv198, %indvars.iv214
%arrayidx97 = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %51, i64 %54
%55 = load i32, ptr %arrayidx97, align 4, !tbaa !5
%56 = add nsw i64 %indvars.iv198, -1
%57 = mul nuw nsw i64 %56, %indvars.iv214
%arrayidx105 = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %53, i64 %57
%58 = load i32, ptr %arrayidx105, align 4, !tbaa !5
%arrayidx113 = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %53, i64 %54
%59 = load i32, ptr %arrayidx113, align 4, !tbaa !5
%arrayidx121 = getelementptr inbounds [5202 x [5202 x i32]], ptr @s, i64 0, i64 %51, i64 %57
%60 = load i32, ptr %arrayidx121, align 4, !tbaa !5
%.neg161 = add i32 %58, %55
%61 = add i32 %59, %60
%sub122 = sub i32 %.neg161, %61
%rem124 = srem i32 %sub122, %50
%cmp125.not = icmp eq i32 %rem124, 0
%spec.select = select i1 %cmp125.not, i32 %flag.1174, i32 1
%indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
%exitcond205.not = icmp eq i64 %indvars.iv.next199, %wide.trip.count212
br i1 %exitcond205.not, label %for.cond87.for.inc132_crit_edge, label %for.body91, !llvm.loop !17
for.cond87.for.inc132_crit_edge: ; preds = %for.body91
%indvars.iv.next207 = add nuw nsw i64 %indvars.iv206, 1
%exitcond213.not = icmp eq i64 %indvars.iv.next207, %wide.trip.count212
br i1 %exitcond213.not, label %for.end134, label %for.cond87.preheader, !llvm.loop !18
for.end134: ; preds = %for.cond87.for.inc132_crit_edge
%62 = add i32 %div83, 1
store i32 %49, ptr @j, align 4, !tbaa !5
store i32 %62, ptr @i, align 4, !tbaa !5
%cmp135 = icmp eq i32 %spec.select, 0
br i1 %cmp135, label %if.then137, label %for.inc140
if.then137: ; preds = %for.end134.thread, %for.end134
store i32 %47, ptr @ans, align 4, !tbaa !5
br label %for.inc140
for.inc140: ; preds = %for.end134, %if.then137, %for.body77
%indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
%exitcond219.not = icmp eq i64 %indvars.iv.next215, %wide.trip.count218
br i1 %exitcond219.not, label %for.end142, label %for.body77, !llvm.loop !19
for.end142: ; preds = %for.inc140, %entry, %for.cond74.preheader
%storemerge148.lcssa = phi i32 [ 1, %for.cond74.preheader ], [ 1, %entry ], [ %1, %for.inc140 ]
store i32 %storemerge148.lcssa, ptr @p, align 4, !tbaa !5
%63 = load i32, ptr @ans, align 4, !tbaa !5
%call143 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %63)
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 = !{!"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}
!15 = distinct !{!15, !11}
!16 = distinct !{!16, !11}
!17 = distinct !{!17, !11}
!18 = distinct !{!18, !11}
!19 = distinct !{!19, !11}
|
#include<stdio.h>
int main(void){
int year,month,day;
scanf("%d/%d/%d",&year,&month,&day);
if(year!=2018){
year=2018;
}
printf("%d/",year);
if(month<10){
printf("0");
}
printf("%d/",month);
if(day<10){
printf("0");
}
printf("%d",day);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205743/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205743/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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/\00", align 1
@.str.3 = 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:
%year = alloca i32, align 4
%month = alloca i32, align 4
%day = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %year) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %month) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %day) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %year, ptr noundef nonnull %month, ptr noundef nonnull %day)
%0 = load i32, ptr %year, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, 2018
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
store i32 2018, ptr %year, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 2018)
%1 = load i32, ptr %month, align 4, !tbaa !5
%cmp2 = icmp slt i32 %1, 10
br i1 %cmp2, label %if.then3, label %if.end5
if.then3: ; preds = %if.end
%putchar = call i32 @putchar(i32 48)
%.pre = load i32, ptr %month, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%2 = phi i32 [ %.pre, %if.then3 ], [ %1, %if.end ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%3 = load i32, ptr %day, align 4, !tbaa !5
%cmp7 = icmp slt i32 %3, 10
br i1 %cmp7, label %if.then8, label %if.end10
if.then8: ; preds = %if.end5
%putchar12 = call i32 @putchar(i32 48)
%.pre13 = load i32, ptr %day, align 4, !tbaa !5
br label %if.end10
if.end10: ; preds = %if.then8, %if.end5
%4 = phi i32 [ %.pre13, %if.then8 ], [ %3, %if.end5 ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %day) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %month) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %year) #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"}
|
#include <stdio.h>
int main(void){
int n,t,e,i;
int x[100],ans=-1;
scanf("%d %d %d",&n,&t,&e);
for(i=0;i<n;i++){
scanf("%d",&x[i]);
if(t%x[i]<=e||x[i]-(t%x[i])<=e){
ans=i+1;
}
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205945/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205945/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%t = alloca i32, align 4
%e = alloca i32, align 4
%x = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %x) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %t, ptr noundef nonnull %e)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp sgt i32 %0, 0
br i1 %cmp18, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%ans.020 = phi i32 [ %ans.1, %for.body ], [ -1, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %x, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %t, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%rem = srem i32 %1, %2
%3 = load i32, ptr %e, align 4, !tbaa !5
%cmp4.not = icmp sgt i32 %rem, %3
%sub = sub nsw i32 %2, %rem
%cmp10.not = icmp sgt i32 %sub, %3
%or.cond = select i1 %cmp4.not, i1 %cmp10.not, i1 false
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = trunc i64 %indvars.iv.next to i32
%ans.1 = select i1 %or.cond, i32 %ans.020, i32 %4
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%ans.0.lcssa = phi i32 [ -1, %entry ], [ %ans.1, %for.body ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %x) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %e) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(void)
{
int q,c,a,n,i,cnt;
scanf("%d",&q);
for(i=0;i<q;i++){
scanf("%d %d %d",&c,&a,&n);
cnt=0;
while(1){
if(c==0||a==0||n==0)break;
c--;
a--;
n--;
cnt++;
}
while(1){
if(c<2||a==0)break;
c-=2;
a--;
cnt++;
}
while(1){
if(c<3)break;
c-=3;
cnt++;
}
printf("%d\n",cnt);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_205989/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_205989/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%q = alloca i32, align 4
%c = alloca i32, align 4
%a = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #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 %q)
%0 = load i32, ptr %q, align 4, !tbaa !5
%cmp57 = icmp sgt i32 %0, 0
br i1 %cmp57, label %for.body, label %for.end
for.body: ; preds = %entry, %while.end25
%i.058 = phi i32 [ %inc27, %while.end25 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %c, ptr noundef nonnull %a, ptr noundef nonnull %n)
%c.promoted = load i32, ptr %c, align 4, !tbaa !5
%a.promoted = load i32, ptr %a, align 4
%a.promoted.fr = freeze i32 %a.promoted
%n.promoted = load i32, ptr %n, align 4
%n.promoted.fr = freeze i32 %n.promoted
%cmp237 = icmp eq i32 %c.promoted, 0
%cmp338 = icmp eq i32 %a.promoted.fr, 0
%or.cond39 = or i1 %cmp237, %cmp338
%cmp540 = icmp eq i32 %n.promoted.fr, 0
%or.cond2841 = or i1 %or.cond39, %cmp540
br i1 %or.cond2841, label %while.cond8.preheader, label %if.end.preheader
if.end.preheader: ; preds = %for.body
%1 = add i32 %c.promoted, -1
%2 = add i32 %n.promoted.fr, -1
%3 = add i32 %a.promoted.fr, -1
%umin = call i32 @llvm.umin.i32(i32 %2, i32 %3)
%umin59 = call i32 @llvm.umin.i32(i32 %umin, i32 %1)
%4 = sub i32 %1, %umin59
%5 = sub i32 %2, %umin59
%6 = sub i32 %3, %umin59
%7 = add nuw i32 %umin59, 1
store i32 %4, ptr %c, align 4, !tbaa !5
store i32 %6, ptr %a, align 4, !tbaa !5
store i32 %5, ptr %n, align 4, !tbaa !5
br label %while.cond8.preheader
while.cond8.preheader: ; preds = %if.end.preheader, %for.body
%a.promoted46 = phi i32 [ %6, %if.end.preheader ], [ %a.promoted.fr, %for.body ]
%c.promoted44 = phi i32 [ %4, %if.end.preheader ], [ %c.promoted, %for.body ]
%cnt.0.lcssa = phi i32 [ %7, %if.end.preheader ], [ 0, %for.body ]
%a.promoted46.fr = freeze i32 %a.promoted46
%cmp1047 = icmp slt i32 %c.promoted44, 2
%cmp1248 = icmp eq i32 %a.promoted46.fr, 0
%or.cond2949 = or i1 %cmp1047, %cmp1248
br i1 %or.cond2949, label %while.cond18.preheader, label %if.end14.preheader
if.end14.preheader: ; preds = %while.cond8.preheader
%8 = add i32 %a.promoted46.fr, -1
%9 = add nuw i32 %c.promoted44, 1
%smin = call i32 @llvm.smin.i32(i32 %c.promoted44, i32 3)
%10 = sub nuw i32 %9, %smin
%11 = lshr i32 %10, 1
%umin60 = call i32 @llvm.umin.i32(i32 %8, i32 %11)
%12 = shl nuw nsw i32 %umin60, 1
%13 = add i32 %cnt.0.lcssa, 1
%14 = add nsw i32 %c.promoted44, -2
%15 = sub nsw i32 %14, %12
%16 = sub i32 %8, %umin60
%17 = add i32 %13, %umin60
store i32 %15, ptr %c, align 4, !tbaa !5
store i32 %16, ptr %a, align 4, !tbaa !5
br label %while.cond18.preheader
while.cond18.preheader: ; preds = %if.end14.preheader, %while.cond8.preheader
%cnt.1.lcssa = phi i32 [ %17, %if.end14.preheader ], [ %cnt.0.lcssa, %while.cond8.preheader ]
%.lcssa = phi i32 [ %15, %if.end14.preheader ], [ %c.promoted44, %while.cond8.preheader ]
%cmp2054 = icmp slt i32 %.lcssa, 3
br i1 %cmp2054, label %while.end25, label %if.end22.preheader
if.end22.preheader: ; preds = %while.cond18.preheader
%18 = add nuw i32 %.lcssa, 2
%smin61 = call i32 @llvm.smin.i32(i32 %.lcssa, i32 5)
%19 = sub nuw i32 %18, %smin61
%20 = udiv i32 %19, 3
%.neg = mul nsw i32 %20, -3
%21 = add i32 %cnt.1.lcssa, 1
%22 = add nsw i32 %.lcssa, -3
%23 = add nsw i32 %.neg, %22
%24 = add i32 %21, %20
store i32 %23, ptr %c, align 4, !tbaa !5
br label %while.end25
while.end25: ; preds = %if.end22.preheader, %while.cond18.preheader
%cnt.2.lcssa = phi i32 [ %24, %if.end22.preheader ], [ %cnt.1.lcssa, %while.cond18.preheader ]
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %cnt.2.lcssa)
%inc27 = add nuw nsw i32 %i.058, 1
%25 = load i32, ptr %q, align 4, !tbaa !5
%cmp = icmp slt i32 %inc27, %25
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %while.end25, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress 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.umin.i32(i32, i32) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
char s[100001],l[100001];
int check(long n,int i){
l[0]=(i%2==0)?'S':'W';
l[1]=(i/2==0)?'S':'W';
long j;
for(j=1;j<n-1;j++){
if(l[j]=='S'){
if(s[j]=='o') l[j+1]=l[j-1];
else l[j+1]=(l[j-1]=='W')?'S':'W';
}else{
if(s[j]=='x') l[j+1]=l[j-1];
else l[j+1]=(l[j-1]=='W')?'S':'W';
}
}
if(l[n-1]=='S'){
if(s[n-1]=='o'){
if(l[0]!=l[n-2]) return 0;
}else{
if(l[0]==l[n-2]) return 0;
}
}else{
if(s[n-1]=='x'){
if(l[0]!=l[n-2]) return 0;
}else{
if(l[0]==l[n-2]) return 0;
}
}
if(l[0]=='S'){
if(s[0]=='o'){
if(l[1]!=l[n-1]) return 0;
}else{
if(l[1]==l[n-1]) return 0;
}
}else{
if(s[0]=='x'){
if(l[1]!=l[n-1]) return 0;
}else{
if(l[1]==l[n-1]) return 0;
}
}
l[n]='\0';
return 1;
}
int main(int argc, char const *argv[]) {
long n;
int i;
scanf("%ld",&n);
scanf("%s",s);
for(i=0;i<4;i++){
if(check(n,i)) i=4;
}
if(i==4) printf("-1\n");
else printf("%s\n",l);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206038/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206038/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@l = dso_local global [100001 x i8] zeroinitializer, align 16
@s = dso_local global [100001 x i8] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @check(i64 noundef %n, i32 noundef %i) local_unnamed_addr #0 {
entry:
%0 = and i32 %i, 1
%cmp = icmp eq i32 %0, 0
%conv = select i1 %cmp, i8 83, i8 87
store i8 %conv, ptr @l, align 16, !tbaa !5
%i.off = add i32 %i, 1
%cmp1 = icmp ult i32 %i.off, 3
%conv4 = select i1 %cmp1, i8 83, i8 87
store i8 %conv4, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%sub = add i64 %n, -1
%cmp5181 = icmp sgt i64 %n, 2
br i1 %cmp5181, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%load_initial = load i8, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc
%store_forwarded = phi i8 [ %load_initial, %for.body.preheader ], [ %conv24.sink, %for.inc ]
%j.0182 = phi i64 [ 1, %for.body.preheader ], [ %add25, %for.inc ]
%cmp8 = icmp eq i8 %store_forwarded, 83
%arrayidx10 = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %j.0182
%1 = load i8, ptr %arrayidx10, align 1, !tbaa !5
%sub15 = add nsw i64 %j.0182, -1
%arrayidx16 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %sub15
%2 = load i8, ptr %arrayidx16, align 1, !tbaa !5
br i1 %cmp8, label %if.then, label %if.else27
if.then: ; preds = %for.body
%cmp12 = icmp eq i8 %1, 111
br i1 %cmp12, label %for.inc, label %if.else
if.else: ; preds = %if.then
%cmp21 = icmp eq i8 %2, 87
%conv24 = select i1 %cmp21, i8 83, i8 87
br label %for.inc
if.else27: ; preds = %for.body
%cmp30 = icmp eq i8 %1, 120
br i1 %cmp30, label %for.inc, label %if.else37
if.else37: ; preds = %if.else27
%cmp41 = icmp eq i8 %2, 87
%conv44 = select i1 %cmp41, i8 83, i8 87
br label %for.inc
for.inc: ; preds = %if.else27, %if.then, %if.else, %if.else37
%conv24.sink = phi i8 [ %conv24, %if.else ], [ %conv44, %if.else37 ], [ %2, %if.then ], [ %2, %if.else27 ]
%add25 = add nuw nsw i64 %j.0182, 1
%arrayidx26 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %add25
store i8 %conv24.sink, ptr %arrayidx26, align 1, !tbaa !5
%exitcond.not = icmp eq i64 %add25, %sub
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !8
for.end: ; preds = %for.inc, %entry
%arrayidx50 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %sub
%3 = load i8, ptr %arrayidx50, align 1, !tbaa !5
%cmp52 = icmp eq i8 %3, 83
%arrayidx56 = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %sub
%4 = load i8, ptr %arrayidx56, align 1, !tbaa !5
%sub62 = add nsw i64 %n, -2
%arrayidx63 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %sub62
%5 = load i8, ptr %arrayidx63, align 1, !tbaa !5
%cmp65.not = icmp eq i8 %conv, %5
br i1 %cmp52, label %if.then54, label %if.else79
if.then54: ; preds = %for.end
%cmp58 = icmp eq i8 %4, 111
br i1 %cmp58, label %if.then60, label %if.else69
if.then60: ; preds = %if.then54
br i1 %cmp65.not, label %if.end104, label %cleanup
if.else69: ; preds = %if.then54
br i1 %cmp65.not, label %cleanup, label %if.end104
if.else79: ; preds = %for.end
%cmp83 = icmp eq i8 %4, 120
br i1 %cmp83, label %if.then85, label %if.else94
if.then85: ; preds = %if.else79
br i1 %cmp65.not, label %if.end104, label %cleanup
if.else94: ; preds = %if.else79
br i1 %cmp65.not, label %cleanup, label %if.end104
if.end104: ; preds = %if.then85, %if.else94, %if.then60, %if.else69
%6 = load i8, ptr @s, align 16, !tbaa !5
%cmp117.not = icmp eq i8 %conv4, %3
br i1 %cmp, label %if.then108, label %if.else131
if.then108: ; preds = %if.end104
%cmp110 = icmp eq i8 %6, 111
br i1 %cmp110, label %if.then112, label %if.else121
if.then112: ; preds = %if.then108
br i1 %cmp117.not, label %if.end154, label %cleanup
if.else121: ; preds = %if.then108
br i1 %cmp117.not, label %cleanup, label %if.end154
if.else131: ; preds = %if.end104
%cmp133 = icmp eq i8 %6, 120
br i1 %cmp133, label %if.then135, label %if.else144
if.then135: ; preds = %if.else131
br i1 %cmp117.not, label %if.end154, label %cleanup
if.else144: ; preds = %if.else131
br i1 %cmp117.not, label %cleanup, label %if.end154
if.end154: ; preds = %if.then135, %if.else144, %if.then112, %if.else121
%arrayidx155 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %n
store i8 0, ptr %arrayidx155, align 1, !tbaa !5
br label %cleanup
cleanup: ; preds = %if.else144, %if.then135, %if.else121, %if.then112, %if.else94, %if.then85, %if.else69, %if.then60, %if.end154
%retval.0 = phi i32 [ 1, %if.end154 ], [ 0, %if.then60 ], [ 0, %if.else69 ], [ 0, %if.then85 ], [ 0, %if.else94 ], [ 0, %if.then112 ], [ 0, %if.else121 ], [ 0, %if.then135 ], [ 0, %if.else144 ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 {
entry:
%n = alloca i64, align 8
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 %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @s)
%0 = load i64, ptr %n, align 8, !tbaa !10
%sub.i = add i64 %0, -1
%cmp5181.i = icmp sgt i64 %0, 2
%arrayidx50.i = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %sub.i
%arrayidx56.i = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %sub.i
%1 = load i8, ptr %arrayidx56.i, align 1, !tbaa !5
%.fr = freeze i8 %1
%sub62.i = add nsw i64 %0, -2
%arrayidx63.i = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %sub62.i
%cmp83.i = icmp eq i8 %.fr, 120
%cmp58.i = icmp eq i8 %.fr, 111
%2 = load i8, ptr @s, align 16
%cmp133.i = icmp eq i8 %2, 120
%cmp110.i = icmp eq i8 %2, 111
%arrayidx155.i = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %0
br i1 %cmp5181.i, label %for.body.us, label %entry.split
for.body.us: ; preds = %entry
store i8 83, ptr @l, align 16, !tbaa !5
store i8 83, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
br label %for.body.i.us
for.body.i.us: ; preds = %for.body.us, %for.inc.i.us
%3 = phi i8 [ %conv24.sink.i.us, %for.inc.i.us ], [ 83, %for.body.us ]
%j.0182.i.us = phi i64 [ %add25.i.us, %for.inc.i.us ], [ 1, %for.body.us ]
%cmp8.i.us = icmp eq i8 %3, 83
%arrayidx10.i.us = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %j.0182.i.us
%4 = load i8, ptr %arrayidx10.i.us, align 1, !tbaa !5
%sub15.i.us = add nsw i64 %j.0182.i.us, -1
%arrayidx16.i.us = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %sub15.i.us
%5 = load i8, ptr %arrayidx16.i.us, align 1, !tbaa !5
br i1 %cmp8.i.us, label %if.then.i.us, label %if.else27.i.us
if.else27.i.us: ; preds = %for.body.i.us
%cmp30.i.us = icmp eq i8 %4, 120
br i1 %cmp30.i.us, label %for.inc.i.us, label %if.else37.i.us
if.else37.i.us: ; preds = %if.else27.i.us
%cmp41.i.us = icmp eq i8 %5, 87
%conv44.i.us = select i1 %cmp41.i.us, i8 83, i8 87
br label %for.inc.i.us
if.then.i.us: ; preds = %for.body.i.us
%cmp12.i.us = icmp eq i8 %4, 111
br i1 %cmp12.i.us, label %for.inc.i.us, label %if.else.i.us
if.else.i.us: ; preds = %if.then.i.us
%cmp21.i.us = icmp eq i8 %5, 87
%conv24.i.us = select i1 %cmp21.i.us, i8 83, i8 87
br label %for.inc.i.us
for.inc.i.us: ; preds = %if.else.i.us, %if.then.i.us, %if.else37.i.us, %if.else27.i.us
%conv24.sink.i.us = phi i8 [ %conv24.i.us, %if.else.i.us ], [ %conv44.i.us, %if.else37.i.us ], [ %5, %if.then.i.us ], [ %5, %if.else27.i.us ]
%add25.i.us = add nuw nsw i64 %j.0182.i.us, 1
%arrayidx26.i.us = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %add25.i.us
store i8 %conv24.sink.i.us, ptr %arrayidx26.i.us, align 1, !tbaa !5
%exitcond.not.i.us = icmp eq i64 %add25.i.us, %sub.i
br i1 %exitcond.not.i.us, label %for.end.i.loopexit.us, label %for.body.i.us, !llvm.loop !8
if.else79.i.us: ; preds = %for.end.i.loopexit.us
br i1 %cmp83.i, label %if.then85.i.us, label %if.else94.i.us
if.else94.i.us: ; preds = %if.else79.i.us
br i1 %cmp65.not.i.us, label %for.cond.us, label %if.end104.i.us
if.then85.i.us: ; preds = %if.else79.i.us
br i1 %cmp65.not.i.us, label %if.end104.i.us, label %for.cond.us
if.then54.i.us: ; preds = %for.end.i.loopexit.us
br i1 %cmp58.i, label %if.then60.i.us, label %if.else69.i.us
if.else69.i.us: ; preds = %if.then54.i.us
br i1 %cmp65.not.i.us, label %for.cond.us, label %if.end104.i.us
if.then60.i.us: ; preds = %if.then54.i.us
br i1 %cmp65.not.i.us, label %if.end104.i.us, label %for.cond.us
if.end104.i.us: ; preds = %if.then60.i.us, %if.else69.i.us, %if.then85.i.us, %if.else94.i.us
%cmp117.not.i.us = icmp eq i8 %21, 83
br i1 %cmp110.i, label %if.then112.i.us, label %if.else121.i.us
if.else121.i.us: ; preds = %if.end104.i.us
br i1 %cmp117.not.i.us, label %for.cond.us, label %if.else.sink.split
if.then112.i.us: ; preds = %if.end104.i.us
br i1 %cmp117.not.i.us, label %if.else.sink.split, label %for.cond.us
for.cond.us: ; preds = %if.then112.i.us, %if.else121.i.us, %if.then60.i.us, %if.else69.i.us, %if.then85.i.us, %if.else94.i.us
store i8 87, ptr @l, align 16, !tbaa !5
store i8 83, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
br label %for.body.i.us.1
for.body.i.us.1: ; preds = %for.inc.i.us.1, %for.cond.us
%6 = phi i8 [ %conv24.sink.i.us.1, %for.inc.i.us.1 ], [ 83, %for.cond.us ]
%j.0182.i.us.1 = phi i64 [ %add25.i.us.1, %for.inc.i.us.1 ], [ 1, %for.cond.us ]
%cmp8.i.us.1 = icmp eq i8 %6, 83
%arrayidx10.i.us.1 = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %j.0182.i.us.1
%7 = load i8, ptr %arrayidx10.i.us.1, align 1, !tbaa !5
%sub15.i.us.1 = add nsw i64 %j.0182.i.us.1, -1
%arrayidx16.i.us.1 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %sub15.i.us.1
%8 = load i8, ptr %arrayidx16.i.us.1, align 1, !tbaa !5
br i1 %cmp8.i.us.1, label %if.then.i.us.1, label %if.else27.i.us.1
if.else27.i.us.1: ; preds = %for.body.i.us.1
%cmp30.i.us.1 = icmp eq i8 %7, 120
br i1 %cmp30.i.us.1, label %for.inc.i.us.1, label %if.else37.i.us.1
if.else37.i.us.1: ; preds = %if.else27.i.us.1
%cmp41.i.us.1 = icmp eq i8 %8, 87
%conv44.i.us.1 = select i1 %cmp41.i.us.1, i8 83, i8 87
br label %for.inc.i.us.1
if.then.i.us.1: ; preds = %for.body.i.us.1
%cmp12.i.us.1 = icmp eq i8 %7, 111
br i1 %cmp12.i.us.1, label %for.inc.i.us.1, label %if.else.i.us.1
if.else.i.us.1: ; preds = %if.then.i.us.1
%cmp21.i.us.1 = icmp eq i8 %8, 87
%conv24.i.us.1 = select i1 %cmp21.i.us.1, i8 83, i8 87
br label %for.inc.i.us.1
for.inc.i.us.1: ; preds = %if.else.i.us.1, %if.then.i.us.1, %if.else37.i.us.1, %if.else27.i.us.1
%conv24.sink.i.us.1 = phi i8 [ %conv24.i.us.1, %if.else.i.us.1 ], [ %conv44.i.us.1, %if.else37.i.us.1 ], [ %8, %if.then.i.us.1 ], [ %8, %if.else27.i.us.1 ]
%add25.i.us.1 = add nuw nsw i64 %j.0182.i.us.1, 1
%arrayidx26.i.us.1 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %add25.i.us.1
store i8 %conv24.sink.i.us.1, ptr %arrayidx26.i.us.1, align 1, !tbaa !5
%exitcond.not.i.us.1 = icmp eq i64 %add25.i.us.1, %sub.i
br i1 %exitcond.not.i.us.1, label %for.end.i.loopexit.us.1, label %for.body.i.us.1, !llvm.loop !8
for.end.i.loopexit.us.1: ; preds = %for.inc.i.us.1
%9 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us.1 = icmp eq i8 %9, 83
%10 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us.1 = icmp eq i8 %10, 87
br i1 %cmp52.i.us.1, label %if.then54.i.us.1, label %if.else79.i.us.1
if.else79.i.us.1: ; preds = %for.end.i.loopexit.us.1
br i1 %cmp83.i, label %if.then85.i.us.1, label %if.else94.i.us.1
if.else94.i.us.1: ; preds = %if.else79.i.us.1
br i1 %cmp65.not.i.us.1, label %for.cond.us.1, label %if.end104.i.us.1
if.then85.i.us.1: ; preds = %if.else79.i.us.1
br i1 %cmp65.not.i.us.1, label %if.end104.i.us.1, label %for.cond.us.1
if.then54.i.us.1: ; preds = %for.end.i.loopexit.us.1
br i1 %cmp58.i, label %if.then60.i.us.1, label %if.else69.i.us.1
if.else69.i.us.1: ; preds = %if.then54.i.us.1
br i1 %cmp65.not.i.us.1, label %for.cond.us.1, label %if.end104.i.us.1
if.then60.i.us.1: ; preds = %if.then54.i.us.1
br i1 %cmp65.not.i.us.1, label %if.end104.i.us.1, label %for.cond.us.1
if.end104.i.us.1: ; preds = %if.then60.i.us.1, %if.else69.i.us.1, %if.then85.i.us.1, %if.else94.i.us.1
%cmp117.not.i.us.1 = icmp eq i8 %9, 83
br i1 %cmp133.i, label %if.then135.i.us.1, label %if.else144.i.us.1
if.else144.i.us.1: ; preds = %if.end104.i.us.1
br i1 %cmp117.not.i.us.1, label %for.cond.us.1, label %if.else.sink.split
if.then135.i.us.1: ; preds = %if.end104.i.us.1
br i1 %cmp117.not.i.us.1, label %if.else.sink.split, label %for.cond.us.1
for.cond.us.1: ; preds = %if.then135.i.us.1, %if.else144.i.us.1, %if.then60.i.us.1, %if.else69.i.us.1, %if.then85.i.us.1, %if.else94.i.us.1
store i8 83, ptr @l, align 16, !tbaa !5
store i8 87, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
br label %for.body.i.us.2
for.body.i.us.2: ; preds = %for.inc.i.us.2, %for.cond.us.1
%11 = phi i8 [ %conv24.sink.i.us.2, %for.inc.i.us.2 ], [ 87, %for.cond.us.1 ]
%j.0182.i.us.2 = phi i64 [ %add25.i.us.2, %for.inc.i.us.2 ], [ 1, %for.cond.us.1 ]
%cmp8.i.us.2 = icmp eq i8 %11, 83
%arrayidx10.i.us.2 = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %j.0182.i.us.2
%12 = load i8, ptr %arrayidx10.i.us.2, align 1, !tbaa !5
%sub15.i.us.2 = add nsw i64 %j.0182.i.us.2, -1
%arrayidx16.i.us.2 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %sub15.i.us.2
%13 = load i8, ptr %arrayidx16.i.us.2, align 1, !tbaa !5
br i1 %cmp8.i.us.2, label %if.then.i.us.2, label %if.else27.i.us.2
if.else27.i.us.2: ; preds = %for.body.i.us.2
%cmp30.i.us.2 = icmp eq i8 %12, 120
br i1 %cmp30.i.us.2, label %for.inc.i.us.2, label %if.else37.i.us.2
if.else37.i.us.2: ; preds = %if.else27.i.us.2
%cmp41.i.us.2 = icmp eq i8 %13, 87
%conv44.i.us.2 = select i1 %cmp41.i.us.2, i8 83, i8 87
br label %for.inc.i.us.2
if.then.i.us.2: ; preds = %for.body.i.us.2
%cmp12.i.us.2 = icmp eq i8 %12, 111
br i1 %cmp12.i.us.2, label %for.inc.i.us.2, label %if.else.i.us.2
if.else.i.us.2: ; preds = %if.then.i.us.2
%cmp21.i.us.2 = icmp eq i8 %13, 87
%conv24.i.us.2 = select i1 %cmp21.i.us.2, i8 83, i8 87
br label %for.inc.i.us.2
for.inc.i.us.2: ; preds = %if.else.i.us.2, %if.then.i.us.2, %if.else37.i.us.2, %if.else27.i.us.2
%conv24.sink.i.us.2 = phi i8 [ %conv24.i.us.2, %if.else.i.us.2 ], [ %conv44.i.us.2, %if.else37.i.us.2 ], [ %13, %if.then.i.us.2 ], [ %13, %if.else27.i.us.2 ]
%add25.i.us.2 = add nuw nsw i64 %j.0182.i.us.2, 1
%arrayidx26.i.us.2 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %add25.i.us.2
store i8 %conv24.sink.i.us.2, ptr %arrayidx26.i.us.2, align 1, !tbaa !5
%exitcond.not.i.us.2 = icmp eq i64 %add25.i.us.2, %sub.i
br i1 %exitcond.not.i.us.2, label %for.end.i.loopexit.us.2, label %for.body.i.us.2, !llvm.loop !8
for.end.i.loopexit.us.2: ; preds = %for.inc.i.us.2
%14 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us.2 = icmp eq i8 %14, 83
%15 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us.2 = icmp eq i8 %15, 83
br i1 %cmp52.i.us.2, label %if.then54.i.us.2, label %if.else79.i.us.2
if.else79.i.us.2: ; preds = %for.end.i.loopexit.us.2
br i1 %cmp83.i, label %if.then85.i.us.2, label %if.else94.i.us.2
if.else94.i.us.2: ; preds = %if.else79.i.us.2
br i1 %cmp65.not.i.us.2, label %for.cond.us.2, label %if.end104.i.us.2
if.then85.i.us.2: ; preds = %if.else79.i.us.2
br i1 %cmp65.not.i.us.2, label %if.end104.i.us.2, label %for.cond.us.2
if.then54.i.us.2: ; preds = %for.end.i.loopexit.us.2
br i1 %cmp58.i, label %if.then60.i.us.2, label %if.else69.i.us.2
if.else69.i.us.2: ; preds = %if.then54.i.us.2
br i1 %cmp65.not.i.us.2, label %for.cond.us.2, label %if.end104.i.us.2
if.then60.i.us.2: ; preds = %if.then54.i.us.2
br i1 %cmp65.not.i.us.2, label %if.end104.i.us.2, label %for.cond.us.2
if.end104.i.us.2: ; preds = %if.then60.i.us.2, %if.else69.i.us.2, %if.then85.i.us.2, %if.else94.i.us.2
%cmp117.not.i.us.2 = icmp eq i8 %14, 87
br i1 %cmp110.i, label %if.then112.i.us.2, label %if.else121.i.us.2
if.else121.i.us.2: ; preds = %if.end104.i.us.2
br i1 %cmp117.not.i.us.2, label %for.cond.us.2, label %if.else.sink.split
if.then112.i.us.2: ; preds = %if.end104.i.us.2
br i1 %cmp117.not.i.us.2, label %if.else.sink.split, label %for.cond.us.2
for.cond.us.2: ; preds = %if.then112.i.us.2, %if.else121.i.us.2, %if.then60.i.us.2, %if.else69.i.us.2, %if.then85.i.us.2, %if.else94.i.us.2
store i8 87, ptr @l, align 16, !tbaa !5
store i8 87, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
br label %for.body.i.us.3
for.body.i.us.3: ; preds = %for.inc.i.us.3, %for.cond.us.2
%16 = phi i8 [ %conv24.sink.i.us.3, %for.inc.i.us.3 ], [ 87, %for.cond.us.2 ]
%j.0182.i.us.3 = phi i64 [ %add25.i.us.3, %for.inc.i.us.3 ], [ 1, %for.cond.us.2 ]
%cmp8.i.us.3 = icmp eq i8 %16, 83
%arrayidx10.i.us.3 = getelementptr inbounds [100001 x i8], ptr @s, i64 0, i64 %j.0182.i.us.3
%17 = load i8, ptr %arrayidx10.i.us.3, align 1, !tbaa !5
%sub15.i.us.3 = add nsw i64 %j.0182.i.us.3, -1
%arrayidx16.i.us.3 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %sub15.i.us.3
%18 = load i8, ptr %arrayidx16.i.us.3, align 1, !tbaa !5
br i1 %cmp8.i.us.3, label %if.then.i.us.3, label %if.else27.i.us.3
if.else27.i.us.3: ; preds = %for.body.i.us.3
%cmp30.i.us.3 = icmp eq i8 %17, 120
br i1 %cmp30.i.us.3, label %for.inc.i.us.3, label %if.else37.i.us.3
if.else37.i.us.3: ; preds = %if.else27.i.us.3
%cmp41.i.us.3 = icmp eq i8 %18, 87
%conv44.i.us.3 = select i1 %cmp41.i.us.3, i8 83, i8 87
br label %for.inc.i.us.3
if.then.i.us.3: ; preds = %for.body.i.us.3
%cmp12.i.us.3 = icmp eq i8 %17, 111
br i1 %cmp12.i.us.3, label %for.inc.i.us.3, label %if.else.i.us.3
if.else.i.us.3: ; preds = %if.then.i.us.3
%cmp21.i.us.3 = icmp eq i8 %18, 87
%conv24.i.us.3 = select i1 %cmp21.i.us.3, i8 83, i8 87
br label %for.inc.i.us.3
for.inc.i.us.3: ; preds = %if.else.i.us.3, %if.then.i.us.3, %if.else37.i.us.3, %if.else27.i.us.3
%conv24.sink.i.us.3 = phi i8 [ %conv24.i.us.3, %if.else.i.us.3 ], [ %conv44.i.us.3, %if.else37.i.us.3 ], [ %18, %if.then.i.us.3 ], [ %18, %if.else27.i.us.3 ]
%add25.i.us.3 = add nuw nsw i64 %j.0182.i.us.3, 1
%arrayidx26.i.us.3 = getelementptr inbounds [100001 x i8], ptr @l, i64 0, i64 %add25.i.us.3
store i8 %conv24.sink.i.us.3, ptr %arrayidx26.i.us.3, align 1, !tbaa !5
%exitcond.not.i.us.3 = icmp eq i64 %add25.i.us.3, %sub.i
br i1 %exitcond.not.i.us.3, label %for.end.i.loopexit.us.3, label %for.body.i.us.3, !llvm.loop !8
for.end.i.loopexit.us.3: ; preds = %for.inc.i.us.3
%19 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us.3 = icmp eq i8 %19, 83
%20 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us.3 = icmp eq i8 %20, 87
br i1 %cmp52.i.us.3, label %if.then54.i.us.3, label %if.else79.i.us.3
if.else79.i.us.3: ; preds = %for.end.i.loopexit.us.3
br i1 %cmp83.i, label %if.then85.i.us.3, label %if.else94.i.us.3
if.else94.i.us.3: ; preds = %if.else79.i.us.3
br i1 %cmp65.not.i.us.3, label %if.end7, label %if.end104.i.us.3
if.then85.i.us.3: ; preds = %if.else79.i.us.3
br i1 %cmp65.not.i.us.3, label %if.end104.i.us.3, label %if.end7
if.then54.i.us.3: ; preds = %for.end.i.loopexit.us.3
br i1 %cmp58.i, label %if.then60.i.us.3, label %if.else69.i.us.3
if.else69.i.us.3: ; preds = %if.then54.i.us.3
br i1 %cmp65.not.i.us.3, label %if.end7, label %if.end104.i.us.3
if.then60.i.us.3: ; preds = %if.then54.i.us.3
br i1 %cmp65.not.i.us.3, label %if.end104.i.us.3, label %if.end7
if.end104.i.us.3: ; preds = %if.then60.i.us.3, %if.else69.i.us.3, %if.then85.i.us.3, %if.else94.i.us.3
%cmp117.not.i.us.3 = icmp eq i8 %19, 87
br i1 %cmp133.i, label %if.then135.i.us.3, label %if.else144.i.us.3
if.else144.i.us.3: ; preds = %if.end104.i.us.3
br i1 %cmp117.not.i.us.3, label %if.end7, label %if.else.sink.split
if.then135.i.us.3: ; preds = %if.end104.i.us.3
br i1 %cmp117.not.i.us.3, label %if.else.sink.split, label %if.end7
for.end.i.loopexit.us: ; preds = %for.inc.i.us
%21 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us = icmp eq i8 %21, 83
%22 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us = icmp eq i8 %22, 83
br i1 %cmp52.i.us, label %if.then54.i.us, label %if.else79.i.us
entry.split: ; preds = %entry
br i1 %cmp83.i, label %for.body.us15, label %entry.split.split
for.body.us15: ; preds = %entry.split
store i8 83, ptr @l, align 16, !tbaa !5
store i8 83, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%23 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us22 = icmp eq i8 %23, 83
%24 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us23 = icmp eq i8 %24, 83
br i1 %cmp52.i.us22, label %if.then54.i.us26, label %if.else79.i.us24
if.else79.i.us24: ; preds = %for.body.us15
br i1 %cmp65.not.i.us23, label %if.end104.i.us29, label %for.cond.us38
if.then54.i.us26: ; preds = %for.body.us15
br i1 %cmp58.i, label %if.then60.i.us28, label %if.else69.i.us27
if.else69.i.us27: ; preds = %if.then54.i.us26
br i1 %cmp65.not.i.us23, label %for.cond.us38, label %if.end104.i.us29
if.then60.i.us28: ; preds = %if.then54.i.us26
br i1 %cmp65.not.i.us23, label %if.end104.i.us29, label %for.cond.us38
if.end104.i.us29: ; preds = %if.then60.i.us28, %if.else69.i.us27, %if.else79.i.us24
%cmp117.not.i.us30 = icmp eq i8 %23, 83
br i1 %cmp110.i, label %if.then112.i.us36, label %if.else121.i.us35
if.else121.i.us35: ; preds = %if.end104.i.us29
br i1 %cmp117.not.i.us30, label %for.cond.us38, label %if.else.sink.split
if.then112.i.us36: ; preds = %if.end104.i.us29
br i1 %cmp117.not.i.us30, label %if.else.sink.split, label %for.cond.us38
for.cond.us38: ; preds = %if.then112.i.us36, %if.else121.i.us35, %if.then60.i.us28, %if.else69.i.us27, %if.else79.i.us24
store i8 87, ptr @l, align 16, !tbaa !5
store i8 83, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%25 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us22.1 = icmp eq i8 %25, 83
%26 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us23.1 = icmp eq i8 %26, 87
br i1 %cmp52.i.us22.1, label %if.then54.i.us26.1, label %if.else79.i.us24.1
if.else79.i.us24.1: ; preds = %for.cond.us38
br i1 %cmp65.not.i.us23.1, label %if.end104.i.us29.1, label %for.cond.us38.1
if.then54.i.us26.1: ; preds = %for.cond.us38
br i1 %cmp58.i, label %if.then60.i.us28.1, label %if.else69.i.us27.1
if.else69.i.us27.1: ; preds = %if.then54.i.us26.1
br i1 %cmp65.not.i.us23.1, label %for.cond.us38.1, label %if.end104.i.us29.1
if.then60.i.us28.1: ; preds = %if.then54.i.us26.1
br i1 %cmp65.not.i.us23.1, label %if.end104.i.us29.1, label %for.cond.us38.1
if.end104.i.us29.1: ; preds = %if.then60.i.us28.1, %if.else69.i.us27.1, %if.else79.i.us24.1
%cmp117.not.i.us30.1 = icmp eq i8 %25, 83
br i1 %cmp133.i, label %if.then135.i.us33.1, label %if.else144.i.us32.1
if.else144.i.us32.1: ; preds = %if.end104.i.us29.1
br i1 %cmp117.not.i.us30.1, label %for.cond.us38.1, label %if.else.sink.split
if.then135.i.us33.1: ; preds = %if.end104.i.us29.1
br i1 %cmp117.not.i.us30.1, label %if.else.sink.split, label %for.cond.us38.1
for.cond.us38.1: ; preds = %if.then135.i.us33.1, %if.else144.i.us32.1, %if.then60.i.us28.1, %if.else69.i.us27.1, %if.else79.i.us24.1
store i8 83, ptr @l, align 16, !tbaa !5
store i8 87, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%27 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us22.2 = icmp eq i8 %27, 83
%28 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us23.2 = icmp eq i8 %28, 83
br i1 %cmp52.i.us22.2, label %if.then54.i.us26.2, label %if.else79.i.us24.2
if.else79.i.us24.2: ; preds = %for.cond.us38.1
br i1 %cmp65.not.i.us23.2, label %if.end104.i.us29.2, label %for.cond.us38.2
if.then54.i.us26.2: ; preds = %for.cond.us38.1
br i1 %cmp58.i, label %if.then60.i.us28.2, label %if.else69.i.us27.2
if.else69.i.us27.2: ; preds = %if.then54.i.us26.2
br i1 %cmp65.not.i.us23.2, label %for.cond.us38.2, label %if.end104.i.us29.2
if.then60.i.us28.2: ; preds = %if.then54.i.us26.2
br i1 %cmp65.not.i.us23.2, label %if.end104.i.us29.2, label %for.cond.us38.2
if.end104.i.us29.2: ; preds = %if.then60.i.us28.2, %if.else69.i.us27.2, %if.else79.i.us24.2
%cmp117.not.i.us30.2 = icmp eq i8 %27, 87
br i1 %cmp110.i, label %if.then112.i.us36.2, label %if.else121.i.us35.2
if.else121.i.us35.2: ; preds = %if.end104.i.us29.2
br i1 %cmp117.not.i.us30.2, label %for.cond.us38.2, label %if.else.sink.split
if.then112.i.us36.2: ; preds = %if.end104.i.us29.2
br i1 %cmp117.not.i.us30.2, label %if.else.sink.split, label %for.cond.us38.2
for.cond.us38.2: ; preds = %if.then112.i.us36.2, %if.else121.i.us35.2, %if.then60.i.us28.2, %if.else69.i.us27.2, %if.else79.i.us24.2
store i8 87, ptr @l, align 16, !tbaa !5
store i8 87, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%29 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us22.3 = icmp eq i8 %29, 83
%30 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us23.3 = icmp eq i8 %30, 87
br i1 %cmp52.i.us22.3, label %if.then54.i.us26.3, label %if.else79.i.us24.3
if.else79.i.us24.3: ; preds = %for.cond.us38.2
br i1 %cmp65.not.i.us23.3, label %if.end104.i.us29.3, label %if.end7
if.then54.i.us26.3: ; preds = %for.cond.us38.2
br i1 %cmp58.i, label %if.then60.i.us28.3, label %if.else69.i.us27.3
if.else69.i.us27.3: ; preds = %if.then54.i.us26.3
br i1 %cmp65.not.i.us23.3, label %if.end7, label %if.end104.i.us29.3
if.then60.i.us28.3: ; preds = %if.then54.i.us26.3
br i1 %cmp65.not.i.us23.3, label %if.end104.i.us29.3, label %if.end7
if.end104.i.us29.3: ; preds = %if.then60.i.us28.3, %if.else69.i.us27.3, %if.else79.i.us24.3
%cmp117.not.i.us30.3 = icmp eq i8 %29, 87
br i1 %cmp133.i, label %if.then135.i.us33.3, label %if.else144.i.us32.3
if.else144.i.us32.3: ; preds = %if.end104.i.us29.3
br i1 %cmp117.not.i.us30.3, label %if.end7, label %if.else.sink.split
if.then135.i.us33.3: ; preds = %if.end104.i.us29.3
br i1 %cmp117.not.i.us30.3, label %if.else.sink.split, label %if.end7
entry.split.split: ; preds = %entry.split
br i1 %cmp58.i, label %for.body.us43, label %for.body
for.body.us43: ; preds = %entry.split.split
store i8 83, ptr @l, align 16, !tbaa !5
store i8 83, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%31 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us50 = icmp eq i8 %31, 83
%32 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us51 = icmp eq i8 %32, 83
br i1 %cmp52.i.us50, label %if.then54.i.us53, label %if.else79.i.us52
if.else79.i.us52: ; preds = %for.body.us43
br i1 %cmp65.not.i.us51, label %for.cond.us64, label %if.end104.i.us55
if.then54.i.us53: ; preds = %for.body.us43
br i1 %cmp65.not.i.us51, label %if.end104.i.us55, label %for.cond.us64
if.end104.i.us55: ; preds = %if.then54.i.us53, %if.else79.i.us52
%cmp117.not.i.us56 = icmp eq i8 %31, 83
br i1 %cmp110.i, label %if.then112.i.us62, label %if.else121.i.us61
if.else121.i.us61: ; preds = %if.end104.i.us55
br i1 %cmp117.not.i.us56, label %for.cond.us64, label %if.else.sink.split
if.then112.i.us62: ; preds = %if.end104.i.us55
br i1 %cmp117.not.i.us56, label %if.else.sink.split, label %for.cond.us64
for.cond.us64: ; preds = %if.then112.i.us62, %if.else121.i.us61, %if.then54.i.us53, %if.else79.i.us52
store i8 87, ptr @l, align 16, !tbaa !5
store i8 83, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%33 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us50.1 = icmp eq i8 %33, 83
%34 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us51.1 = icmp eq i8 %34, 87
br i1 %cmp52.i.us50.1, label %if.then54.i.us53.1, label %if.else79.i.us52.1
if.else79.i.us52.1: ; preds = %for.cond.us64
br i1 %cmp65.not.i.us51.1, label %for.cond.us64.1, label %if.end104.i.us55.1
if.then54.i.us53.1: ; preds = %for.cond.us64
br i1 %cmp65.not.i.us51.1, label %if.end104.i.us55.1, label %for.cond.us64.1
if.end104.i.us55.1: ; preds = %if.then54.i.us53.1, %if.else79.i.us52.1
%cmp117.not.i.us56.1 = icmp eq i8 %33, 83
br i1 %cmp133.i, label %if.then135.i.us59.1, label %if.else144.i.us58.1
if.else144.i.us58.1: ; preds = %if.end104.i.us55.1
br i1 %cmp117.not.i.us56.1, label %for.cond.us64.1, label %if.else.sink.split
if.then135.i.us59.1: ; preds = %if.end104.i.us55.1
br i1 %cmp117.not.i.us56.1, label %if.else.sink.split, label %for.cond.us64.1
for.cond.us64.1: ; preds = %if.then135.i.us59.1, %if.else144.i.us58.1, %if.then54.i.us53.1, %if.else79.i.us52.1
store i8 83, ptr @l, align 16, !tbaa !5
store i8 87, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%35 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us50.2 = icmp eq i8 %35, 83
%36 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us51.2 = icmp eq i8 %36, 83
br i1 %cmp52.i.us50.2, label %if.then54.i.us53.2, label %if.else79.i.us52.2
if.else79.i.us52.2: ; preds = %for.cond.us64.1
br i1 %cmp65.not.i.us51.2, label %for.cond.us64.2, label %if.end104.i.us55.2
if.then54.i.us53.2: ; preds = %for.cond.us64.1
br i1 %cmp65.not.i.us51.2, label %if.end104.i.us55.2, label %for.cond.us64.2
if.end104.i.us55.2: ; preds = %if.then54.i.us53.2, %if.else79.i.us52.2
%cmp117.not.i.us56.2 = icmp eq i8 %35, 87
br i1 %cmp110.i, label %if.then112.i.us62.2, label %if.else121.i.us61.2
if.else121.i.us61.2: ; preds = %if.end104.i.us55.2
br i1 %cmp117.not.i.us56.2, label %for.cond.us64.2, label %if.else.sink.split
if.then112.i.us62.2: ; preds = %if.end104.i.us55.2
br i1 %cmp117.not.i.us56.2, label %if.else.sink.split, label %for.cond.us64.2
for.cond.us64.2: ; preds = %if.then112.i.us62.2, %if.else121.i.us61.2, %if.then54.i.us53.2, %if.else79.i.us52.2
store i8 87, ptr @l, align 16, !tbaa !5
store i8 87, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%37 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp52.i.us50.3 = icmp eq i8 %37, 83
%38 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.us51.3 = icmp eq i8 %38, 87
br i1 %cmp52.i.us50.3, label %if.then54.i.us53.3, label %if.else79.i.us52.3
if.else79.i.us52.3: ; preds = %for.cond.us64.2
br i1 %cmp65.not.i.us51.3, label %if.end7, label %if.end104.i.us55.3
if.then54.i.us53.3: ; preds = %for.cond.us64.2
br i1 %cmp65.not.i.us51.3, label %if.end104.i.us55.3, label %if.end7
if.end104.i.us55.3: ; preds = %if.then54.i.us53.3, %if.else79.i.us52.3
%cmp117.not.i.us56.3 = icmp eq i8 %37, 87
br i1 %cmp133.i, label %if.then135.i.us59.3, label %if.else144.i.us58.3
if.else144.i.us58.3: ; preds = %if.end104.i.us55.3
br i1 %cmp117.not.i.us56.3, label %if.end7, label %if.else.sink.split
if.then135.i.us59.3: ; preds = %if.end104.i.us55.3
br i1 %cmp117.not.i.us56.3, label %if.else.sink.split, label %if.end7
for.body: ; preds = %entry.split.split
store i8 83, ptr @l, align 16, !tbaa !5
store i8 83, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%39 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i = icmp eq i8 %39, 83
br i1 %cmp65.not.i, label %for.cond, label %if.end104.i
if.end104.i: ; preds = %for.body
%40 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp117.not.i = icmp eq i8 %40, 83
br i1 %cmp110.i, label %if.then112.i, label %if.else121.i
if.then112.i: ; preds = %if.end104.i
br i1 %cmp117.not.i, label %if.else.sink.split, label %for.cond
if.else121.i: ; preds = %if.end104.i
br i1 %cmp117.not.i, label %for.cond, label %if.else.sink.split
for.cond: ; preds = %for.body, %if.else121.i, %if.then112.i
store i8 87, ptr @l, align 16, !tbaa !5
store i8 83, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%41 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.1 = icmp eq i8 %41, 87
br i1 %cmp65.not.i.1, label %for.cond.1, label %if.end104.i.1
if.end104.i.1: ; preds = %for.cond
%42 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp117.not.i.1 = icmp eq i8 %42, 83
br i1 %cmp133.i, label %if.then135.i.1, label %if.else144.i.1
if.else144.i.1: ; preds = %if.end104.i.1
br i1 %cmp117.not.i.1, label %for.cond.1, label %if.else.sink.split
if.then135.i.1: ; preds = %if.end104.i.1
br i1 %cmp117.not.i.1, label %if.else.sink.split, label %for.cond.1
for.cond.1: ; preds = %if.then135.i.1, %if.else144.i.1, %for.cond
store i8 83, ptr @l, align 16, !tbaa !5
store i8 87, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%43 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.2 = icmp eq i8 %43, 83
br i1 %cmp65.not.i.2, label %for.cond.2, label %if.end104.i.2
if.end104.i.2: ; preds = %for.cond.1
%44 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp117.not.i.2 = icmp eq i8 %44, 87
br i1 %cmp110.i, label %if.then112.i.2, label %if.else121.i.2
if.else121.i.2: ; preds = %if.end104.i.2
br i1 %cmp117.not.i.2, label %for.cond.2, label %if.else.sink.split
if.then112.i.2: ; preds = %if.end104.i.2
br i1 %cmp117.not.i.2, label %if.else.sink.split, label %for.cond.2
for.cond.2: ; preds = %if.then112.i.2, %if.else121.i.2, %for.cond.1
store i8 87, ptr @l, align 16, !tbaa !5
store i8 87, ptr getelementptr inbounds ([100001 x i8], ptr @l, i64 0, i64 1), align 1, !tbaa !5
%45 = load i8, ptr %arrayidx63.i, align 1, !tbaa !5
%cmp65.not.i.3 = icmp eq i8 %45, 87
br i1 %cmp65.not.i.3, label %if.end7, label %if.end104.i.3
if.end104.i.3: ; preds = %for.cond.2
%46 = load i8, ptr %arrayidx50.i, align 1, !tbaa !5
%cmp117.not.i.3 = icmp eq i8 %46, 87
br i1 %cmp133.i, label %if.then135.i.3, label %if.else144.i.3
if.else144.i.3: ; preds = %if.end104.i.3
br i1 %cmp117.not.i.3, label %if.end7, label %if.else.sink.split
if.then135.i.3: ; preds = %if.end104.i.3
br i1 %cmp117.not.i.3, label %if.else.sink.split, label %if.end7
if.else.sink.split: ; preds = %if.then112.i, %if.else121.i, %if.else144.i.1, %if.then135.i.1, %if.else121.i.2, %if.then112.i.2, %if.else144.i.3, %if.then135.i.3, %if.then112.i.us62, %if.else121.i.us61, %if.else144.i.us58.1, %if.then135.i.us59.1, %if.else121.i.us61.2, %if.then112.i.us62.2, %if.else144.i.us58.3, %if.then135.i.us59.3, %if.then112.i.us36, %if.else121.i.us35, %if.else144.i.us32.1, %if.then135.i.us33.1, %if.else121.i.us35.2, %if.then112.i.us36.2, %if.else144.i.us32.3, %if.then135.i.us33.3, %if.then112.i.us, %if.else121.i.us, %if.else144.i.us.1, %if.then135.i.us.1, %if.else121.i.us.2, %if.then112.i.us.2, %if.else144.i.us.3, %if.then135.i.us.3
store i8 0, ptr %arrayidx155.i, align 1, !tbaa !5
br label %if.end7
if.end7: ; preds = %if.then135.i.us.3, %if.else144.i.us.3, %if.then60.i.us.3, %if.else69.i.us.3, %if.then85.i.us.3, %if.else94.i.us.3, %if.then135.i.us33.3, %if.else144.i.us32.3, %if.then60.i.us28.3, %if.else69.i.us27.3, %if.else79.i.us24.3, %if.then135.i.us59.3, %if.else144.i.us58.3, %if.then54.i.us53.3, %if.else79.i.us52.3, %if.then135.i.3, %if.else144.i.3, %for.cond.2, %if.else.sink.split
%l.sink = phi ptr [ @l, %if.else.sink.split ], [ @str, %for.cond.2 ], [ @str, %if.else144.i.3 ], [ @str, %if.then135.i.3 ], [ @str, %if.else79.i.us52.3 ], [ @str, %if.then54.i.us53.3 ], [ @str, %if.else144.i.us58.3 ], [ @str, %if.then135.i.us59.3 ], [ @str, %if.else79.i.us24.3 ], [ @str, %if.else69.i.us27.3 ], [ @str, %if.then60.i.us28.3 ], [ @str, %if.else144.i.us32.3 ], [ @str, %if.then135.i.us33.3 ], [ @str, %if.else94.i.us.3 ], [ @str, %if.then85.i.us.3 ], [ @str, %if.else69.i.us.3 ], [ @str, %if.then60.i.us.3 ], [ @str, %if.else144.i.us.3 ], [ @str, %if.then135.i.us.3 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %l.sink)
call void @llvm.lifetime.end.p0(i64 8, 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 @puts(ptr nocapture noundef readonly) 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"long", !6, i64 0}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int sosu(int i) {
int k;
if(i==1)
return 0;
if(i==2||i==3)
return 1;
for(k=2;k<=sqrt(i);k++)
if(i%k==0) return 0;
return 1;
}
int main() {
int a,d,n;
int i,j;
while(1){
scanf("%d %d %d",&a,&d,&n);
if(!a&&!d&&!n) break;
j=0,i=a;
while(j<n) {
if(sosu(i)) {
j++;
}
i+=d;
}
printf("%d\n",i-d);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206081/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206081/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 memory(write) uwtable
define dso_local i32 @sosu(i32 noundef %i) local_unnamed_addr #0 {
entry:
%cmp = icmp eq i32 %i, 1
br i1 %cmp, label %cleanup, label %if.end
if.end: ; preds = %entry
%0 = and i32 %i, -2
%or.cond = icmp eq i32 %0, 2
br i1 %or.cond, label %cleanup, label %for.cond.preheader
for.cond.preheader: ; preds = %if.end
%conv5 = sitofp i32 %i to double
%call18 = tail call double @sqrt(double noundef %conv5) #5
%cmp619 = fcmp ult double %call18, 2.000000e+00
br i1 %cmp619, label %cleanup, label %for.body
for.cond: ; preds = %for.body
%inc = add nuw nsw i32 %k.020, 1
%conv = sitofp i32 %inc to double
%call = tail call double @sqrt(double noundef %conv5) #5
%cmp6 = fcmp ult double %call, %conv
br i1 %cmp6, label %cleanup, label %for.body, !llvm.loop !5
for.body: ; preds = %for.cond.preheader, %for.cond
%k.020 = phi i32 [ %inc, %for.cond ], [ 2, %for.cond.preheader ]
%rem = srem i32 %i, %k.020
%cmp8 = icmp eq i32 %rem, 0
br i1 %cmp8, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %for.cond.preheader, %if.end, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 1, %if.end ], [ 1, %for.cond.preheader ], [ 0, %for.body ], [ 1, %for.cond ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double 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 uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%a = alloca i32, align 4
%d = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call23 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %d, ptr noundef nonnull %n)
%0 = load i32, ptr %a, align 4, !tbaa !7
%tobool24 = icmp ne i32 %0, 0
%1 = load i32, ptr %d, align 4
%tobool125 = icmp ne i32 %1, 0
%or.cond26 = select i1 %tobool24, i1 true, i1 %tobool125
%2 = load i32, ptr %n, align 4
%tobool327 = icmp ne i32 %2, 0
%or.cond1228 = select i1 %or.cond26, i1 true, i1 %tobool327
br i1 %or.cond1228, label %while.cond4.preheader, label %while.end11
while.cond4.preheader: ; preds = %entry, %while.end
%3 = phi i32 [ %12, %while.end ], [ %1, %entry ]
%4 = phi i32 [ %13, %while.end ], [ %2, %entry ]
%5 = phi i32 [ %11, %while.end ], [ %0, %entry ]
%cmp19 = icmp sgt i32 %4, 0
br i1 %cmp19, label %while.body5, label %while.end
while.body5: ; preds = %while.cond4.preheader, %while.cond4
%j.022 = phi i32 [ %7, %while.cond4 ], [ 0, %while.cond4.preheader ]
%i.020 = phi i32 [ %add, %while.cond4 ], [ %5, %while.cond4.preheader ]
%cmp.i = icmp eq i32 %i.020, 1
br i1 %cmp.i, label %while.cond4, label %if.end.i
if.end.i: ; preds = %while.body5
%6 = and i32 %i.020, -2
%or.cond.i = icmp eq i32 %6, 2
br i1 %or.cond.i, label %sosu.exit.thread, label %for.cond.preheader.i
for.cond.preheader.i: ; preds = %if.end.i
%conv5.i = sitofp i32 %i.020 to double
%call18.i = call double @sqrt(double noundef %conv5.i) #5
%cmp619.i = fcmp ult double %call18.i, 2.000000e+00
br i1 %cmp619.i, label %sosu.exit.thread, label %for.body.i
for.cond.i: ; preds = %for.body.i
%inc.i = add nuw nsw i32 %k.020.i, 1
%conv.i = sitofp i32 %inc.i to double
%call.i = call double @sqrt(double noundef %conv5.i) #5
%cmp6.i = fcmp ult double %call.i, %conv.i
br i1 %cmp6.i, label %sosu.exit.thread, label %for.body.i, !llvm.loop !5
for.body.i: ; preds = %for.cond.preheader.i, %for.cond.i
%k.020.i = phi i32 [ %inc.i, %for.cond.i ], [ 2, %for.cond.preheader.i ]
%rem.i = srem i32 %i.020, %k.020.i
%cmp8.i = icmp eq i32 %rem.i, 0
br i1 %cmp8.i, label %while.cond4, label %for.cond.i
sosu.exit.thread: ; preds = %for.cond.i, %if.end.i, %for.cond.preheader.i
%inc18 = add nsw i32 %j.022, 1
br label %while.cond4
while.cond4: ; preds = %for.body.i, %while.body5, %sosu.exit.thread
%7 = phi i32 [ %inc18, %sosu.exit.thread ], [ %j.022, %while.body5 ], [ %j.022, %for.body.i ]
%8 = load i32, ptr %d, align 4, !tbaa !7
%add = add nsw i32 %8, %i.020
%9 = load i32, ptr %n, align 4, !tbaa !7
%cmp = icmp slt i32 %7, %9
br i1 %cmp, label %while.body5, label %while.end, !llvm.loop !11
while.end: ; preds = %while.cond4, %while.cond4.preheader
%10 = phi i32 [ %3, %while.cond4.preheader ], [ %8, %while.cond4 ]
%i.0.lcssa = phi i32 [ %5, %while.cond4.preheader ], [ %add, %while.cond4 ]
%sub = sub nsw i32 %i.0.lcssa, %10
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %d, ptr noundef nonnull %n)
%11 = load i32, ptr %a, align 4, !tbaa !7
%tobool = icmp ne i32 %11, 0
%12 = load i32, ptr %d, align 4
%tobool1 = icmp ne i32 %12, 0
%or.cond = select i1 %tobool, i1 true, i1 %tobool1
%13 = load i32, ptr %n, align 4
%tobool3 = icmp ne i32 %13, 0
%or.cond12 = select i1 %or.cond, i1 true, i1 %tobool3
br i1 %or.cond12, label %while.cond4.preheader, label %while.end11
while.end11: ; preds = %while.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
attributes #0 = { nofree nounwind memory(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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = distinct !{!11, !6}
|
#include <stdio.h>
#define ll long long
#define rep(i,l,r)for(ll i=l;i<r;i++)
#define PLIMIT 1000000
int prime[PLIMIT+10];
void makep(ll n){prime[0]=prime[1]=1;for(int i=2;i*i<=n;i++)if(!prime[i])for(int j=i*i;j<=n;j+=i)prime[j]=1;}
int main(){
makep(PLIMIT);
ll a,d,n;
while(scanf("%lld%lld%lld",&a,&d,&n),n){
ll cnt=0;
while(1){
if(!prime[a]){
cnt++;
if(cnt==n){
printf("%lld\n",a);
break;
}
}
a+=d;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206124/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206124/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@prime = dso_local local_unnamed_addr global [1000010 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @makep(i64 noundef %n) local_unnamed_addr #0 {
entry:
store i32 1, ptr getelementptr inbounds ([1000010 x i32], ptr @prime, i64 0, i64 1), align 4, !tbaa !5
store i32 1, ptr @prime, align 16, !tbaa !5
%cmp.not26 = icmp slt i64 %n, 4
br i1 %cmp.not26, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.inc11, %entry
ret void
for.body: ; preds = %entry, %for.inc11
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc11 ], [ 2, %entry ]
%mul29 = phi i32 [ %mul, %for.inc11 ], [ 4, %entry ]
%arrayidx = getelementptr inbounds [1000010 x i32], ptr @prime, i64 0, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%tobool.not = icmp ne i32 %0, 0
%conv422 = zext i32 %mul29 to i64
%cmp5.not23 = icmp sgt i64 %conv422, %n
%or.cond = or i1 %tobool.not, %cmp5.not23
br i1 %or.cond, label %for.inc11, label %for.body8
for.body8: ; preds = %for.body, %for.body8
%indvars.iv30 = phi i64 [ %indvars.iv.next31, %for.body8 ], [ %conv422, %for.body ]
%arrayidx10 = getelementptr inbounds [1000010 x i32], ptr @prime, i64 0, i64 %indvars.iv30
store i32 1, ptr %arrayidx10, align 4, !tbaa !5
%indvars.iv.next31 = add nuw i64 %indvars.iv30, %indvars.iv
%cmp5.not = icmp sgt i64 %indvars.iv.next31, %n
br i1 %cmp5.not, label %for.inc11, label %for.body8, !llvm.loop !9
for.inc11: ; preds = %for.body8, %for.body
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%1 = trunc i64 %indvars.iv.next to i32
%mul = mul nsw i32 %1, %1
%conv = zext i32 %mul to i64
%cmp.not = icmp sgt i64 %conv, %n
br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree 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 i64, align 8
%d = alloca i64, align 8
%n = alloca i64, align 8
store i32 1, ptr getelementptr inbounds ([1000010 x i32], ptr @prime, i64 0, i64 1), align 4, !tbaa !5
store i32 1, ptr @prime, align 16, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.inc11.i, %entry
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc11.i ], [ 2, %entry ]
%mul29.i = phi i32 [ %mul.i, %for.inc11.i ], [ 4, %entry ]
%arrayidx.i = getelementptr inbounds [1000010 x i32], ptr @prime, i64 0, i64 %indvars.iv.i
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%tobool.not.i = icmp ne i32 %0, 0
%cmp5.not23.i = icmp ugt i32 %mul29.i, 1000000
%or.cond.i = or i1 %cmp5.not23.i, %tobool.not.i
br i1 %or.cond.i, label %for.inc11.i, label %for.body8.i.preheader
for.body8.i.preheader: ; preds = %for.body.i
%conv422.i = zext i32 %mul29.i to i64
br label %for.body8.i
for.body8.i: ; preds = %for.body8.i.preheader, %for.body8.i
%indvars.iv30.i = phi i64 [ %indvars.iv.next31.i, %for.body8.i ], [ %conv422.i, %for.body8.i.preheader ]
%arrayidx10.i = getelementptr inbounds [1000010 x i32], ptr @prime, i64 0, i64 %indvars.iv30.i
store i32 1, ptr %arrayidx10.i, align 4, !tbaa !5
%indvars.iv.next31.i = add nuw nsw i64 %indvars.iv30.i, %indvars.iv.i
%cmp5.not.i = icmp ugt i64 %indvars.iv.next31.i, 1000000
br i1 %cmp5.not.i, label %for.inc11.i, label %for.body8.i, !llvm.loop !9
for.inc11.i: ; preds = %for.body8.i, %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%1 = trunc i64 %indvars.iv.next.i to i32
%mul.i = mul nsw i32 %1, %1
%exitcond = icmp eq i64 %indvars.iv.next.i, 1001
br i1 %exitcond, label %makep.exit, label %for.body.i, !llvm.loop !11
makep.exit: ; preds = %for.inc11.i
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %d, ptr noundef nonnull %n)
%2 = load i64, ptr %n, align 8, !tbaa !12
%tobool.not11 = icmp eq i64 %2, 0
br i1 %tobool.not11, label %while.end7, label %while.cond1.preheader
while.cond1.preheader: ; preds = %makep.exit, %if.then4
%3 = phi i64 [ %6, %if.then4 ], [ %2, %makep.exit ]
%a.promoted = load i64, ptr %a, align 8, !tbaa !12
%4 = load i64, ptr %d, align 8
br label %while.cond1
while.cond1: ; preds = %while.cond1.preheader, %if.end6
%add9 = phi i64 [ %add, %if.end6 ], [ %a.promoted, %while.cond1.preheader ]
%cnt.0 = phi i64 [ %cnt.1, %if.end6 ], [ 0, %while.cond1.preheader ]
%arrayidx = getelementptr inbounds [1000010 x i32], ptr @prime, i64 0, i64 %add9
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%tobool3.not = icmp eq i32 %5, 0
br i1 %tobool3.not, label %if.then, label %if.end6
if.then: ; preds = %while.cond1
%inc = add nsw i64 %cnt.0, 1
%cmp = icmp eq i64 %inc, %3
br i1 %cmp, label %if.then4, label %if.end6
if.then4: ; preds = %if.then
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %add9)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %d, ptr noundef nonnull %n)
%6 = load i64, ptr %n, align 8, !tbaa !12
%tobool.not = icmp eq i64 %6, 0
br i1 %tobool.not, label %while.end7, label %while.cond1.preheader, !llvm.loop !14
if.end6: ; preds = %if.then, %while.cond1
%cnt.1 = phi i64 [ %cnt.0, %while.cond1 ], [ %inc, %if.then ]
%add = add nsw i64 %4, %add9
store i64 %add, ptr %a, align 8, !tbaa !12
br label %while.cond1
while.end7: ; preds = %if.then4, %makep.exit
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !13, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main(){
int n = 0, p = 0;
char t = '\0';
while(1){
scanf("%c", &t);
if( t == '\n'){ break; }
n++;
if( t == 'p' ){ p++; }
}
printf("%d\n", n/2-p);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206168/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206168/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %t) #3
store i8 0, ptr %t, align 1, !tbaa !5
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i8, ptr %t, align 1, !tbaa !5
%cmp13 = icmp eq i8 %0, 10
br i1 %cmp13, label %while.end, label %if.end
if.end: ; preds = %entry, %if.end
%1 = phi i8 [ %2, %if.end ], [ %0, %entry ]
%p.015 = phi i32 [ %spec.select, %if.end ], [ 0, %entry ]
%n.014 = phi i32 [ %inc, %if.end ], [ 0, %entry ]
%inc = add nuw nsw i32 %n.014, 1
%cmp3 = icmp eq i8 %1, 112
%inc6 = zext i1 %cmp3 to i32
%spec.select = add nuw nsw i32 %p.015, %inc6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%2 = load i8, ptr %t, align 1, !tbaa !5
%cmp = icmp eq i8 %2, 10
br i1 %cmp, label %while.end.loopexit, label %if.end
while.end.loopexit: ; preds = %if.end
%3 = lshr i32 %inc, 1
%4 = sub nsw i32 %3, %spec.select
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%sub = phi i32 [ 0, %entry ], [ %4, %while.end.loopexit ]
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#define isNum(A) (A<='9' && A>='0')
#define SIZE 99
#define max(a,b) (a>b ? a : b)
int map[SIZE][SIZE];
int main(void)
{
int i, j, n, t;
char ch = getchar();
/* init */
for(i=0; i<SIZE; i++)
for(j=0; j<SIZE; j++)
map[i][j] = 0;
/* input */
i = j = n = 0;
while(ch!=EOF){
t = 0;
while(isNum(ch)) t = t*10+ch-'0', ch = getchar();
map[i][j] = t;
j++;
if(ch == '\n'){
if(j>n) n = j;
j = 0, i++;
}
ch = getchar();
}
/* calc */
for(i=1; i<n; i++){
map[i][0] += map[i-1][0];
for(j=1; j<=i; j++)
map[i][j] += max(map[i-1][j], map[i-1][j-1]);
}
for(i=0; i<n-1; i++)
for(j=0; j<=n-i-1; j++)
map[n+i][j] += max(map[n+i-1][j], map[n+i-1][j+1]);
printf("%d\n",map[n*2-2][0]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206225/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206225/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@map = dso_local local_unnamed_addr global [99 x [99 x i32]] zeroinitializer, align 16
@.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.i = tail call i32 @getc(ptr noundef %0)
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(39204) @map, i8 0, i64 39204, i1 false), !tbaa !9
%sext.mask221 = and i32 %call.i, 255
%cmp12.not222 = icmp eq i32 %sext.mask221, 255
br i1 %cmp12.not222, label %for.end146, label %while.cond14.preheader
while.cond14.preheader: ; preds = %entry, %while.end
%ch.0.in226 = phi i32 [ %call.i214, %while.end ], [ %call.i, %entry ]
%n.0225 = phi i32 [ %n.2, %while.end ], [ 0, %entry ]
%j.1224 = phi i32 [ %j.2, %while.end ], [ 0, %entry ]
%i.1223 = phi i32 [ %i.2, %while.end ], [ 0, %entry ]
%sext217 = shl i32 %ch.0.in226, 24
%1 = add i32 %sext217, -788529153
%2 = icmp ult i32 %1, 184549375
br i1 %2, label %while.body21, label %while.end
for.cond41.preheader: ; preds = %while.end
%cmp42229 = icmp sgt i32 %n.2, 1
br i1 %cmp42229, label %for.body44.preheader, label %for.end146
for.body44.preheader: ; preds = %for.cond41.preheader
%wide.trip.count250 = zext i32 %n.2 to i64
%.pre = load i32, ptr @map, align 16, !tbaa !9
br label %for.body44
while.body21: ; preds = %while.cond14.preheader, %while.body21
%ch.1.in219 = phi i32 [ %call.i213, %while.body21 ], [ %ch.0.in226, %while.cond14.preheader ]
%t.0218 = phi i32 [ %sub, %while.body21 ], [ 0, %while.cond14.preheader ]
%conv15 = and i32 %ch.1.in219, 255
%mul = mul nsw i32 %t.0218, 10
%add = add i32 %mul, -48
%sub = add i32 %add, %conv15
%3 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i213 = tail call i32 @getc(ptr noundef %3)
%sext = shl i32 %call.i213, 24
%4 = add i32 %sext, -788529153
%5 = icmp ult i32 %4, 184549375
br i1 %5, label %while.body21, label %while.end, !llvm.loop !11
while.end: ; preds = %while.body21, %while.cond14.preheader
%t.0.lcssa = phi i32 [ 0, %while.cond14.preheader ], [ %sub, %while.body21 ]
%sext.lcssa = phi i32 [ %sext217, %while.cond14.preheader ], [ %sext, %while.body21 ]
%idxprom25 = zext i32 %i.1223 to i64
%idxprom27 = sext i32 %j.1224 to i64
%arrayidx28 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %idxprom25, i64 %idxprom27
store i32 %t.0.lcssa, ptr %arrayidx28, align 4, !tbaa !9
%inc29 = add nsw i32 %j.1224, 1
%cmp31 = icmp eq i32 %sext.lcssa, 167772160
%cmp33.not = icmp slt i32 %j.1224, %n.0225
%spec.select = select i1 %cmp33.not, i32 %n.0225, i32 %inc29
%inc36 = zext i1 %cmp31 to i32
%i.2 = add nuw nsw i32 %i.1223, %inc36
%j.2 = select i1 %cmp31, i32 0, i32 %inc29
%n.2 = select i1 %cmp31, i32 %spec.select, i32 %n.0225
%6 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i214 = tail call i32 @getc(ptr noundef %6)
%sext.mask = and i32 %call.i214, 255
%cmp12.not = icmp eq i32 %sext.mask, 255
br i1 %cmp12.not, label %for.cond41.preheader, label %while.cond14.preheader, !llvm.loop !13
for.cond92.preheader: ; preds = %for.inc89
br i1 %cmp42229, label %for.cond97.preheader.preheader, label %for.end146
for.cond97.preheader.preheader: ; preds = %for.cond92.preheader
%sub93 = add nsw i32 %n.2, -1
%7 = zext i32 %n.2 to i64
%wide.trip.count263 = zext i32 %sub93 to i64
br label %for.cond97.preheader
for.body44: ; preds = %for.body44.preheader, %for.inc89
%.pre265 = phi i32 [ %.pre, %for.body44.preheader ], [ %add52, %for.inc89 ]
%indvars.iv244 = phi i64 [ 1, %for.body44.preheader ], [ %indvars.iv.next245, %for.inc89 ]
%indvars.iv242 = phi i64 [ 2, %for.body44.preheader ], [ %indvars.iv.next243, %for.inc89 ]
%8 = add nsw i64 %indvars.iv244, -1
%arrayidx50 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %indvars.iv244
%9 = load i32, ptr %arrayidx50, align 4, !tbaa !9
%add52 = add nsw i32 %9, %.pre265
store i32 %add52, ptr %arrayidx50, align 4, !tbaa !9
%min.iters.check = icmp ult i64 %indvars.iv244, 2
br i1 %min.iters.check, label %for.body56.preheader, label %vector.ph
vector.ph: ; preds = %for.body44
%n.vec = and i64 %indvars.iv244, 9223372036854775806
%ind.end = or i64 %indvars.iv244, 1
%vector.recur.init = insertelement <2 x i32> poison, i32 %.pre265, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <2 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ]
%offset.idx = or i64 %index, 1
%10 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %8, i64 %offset.idx
%wide.load = load <2 x i32>, ptr %10, align 4, !tbaa !9
%11 = shufflevector <2 x i32> %vector.recur, <2 x i32> %wide.load, <2 x i32> <i32 1, i32 2>
%12 = tail call <2 x i32> @llvm.smax.v2i32(<2 x i32> %wide.load, <2 x i32> %11)
%13 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %indvars.iv244, i64 %offset.idx
%wide.load276 = load <2 x i32>, ptr %13, align 4, !tbaa !9
%14 = add nsw <2 x i32> %wide.load276, %12
store <2 x i32> %14, ptr %13, align 4, !tbaa !9
%index.next = add nuw i64 %index, 2
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %indvars.iv244, %n.vec
%vector.recur.extract = extractelement <2 x i32> %wide.load, i64 1
br i1 %cmp.n, label %for.inc89, label %for.body56.preheader
for.body56.preheader: ; preds = %for.body44, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre265, %for.body44 ]
%indvars.iv.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body44 ]
br label %for.body56
for.body56: ; preds = %for.body56.preheader, %for.body56
%scalar.recur = phi i32 [ %16, %for.body56 ], [ %scalar.recur.ph, %for.body56.preheader ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body56 ], [ %indvars.iv.ph, %for.body56.preheader ]
%arrayidx61 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %8, i64 %indvars.iv
%16 = load i32, ptr %arrayidx61, align 4, !tbaa !9
%. = tail call i32 @llvm.smax.i32(i32 %16, i32 %scalar.recur)
%arrayidx84 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %indvars.iv244, i64 %indvars.iv
%17 = load i32, ptr %arrayidx84, align 4, !tbaa !9
%add85 = add nsw i32 %17, %.
store i32 %add85, ptr %arrayidx84, align 4, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv242
br i1 %exitcond.not, label %for.inc89, label %for.body56, !llvm.loop !17
for.inc89: ; preds = %for.body56, %middle.block
%indvars.iv.next245 = add nuw nsw i64 %indvars.iv244, 1
%indvars.iv.next243 = add nuw nsw i64 %indvars.iv242, 1
%exitcond251.not = icmp eq i64 %indvars.iv.next245, %wide.trip.count250
br i1 %exitcond251.not, label %for.cond92.preheader, label %for.body44, !llvm.loop !18
for.cond97.preheader: ; preds = %for.cond97.preheader.preheader, %for.inc144
%indvars.iv258 = phi i64 [ 0, %for.cond97.preheader.preheader ], [ %indvars.iv.next259, %for.inc144 ]
%indvars.iv255 = phi i32 [ %n.2, %for.cond97.preheader.preheader ], [ %indvars.iv.next256, %for.inc144 ]
%18 = zext i32 %indvars.iv255 to i64
%indvars262 = trunc i64 %indvars.iv258 to i32
%19 = xor i32 %indvars262, -1
%sub99 = add i32 %n.2, %19
%cmp100.not231 = icmp slt i32 %sub99, 0
br i1 %cmp100.not231, label %for.inc144, label %for.body102.lr.ph
for.body102.lr.ph: ; preds = %for.cond97.preheader
%20 = add nuw nsw i64 %indvars.iv258, %7
%21 = add nsw i64 %20, -1
%wide.trip.count = zext i32 %indvars.iv255 to i64
%arrayidx108.phi.trans.insert = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %21, i64 0
%.pre266 = load i32, ptr %arrayidx108.phi.trans.insert, align 4, !tbaa !9
%min.iters.check279 = icmp ult i32 %indvars.iv255, 2
br i1 %min.iters.check279, label %for.body102.preheader, label %vector.ph280
vector.ph280: ; preds = %for.body102.lr.ph
%n.vec282 = and i64 %18, 4294967294
%vector.recur.init287 = insertelement <2 x i32> poison, i32 %.pre266, i64 1
br label %vector.body285
vector.body285: ; preds = %vector.body285, %vector.ph280
%index286 = phi i64 [ 0, %vector.ph280 ], [ %index.next291, %vector.body285 ]
%vector.recur288 = phi <2 x i32> [ %vector.recur.init287, %vector.ph280 ], [ %wide.load289, %vector.body285 ]
%22 = or i64 %index286, 1
%23 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %21, i64 %22
%wide.load289 = load <2 x i32>, ptr %23, align 4, !tbaa !9
%24 = shufflevector <2 x i32> %vector.recur288, <2 x i32> %wide.load289, <2 x i32> <i32 1, i32 2>
%25 = tail call <2 x i32> @llvm.smax.v2i32(<2 x i32> %24, <2 x i32> %wide.load289)
%26 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %20, i64 %index286
%wide.load290 = load <2 x i32>, ptr %26, align 4, !tbaa !9
%27 = add nsw <2 x i32> %wide.load290, %25
store <2 x i32> %27, ptr %26, align 4, !tbaa !9
%index.next291 = add nuw i64 %index286, 2
%28 = icmp eq i64 %index.next291, %n.vec282
br i1 %28, label %middle.block277, label %vector.body285, !llvm.loop !19
middle.block277: ; preds = %vector.body285
%cmp.n284 = icmp eq i64 %n.vec282, %18
%vector.recur.extract292 = extractelement <2 x i32> %wide.load289, i64 1
br i1 %cmp.n284, label %for.inc144, label %for.body102.preheader
for.body102.preheader: ; preds = %for.body102.lr.ph, %middle.block277
%scalar.recur294.ph = phi i32 [ %vector.recur.extract292, %middle.block277 ], [ %.pre266, %for.body102.lr.ph ]
%indvars.iv252.ph = phi i64 [ %n.vec282, %middle.block277 ], [ 0, %for.body102.lr.ph ]
br label %for.body102
for.body102: ; preds = %for.body102.preheader, %for.body102
%scalar.recur294 = phi i32 [ %29, %for.body102 ], [ %scalar.recur294.ph, %for.body102.preheader ]
%indvars.iv252 = phi i64 [ %indvars.iv.next253, %for.body102 ], [ %indvars.iv252.ph, %for.body102.preheader ]
%indvars.iv.next253 = add nuw nsw i64 %indvars.iv252, 1
%arrayidx115 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %21, i64 %indvars.iv.next253
%29 = load i32, ptr %arrayidx115, align 4, !tbaa !9
%.212 = tail call i32 @llvm.smax.i32(i32 %scalar.recur294, i32 %29)
%arrayidx139 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %20, i64 %indvars.iv252
%30 = load i32, ptr %arrayidx139, align 4, !tbaa !9
%add140 = add nsw i32 %30, %.212
store i32 %add140, ptr %arrayidx139, align 4, !tbaa !9
%exitcond257.not = icmp eq i64 %indvars.iv.next253, %wide.trip.count
br i1 %exitcond257.not, label %for.inc144, label %for.body102, !llvm.loop !20
for.inc144: ; preds = %for.body102, %middle.block277, %for.cond97.preheader
%indvars.iv.next259 = add nuw nsw i64 %indvars.iv258, 1
%indvars.iv.next256 = add i32 %indvars.iv255, -1
%exitcond264.not = icmp eq i64 %indvars.iv.next259, %wide.trip.count263
br i1 %exitcond264.not, label %for.end146, label %for.cond97.preheader, !llvm.loop !21
for.end146: ; preds = %for.inc144, %entry, %for.cond41.preheader, %for.cond92.preheader
%n.0.lcssa269273 = phi i32 [ %n.2, %for.cond92.preheader ], [ %n.2, %for.cond41.preheader ], [ 0, %entry ], [ %n.2, %for.inc144 ]
%mul147 = shl nsw i32 %n.0.lcssa269273, 1
%sub148 = add nsw i32 %mul147, -2
%idxprom149 = sext i32 %sub148 to i64
%arrayidx150 = getelementptr inbounds [99 x [99 x i32]], ptr @map, i64 0, i64 %idxprom149
%31 = load i32, ptr %arrayidx150, align 8, !tbaa !9
%call152 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %31)
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
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #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 <2 x i32> @llvm.smax.v2i32(<2 x i32>, <2 x i32>) #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12, !15, !16}
!15 = !{!"llvm.loop.isvectorized", i32 1}
!16 = !{!"llvm.loop.unroll.runtime.disable"}
!17 = distinct !{!17, !12, !16, !15}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12, !15, !16}
!20 = distinct !{!20, !12, !16, !15}
!21 = distinct !{!21, !12}
|
#include <stdio.h>
int main(void)
{
double l;
scanf("%lf", &l);
printf("%.12f\n", (l / 3) * (l / 3) * (l / 3));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206283/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206283/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lf\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.12f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%l = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l)
%0 = load double, ptr %l, align 8, !tbaa !5
%div = fdiv double %0, 3.000000e+00
%mul = fmul double %div, %div
%mul3 = fmul double %div, %mul
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul3)
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int l; scanf("%d",&l);
printf("%f",(l/3.0)*(l/3.0)*(l/3.0));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206326/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206326/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%l = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l)
%0 = load i32, ptr %l, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%div = fdiv double %conv, 3.000000e+00
%mul = fmul double %div, %div
%mul5 = fmul double %div, %mul
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul5)
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"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define K 500
#define N_ ((K + 1) * (K + 1))
#define INF 0x3f3f3f3f
int *ej[N_], *ew[N_], eo[N_], n_;
void append(int i, int j, int w) {
int o = eo[i]++;
if (o >= 2 && (o & o - 1) == 0) {
ej[i] = (int *) realloc(ej[i], o * 2 * sizeof *ej[i]);
ew[i] = (int *) realloc(ew[i], o * 2 * sizeof *ew[i]);
}
ej[i][o] = j, ew[i][o] = w;
}
int dd[N_], pq[N_], iq[1 + N_], cnt;
int lt(int i, int j) { return dd[i] < dd[j]; }
int p2(int p) {
return (p *= 2) > cnt ? 0 : (p < cnt && lt(iq[p + 1], iq[p]) ? p + 1 : p);
}
void pq_up(int i) {
int p, q, j;
for (p = pq[i]; (q = p / 2) && lt(i, j = iq[q]); p = q)
iq[pq[j] = p] = j;
iq[pq[i] = p] = i;
}
void pq_dn(int i) {
int p, q, j;
for (p = pq[i]; (q = p2(p)) && lt(j = iq[q], i); p = q)
iq[pq[j] = p] = j;
iq[pq[i] = p] = i;
}
void pq_add_last(int i) {
iq[pq[i] = ++cnt] = i;
}
int pq_remove_first() {
int i = iq[1], j = iq[cnt--];
if (j != i)
pq[j] = 1, pq_dn(j);
pq[i] = 0;
return i;
}
char sink[N_];
int dijkstra(int s) {
memset(dd, 0x3f, n_ * sizeof *dd);
memset(pq, 0, n_ * sizeof *pq), cnt = 0;
dd[s] = 0, pq_add_last(s);
while (cnt) {
int i, o;
i = pq_remove_first();
if (sink[i])
return dd[i];
for (o = eo[i]; o--; ) {
int j = ej[i][o], w = ew[i][o], d = dd[i] + w;
if (dd[j] > d) {
if (dd[j] == INF)
pq_add_last(j);
dd[j] = d, pq_up(j);
}
}
}
return INF;
}
int main() {
int t;
scanf("%d", &t);
while (t--) {
static int ww[N_];
static char used[N_];
int m, k, h, i, j, i1, j1, i2, j2, u, v, w, o, o_;
scanf("%d%d", &m, &k), n_ = (k + 1) * (k + 1);
for (i = 0; i < n_; i++) {
ej[i] = (int *) malloc(2 * sizeof *ej[i]), eo[i] = 0;
ew[i] = (int *) malloc(2 * sizeof *ew[i]), eo[i] = 0;
}
memset(sink, 0, n_ * sizeof *sink);
for (i = 0; i <= k; i++)
for (j = 0; j <= k; j++) {
if (i == 0 || i == k || j == 0 || j == k) {
u = i * (k + 1) + j;
if (u * 2 >= n_)
u = n_ - 1 - u;
sink[u] = 1;
}
if (i >= 1 && i < k && j < k) {
u = i * (k + 1) + j, v = i * (k + 1) + (j + 1);
if (u * 2 >= n_)
u = n_ - 1 - u;
if (v * 2 >= n_)
v = n_ - 1 - v;
append(u, v, 0), append(v, u, 0);
}
if (j >= 1 && j < k && i < k) {
u = i * (k + 1) + j, v = (i + 1) * (k + 1) + j;
if (u * 2 >= n_)
u = n_ - 1 - u;
if (v * 2 >= n_)
v = n_ - 1 - v;
append(u, v, 0), append(v, u, 0);
}
}
for (h = 0; h < m; h++) {
int tmp, u, v;
scanf("%d%d%d%d", &i1, &j1, &i2, &j2), i1--, j1--, i2--, j2--;
if (i1 > i2)
tmp = i1, i1 = i2, i2 = tmp;
if (j1 > j2)
tmp = j1, j1 = j2, j2 = tmp;
if (i1 != i2)
u = (i1 + 1) * (k + 1) + j1, v = (i1 + 1) * (k + 1) + j1 + 1;
else
u = i1 * (k + 1) + j1 + 1, v = (i1 + 1) * (k + 1) + j1 + 1;
if (u * 2 >= n_)
u = n_ - 1 - u;
if (v * 2 >= n_)
v = n_ - 1 - v;
append(u, v, 1), append(v, u, 1);
}
for (i = 0; i < n_; i++) {
for (o = 0; o < eo[i]; o++) {
j = ej[i][o], w = ew[i][o];
used[j] = 1, ww[j] += w;
}
for (o = 0, o_ = 0; o < eo[i]; o++) {
j = ej[i][o], w = ew[i][o];
if (used[j]) {
ej[i][o_] = j, ew[i][o_] = ww[j], o_++;
used[j] = 0, ww[j] = 0;
}
}
eo[i] = o_;
}
printf("%d\n", m - dijkstra(n_ / 2));
for (i = 0; i < n_; i++)
free(ej[i]), free(ew[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20637/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20637/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@eo = dso_local local_unnamed_addr global [251001 x i32] zeroinitializer, align 16
@ej = dso_local local_unnamed_addr global [251001 x ptr] zeroinitializer, align 16
@ew = dso_local local_unnamed_addr global [251001 x ptr] zeroinitializer, align 16
@dd = dso_local local_unnamed_addr global [251001 x i32] zeroinitializer, align 16
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@iq = dso_local local_unnamed_addr global [251002 x i32] zeroinitializer, align 16
@pq = dso_local local_unnamed_addr global [251001 x i32] zeroinitializer, align 16
@n_ = dso_local local_unnamed_addr global i32 0, align 4
@sink = dso_local local_unnamed_addr global [251001 x i8] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@main.ww = internal unnamed_addr global [251001 x i32] zeroinitializer, align 16
@main.used = internal unnamed_addr global [251001 x i8] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.2 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nounwind willreturn uwtable
define dso_local void @append(i32 noundef %i, i32 noundef %j, i32 noundef %w) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds [251001 x i32], ptr @eo, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, 1
%1 = tail call i32 @llvm.ctpop.i32(i32 %0), !range !9
%cmp1 = icmp ult i32 %1, 2
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %if.then, label %entry.if.end_crit_edge
entry.if.end_crit_edge: ; preds = %entry
%arrayidx20.phi.trans.insert = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom
%.pre = load ptr, ptr %arrayidx20.phi.trans.insert, align 8, !tbaa !10
br label %if.end
if.then: ; preds = %entry
%arrayidx3 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom
%2 = load ptr, ptr %arrayidx3, align 8, !tbaa !10
%mul = shl nuw nsw i32 %0, 1
%conv = zext i32 %mul to i64
%mul4 = shl nuw nsw i64 %conv, 2
%call = tail call ptr @realloc(ptr noundef %2, i64 noundef %mul4) #13
store ptr %call, ptr %arrayidx3, align 8, !tbaa !10
%arrayidx8 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom
%3 = load ptr, ptr %arrayidx8, align 8, !tbaa !10
%call12 = tail call ptr @realloc(ptr noundef %3, i64 noundef %mul4) #13
store ptr %call12, ptr %arrayidx8, align 8, !tbaa !10
br label %if.end
if.end: ; preds = %entry.if.end_crit_edge, %if.then
%4 = phi ptr [ %.pre, %entry.if.end_crit_edge ], [ %call12, %if.then ]
%arrayidx16 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom
%5 = load ptr, ptr %arrayidx16, align 8, !tbaa !10
%idxprom17 = sext i32 %0 to i64
%arrayidx18 = getelementptr inbounds i32, ptr %5, i64 %idxprom17
store i32 %j, ptr %arrayidx18, align 4, !tbaa !5
%arrayidx22 = getelementptr inbounds i32, ptr %4, i64 %idxprom17
store i32 %w, ptr %arrayidx22, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 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: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @lt(i32 noundef %i, i32 noundef %j) local_unnamed_addr #3 {
entry:
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %j to i64
%arrayidx2 = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%conv = zext i1 %cmp to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @p2(i32 noundef %p) local_unnamed_addr #3 {
entry:
%mul = shl nsw i32 %p, 1
%0 = load i32, ptr @cnt, align 4, !tbaa !5
%cmp = icmp sgt i32 %mul, %0
br i1 %cmp, label %cond.end7, label %cond.false
cond.false: ; preds = %entry
%cmp1 = icmp slt i32 %mul, %0
br i1 %cmp1, label %land.lhs.true, label %cond.false6
land.lhs.true: ; preds = %cond.false
%add = or i32 %mul, 1
%idxprom = sext i32 %add to i64
%arrayidx = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom2 = sext i32 %mul to i64
%arrayidx3 = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom2
%2 = load i32, ptr %arrayidx3, align 8, !tbaa !5
%idxprom.i = sext i32 %1 to i64
%arrayidx.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%idxprom1.i = sext i32 %2 to i64
%arrayidx2.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom1.i
%4 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.i.not = icmp slt i32 %3, %4
br i1 %cmp.i.not, label %cond.end7, label %cond.false6
cond.false6: ; preds = %land.lhs.true, %cond.false
br label %cond.end7
cond.end7: ; preds = %land.lhs.true, %cond.false6, %entry
%cond8 = phi i32 [ 0, %entry ], [ %mul, %cond.false6 ], [ %add, %land.lhs.true ]
ret i32 %cond8
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @pq_up(i32 noundef %i) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%p.0.off20 = add i32 %0, 1
%tobool.not21 = icmp ult i32 %p.0.off20, 3
br i1 %tobool.not21, label %for.end, label %land.rhs.lr.ph
land.rhs.lr.ph: ; preds = %entry
%arrayidx.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom
%1 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %land.rhs.lr.ph, %for.body
%p.022 = phi i32 [ %0, %land.rhs.lr.ph ], [ %div23, %for.body ]
%div23 = sdiv i32 %p.022, 2
%idxprom1 = sext i32 %div23 to i64
%arrayidx2 = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom1
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%idxprom1.i = sext i32 %2 to i64
%arrayidx2.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom1.i
%3 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.i.not = icmp slt i32 %1, %3
br i1 %cmp.i.not, label %for.body, label %for.end
for.body: ; preds = %land.rhs
%arrayidx5 = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom1.i
store i32 %p.022, ptr %arrayidx5, align 4, !tbaa !5
%idxprom6 = sext i32 %p.022 to i64
%arrayidx7 = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom6
store i32 %2, ptr %arrayidx7, align 4, !tbaa !5
%p.0.off = add nsw i32 %div23, 1
%tobool.not = icmp ult i32 %p.0.off, 3
br i1 %tobool.not, label %for.end, label %land.rhs, !llvm.loop !12
for.end: ; preds = %land.rhs, %for.body, %entry
%p.0.lcssa = phi i32 [ %0, %entry ], [ %div23, %for.body ], [ %p.022, %land.rhs ]
store i32 %p.0.lcssa, ptr %arrayidx, align 4, !tbaa !5
%idxprom10 = sext i32 %p.0.lcssa to i64
%arrayidx11 = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom10
store i32 %i, ptr %arrayidx11, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @pq_dn(i32 noundef %i) local_unnamed_addr #4 {
entry:
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%1 = load i32, ptr @cnt, align 4, !tbaa !5
%mul.i29 = shl nsw i32 %0, 1
%cmp.i30 = icmp sgt i32 %mul.i29, %1
br i1 %cmp.i30, label %for.end, label %cond.false.i.lr.ph
cond.false.i.lr.ph: ; preds = %entry
%arrayidx2.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom
br label %cond.false.i
cond.false.i: ; preds = %cond.false.i.lr.ph, %for.body
%mul.i32 = phi i32 [ %mul.i29, %cond.false.i.lr.ph ], [ %mul.i, %for.body ]
%p.031 = phi i32 [ %0, %cond.false.i.lr.ph ], [ %cond8.i28, %for.body ]
%cmp1.i = icmp slt i32 %mul.i32, %1
br i1 %cmp1.i, label %land.lhs.true.i, label %p2.exit
land.lhs.true.i: ; preds = %cond.false.i
%add.i = or i32 %mul.i32, 1
%idxprom.i = sext i32 %add.i to i64
%arrayidx.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom.i
%2 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%idxprom2.i = sext i32 %mul.i32 to i64
%arrayidx3.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom2.i
%3 = load i32, ptr %arrayidx3.i, align 8, !tbaa !5
%idxprom.i.i = sext i32 %2 to i64
%arrayidx.i.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom.i.i
%4 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5
%idxprom1.i.i = sext i32 %3 to i64
%arrayidx2.i.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom1.i.i
%5 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp.i.not.i = icmp slt i32 %4, %5
br i1 %cmp.i.not.i, label %land.rhs, label %p2.exit
p2.exit: ; preds = %cond.false.i, %land.lhs.true.i
%tobool.not = icmp eq i32 %p.031, 0
br i1 %tobool.not, label %for.end, label %p2.exit.land.rhs_crit_edge
p2.exit.land.rhs_crit_edge: ; preds = %p2.exit
%idxprom1.phi.trans.insert = sext i32 %mul.i32 to i64
%arrayidx2.phi.trans.insert = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom1.phi.trans.insert
%.pre = load i32, ptr %arrayidx2.phi.trans.insert, align 8, !tbaa !5
%idxprom.i20.phi.trans.insert = sext i32 %.pre to i64
%arrayidx.i21.phi.trans.insert = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom.i20.phi.trans.insert
%.pre35 = load i32, ptr %arrayidx.i21.phi.trans.insert, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %p2.exit.land.rhs_crit_edge, %land.lhs.true.i
%idxprom.i20.pre-phi = phi i64 [ %idxprom.i20.phi.trans.insert, %p2.exit.land.rhs_crit_edge ], [ %idxprom.i.i, %land.lhs.true.i ]
%6 = phi i32 [ %.pre35, %p2.exit.land.rhs_crit_edge ], [ %4, %land.lhs.true.i ]
%7 = phi i32 [ %.pre, %p2.exit.land.rhs_crit_edge ], [ %2, %land.lhs.true.i ]
%cond8.i28 = phi i32 [ %mul.i32, %p2.exit.land.rhs_crit_edge ], [ %add.i, %land.lhs.true.i ]
%8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.i22.not = icmp slt i32 %6, %8
br i1 %cmp.i22.not, label %for.body, label %for.end
for.body: ; preds = %land.rhs
%arrayidx6 = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom.i20.pre-phi
store i32 %p.031, ptr %arrayidx6, align 4, !tbaa !5
%idxprom7 = sext i32 %p.031 to i64
%arrayidx8 = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom7
store i32 %7, ptr %arrayidx8, align 4, !tbaa !5
%mul.i = shl nsw i32 %cond8.i28, 1
%cmp.i = icmp sgt i32 %mul.i, %1
br i1 %cmp.i, label %for.end, label %cond.false.i, !llvm.loop !14
for.end: ; preds = %land.rhs, %p2.exit, %for.body, %entry
%p.0.lcssa = phi i32 [ %0, %entry ], [ %cond8.i28, %for.body ], [ 0, %p2.exit ], [ %p.031, %land.rhs ]
store i32 %p.0.lcssa, ptr %arrayidx, align 4, !tbaa !5
%idxprom11 = sext i32 %p.0.lcssa to i64
%arrayidx12 = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom11
store i32 %i, ptr %arrayidx12, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @pq_add_last(i32 noundef %i) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr @cnt, align 4, !tbaa !5
%inc = add nsw i32 %0, 1
store i32 %inc, ptr @cnt, align 4, !tbaa !5
%idxprom = sext i32 %i to i64
%arrayidx = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %inc to i64
%arrayidx2 = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom1
store i32 %i, ptr %arrayidx2, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @pq_remove_first() local_unnamed_addr #4 {
entry:
%0 = load i32, ptr getelementptr inbounds ([251002 x i32], ptr @iq, i64 0, i64 1), align 4, !tbaa !5
%1 = load i32, ptr @cnt, align 4, !tbaa !5
%dec = add nsw i32 %1, -1
store i32 %dec, ptr @cnt, align 4, !tbaa !5
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not = icmp eq i32 %2, %0
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%idxprom1 = sext i32 %2 to i64
%arrayidx2 = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom1
%cmp.i30.i = icmp slt i32 %1, 3
br i1 %cmp.i30.i, label %pq_dn.exit, label %cond.false.i.lr.ph.i
cond.false.i.lr.ph.i: ; preds = %if.then
%arrayidx2.i.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom1
br label %cond.false.i.i
cond.false.i.i: ; preds = %for.body.i, %cond.false.i.lr.ph.i
%mul.i32.i = phi i32 [ 2, %cond.false.i.lr.ph.i ], [ %mul.i.i, %for.body.i ]
%p.031.i = phi i32 [ 1, %cond.false.i.lr.ph.i ], [ %cond8.i28.i, %for.body.i ]
%cmp1.i.i = icmp slt i32 %mul.i32.i, %dec
br i1 %cmp1.i.i, label %land.lhs.true.i.i, label %p2.exit.i
land.lhs.true.i.i: ; preds = %cond.false.i.i
%add.i.i = or i32 %mul.i32.i, 1
%idxprom.i.i = sext i32 %add.i.i to i64
%arrayidx.i.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom.i.i
%3 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5
%idxprom2.i.i = sext i32 %mul.i32.i to i64
%arrayidx3.i.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom2.i.i
%4 = load i32, ptr %arrayidx3.i.i, align 8, !tbaa !5
%idxprom.i.i.i = sext i32 %3 to i64
%arrayidx.i.i.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom.i.i.i
%5 = load i32, ptr %arrayidx.i.i.i, align 4, !tbaa !5
%idxprom1.i.i.i = sext i32 %4 to i64
%arrayidx2.i.i.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom1.i.i.i
%6 = load i32, ptr %arrayidx2.i.i.i, align 4, !tbaa !5
%cmp.i.not.i.i = icmp slt i32 %5, %6
br i1 %cmp.i.not.i.i, label %land.rhs.i, label %p2.exit.i
p2.exit.i: ; preds = %land.lhs.true.i.i, %cond.false.i.i
%tobool.not.i = icmp eq i32 %p.031.i, 0
br i1 %tobool.not.i, label %pq_dn.exit, label %p2.exit.land.rhs_crit_edge.i
p2.exit.land.rhs_crit_edge.i: ; preds = %p2.exit.i
%idxprom1.phi.trans.insert.i = sext i32 %mul.i32.i to i64
%arrayidx2.phi.trans.insert.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom1.phi.trans.insert.i
%.pre.i = load i32, ptr %arrayidx2.phi.trans.insert.i, align 8, !tbaa !5
%idxprom.i20.phi.trans.insert.i = sext i32 %.pre.i to i64
%arrayidx.i21.phi.trans.insert.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom.i20.phi.trans.insert.i
%.pre35.i = load i32, ptr %arrayidx.i21.phi.trans.insert.i, align 4, !tbaa !5
br label %land.rhs.i
land.rhs.i: ; preds = %p2.exit.land.rhs_crit_edge.i, %land.lhs.true.i.i
%idxprom.i20.pre-phi.i = phi i64 [ %idxprom.i20.phi.trans.insert.i, %p2.exit.land.rhs_crit_edge.i ], [ %idxprom.i.i.i, %land.lhs.true.i.i ]
%7 = phi i32 [ %.pre35.i, %p2.exit.land.rhs_crit_edge.i ], [ %5, %land.lhs.true.i.i ]
%8 = phi i32 [ %.pre.i, %p2.exit.land.rhs_crit_edge.i ], [ %3, %land.lhs.true.i.i ]
%cond8.i28.i = phi i32 [ %mul.i32.i, %p2.exit.land.rhs_crit_edge.i ], [ %add.i.i, %land.lhs.true.i.i ]
%9 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp.i22.not.i = icmp slt i32 %7, %9
br i1 %cmp.i22.not.i, label %for.body.i, label %pq_dn.exit
for.body.i: ; preds = %land.rhs.i
%arrayidx6.i = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom.i20.pre-phi.i
store i32 %p.031.i, ptr %arrayidx6.i, align 4, !tbaa !5
%idxprom7.i = sext i32 %p.031.i to i64
%arrayidx8.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom7.i
store i32 %8, ptr %arrayidx8.i, align 4, !tbaa !5
%mul.i.i = shl nsw i32 %cond8.i28.i, 1
%cmp.i.i.not = icmp slt i32 %mul.i.i, %1
br i1 %cmp.i.i.not, label %cond.false.i.i, label %pq_dn.exit, !llvm.loop !14
pq_dn.exit: ; preds = %p2.exit.i, %land.rhs.i, %for.body.i, %if.then
%p.0.lcssa.i = phi i32 [ 1, %if.then ], [ %p.031.i, %land.rhs.i ], [ 0, %p2.exit.i ], [ %cond8.i28.i, %for.body.i ]
store i32 %p.0.lcssa.i, ptr %arrayidx2, align 4, !tbaa !5
%idxprom11.i = sext i32 %p.0.lcssa.i to i64
%arrayidx12.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom11.i
store i32 %2, ptr %arrayidx12.i, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %pq_dn.exit, %entry
%idxprom3 = sext i32 %0 to i64
%arrayidx4 = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom3
store i32 0, ptr %arrayidx4, align 4, !tbaa !5
ret i32 %0
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable
define dso_local i32 @dijkstra(i32 noundef %s) local_unnamed_addr #6 {
entry:
%0 = load i32, ptr @n_, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @dd, i8 63, i64 %mul, i1 false)
tail call void @llvm.memset.p0.i64(ptr nonnull align 16 @pq, i8 0, i64 %mul, i1 false)
%idxprom = sext i32 %s to i64
%arrayidx = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom
store i32 0, ptr %arrayidx, align 4, !tbaa !5
%arrayidx.i = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom
store i32 1, ptr %arrayidx.i, align 4, !tbaa !5
store i32 %s, ptr getelementptr inbounds ([251002 x i32], ptr @iq, i64 0, i64 1), align 4, !tbaa !5
br label %while.body
while.body: ; preds = %entry, %cleanup
%1 = phi i32 [ 1, %entry ], [ %cnt.promoted71, %cleanup ]
%2 = load i32, ptr getelementptr inbounds ([251002 x i32], ptr @iq, i64 0, i64 1), align 4, !tbaa !5
%dec.i = add nsw i32 %1, -1
store i32 %dec.i, ptr @cnt, align 4, !tbaa !5
%idxprom.i48 = sext i32 %1 to i64
%arrayidx.i49 = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom.i48
%3 = load i32, ptr %arrayidx.i49, align 4, !tbaa !5
%cmp.not.i = icmp eq i32 %3, %2
br i1 %cmp.not.i, label %pq_remove_first.exit, label %if.then.i
if.then.i: ; preds = %while.body
%idxprom1.i50 = sext i32 %3 to i64
%arrayidx2.i51 = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom1.i50
%cmp.i30.i.i = icmp slt i32 %1, 3
br i1 %cmp.i30.i.i, label %pq_dn.exit.i, label %cond.false.i.lr.ph.i.i
cond.false.i.lr.ph.i.i: ; preds = %if.then.i
%arrayidx2.i.i.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom1.i50
br label %cond.false.i.i.i
cond.false.i.i.i: ; preds = %for.body.i.i, %cond.false.i.lr.ph.i.i
%mul.i32.i.i = phi i32 [ 2, %cond.false.i.lr.ph.i.i ], [ %mul.i.i.i, %for.body.i.i ]
%p.031.i.i = phi i32 [ 1, %cond.false.i.lr.ph.i.i ], [ %cond8.i28.i.i, %for.body.i.i ]
%cmp1.i.i.i = icmp slt i32 %mul.i32.i.i, %dec.i
br i1 %cmp1.i.i.i, label %land.lhs.true.i.i.i, label %p2.exit.i.i
land.lhs.true.i.i.i: ; preds = %cond.false.i.i.i
%add.i.i.i = or i32 %mul.i32.i.i, 1
%idxprom.i.i.i = sext i32 %add.i.i.i to i64
%arrayidx.i.i.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom.i.i.i
%4 = load i32, ptr %arrayidx.i.i.i, align 4, !tbaa !5
%idxprom2.i.i.i = sext i32 %mul.i32.i.i to i64
%arrayidx3.i.i.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom2.i.i.i
%5 = load i32, ptr %arrayidx3.i.i.i, align 8, !tbaa !5
%idxprom.i.i.i.i = sext i32 %4 to i64
%arrayidx.i.i.i.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom.i.i.i.i
%6 = load i32, ptr %arrayidx.i.i.i.i, align 4, !tbaa !5
%idxprom1.i.i.i.i = sext i32 %5 to i64
%arrayidx2.i.i.i.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom1.i.i.i.i
%7 = load i32, ptr %arrayidx2.i.i.i.i, align 4, !tbaa !5
%cmp.i.not.i.i.i = icmp slt i32 %6, %7
br i1 %cmp.i.not.i.i.i, label %land.rhs.i.i, label %p2.exit.i.i
p2.exit.i.i: ; preds = %land.lhs.true.i.i.i, %cond.false.i.i.i
%tobool.not.i.i = icmp eq i32 %p.031.i.i, 0
br i1 %tobool.not.i.i, label %pq_dn.exit.i, label %p2.exit.land.rhs_crit_edge.i.i
p2.exit.land.rhs_crit_edge.i.i: ; preds = %p2.exit.i.i
%idxprom1.phi.trans.insert.i.i = sext i32 %mul.i32.i.i to i64
%arrayidx2.phi.trans.insert.i.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom1.phi.trans.insert.i.i
%.pre.i.i = load i32, ptr %arrayidx2.phi.trans.insert.i.i, align 8, !tbaa !5
%idxprom.i20.phi.trans.insert.i.i = sext i32 %.pre.i.i to i64
%arrayidx.i21.phi.trans.insert.i.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom.i20.phi.trans.insert.i.i
%.pre35.i.i = load i32, ptr %arrayidx.i21.phi.trans.insert.i.i, align 4, !tbaa !5
br label %land.rhs.i.i
land.rhs.i.i: ; preds = %p2.exit.land.rhs_crit_edge.i.i, %land.lhs.true.i.i.i
%idxprom.i20.pre-phi.i.i = phi i64 [ %idxprom.i20.phi.trans.insert.i.i, %p2.exit.land.rhs_crit_edge.i.i ], [ %idxprom.i.i.i.i, %land.lhs.true.i.i.i ]
%8 = phi i32 [ %.pre35.i.i, %p2.exit.land.rhs_crit_edge.i.i ], [ %6, %land.lhs.true.i.i.i ]
%9 = phi i32 [ %.pre.i.i, %p2.exit.land.rhs_crit_edge.i.i ], [ %4, %land.lhs.true.i.i.i ]
%cond8.i28.i.i = phi i32 [ %mul.i32.i.i, %p2.exit.land.rhs_crit_edge.i.i ], [ %add.i.i.i, %land.lhs.true.i.i.i ]
%10 = load i32, ptr %arrayidx2.i.i.i, align 4, !tbaa !5
%cmp.i22.not.i.i = icmp slt i32 %8, %10
br i1 %cmp.i22.not.i.i, label %for.body.i.i, label %pq_dn.exit.i
for.body.i.i: ; preds = %land.rhs.i.i
%arrayidx6.i.i = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom.i20.pre-phi.i.i
store i32 %p.031.i.i, ptr %arrayidx6.i.i, align 4, !tbaa !5
%idxprom7.i.i = sext i32 %p.031.i.i to i64
%arrayidx8.i.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom7.i.i
store i32 %9, ptr %arrayidx8.i.i, align 4, !tbaa !5
%mul.i.i.i = shl nsw i32 %cond8.i28.i.i, 1
%cmp.i.i.not.i = icmp slt i32 %mul.i.i.i, %1
br i1 %cmp.i.i.not.i, label %cond.false.i.i.i, label %pq_dn.exit.i, !llvm.loop !14
pq_dn.exit.i: ; preds = %for.body.i.i, %land.rhs.i.i, %p2.exit.i.i, %if.then.i
%p.0.lcssa.i.i = phi i32 [ 1, %if.then.i ], [ %cond8.i28.i.i, %for.body.i.i ], [ 0, %p2.exit.i.i ], [ %p.031.i.i, %land.rhs.i.i ]
store i32 %p.0.lcssa.i.i, ptr %arrayidx2.i51, align 4, !tbaa !5
%idxprom11.i.i = sext i32 %p.0.lcssa.i.i to i64
%arrayidx12.i.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom11.i.i
store i32 %3, ptr %arrayidx12.i.i, align 4, !tbaa !5
br label %pq_remove_first.exit
pq_remove_first.exit: ; preds = %while.body, %pq_dn.exit.i
%idxprom3.i = sext i32 %2 to i64
%arrayidx4.i = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom3.i
store i32 0, ptr %arrayidx4.i, align 4, !tbaa !5
%arrayidx4 = getelementptr inbounds [251001 x i8], ptr @sink, i64 0, i64 %idxprom3.i
%11 = load i8, ptr %arrayidx4, align 1, !tbaa !15
%tobool5.not.not = icmp eq i8 %11, 0
br i1 %tobool5.not.not, label %if.end, label %cleanup.thread
cleanup.thread: ; preds = %pq_remove_first.exit
%arrayidx7 = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom3.i
%12 = load i32, ptr %arrayidx7, align 4, !tbaa !5
br label %return
if.end: ; preds = %pq_remove_first.exit
%arrayidx9 = getelementptr inbounds [251001 x i32], ptr @eo, i64 0, i64 %idxprom3.i
%13 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%tobool10.not67 = icmp eq i32 %13, 0
br i1 %tobool10.not67, label %cleanup, label %for.body.lr.ph
for.body.lr.ph: ; preds = %if.end
%arrayidx12 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom3.i
%14 = load ptr, ptr %arrayidx12, align 8, !tbaa !10
%arrayidx16 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom3.i
%15 = load ptr, ptr %arrayidx16, align 8, !tbaa !10
%arrayidx20 = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom3.i
%16 = sext i32 %13 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %if.end33
%indvars.iv = phi i64 [ %16, %for.body.lr.ph ], [ %indvars.iv.next, %if.end33 ]
%inc.i526568 = phi i32 [ %dec.i, %for.body.lr.ph ], [ %inc.i5263, %if.end33 ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx14 = getelementptr inbounds i32, ptr %14, i64 %indvars.iv.next
%17 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds i32, ptr %15, i64 %indvars.iv.next
%18 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%19 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%add = add nsw i32 %19, %18
%idxprom21 = sext i32 %17 to i64
%arrayidx22 = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom21
%20 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp = icmp sgt i32 %20, %add
br i1 %cmp, label %if.then24, label %if.end33
if.then24: ; preds = %for.body
%cmp27 = icmp eq i32 %20, 1061109567
br i1 %cmp27, label %if.then29, label %if.then24.if.end30_crit_edge
if.then24.if.end30_crit_edge: ; preds = %if.then24
%arrayidx.i58.phi.trans.insert = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom21
%.pre = load i32, ptr %arrayidx.i58.phi.trans.insert, align 4, !tbaa !5
br label %if.end30
if.then29: ; preds = %if.then24
%inc.i52 = add nsw i32 %inc.i526568, 1
store i32 %inc.i52, ptr @cnt, align 4, !tbaa !5
%idxprom1.i55 = sext i32 %inc.i52 to i64
%arrayidx2.i56 = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom1.i55
store i32 %17, ptr %arrayidx2.i56, align 4, !tbaa !5
br label %if.end30
if.end30: ; preds = %if.then24.if.end30_crit_edge, %if.then29
%21 = phi i32 [ %inc.i52, %if.then29 ], [ %.pre, %if.then24.if.end30_crit_edge ]
%inc.i5264 = phi i32 [ %inc.i52, %if.then29 ], [ %inc.i526568, %if.then24.if.end30_crit_edge ]
store i32 %add, ptr %arrayidx22, align 4, !tbaa !5
%arrayidx.i58 = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom21
%p.0.off20.i = add i32 %21, 1
%tobool.not21.i = icmp ult i32 %p.0.off20.i, 3
br i1 %tobool.not21.i, label %pq_up.exit, label %land.rhs.i
land.rhs.i: ; preds = %if.end30, %for.body.i
%p.022.i = phi i32 [ %div23.i, %for.body.i ], [ %21, %if.end30 ]
%div23.i = sdiv i32 %p.022.i, 2
%idxprom1.i59 = sext i32 %div23.i to i64
%arrayidx2.i60 = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom1.i59
%22 = load i32, ptr %arrayidx2.i60, align 4, !tbaa !5
%idxprom1.i.i = sext i32 %22 to i64
%arrayidx2.i.i = getelementptr inbounds [251001 x i32], ptr @dd, i64 0, i64 %idxprom1.i.i
%23 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp.i.not.i = icmp slt i32 %add, %23
br i1 %cmp.i.not.i, label %for.body.i, label %pq_up.exit
for.body.i: ; preds = %land.rhs.i
%arrayidx5.i = getelementptr inbounds [251001 x i32], ptr @pq, i64 0, i64 %idxprom1.i.i
store i32 %p.022.i, ptr %arrayidx5.i, align 4, !tbaa !5
%idxprom6.i = sext i32 %p.022.i to i64
%arrayidx7.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom6.i
store i32 %22, ptr %arrayidx7.i, align 4, !tbaa !5
%p.0.off.i = add nsw i32 %div23.i, 1
%tobool.not.i = icmp ult i32 %p.0.off.i, 3
br i1 %tobool.not.i, label %pq_up.exit, label %land.rhs.i, !llvm.loop !12
pq_up.exit: ; preds = %land.rhs.i, %for.body.i, %if.end30
%p.0.lcssa.i = phi i32 [ %21, %if.end30 ], [ %p.022.i, %land.rhs.i ], [ %div23.i, %for.body.i ]
store i32 %p.0.lcssa.i, ptr %arrayidx.i58, align 4, !tbaa !5
%idxprom10.i = sext i32 %p.0.lcssa.i to i64
%arrayidx11.i = getelementptr inbounds [251002 x i32], ptr @iq, i64 0, i64 %idxprom10.i
store i32 %17, ptr %arrayidx11.i, align 4, !tbaa !5
br label %if.end33
if.end33: ; preds = %pq_up.exit, %for.body
%inc.i5263 = phi i32 [ %inc.i5264, %pq_up.exit ], [ %inc.i526568, %for.body ]
%24 = and i64 %indvars.iv.next, 4294967295
%tobool10.not = icmp eq i64 %24, 0
br i1 %tobool10.not, label %cleanup, label %for.body, !llvm.loop !16
cleanup: ; preds = %if.end33, %if.end
%cnt.promoted71 = phi i32 [ %dec.i, %if.end ], [ %inc.i5263, %if.end33 ]
%tobool.not = icmp eq i32 %cnt.promoted71, 0
br i1 %tobool.not, label %return, label %while.body
return: ; preds = %cleanup, %cleanup.thread
%retval.2 = phi i32 [ %12, %cleanup.thread ], [ 1061109567, %cleanup ]
ret i32 %retval.2
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #8 {
entry:
%t = alloca i32, align 4
%m = alloca i32, align 4
%k = alloca i32, align 4
%i1 = alloca i32, align 4
%j1 = alloca i32, align 4
%i2 = alloca i32, align 4
%j2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #14
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec481 = add nsw i32 %0, -1
store i32 %dec481, ptr %t, align 4, !tbaa !5
%tobool.not482 = icmp eq i32 %0, 0
br i1 %tobool.not482, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end247
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #14
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #14
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i1) #14
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j1) #14
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i2) #14
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j2) #14
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %m, ptr noundef nonnull %k)
%1 = load i32, ptr %k, align 4, !tbaa !5
%add = add nsw i32 %1, 1
%mul = mul i32 %add, %add
store i32 %mul, ptr @n_, align 4, !tbaa !5
%cmp462.not = icmp eq i32 %add, 0
br i1 %cmp462.not, label %for.end.thread, label %for.body.preheader
for.end.thread: ; preds = %while.body
%conv511 = zext i32 %mul to i64
call void @llvm.memset.p0.i64(ptr nonnull align 16 @sink, i8 0, i64 %conv511, i1 false)
br label %for.cond108.preheader
for.body.preheader: ; preds = %while.body
%umax = call i32 @llvm.umax.i32(i32 %mul, i32 1)
%wide.trip.count = zext i32 %umax to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%call3 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #15
%arrayidx = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %indvars.iv
store ptr %call3, ptr %arrayidx, align 8, !tbaa !10
%arrayidx5 = getelementptr inbounds [251001 x i32], ptr @eo, i64 0, i64 %indvars.iv
%call6 = call noalias dereferenceable_or_null(8) ptr @malloc(i64 noundef 8) #15
%arrayidx8 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %indvars.iv
store ptr %call6, ptr %arrayidx8, align 8, !tbaa !10
store i32 0, ptr %arrayidx5, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !17
for.end: ; preds = %for.body
%conv = zext i32 %mul to i64
call void @llvm.memset.p0.i64(ptr nonnull align 16 @sink, i8 0, i64 %conv, i1 false)
%cmp13.not466 = icmp slt i32 %1, 0
br i1 %cmp13.not466, label %for.cond108.preheader, label %for.cond16.preheader
for.cond108.preheader: ; preds = %for.inc105, %for.end.thread, %for.end
%2 = load i32, ptr %m, align 4, !tbaa !5
%cmp109468 = icmp sgt i32 %2, 0
br i1 %cmp109468, label %for.body111, label %for.cond166.preheader
for.cond16.preheader: ; preds = %for.end, %for.inc105
%.pre501505 = phi i32 [ %.pre501506, %for.inc105 ], [ %1, %for.end ]
%3 = phi i32 [ %37, %for.inc105 ], [ %1, %for.end ]
%i.1467 = phi i32 [ %inc106.pre-phi, %for.inc105 ], [ 0, %for.end ]
%cmp17.not464 = icmp slt i32 %3, 0
br i1 %cmp17.not464, label %for.cond16.preheader.for.inc105_crit_edge, label %for.body19.lr.ph
for.cond16.preheader.for.inc105_crit_edge: ; preds = %for.cond16.preheader
%.pre510 = add nuw nsw i32 %i.1467, 1
br label %for.inc105
for.body19.lr.ph: ; preds = %for.cond16.preheader
%cmp20 = icmp eq i32 %i.1467, 0
%add83 = add nuw nsw i32 %i.1467, 1
br label %for.body19
for.body19: ; preds = %for.body19.lr.ph, %for.inc102
%.pre501507 = phi i32 [ %.pre501505, %for.body19.lr.ph ], [ %.pre501508, %for.inc102 ]
%4 = phi i32 [ %3, %for.body19.lr.ph ], [ %.pre501508, %for.inc102 ]
%j.0465 = phi i32 [ 0, %for.body19.lr.ph ], [ %inc103, %for.inc102 ]
br i1 %cmp20, label %if.end40, label %lor.lhs.false
lor.lhs.false: ; preds = %for.body19
%cmp22 = icmp eq i32 %i.1467, %4
%cmp25 = icmp eq i32 %j.0465, 0
%or.cond = or i1 %cmp25, %cmp22
%cmp28 = icmp eq i32 %j.0465, %4
%or.cond349 = or i1 %cmp28, %or.cond
br i1 %or.cond349, label %if.end40, label %land.lhs.true
if.end40: ; preds = %for.body19, %lor.lhs.false
%add30 = add nsw i32 %4, 1
%mul31 = mul nsw i32 %add30, %i.1467
%add32 = add nsw i32 %mul31, %j.0465
%mul33 = shl nsw i32 %add32, 1
%5 = load i32, ptr @n_, align 4, !tbaa !5
%cmp34.not = icmp slt i32 %mul33, %5
%6 = xor i32 %add32, -1
%sub37 = add i32 %5, %6
%u.0 = select i1 %cmp34.not, i32 %add32, i32 %sub37
%idxprom38 = sext i32 %u.0 to i64
%arrayidx39 = getelementptr inbounds [251001 x i8], ptr @sink, i64 0, i64 %idxprom38
store i8 1, ptr %arrayidx39, align 1, !tbaa !15
br i1 %cmp20, label %if.end70, label %land.lhs.true
land.lhs.true: ; preds = %lor.lhs.false, %if.end40
%cmp43 = icmp slt i32 %i.1467, %4
%cmp46 = icmp slt i32 %j.0465, %4
%or.cond350 = and i1 %cmp43, %cmp46
br i1 %or.cond350, label %if.then48, label %if.end70
if.then48: ; preds = %land.lhs.true
%add49 = add nuw nsw i32 %4, 1
%mul50 = mul nsw i32 %add49, %i.1467
%add51 = add nsw i32 %mul50, %j.0465
%add54 = add nuw nsw i32 %j.0465, 1
%add55 = add nsw i32 %add54, %mul50
%mul56 = shl nsw i32 %add51, 1
%7 = load i32, ptr @n_, align 4, !tbaa !5
%cmp57.not = icmp slt i32 %mul56, %7
%8 = xor i32 %add51, -1
%sub61 = add i32 %7, %8
%u.1 = select i1 %cmp57.not, i32 %add51, i32 %sub61
%mul63 = shl nsw i32 %add55, 1
%cmp64.not = icmp slt i32 %mul63, %7
%9 = xor i32 %add55, -1
%sub68 = add i32 %7, %9
%v.0 = select i1 %cmp64.not, i32 %add55, i32 %sub68
%idxprom.i = sext i32 %u.1 to i64
%arrayidx.i = getelementptr inbounds [251001 x i32], ptr @eo, i64 0, i64 %idxprom.i
%10 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%inc.i = add nsw i32 %10, 1
store i32 %inc.i, ptr %arrayidx.i, align 4, !tbaa !5
%cmp.i = icmp sgt i32 %10, 1
%11 = call i32 @llvm.ctpop.i32(i32 %10), !range !9
%cmp1.i = icmp ult i32 %11, 2
%or.cond.i = select i1 %cmp.i, i1 %cmp1.i, i1 false
br i1 %or.cond.i, label %if.then.i, label %entry.if.end_crit_edge.i
entry.if.end_crit_edge.i: ; preds = %if.then48
%arrayidx20.phi.trans.insert.i = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i
%.pre.i = load ptr, ptr %arrayidx20.phi.trans.insert.i, align 8, !tbaa !10
br label %append.exit
if.then.i: ; preds = %if.then48
%arrayidx3.i = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i
%12 = load ptr, ptr %arrayidx3.i, align 8, !tbaa !10
%mul.i = shl nuw nsw i32 %10, 1
%conv.i = zext i32 %mul.i to i64
%mul4.i = shl nuw nsw i64 %conv.i, 2
%call.i = call ptr @realloc(ptr noundef %12, i64 noundef %mul4.i) #13
store ptr %call.i, ptr %arrayidx3.i, align 8, !tbaa !10
%arrayidx8.i = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i
%13 = load ptr, ptr %arrayidx8.i, align 8, !tbaa !10
%call12.i = call ptr @realloc(ptr noundef %13, i64 noundef %mul4.i) #13
store ptr %call12.i, ptr %arrayidx8.i, align 8, !tbaa !10
br label %append.exit
append.exit: ; preds = %entry.if.end_crit_edge.i, %if.then.i
%14 = phi ptr [ %.pre.i, %entry.if.end_crit_edge.i ], [ %call12.i, %if.then.i ]
%arrayidx16.i = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i
%15 = load ptr, ptr %arrayidx16.i, align 8, !tbaa !10
%idxprom17.i = sext i32 %10 to i64
%arrayidx18.i = getelementptr inbounds i32, ptr %15, i64 %idxprom17.i
store i32 %v.0, ptr %arrayidx18.i, align 4, !tbaa !5
%arrayidx22.i = getelementptr inbounds i32, ptr %14, i64 %idxprom17.i
store i32 0, ptr %arrayidx22.i, align 4, !tbaa !5
%idxprom.i352 = sext i32 %v.0 to i64
%arrayidx.i353 = getelementptr inbounds [251001 x i32], ptr @eo, i64 0, i64 %idxprom.i352
%16 = load i32, ptr %arrayidx.i353, align 4, !tbaa !5
%inc.i354 = add nsw i32 %16, 1
store i32 %inc.i354, ptr %arrayidx.i353, align 4, !tbaa !5
%cmp.i355 = icmp sgt i32 %16, 1
%17 = call i32 @llvm.ctpop.i32(i32 %16), !range !9
%cmp1.i356 = icmp ult i32 %17, 2
%or.cond.i357 = select i1 %cmp.i355, i1 %cmp1.i356, i1 false
br i1 %or.cond.i357, label %if.then.i365, label %entry.if.end_crit_edge.i358
entry.if.end_crit_edge.i358: ; preds = %append.exit
%arrayidx20.phi.trans.insert.i359 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i352
%.pre.i360 = load ptr, ptr %arrayidx20.phi.trans.insert.i359, align 8, !tbaa !10
br label %append.exit373
if.then.i365: ; preds = %append.exit
%arrayidx3.i366 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i352
%18 = load ptr, ptr %arrayidx3.i366, align 8, !tbaa !10
%mul.i367 = shl nuw nsw i32 %16, 1
%conv.i368 = zext i32 %mul.i367 to i64
%mul4.i369 = shl nuw nsw i64 %conv.i368, 2
%call.i370 = call ptr @realloc(ptr noundef %18, i64 noundef %mul4.i369) #13
store ptr %call.i370, ptr %arrayidx3.i366, align 8, !tbaa !10
%arrayidx8.i371 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i352
%19 = load ptr, ptr %arrayidx8.i371, align 8, !tbaa !10
%call12.i372 = call ptr @realloc(ptr noundef %19, i64 noundef %mul4.i369) #13
store ptr %call12.i372, ptr %arrayidx8.i371, align 8, !tbaa !10
br label %append.exit373
append.exit373: ; preds = %entry.if.end_crit_edge.i358, %if.then.i365
%20 = phi ptr [ %.pre.i360, %entry.if.end_crit_edge.i358 ], [ %call12.i372, %if.then.i365 ]
%arrayidx16.i361 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i352
%21 = load ptr, ptr %arrayidx16.i361, align 8, !tbaa !10
%idxprom17.i362 = sext i32 %16 to i64
%arrayidx18.i363 = getelementptr inbounds i32, ptr %21, i64 %idxprom17.i362
store i32 %u.1, ptr %arrayidx18.i363, align 4, !tbaa !5
%arrayidx22.i364 = getelementptr inbounds i32, ptr %20, i64 %idxprom17.i362
store i32 0, ptr %arrayidx22.i364, align 4, !tbaa !5
%.pre501.pre = load i32, ptr %k, align 4, !tbaa !5
br label %if.end70
if.end70: ; preds = %append.exit373, %land.lhs.true, %if.end40
%.pre501 = phi i32 [ %.pre501.pre, %append.exit373 ], [ %.pre501507, %land.lhs.true ], [ %.pre501507, %if.end40 ]
%cmp71.not = icmp eq i32 %j.0465, 0
br i1 %cmp71.not, label %for.inc102, label %land.lhs.true73
land.lhs.true73: ; preds = %if.end70
%cmp74 = icmp slt i32 %j.0465, %.pre501
%cmp77 = icmp slt i32 %i.1467, %.pre501
%or.cond351 = and i1 %cmp74, %cmp77
br i1 %or.cond351, label %if.then79, label %for.inc102
if.then79: ; preds = %land.lhs.true73
%add80 = add nuw nsw i32 %.pre501, 1
%mul81 = mul nsw i32 %add80, %i.1467
%add82 = add nsw i32 %mul81, %j.0465
%mul85 = mul nsw i32 %add80, %add83
%add86 = add nsw i32 %mul85, %j.0465
%mul87 = shl nsw i32 %add82, 1
%22 = load i32, ptr @n_, align 4, !tbaa !5
%cmp88.not = icmp slt i32 %mul87, %22
%23 = xor i32 %add82, -1
%sub92 = add i32 %22, %23
%u.2 = select i1 %cmp88.not, i32 %add82, i32 %sub92
%mul94 = shl nsw i32 %add86, 1
%cmp95.not = icmp slt i32 %mul94, %22
%24 = xor i32 %add86, -1
%sub99 = add i32 %22, %24
%v.1 = select i1 %cmp95.not, i32 %add86, i32 %sub99
%idxprom.i374 = sext i32 %u.2 to i64
%arrayidx.i375 = getelementptr inbounds [251001 x i32], ptr @eo, i64 0, i64 %idxprom.i374
%25 = load i32, ptr %arrayidx.i375, align 4, !tbaa !5
%inc.i376 = add nsw i32 %25, 1
store i32 %inc.i376, ptr %arrayidx.i375, align 4, !tbaa !5
%cmp.i377 = icmp sgt i32 %25, 1
%26 = call i32 @llvm.ctpop.i32(i32 %25), !range !9
%cmp1.i378 = icmp ult i32 %26, 2
%or.cond.i379 = select i1 %cmp.i377, i1 %cmp1.i378, i1 false
br i1 %or.cond.i379, label %if.then.i387, label %entry.if.end_crit_edge.i380
entry.if.end_crit_edge.i380: ; preds = %if.then79
%arrayidx20.phi.trans.insert.i381 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i374
%.pre.i382 = load ptr, ptr %arrayidx20.phi.trans.insert.i381, align 8, !tbaa !10
br label %append.exit395
if.then.i387: ; preds = %if.then79
%arrayidx3.i388 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i374
%27 = load ptr, ptr %arrayidx3.i388, align 8, !tbaa !10
%mul.i389 = shl nuw nsw i32 %25, 1
%conv.i390 = zext i32 %mul.i389 to i64
%mul4.i391 = shl nuw nsw i64 %conv.i390, 2
%call.i392 = call ptr @realloc(ptr noundef %27, i64 noundef %mul4.i391) #13
store ptr %call.i392, ptr %arrayidx3.i388, align 8, !tbaa !10
%arrayidx8.i393 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i374
%28 = load ptr, ptr %arrayidx8.i393, align 8, !tbaa !10
%call12.i394 = call ptr @realloc(ptr noundef %28, i64 noundef %mul4.i391) #13
store ptr %call12.i394, ptr %arrayidx8.i393, align 8, !tbaa !10
br label %append.exit395
append.exit395: ; preds = %entry.if.end_crit_edge.i380, %if.then.i387
%29 = phi ptr [ %.pre.i382, %entry.if.end_crit_edge.i380 ], [ %call12.i394, %if.then.i387 ]
%arrayidx16.i383 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i374
%30 = load ptr, ptr %arrayidx16.i383, align 8, !tbaa !10
%idxprom17.i384 = sext i32 %25 to i64
%arrayidx18.i385 = getelementptr inbounds i32, ptr %30, i64 %idxprom17.i384
store i32 %v.1, ptr %arrayidx18.i385, align 4, !tbaa !5
%arrayidx22.i386 = getelementptr inbounds i32, ptr %29, i64 %idxprom17.i384
store i32 0, ptr %arrayidx22.i386, align 4, !tbaa !5
%idxprom.i396 = sext i32 %v.1 to i64
%arrayidx.i397 = getelementptr inbounds [251001 x i32], ptr @eo, i64 0, i64 %idxprom.i396
%31 = load i32, ptr %arrayidx.i397, align 4, !tbaa !5
%inc.i398 = add nsw i32 %31, 1
store i32 %inc.i398, ptr %arrayidx.i397, align 4, !tbaa !5
%cmp.i399 = icmp sgt i32 %31, 1
%32 = call i32 @llvm.ctpop.i32(i32 %31), !range !9
%cmp1.i400 = icmp ult i32 %32, 2
%or.cond.i401 = select i1 %cmp.i399, i1 %cmp1.i400, i1 false
br i1 %or.cond.i401, label %if.then.i409, label %entry.if.end_crit_edge.i402
entry.if.end_crit_edge.i402: ; preds = %append.exit395
%arrayidx20.phi.trans.insert.i403 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i396
%.pre.i404 = load ptr, ptr %arrayidx20.phi.trans.insert.i403, align 8, !tbaa !10
br label %append.exit417
if.then.i409: ; preds = %append.exit395
%arrayidx3.i410 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i396
%33 = load ptr, ptr %arrayidx3.i410, align 8, !tbaa !10
%mul.i411 = shl nuw nsw i32 %31, 1
%conv.i412 = zext i32 %mul.i411 to i64
%mul4.i413 = shl nuw nsw i64 %conv.i412, 2
%call.i414 = call ptr @realloc(ptr noundef %33, i64 noundef %mul4.i413) #13
store ptr %call.i414, ptr %arrayidx3.i410, align 8, !tbaa !10
%arrayidx8.i415 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i396
%34 = load ptr, ptr %arrayidx8.i415, align 8, !tbaa !10
%call12.i416 = call ptr @realloc(ptr noundef %34, i64 noundef %mul4.i413) #13
store ptr %call12.i416, ptr %arrayidx8.i415, align 8, !tbaa !10
br label %append.exit417
append.exit417: ; preds = %entry.if.end_crit_edge.i402, %if.then.i409
%35 = phi ptr [ %.pre.i404, %entry.if.end_crit_edge.i402 ], [ %call12.i416, %if.then.i409 ]
%arrayidx16.i405 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i396
%36 = load ptr, ptr %arrayidx16.i405, align 8, !tbaa !10
%idxprom17.i406 = sext i32 %31 to i64
%arrayidx18.i407 = getelementptr inbounds i32, ptr %36, i64 %idxprom17.i406
store i32 %u.2, ptr %arrayidx18.i407, align 4, !tbaa !5
%arrayidx22.i408 = getelementptr inbounds i32, ptr %35, i64 %idxprom17.i406
store i32 0, ptr %arrayidx22.i408, align 4, !tbaa !5
%.pre = load i32, ptr %k, align 4, !tbaa !5
br label %for.inc102
for.inc102: ; preds = %if.end70, %land.lhs.true73, %append.exit417
%.pre501508 = phi i32 [ %.pre501, %if.end70 ], [ %.pre501, %land.lhs.true73 ], [ %.pre, %append.exit417 ]
%inc103 = add nuw nsw i32 %j.0465, 1
%cmp17.not.not = icmp slt i32 %j.0465, %.pre501508
br i1 %cmp17.not.not, label %for.body19, label %for.inc105, !llvm.loop !18
for.inc105: ; preds = %for.inc102, %for.cond16.preheader.for.inc105_crit_edge
%inc106.pre-phi = phi i32 [ %.pre510, %for.cond16.preheader.for.inc105_crit_edge ], [ %add83, %for.inc102 ]
%.pre501506 = phi i32 [ %.pre501505, %for.cond16.preheader.for.inc105_crit_edge ], [ %.pre501508, %for.inc102 ]
%37 = phi i32 [ %3, %for.cond16.preheader.for.inc105_crit_edge ], [ %.pre501508, %for.inc102 ]
%cmp13.not.not = icmp slt i32 %i.1467, %37
br i1 %cmp13.not.not, label %for.cond16.preheader, label %for.cond108.preheader, !llvm.loop !19
for.cond166.preheader: ; preds = %append.exit461, %for.cond108.preheader
%38 = phi i32 [ %2, %for.cond108.preheader ], [ %63, %append.exit461 ]
%39 = load i32, ptr @n_, align 4, !tbaa !5
%cmp167477 = icmp sgt i32 %39, 0
br i1 %cmp167477, label %for.cond170.preheader, label %for.end233
for.body111: ; preds = %for.cond108.preheader, %append.exit461
%h.0469 = phi i32 [ %inc164, %append.exit461 ], [ 0, %for.cond108.preheader ]
%call114 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i1, ptr noundef nonnull %j1, ptr noundef nonnull %i2, ptr noundef nonnull %j2)
%40 = load i32, ptr %i1, align 4, !tbaa !5
%dec115 = add nsw i32 %40, -1
store i32 %dec115, ptr %i1, align 4, !tbaa !5
%41 = load i32, ptr %j1, align 4, !tbaa !5
%dec116 = add nsw i32 %41, -1
store i32 %dec116, ptr %j1, align 4, !tbaa !5
%42 = load i32, ptr %i2, align 4, !tbaa !5
%dec117 = add nsw i32 %42, -1
store i32 %dec117, ptr %i2, align 4, !tbaa !5
%43 = load i32, ptr %j2, align 4, !tbaa !5
%dec118 = add nsw i32 %43, -1
store i32 %dec118, ptr %j2, align 4, !tbaa !5
%cmp119.not.not = icmp sgt i32 %40, %42
br i1 %cmp119.not.not, label %if.then121, label %if.end122
if.then121: ; preds = %for.body111
store i32 %dec117, ptr %i1, align 4, !tbaa !5
store i32 %dec115, ptr %i2, align 4, !tbaa !5
br label %if.end122
if.end122: ; preds = %if.then121, %for.body111
%44 = phi i32 [ %dec115, %if.then121 ], [ %dec117, %for.body111 ]
%45 = phi i32 [ %dec117, %if.then121 ], [ %dec115, %for.body111 ]
%cmp123 = icmp sgt i32 %41, %43
br i1 %cmp123, label %if.then125, label %if.end126
if.then125: ; preds = %if.end122
store i32 %dec118, ptr %j1, align 4, !tbaa !5
store i32 %dec116, ptr %j2, align 4, !tbaa !5
br label %if.end126
if.end126: ; preds = %if.then125, %if.end122
%46 = phi i32 [ %dec118, %if.then125 ], [ %dec116, %if.end122 ]
%cmp127.not = icmp eq i32 %45, %44
br i1 %cmp127.not, label %if.else, label %if.then129
if.then129: ; preds = %if.end126
%add130 = add nsw i32 %45, 1
%47 = load i32, ptr %k, align 4, !tbaa !5
%add131 = add nsw i32 %47, 1
%mul132 = mul nsw i32 %add131, %add130
%add133 = add nsw i32 %mul132, %46
br label %if.end148
if.else: ; preds = %if.end126
%48 = load i32, ptr %k, align 4, !tbaa !5
%add139 = add nsw i32 %48, 1
%mul140 = mul nsw i32 %add139, %44
%add141 = add nsw i32 %46, 1
%add142 = add i32 %add141, %mul140
%add143 = add nsw i32 %44, 1
%mul145 = mul nsw i32 %add139, %add143
%add146 = add nsw i32 %mul145, %46
br label %if.end148
if.end148: ; preds = %if.else, %if.then129
%u112.0 = phi i32 [ %add133, %if.then129 ], [ %add142, %if.else ]
%v113.0.in = phi i32 [ %add133, %if.then129 ], [ %add146, %if.else ]
%v113.0 = add nsw i32 %v113.0.in, 1
%mul149 = shl nsw i32 %u112.0, 1
%49 = load i32, ptr @n_, align 4, !tbaa !5
%cmp150.not = icmp slt i32 %mul149, %49
%50 = xor i32 %u112.0, -1
%sub154 = add i32 %49, %50
%u112.1 = select i1 %cmp150.not, i32 %u112.0, i32 %sub154
%mul156 = shl nsw i32 %v113.0, 1
%cmp157.not = icmp slt i32 %mul156, %49
%reass.sub483 = sub i32 %49, %v113.0.in
%sub161 = add i32 %reass.sub483, -2
%v113.1 = select i1 %cmp157.not, i32 %v113.0, i32 %sub161
%idxprom.i418 = sext i32 %u112.1 to i64
%arrayidx.i419 = getelementptr inbounds [251001 x i32], ptr @eo, i64 0, i64 %idxprom.i418
%51 = load i32, ptr %arrayidx.i419, align 4, !tbaa !5
%inc.i420 = add nsw i32 %51, 1
store i32 %inc.i420, ptr %arrayidx.i419, align 4, !tbaa !5
%cmp.i421 = icmp sgt i32 %51, 1
%52 = call i32 @llvm.ctpop.i32(i32 %51), !range !9
%cmp1.i422 = icmp ult i32 %52, 2
%or.cond.i423 = select i1 %cmp.i421, i1 %cmp1.i422, i1 false
br i1 %or.cond.i423, label %if.then.i431, label %entry.if.end_crit_edge.i424
entry.if.end_crit_edge.i424: ; preds = %if.end148
%arrayidx20.phi.trans.insert.i425 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i418
%.pre.i426 = load ptr, ptr %arrayidx20.phi.trans.insert.i425, align 8, !tbaa !10
br label %append.exit439
if.then.i431: ; preds = %if.end148
%arrayidx3.i432 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i418
%53 = load ptr, ptr %arrayidx3.i432, align 8, !tbaa !10
%mul.i433 = shl nuw nsw i32 %51, 1
%conv.i434 = zext i32 %mul.i433 to i64
%mul4.i435 = shl nuw nsw i64 %conv.i434, 2
%call.i436 = call ptr @realloc(ptr noundef %53, i64 noundef %mul4.i435) #13
store ptr %call.i436, ptr %arrayidx3.i432, align 8, !tbaa !10
%arrayidx8.i437 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i418
%54 = load ptr, ptr %arrayidx8.i437, align 8, !tbaa !10
%call12.i438 = call ptr @realloc(ptr noundef %54, i64 noundef %mul4.i435) #13
store ptr %call12.i438, ptr %arrayidx8.i437, align 8, !tbaa !10
br label %append.exit439
append.exit439: ; preds = %entry.if.end_crit_edge.i424, %if.then.i431
%55 = phi ptr [ %.pre.i426, %entry.if.end_crit_edge.i424 ], [ %call12.i438, %if.then.i431 ]
%arrayidx16.i427 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i418
%56 = load ptr, ptr %arrayidx16.i427, align 8, !tbaa !10
%idxprom17.i428 = sext i32 %51 to i64
%arrayidx18.i429 = getelementptr inbounds i32, ptr %56, i64 %idxprom17.i428
store i32 %v113.1, ptr %arrayidx18.i429, align 4, !tbaa !5
%arrayidx22.i430 = getelementptr inbounds i32, ptr %55, i64 %idxprom17.i428
store i32 1, ptr %arrayidx22.i430, align 4, !tbaa !5
%idxprom.i440 = sext i32 %v113.1 to i64
%arrayidx.i441 = getelementptr inbounds [251001 x i32], ptr @eo, i64 0, i64 %idxprom.i440
%57 = load i32, ptr %arrayidx.i441, align 4, !tbaa !5
%inc.i442 = add nsw i32 %57, 1
store i32 %inc.i442, ptr %arrayidx.i441, align 4, !tbaa !5
%cmp.i443 = icmp sgt i32 %57, 1
%58 = call i32 @llvm.ctpop.i32(i32 %57), !range !9
%cmp1.i444 = icmp ult i32 %58, 2
%or.cond.i445 = select i1 %cmp.i443, i1 %cmp1.i444, i1 false
br i1 %or.cond.i445, label %if.then.i453, label %entry.if.end_crit_edge.i446
entry.if.end_crit_edge.i446: ; preds = %append.exit439
%arrayidx20.phi.trans.insert.i447 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i440
%.pre.i448 = load ptr, ptr %arrayidx20.phi.trans.insert.i447, align 8, !tbaa !10
br label %append.exit461
if.then.i453: ; preds = %append.exit439
%arrayidx3.i454 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i440
%59 = load ptr, ptr %arrayidx3.i454, align 8, !tbaa !10
%mul.i455 = shl nuw nsw i32 %57, 1
%conv.i456 = zext i32 %mul.i455 to i64
%mul4.i457 = shl nuw nsw i64 %conv.i456, 2
%call.i458 = call ptr @realloc(ptr noundef %59, i64 noundef %mul4.i457) #13
store ptr %call.i458, ptr %arrayidx3.i454, align 8, !tbaa !10
%arrayidx8.i459 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %idxprom.i440
%60 = load ptr, ptr %arrayidx8.i459, align 8, !tbaa !10
%call12.i460 = call ptr @realloc(ptr noundef %60, i64 noundef %mul4.i457) #13
store ptr %call12.i460, ptr %arrayidx8.i459, align 8, !tbaa !10
br label %append.exit461
append.exit461: ; preds = %entry.if.end_crit_edge.i446, %if.then.i453
%61 = phi ptr [ %.pre.i448, %entry.if.end_crit_edge.i446 ], [ %call12.i460, %if.then.i453 ]
%arrayidx16.i449 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %idxprom.i440
%62 = load ptr, ptr %arrayidx16.i449, align 8, !tbaa !10
%idxprom17.i450 = sext i32 %57 to i64
%arrayidx18.i451 = getelementptr inbounds i32, ptr %62, i64 %idxprom17.i450
store i32 %u112.1, ptr %arrayidx18.i451, align 4, !tbaa !5
%arrayidx22.i452 = getelementptr inbounds i32, ptr %61, i64 %idxprom17.i450
store i32 1, ptr %arrayidx22.i452, align 4, !tbaa !5
%inc164 = add nuw nsw i32 %h.0469, 1
%63 = load i32, ptr %m, align 4, !tbaa !5
%cmp109 = icmp slt i32 %inc164, %63
br i1 %cmp109, label %for.body111, label %for.cond166.preheader, !llvm.loop !21
for.cond170.preheader: ; preds = %for.cond166.preheader, %for.end228
%64 = phi i32 [ %86, %for.end228 ], [ %39, %for.cond166.preheader ]
%indvars.iv495 = phi i64 [ %indvars.iv.next496, %for.end228 ], [ 0, %for.cond166.preheader ]
%arrayidx172 = getelementptr inbounds [251001 x i32], ptr @eo, i64 0, i64 %indvars.iv495
%65 = load i32, ptr %arrayidx172, align 4, !tbaa !5
%cmp173470 = icmp sgt i32 %65, 0
br i1 %cmp173470, label %for.body175.lr.ph, label %for.end228
for.body175.lr.ph: ; preds = %for.cond170.preheader
%arrayidx177 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %indvars.iv495
%66 = load ptr, ptr %arrayidx177, align 8, !tbaa !10
%arrayidx181 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %indvars.iv495
%67 = load ptr, ptr %arrayidx181, align 8, !tbaa !10
%wide.trip.count490 = zext i32 %65 to i64
%xtraiter = and i64 %wide.trip.count490, 1
%68 = icmp eq i32 %65, 1
br i1 %68, label %for.cond192.preheader.unr-lcssa, label %for.body175.lr.ph.new
for.body175.lr.ph.new: ; preds = %for.body175.lr.ph
%unroll_iter = and i64 %wide.trip.count490, 4294967294
br label %for.body175
for.cond192.preheader.unr-lcssa: ; preds = %for.body175, %for.body175.lr.ph
%indvars.iv487.unr = phi i64 [ 0, %for.body175.lr.ph ], [ %indvars.iv.next488.1, %for.body175 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond192.preheader, label %for.body175.epil
for.body175.epil: ; preds = %for.cond192.preheader.unr-lcssa
%arrayidx179.epil = getelementptr inbounds i32, ptr %66, i64 %indvars.iv487.unr
%69 = load i32, ptr %arrayidx179.epil, align 4, !tbaa !5
%arrayidx183.epil = getelementptr inbounds i32, ptr %67, i64 %indvars.iv487.unr
%70 = load i32, ptr %arrayidx183.epil, align 4, !tbaa !5
%idxprom184.epil = sext i32 %69 to i64
%arrayidx185.epil = getelementptr inbounds [251001 x i8], ptr @main.used, i64 0, i64 %idxprom184.epil
store i8 1, ptr %arrayidx185.epil, align 1, !tbaa !15
%arrayidx187.epil = getelementptr inbounds [251001 x i32], ptr @main.ww, i64 0, i64 %idxprom184.epil
%71 = load i32, ptr %arrayidx187.epil, align 4, !tbaa !5
%add188.epil = add nsw i32 %71, %70
store i32 %add188.epil, ptr %arrayidx187.epil, align 4, !tbaa !5
br label %for.cond192.preheader
for.cond192.preheader: ; preds = %for.cond192.preheader.unr-lcssa, %for.body175.epil
br i1 %cmp173470, label %for.body197.lr.ph, label %for.end228
for.body197.lr.ph: ; preds = %for.cond192.preheader
%arrayidx199 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %indvars.iv495
%72 = load ptr, ptr %arrayidx199, align 8, !tbaa !10
%arrayidx203 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %indvars.iv495
br label %for.body197
for.body175: ; preds = %for.body175, %for.body175.lr.ph.new
%indvars.iv487 = phi i64 [ 0, %for.body175.lr.ph.new ], [ %indvars.iv.next488.1, %for.body175 ]
%niter = phi i64 [ 0, %for.body175.lr.ph.new ], [ %niter.next.1, %for.body175 ]
%arrayidx179 = getelementptr inbounds i32, ptr %66, i64 %indvars.iv487
%73 = load i32, ptr %arrayidx179, align 4, !tbaa !5
%arrayidx183 = getelementptr inbounds i32, ptr %67, i64 %indvars.iv487
%74 = load i32, ptr %arrayidx183, align 4, !tbaa !5
%idxprom184 = sext i32 %73 to i64
%arrayidx185 = getelementptr inbounds [251001 x i8], ptr @main.used, i64 0, i64 %idxprom184
store i8 1, ptr %arrayidx185, align 1, !tbaa !15
%arrayidx187 = getelementptr inbounds [251001 x i32], ptr @main.ww, i64 0, i64 %idxprom184
%75 = load i32, ptr %arrayidx187, align 4, !tbaa !5
%add188 = add nsw i32 %75, %74
store i32 %add188, ptr %arrayidx187, align 4, !tbaa !5
%indvars.iv.next488 = or i64 %indvars.iv487, 1
%arrayidx179.1 = getelementptr inbounds i32, ptr %66, i64 %indvars.iv.next488
%76 = load i32, ptr %arrayidx179.1, align 4, !tbaa !5
%arrayidx183.1 = getelementptr inbounds i32, ptr %67, i64 %indvars.iv.next488
%77 = load i32, ptr %arrayidx183.1, align 4, !tbaa !5
%idxprom184.1 = sext i32 %76 to i64
%arrayidx185.1 = getelementptr inbounds [251001 x i8], ptr @main.used, i64 0, i64 %idxprom184.1
store i8 1, ptr %arrayidx185.1, align 1, !tbaa !15
%arrayidx187.1 = getelementptr inbounds [251001 x i32], ptr @main.ww, i64 0, i64 %idxprom184.1
%78 = load i32, ptr %arrayidx187.1, align 4, !tbaa !5
%add188.1 = add nsw i32 %78, %77
store i32 %add188.1, ptr %arrayidx187.1, align 4, !tbaa !5
%indvars.iv.next488.1 = add nuw nsw i64 %indvars.iv487, 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.cond192.preheader.unr-lcssa, label %for.body175, !llvm.loop !22
for.body197: ; preds = %for.body197.lr.ph, %for.inc226
%79 = phi i32 [ %65, %for.body197.lr.ph ], [ %84, %for.inc226 ]
%indvars.iv492 = phi i64 [ 0, %for.body197.lr.ph ], [ %indvars.iv.next493, %for.inc226 ]
%o_.0475 = phi i32 [ 0, %for.body197.lr.ph ], [ %o_.1, %for.inc226 ]
%arrayidx201 = getelementptr inbounds i32, ptr %72, i64 %indvars.iv492
%80 = load i32, ptr %arrayidx201, align 4, !tbaa !5
%idxprom206 = sext i32 %80 to i64
%arrayidx207 = getelementptr inbounds [251001 x i8], ptr @main.used, i64 0, i64 %idxprom206
%81 = load i8, ptr %arrayidx207, align 1, !tbaa !15
%tobool208.not = icmp eq i8 %81, 0
br i1 %tobool208.not, label %for.inc226, label %if.then209
if.then209: ; preds = %for.body197
%idxprom212 = sext i32 %o_.0475 to i64
%arrayidx213 = getelementptr inbounds i32, ptr %72, i64 %idxprom212
store i32 %80, ptr %arrayidx213, align 4, !tbaa !5
%arrayidx215 = getelementptr inbounds [251001 x i32], ptr @main.ww, i64 0, i64 %idxprom206
%82 = load i32, ptr %arrayidx215, align 4, !tbaa !5
%83 = load ptr, ptr %arrayidx203, align 8, !tbaa !10
%arrayidx219 = getelementptr inbounds i32, ptr %83, i64 %idxprom212
store i32 %82, ptr %arrayidx219, align 4, !tbaa !5
%inc220 = add nsw i32 %o_.0475, 1
store i8 0, ptr %arrayidx207, align 1, !tbaa !15
store i32 0, ptr %arrayidx215, align 4, !tbaa !5
%.pre502 = load i32, ptr %arrayidx172, align 4, !tbaa !5
br label %for.inc226
for.inc226: ; preds = %for.body197, %if.then209
%84 = phi i32 [ %.pre502, %if.then209 ], [ %79, %for.body197 ]
%o_.1 = phi i32 [ %inc220, %if.then209 ], [ %o_.0475, %for.body197 ]
%indvars.iv.next493 = add nuw nsw i64 %indvars.iv492, 1
%85 = sext i32 %84 to i64
%cmp195 = icmp slt i64 %indvars.iv.next493, %85
br i1 %cmp195, label %for.body197, label %for.end228.loopexit, !llvm.loop !23
for.end228.loopexit: ; preds = %for.inc226
%.pre503 = load i32, ptr @n_, align 4, !tbaa !5
br label %for.end228
for.end228: ; preds = %for.cond170.preheader, %for.end228.loopexit, %for.cond192.preheader
%86 = phi i32 [ %64, %for.cond192.preheader ], [ %.pre503, %for.end228.loopexit ], [ %64, %for.cond170.preheader ]
%o_.0.lcssa = phi i32 [ 0, %for.cond192.preheader ], [ %o_.1, %for.end228.loopexit ], [ 0, %for.cond170.preheader ]
store i32 %o_.0.lcssa, ptr %arrayidx172, align 4, !tbaa !5
%indvars.iv.next496 = add nuw nsw i64 %indvars.iv495, 1
%87 = sext i32 %86 to i64
%cmp167 = icmp slt i64 %indvars.iv.next496, %87
br i1 %cmp167, label %for.cond170.preheader, label %for.end233.loopexit, !llvm.loop !24
for.end233.loopexit: ; preds = %for.end228
%.pre504 = load i32, ptr %m, align 4, !tbaa !5
br label %for.end233
for.end233: ; preds = %for.end233.loopexit, %for.cond166.preheader
%88 = phi i32 [ %38, %for.cond166.preheader ], [ %.pre504, %for.end233.loopexit ]
%.lcssa = phi i32 [ %39, %for.cond166.preheader ], [ %86, %for.end233.loopexit ]
%div = sdiv i32 %.lcssa, 2
%call234 = call i32 @dijkstra(i32 noundef %div)
%sub235 = sub nsw i32 %88, %call234
%call236 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %sub235)
%89 = load i32, ptr @n_, align 4, !tbaa !5
%cmp238479 = icmp sgt i32 %89, 0
br i1 %cmp238479, label %for.body240, label %for.end247
for.body240: ; preds = %for.end233, %for.body240
%indvars.iv498 = phi i64 [ %indvars.iv.next499, %for.body240 ], [ 0, %for.end233 ]
%arrayidx242 = getelementptr inbounds [251001 x ptr], ptr @ej, i64 0, i64 %indvars.iv498
%90 = load ptr, ptr %arrayidx242, align 8, !tbaa !10
call void @free(ptr noundef %90) #14
%arrayidx244 = getelementptr inbounds [251001 x ptr], ptr @ew, i64 0, i64 %indvars.iv498
%91 = load ptr, ptr %arrayidx244, align 8, !tbaa !10
call void @free(ptr noundef %91) #14
%indvars.iv.next499 = add nuw nsw i64 %indvars.iv498, 1
%92 = load i32, ptr @n_, align 4, !tbaa !5
%93 = sext i32 %92 to i64
%cmp238 = icmp slt i64 %indvars.iv.next499, %93
br i1 %cmp238, label %for.body240, label %for.end247, !llvm.loop !25
for.end247: ; preds = %for.body240, %for.end233
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j2) #14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i2) #14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j1) #14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i1) #14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #14
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #14
%94 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %94, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %94, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !26
while.end: ; preds = %for.end247, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #14
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #10
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.ctpop.i32(i32) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #12
attributes #0 = { mustprogress nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind willreturn allockind("realloc") allocsize(1) 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 #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { mustprogress nofree nounwind willreturn 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 #11 = { 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 #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #13 = { nounwind allocsize(1) }
attributes #14 = { nounwind }
attributes #15 = { 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 = !{i32 0, i32 33}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13, !20}
!20 = !{!"llvm.loop.unswitch.partial.disable"}
!21 = distinct !{!21, !13}
!22 = distinct !{!22, !13}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}
!25 = distinct !{!25, !13}
!26 = distinct !{!26, !13}
|
#include <stdio.h>
int main(){
int L;
scanf("%d",&L);
printf("%.12f\n",(double)L*L*L/27);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206412/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206412/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"%.12f\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%L = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %L) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %L)
%0 = load i32, ptr %L, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%mul = fmul double %conv, %conv
%mul3 = fmul double %mul, %conv
%div = fdiv double %mul3, 2.700000e+01
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %div)
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"}
|
#include<stdio.h>
int main()
{
int a,b,i,j;
double s,q,h,k;
scanf("%d",&a);
h=(double)a;
q=h/3;
s=q*q*q;
printf("%.12lf\n",s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206456/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206456/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [8 x i8] c"%.12lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a)
%0 = load i32, ptr %a, align 4, !tbaa !5
%conv = sitofp i32 %0 to double
%div = fdiv double %conv, 3.000000e+00
%mul = fmul double %div, %div
%mul1 = fmul double %div, %mul
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, double noundef %mul1)
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"}
|
/*
* Author : Abhay Jain
* Problem : 246A
* Language : C
* Description : Codeforces Round 151 (Div 2)
*/
#include <stdio.h>
int main ()
{
int n, i;
scanf ("%d", &n);
if (n == 1 || n == 2)
printf ("-1\n");
else
{
for (i=0; i<n; i++)
printf ("%d ", (n - i));
printf ("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_2065/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_2065/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
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
%1 = add i32 %0, -1
%or.cond = icmp ult i32 %1, 2
br i1 %or.cond, label %if.then, label %for.cond.preheader
for.cond.preheader: ; preds = %entry
%cmp38 = icmp sgt i32 %0, 0
br i1 %cmp38, label %for.body, label %for.end
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
for.body: ; preds = %for.cond.preheader, %for.body
%2 = phi i32 [ %3, %for.body ], [ %0, %for.cond.preheader ]
%i.09 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ]
%sub = sub nsw i32 %2, %i.09
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
%inc = add nuw nsw i32 %i.09, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %inc, %3
br i1 %cmp3, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %for.cond.preheader
%putchar = call i32 @putchar(i32 10)
br label %if.end
if.end: ; preds = %for.end, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
long int l;
long double hen, result;
scanf("%ld" , &l);
//printf("%d\n", l);
hen = (double)l / 3;
//printf("%.10Lf\n", hen);
result = hen * hen * hen;
printf("%.15Lf\n", result);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206542/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206542/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [8 x i8] c"%.15Lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%l = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l)
%0 = load i64, ptr %l, align 8, !tbaa !5
%conv = sitofp i64 %0 to double
%div = fdiv double %conv, 3.000000e+00
%conv1 = fpext double %div to x86_fp80
%mul = fmul x86_fp80 %conv1, %conv1
%mul2 = fmul x86_fp80 %mul, %conv1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, x86_fp80 noundef %mul2)
call void @llvm.lifetime.end.p0(i64 8, 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
//set many funcs template
//Ver.20190820
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#include<assert.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int nHr(int a,int b){return nCr(a+b-1,b);}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}
int sankaku(int x){return ((1+x)*x)/2;}
void swap(int *a,int *b){int c;c=(*a);(*a)=(*b);(*b)=c;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
void llswap(long long *a,long long *b){long long c;c=(*a);(*a)=(*b);(*b)=c;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
void dbswap(double *a,double *b){double c;c=(*a);(*a)=(*b);(*b)=c;}
void chswap(char *a,char *b){char c;c=(*a);(*a)=(*b);(*b)=c;}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}
int chsortfncsj(const void *a,const void *b){if(*(char *)a>*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
int chsortfnckj(const void *a,const void *b){if(*(char *)a<*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
void shuffledget(int x[],int n){
int i,b[524288],p,c;
for(i=0;i<n;i++){
b[i]=i;
}
for(i=n;i>=1;i--){
p=rand()%i;
c=b[i-1];b[i-1]=b[p];b[p]=c;
}
for(i=0;i<n;i++){
scanf("%d",&x[b[i]]);
}
}
int dx4[4]={1,-1,0,0};
int dy4[4]={0,0,1,-1};
int dx8[8]={-1,-1,-1,0,0,1,1,1};
int dy8[8]={-1,0,1,-1,1,-1,0,1};
int search(int x,int a[],int n){
int st=0,fi=n-1,te;
while(st<=fi){
te=(st+fi)/2;
if(a[te]<x){st=te+1;}else{fi=te-1;}
}
return st;
}
void prarr(int arr[],int n){
int i;
for(i=0;i<n;i++){
if(i){printf(" ");}
printf("%d",arr[i]);
}
printf("\n");
return;
}
void getperm(int a[],int n){
int i,p;
for(i=0;i<n;i++){
a[i]=i;
}
for(i=n-1;i>=1;i--){
p=rand()%(i+1);
swap(&a[p],&a[i]);
}
}
typedef struct{
int val;
int node;
}sd;
int sdsortfnc(const void *a,const void *b){
if(((sd*)a)->val < ((sd*)b)->val){return -1;}
if(((sd*)a)->val > ((sd*)b)->val){return 1;}
return 0;
}
void coordinate_comp(int a[],int n){
int i,c=0;
sd dat[524288];
for(i=0;i<n;i++){
dat[i].val=a[i];
dat[i].node=i;
}
qsort(dat,n,sizeof(dat[0]),sdsortfnc);
a[dat[0].node]=c;
for(i=1;i<n;i++){
if(dat[i-1].val!=dat[i].val){c++;}
a[dat[i].node]=c;
}
}
int main(void){
double edg;
int i,j,n,m,k,a[524288],b,c,h,w,r=0,l,t;
scanf("%d",&n);
edg=n;edg/=3.0;
printf("%.12lf\n",edg*edg*edg);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206586/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206586/source.c"
target datalayout = "e-m:e-p270: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.sd = type { i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16
@dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16
@dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16
@dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16
@.str.3 = private unnamed_addr constant [8 x i8] c"%.12lf\0A\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i32 %a, %b
%sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true)
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%mul = shl nsw i32 %rem, 1
%cmp.not = icmp sge i32 %mul, %b
%div1 = sdiv i32 %a, %b
%add = zext i1 %cmp.not to i32
%retval.0 = add nsw i32 %div1, %add
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %a, %b
%add = zext i1 %cmp to i32
%retval.0 = add nsw i32 %div, %add
ret i32 %retval.0
}
; 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:
%cmp.not4 = icmp eq i32 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.06, %b.addr.05
%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.05, %while.body ]
ret i32 %a.addr.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i32 %b, 0
br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.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, %entry
%a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i32 %a, %a.addr.0.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i32 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i32 %a, 1
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, 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 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i32 %add, %i.07
%mul = mul nsw i32 %r.08, %sub
%div = sdiv i32 %mul, %i.07
%inc = add nuw i32 %i.07, 1
%sub.1 = sub i32 %add, %inc
%mul.1 = mul nsw i32 %div, %sub.1
%div.1 = sdiv i32 %mul.1, %inc
%inc.1 = add nuw i32 %i.07, 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 !7
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.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
%sub.epil = sub i32 %add, %i.07.unr
%mul.epil = mul nsw i32 %r.08.unr, %sub.epil
%div.epil = sdiv i32 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %b, %a
%cmp.not6.i = icmp slt i32 %b, 1
br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i32 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i32 %add, %i.07.i
%mul.i = mul nsw i32 %sub.i, %r.08.i
%div.i = sdiv i32 %mul.i, %i.07.i
%inc.i = add nuw i32 %i.07.i, 1
%sub.i.1 = sub i32 %add, %inc.i
%mul.i.1 = mul nsw i32 %sub.i.1, %div.i
%div.i.1 = sdiv i32 %mul.i.1, %inc.i
%inc.i.1 = add nuw i32 %i.07.i, 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 %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7
nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i32 %add, %i.07.i.unr
%mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr
br label %nCr.exit
nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i32 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i32 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %a, 8
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %a, -8
%ind.end = or i32 %n.vec, 1
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> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = mul <4 x i32> %vec.phi, %vec.ind
%1 = mul <4 x i32> %vec.phi7, %step.add
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %a
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ]
%i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ]
%mul = mul nsw i32 %r.06, %i.05
%inc = add nuw i32 %i.05, 1
%exitcond.not = icmp eq i32 %i.05, %a
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i32 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %b, 8
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %b, -8
%ind.end = or i32 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%0 = mul <4 x i32> %vec.phi, %broadcast.splat
%1 = mul <4 x i32> %vec.phi6, %broadcast.splat
%index.next = add nuw i32 %index, 8
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %b
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ]
%i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ]
%mul = mul nsw i32 %r.05, %a
%inc = add nuw i32 %i.04, 1
%exitcond.not = icmp eq i32 %i.04, %b
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i32 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.05, 10
%add = add nsw i32 %r.06, %rem
%div = sdiv i32 %x.addr.05, 10
%x.addr.05.off = add i32 %x.addr.05, 9
%tobool.not = icmp ult i32 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i32 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.06, %b
%add = add nsw i32 %rem, %r.07
%div = sdiv i32 %x.addr.06, %b
%tobool.not = icmp eq i32 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i32 %x, 1
%mul = mul nsw i32 %add, %x
%div = sdiv i32 %mul, 2
ret i32 %div
}
; 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 #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !16
%1 = load i32, ptr %b, align 4, !tbaa !16
store i32 %1, ptr %a, align 4, !tbaa !16
store i32 %0, ptr %b, align 4, !tbaa !16
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i64 %a, %b
%sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true)
ret i64 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%mul = shl nsw i64 %rem, 1
%cmp.not = icmp sge i64 %mul, %b
%div1 = sdiv i64 %a, %b
%add = zext i1 %cmp.not to i64
%retval.0 = add nsw i64 %div1, %add
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %a, %b
%add = zext i1 %cmp to i64
%retval.0 = add nsw i64 %div, %add
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i64 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i64 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !20
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i64 %a.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i64 %b, 0
br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i64 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !20
llgcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i64 %a, %a.addr.0.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i64 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i64 %a, 1
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i64 %add, %i.07
%mul = mul nsw i64 %r.08, %sub
%div = sdiv i64 %mul, %i.07
%inc = add nuw i64 %i.07, 1
%sub.1 = sub i64 %add, %inc
%mul.1 = mul nsw i64 %div, %sub.1
%div.1 = sdiv i64 %mul.1, %inc
%inc.1 = add nuw i64 %i.07, 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 !21
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.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
%sub.epil = sub i64 %add, %i.07.unr
%mul.epil = mul nsw i64 %r.08.unr, %sub.epil
%div.epil = sdiv i64 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i64 %b, %a
%cmp.not6.i = icmp slt i64 %b, 1
br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i64 %add, %i.07.i
%mul.i = mul nsw i64 %sub.i, %r.08.i
%div.i = sdiv i64 %mul.i, %i.07.i
%inc.i = add nuw i64 %i.07.i, 1
%sub.i.1 = sub i64 %add, %inc.i
%mul.i.1 = mul nsw i64 %sub.i.1, %div.i
%div.i.1 = sdiv i64 %mul.i.1, %inc.i
%inc.i.1 = add nuw i64 %i.07.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 %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !21
llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i64 %add, %i.07.i.unr
%mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr
br label %llnCr.exit
llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i64 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i64 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %a, 7
%0 = icmp ult i64 %a, 8
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 %a, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.06, %i.05
%inc = add nuw nsw i64 %i.05, 1
%mul.1 = mul nsw i64 %mul, %inc
%inc.1 = add nuw nsw i64 %i.05, 2
%mul.2 = mul nsw i64 %mul.1, %inc.1
%inc.2 = add nuw nsw i64 %i.05, 3
%mul.3 = mul nsw i64 %mul.2, %inc.2
%inc.3 = add nuw nsw i64 %i.05, 4
%mul.4 = mul nsw i64 %mul.3, %inc.3
%inc.4 = add nuw nsw i64 %i.05, 5
%mul.5 = mul nsw i64 %mul.4, %inc.4
%inc.5 = add nuw nsw i64 %i.05, 6
%mul.6 = mul nsw i64 %mul.5, %inc.5
%inc.6 = add nuw i64 %i.05, 7
%mul.7 = mul nsw i64 %mul.6, %inc.6
%inc.7 = add nuw i64 %i.05, 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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !22
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %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
%r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ]
%i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.06.epil, %i.05.epil
%inc.epil = add nuw i64 %i.05.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 !23
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i64 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
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 %b, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.05, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !25
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.05.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !26
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i64 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.05, 10
%add = add nsw i64 %r.06, %rem
%div = sdiv i64 %x.addr.05, 10
%x.addr.05.off = add i64 %x.addr.05, 9
%tobool.not = icmp ult i64 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !27
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i64 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.06, %b
%add = add nsw i64 %rem, %r.07
%div = sdiv i64 %x.addr.06, %b
%tobool.not = icmp eq i64 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !28
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i64 %x, 1
%mul = mul nsw i64 %add, %x
%div = sdiv i64 %mul, 2
ret i64 %div
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @llswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
store i64 %1, ptr %a, align 8, !tbaa !29
store i64 %0, ptr %b, align 8, !tbaa !29
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp ogt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp olt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp.i = fcmp ogt double %a, %b
%a.b.i = select i1 %cmp.i, double %a, double %b
%cmp.i4 = fcmp olt double %a, %b
%a.b.i5 = select i1 %cmp.i4, double %a, double %b
%sub = fsub double %a.b.i, %a.b.i5
ret double %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @dbswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
store double %1, ptr %a, align 8, !tbaa !31
store double %0, ptr %b, align 8, !tbaa !31
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @chswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
store i8 %1, ptr %a, align 1, !tbaa !33
store i8 %0, ptr %b, align 1, !tbaa !33
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !16
%1 = load i32, ptr %b, align 4, !tbaa !16
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !16
%1 = load i32, ptr %b, align 4, !tbaa !16
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp ogt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #16
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #16
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp sgt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nounwind uwtable
define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #8 {
entry:
%b = alloca [524288 x i32], align 16
call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #17
%cmp40 = icmp sgt i32 %n, 0
br i1 %cmp40, label %for.body.preheader, label %for.end25
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader57, 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.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !16
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 16, !tbaa !16
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !34
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader57
for.body.preheader57: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond1.preheader: ; preds = %for.body, %middle.block
br i1 %cmp40, label %for.body3.preheader, label %for.end25
for.body3.preheader: ; preds = %for.cond1.preheader
%3 = zext i32 %n to i64
br label %for.body3
for.body: ; preds = %for.body.preheader57, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader57 ]
%arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 4, !tbaa !16
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !35
for.cond15.preheader: ; preds = %for.body3
br i1 %cmp40, label %for.body17.preheader, label %for.end25
for.body17.preheader: ; preds = %for.cond15.preheader
%wide.trip.count54 = zext i32 %n to i64
br label %for.body17
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv47 = phi i64 [ %3, %for.body3.preheader ], [ %indvars.iv.next48, %for.body3 ]
%call = tail call i32 @rand() #17
%5 = trunc i64 %indvars.iv47 to i32
%rem = srem i32 %call, %5
%indvars.iv.next48 = add nsw i64 %indvars.iv47, -1
%idxprom4 = and i64 %indvars.iv.next48, 4294967295
%arrayidx5 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom4
%6 = load i32, ptr %arrayidx5, align 4, !tbaa !16
%idxprom6 = sext i32 %rem to i64
%arrayidx7 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom6
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !16
store i32 %7, ptr %arrayidx5, align 4, !tbaa !16
store i32 %6, ptr %arrayidx7, align 4, !tbaa !16
%cmp2 = icmp ugt i64 %indvars.iv47, 1
br i1 %cmp2, label %for.body3, label %for.cond15.preheader, !llvm.loop !36
for.body17: ; preds = %for.body17.preheader, %for.body17
%indvars.iv50 = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next51, %for.body17 ]
%arrayidx19 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv50
%8 = load i32, ptr %arrayidx19, align 4, !tbaa !16
%idxprom20 = sext i32 %8 to i64
%arrayidx21 = getelementptr inbounds i32, ptr %x, i64 %idxprom20
%call22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx21)
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%exitcond55.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count54
br i1 %exitcond55.not, label %for.end25, label %for.body17, !llvm.loop !37
for.end25: ; preds = %for.body17, %entry, %for.cond1.preheader, %for.cond15.preheader
call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #17
ret void
}
; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #11 {
entry:
%cmp.not9 = icmp slt i32 %n, 1
br i1 %cmp.not9, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ]
%fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ]
%add = add nsw i32 %st.011, %fi.010
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !16
%cmp1 = icmp slt i32 %0, %x
%add2 = add nsw i32 %div, 1
%sub3 = add nsw i32 %div, -1
%fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3
%st.1 = select i1 %cmp1, i32 %add2, i32 %st.011
%cmp.not = icmp sgt i32 %st.1, %fi.1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !38
while.end: ; preds = %while.body, %entry
%st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ]
ret i32 %st.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @prarr(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #12 {
entry:
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%.pre = load i32, ptr %arr, align 4, !tbaa !16
%call1.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %n, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar6 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !16
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !39
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nounwind uwtable
define dso_local void @getperm(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #8 {
entry:
%cmp20 = icmp sgt i32 %n, 0
br i1 %cmp20, label %for.body.preheader, label %for.end9
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
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, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds i32, ptr %a, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 4, !tbaa !16
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 4, !tbaa !16
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !41
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond1.preheader, 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.cond1.preheader: ; preds = %for.body, %middle.block
%cmp222 = icmp sgt i32 %n, 1
br i1 %cmp222, label %for.body3.preheader, label %for.end9
for.body3.preheader: ; preds = %for.cond1.preheader
%3 = zext i32 %n to i64
br label %for.body3
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 i32, ptr %a, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 4, !tbaa !16
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !42
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv25 = phi i64 [ %3, %for.body3.preheader ], [ %indvars.iv.next26, %for.body3 ]
%indvars.iv.next26 = add nsw i64 %indvars.iv25, -1
%call = tail call i32 @rand() #17
%5 = trunc i64 %indvars.iv25 to i32
%rem = srem i32 %call, %5
%idxprom4 = sext i32 %rem to i64
%arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %idxprom4
%idxprom6 = and i64 %indvars.iv.next26, 4294967295
%arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %idxprom6
%6 = load i32, ptr %arrayidx5, align 4, !tbaa !16
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !16
store i32 %7, ptr %arrayidx5, align 4, !tbaa !16
store i32 %6, ptr %arrayidx7, align 4, !tbaa !16
%cmp2 = icmp ugt i64 %indvars.iv25, 2
br i1 %cmp2, label %for.body3, label %for.end9, !llvm.loop !43
for.end9: ; preds = %for.body3, %entry, %for.cond1.preheader
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !44
%1 = load i32, ptr %b, align 4, !tbaa !44
%cmp = icmp slt i32 %0, %1
%cmp4 = icmp sgt i32 %0, %1
%. = zext i1 %cmp4 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @coordinate_comp(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #12 {
entry:
%dat = alloca [524288 x %struct.sd], align 16
call void @llvm.lifetime.start.p0(i64 4194304, ptr nonnull %dat) #17
%cmp46 = icmp sgt i32 %n, 0
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 4
br i1 %min.iters.check, label %for.body.preheader61, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
%0 = or i64 %index, 2
%1 = getelementptr inbounds i32, ptr %a, i64 %index
%wide.load = load <2 x i32>, ptr %1, align 4, !tbaa !16
%2 = getelementptr inbounds i32, ptr %1, i64 2
%wide.load59 = load <2 x i32>, ptr %2, align 4, !tbaa !16
%3 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %index
%4 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %0
%interleaved.vec = shufflevector <2 x i32> %wide.load, <2 x i32> %vec.ind, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec, ptr %3, align 16, !tbaa !16
%interleaved.vec60 = shufflevector <2 x i32> %wide.load59, <2 x i32> %step.add, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec60, ptr %4, align 16, !tbaa !16
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !46
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.preheader61
for.body.preheader61: ; 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.preheader61, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%6 = load i32, ptr %arrayidx, align 4, !tbaa !16
%arrayidx2 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv
store i32 %6, ptr %arrayidx2, align 8, !tbaa !44
%node = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv, i32 1
%7 = trunc i64 %indvars.iv to i32
store i32 %7, ptr %node, align 4, !tbaa !47
%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 !48
for.end: ; preds = %for.body, %middle.block, %entry
%conv = sext i32 %n to i64
call void @qsort(ptr noundef nonnull %dat, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @sdsortfnc) #17
%node6 = getelementptr inbounds %struct.sd, ptr %dat, i64 0, i32 1
%8 = load i32, ptr %node6, align 4, !tbaa !47
%idxprom7 = sext i32 %8 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %a, i64 %idxprom7
store i32 0, ptr %arrayidx8, align 4, !tbaa !16
%cmp1048 = icmp sgt i32 %n, 1
br i1 %cmp1048, label %for.body12.preheader, label %for.end29
for.body12.preheader: ; preds = %for.end
%wide.trip.count56 = zext i32 %n to i64
%.pre = load i32, ptr %dat, align 16, !tbaa !44
%9 = add nsw i64 %wide.trip.count56, -1
%xtraiter = and i64 %9, 1
%10 = icmp eq i32 %n, 2
br i1 %10, label %for.end29.loopexit.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i64 %9, -2
br label %for.body12
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%11 = phi i32 [ %.pre, %for.body12.preheader.new ], [ %14, %for.body12 ]
%indvars.iv52 = phi i64 [ 1, %for.body12.preheader.new ], [ %indvars.iv.next53.1, %for.body12 ]
%c.050 = phi i32 [ 0, %for.body12.preheader.new ], [ %spec.select.1, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ]
%arrayidx17 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52
%12 = load i32, ptr %arrayidx17, align 8, !tbaa !44
%cmp19.not = icmp ne i32 %11, %12
%inc21 = zext i1 %cmp19.not to i32
%spec.select = add nuw nsw i32 %c.050, %inc21
%node24 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52, i32 1
%13 = load i32, ptr %node24, align 4, !tbaa !47
%idxprom25 = sext i32 %13 to i64
%arrayidx26 = getelementptr inbounds i32, ptr %a, i64 %idxprom25
store i32 %spec.select, ptr %arrayidx26, align 4, !tbaa !16
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%arrayidx17.1 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv.next53
%14 = load i32, ptr %arrayidx17.1, align 8, !tbaa !44
%cmp19.not.1 = icmp ne i32 %12, %14
%inc21.1 = zext i1 %cmp19.not.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc21.1
%node24.1 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv.next53, i32 1
%15 = load i32, ptr %node24.1, align 4, !tbaa !47
%idxprom25.1 = sext i32 %15 to i64
%arrayidx26.1 = getelementptr inbounds i32, ptr %a, i64 %idxprom25.1
store i32 %spec.select.1, ptr %arrayidx26.1, align 4, !tbaa !16
%indvars.iv.next53.1 = add nuw nsw i64 %indvars.iv52, 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.end29.loopexit.unr-lcssa, label %for.body12, !llvm.loop !49
for.end29.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%.unr = phi i32 [ %.pre, %for.body12.preheader ], [ %14, %for.body12 ]
%indvars.iv52.unr = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next53.1, %for.body12 ]
%c.050.unr = phi i32 [ 0, %for.body12.preheader ], [ %spec.select.1, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end29, label %for.body12.epil
for.body12.epil: ; preds = %for.end29.loopexit.unr-lcssa
%arrayidx17.epil = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52.unr
%16 = load i32, ptr %arrayidx17.epil, align 8, !tbaa !44
%cmp19.not.epil = icmp ne i32 %.unr, %16
%inc21.epil = zext i1 %cmp19.not.epil to i32
%spec.select.epil = add nuw nsw i32 %c.050.unr, %inc21.epil
%node24.epil = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52.unr, i32 1
%17 = load i32, ptr %node24.epil, align 4, !tbaa !47
%idxprom25.epil = sext i32 %17 to i64
%arrayidx26.epil = getelementptr inbounds i32, ptr %a, i64 %idxprom25.epil
store i32 %spec.select.epil, ptr %arrayidx26.epil, align 4, !tbaa !16
br label %for.end29
for.end29: ; preds = %for.body12.epil, %for.end29.loopexit.unr-lcssa, %for.end
call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %dat) #17
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #13
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #12 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #17
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !16
%conv = sitofp i32 %0 to double
%div = fdiv double %conv, 3.000000e+00
%mul = fmul double %div, %div
%mul1 = fmul double %div, %mul
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, double noundef %mul1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #17
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #15
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { 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 #12 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #13 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #14 = { nofree nounwind }
attributes #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #16 = { nounwind willreturn memory(read) }
attributes #17 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6, !9, !10}
!9 = !{!"llvm.loop.isvectorized", i32 1}
!10 = !{!"llvm.loop.unroll.runtime.disable"}
!11 = distinct !{!11, !6, !10, !9}
!12 = distinct !{!12, !6, !9, !10}
!13 = distinct !{!13, !6, !10, !9}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !18, i64 0}
!18 = !{!"omnipotent char", !19, i64 0}
!19 = !{!"Simple C/C++ TBAA"}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !6}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
!25 = distinct !{!25, !6}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !6}
!28 = distinct !{!28, !6}
!29 = !{!30, !30, i64 0}
!30 = !{!"long long", !18, i64 0}
!31 = !{!32, !32, i64 0}
!32 = !{!"double", !18, i64 0}
!33 = !{!18, !18, i64 0}
!34 = distinct !{!34, !6, !9, !10}
!35 = distinct !{!35, !6, !10, !9}
!36 = distinct !{!36, !6}
!37 = distinct !{!37, !6}
!38 = distinct !{!38, !6}
!39 = distinct !{!39, !6, !40}
!40 = !{!"llvm.loop.peeled.count", i32 1}
!41 = distinct !{!41, !6, !9, !10}
!42 = distinct !{!42, !6, !10, !9}
!43 = distinct !{!43, !6}
!44 = !{!45, !17, i64 0}
!45 = !{!"", !17, i64 0, !17, i64 4}
!46 = distinct !{!46, !6, !9, !10}
!47 = !{!45, !17, i64 4}
!48 = distinct !{!48, !6, !10, !9}
!49 = distinct !{!49, !6}
|
#include<stdio.h>
#include<stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node * Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x){
while(x->left!=NIL)
x=x->left;
return x;
}
Node treeMaximum(Node x){
while(x->right!=NIL)
x=x->right;
return x;
}
Node treeSearch(Node u, int k){
if(u == NIL || k == u->key) return u;
if (k < u->key)
return treeSearch(u->left, k);
else
return treeSearch(u->right, k);
}
Node treeSuccessor(Node x){
Node y;
if (x->right != NIL)
return treeMinimum(x->right); // case 1
y = x->parent;
while (y != NIL && x == y->right) {
x = y;
y = y->parent;
}
return y; // case 2
}
void treeDelete(Node z){
Node y; // node to be deleted
Node x; // child of y
if (z->left == NIL || z->right == NIL)
y=z;
else y =treeSuccessor(z);
if (y->left != NIL)
x = y->left;
else
x = y->right;
if (x != NIL)
x->parent = y->parent;
if( y->parent == NIL)
root = x;
else if( y == y->parent->left)
y->parent->left = x;
else
y->parent->right = x;
if( y != z)
z->key = y->key;
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x!=NIL) {
y=x;
if(z->key < x->key) x = x->left;
else x = x->right;
}
z->parent = y;
if (y == NIL) root =z;
else if (z->key < y->key) y->left = z;
else y->right = z;
}
void inorder(Node u){
if(u==NIL) return;
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
void preorder(Node u){
if(u==NIL) return;
printf(" %d",u->key);
preorder(u->left);
preorder(u->right);
}
int main(){
int n, i, x;
char com[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
} else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( com[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
}
else if ( com[0] == 'd' ){
scanf("%d", &x);
treeDelete(treeSearch(root, x));
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206636/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206636/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { ptr, ptr, ptr, i32 }
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMaximum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%0 = load ptr, ptr %x.addr.0, align 8, !tbaa !13
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !14
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp14 = icmp eq ptr %u, null
br i1 %cmp14, label %return, label %lor.lhs.false
lor.lhs.false: ; preds = %entry, %if.end
%u.tr15 = phi ptr [ %u.tr.be, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr15, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !15
%cmp1 = icmp eq i32 %0, %k
br i1 %cmp1, label %return, label %if.end
if.end: ; preds = %lor.lhs.false
%cmp3 = icmp sgt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %u.tr15, i64 0, i32 1
%spec.select = select i1 %cmp3, ptr %left, ptr %u.tr15
%u.tr.be = load ptr, ptr %spec.select, align 8, !tbaa !16
%cmp = icmp eq ptr %u.tr.be, null
br i1 %cmp, label %return, label %lor.lhs.false
return: ; preds = %lor.lhs.false, %if.end, %entry
%retval.0 = phi ptr [ null, %entry ], [ null, %if.end ], [ %u.tr15, %lor.lhs.false ]
ret ptr %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !13
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %cleanup, label %while.cond.i, !llvm.loop !11
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !17
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %cleanup, label %land.rhs
land.rhs: ; preds = %while.cond
%2 = load ptr, ptr %y.0, align 8, !tbaa !13
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %cleanup, !llvm.loop !18
cleanup: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load ptr, ptr %z, align 8, !tbaa !13
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !5
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !11
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%3 = load ptr, ptr %y.0.ph, align 8, !tbaa !13
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.058 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.054 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%parent = getelementptr inbounds %struct.node, ptr %y.058, i64 0, i32 2
%4 = load ptr, ptr %parent, align 8, !tbaa !17
%parent11 = getelementptr inbounds %struct.node, ptr %x.054, i64 0, i32 2
store ptr %4, ptr %parent11, align 8, !tbaa !17
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.060 = phi ptr [ %y.058, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.055 = phi ptr [ %x.054, %if.then10 ], [ null, %if.end8 ]
%parent13 = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 2
%5 = load ptr, ptr %parent13, align 8, !tbaa !17
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %left18, align 8, !tbaa !5
%cmp19 = icmp eq ptr %y.060, %6
%left18. = select i1 %cmp19, ptr %left18, ptr %5
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %left18., %if.else16 ]
store ptr %x.055, ptr %left18.sink, align 8, !tbaa !16
%cmp28.not = icmp eq ptr %y.060, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !15
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !15
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !16
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !15
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !15
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !16
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !19
if.then7: ; preds = %entry
%parent37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %parent37, align 8, !tbaa !17
br label %if.end17
if.else8: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %parent, align 8, !tbaa !17
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !15
%cmp11 = icmp sgt i32 %2, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%left13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !16
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @inorder(ptr noundef %0)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !15
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !13
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !15
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @preorder(ptr noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !13
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; 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
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !20
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.067 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !21
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !16
%3 = load i32, ptr %x, align 4, !tbaa !20
%cmp14.i = icmp eq ptr %2, null
br i1 %cmp14.i, label %if.else, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %if.then, %if.end.i
%u.tr15.i = phi ptr [ %u.tr.be.i, %if.end.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.tr15.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !15
%cmp1.i = icmp eq i32 %4, %3
br i1 %cmp1.i, label %if.then8, label %if.end.i
if.end.i: ; preds = %lor.lhs.false.i
%cmp3.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.tr15.i, i64 0, i32 1
%spec.select.i = select i1 %cmp3.i, ptr %left.i, ptr %u.tr15.i
%u.tr.be.i = load ptr, ptr %spec.select.i, align 8, !tbaa !16
%cmp.i = icmp eq ptr %u.tr.be.i, null
br i1 %cmp.i, label %if.else, label %lor.lhs.false.i
if.then8: ; preds = %lor.lhs.false.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %if.end.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !20
%6 = load ptr, ptr @root, align 8, !tbaa !16
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !15
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i
while.body.i: ; preds = %if.then16, %while.body.i
%x.035.i = phi ptr [ %x.1.i, %while.body.i ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !15
%cmp3.i42 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i42, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !16
%cmp.not.i = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i, label %insert.exit, label %while.body.i, !llvm.loop !19
insert.exit: ; preds = %while.body.i, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i ]
%parent37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %parent37.i, align 8, !tbaa !17
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !16
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !16
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !16
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !16
%11 = load i32, ptr %x, align 4, !tbaa !20
%cmp14.i44 = icmp eq ptr %10, null
br i1 %cmp14.i44, label %treeSearch.exit56, label %lor.lhs.false.i45
lor.lhs.false.i45: ; preds = %if.then31, %if.end.i49
%u.tr15.i46 = phi ptr [ %u.tr.be.i53, %if.end.i49 ], [ %10, %if.then31 ]
%key.i47 = getelementptr inbounds %struct.node, ptr %u.tr15.i46, i64 0, i32 3
%12 = load i32, ptr %key.i47, align 8, !tbaa !15
%cmp1.i48 = icmp eq i32 %12, %11
br i1 %cmp1.i48, label %treeSearch.exit56, label %if.end.i49
if.end.i49: ; preds = %lor.lhs.false.i45
%cmp3.i50 = icmp sgt i32 %12, %11
%left.i51 = getelementptr inbounds %struct.node, ptr %u.tr15.i46, i64 0, i32 1
%spec.select.i52 = select i1 %cmp3.i50, ptr %left.i51, ptr %u.tr15.i46
%u.tr.be.i53 = load ptr, ptr %spec.select.i52, align 8, !tbaa !16
%cmp.i54 = icmp eq ptr %u.tr.be.i53, null
br i1 %cmp.i54, label %treeSearch.exit56, label %lor.lhs.false.i45
treeSearch.exit56: ; preds = %lor.lhs.false.i45, %if.end.i49, %if.then31
%retval.0.i55 = phi ptr [ null, %if.then31 ], [ %u.tr15.i46, %lor.lhs.false.i45 ], [ null, %if.end.i49 ]
%left.i57 = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 1
%13 = load ptr, ptr %left.i57, align 8, !tbaa !5
%cmp.i58 = icmp eq ptr %13, null
br i1 %cmp.i58, label %if.end8.i, label %lor.lhs.false.i59
lor.lhs.false.i59: ; preds = %treeSearch.exit56
%14 = load ptr, ptr %retval.0.i55, align 8, !tbaa !13
%cmp1.i60 = icmp eq ptr %14, null
br i1 %cmp1.i60, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i59, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %15, %while.cond.i.i.i ], [ %14, %lor.lhs.false.i59 ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%15 = load ptr, ptr %left.i.i.i, align 8, !tbaa !5
%cmp.not.i.i.i = icmp eq ptr %15, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !11
if.end8.i: ; preds = %while.cond.i.i.i, %treeSearch.exit56
%y.0.ph.i = phi ptr [ %retval.0.i55, %treeSearch.exit56 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%16 = load ptr, ptr %y.0.ph.i, align 8, !tbaa !13
%cmp9.not.i = icmp eq ptr %16, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i59
%y.058.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %retval.0.i55, %lor.lhs.false.i59 ]
%x.054.i = phi ptr [ %16, %if.end8.i ], [ %13, %lor.lhs.false.i59 ]
%parent.i61 = getelementptr inbounds %struct.node, ptr %y.058.i, i64 0, i32 2
%17 = load ptr, ptr %parent.i61, align 8, !tbaa !17
%parent11.i = getelementptr inbounds %struct.node, ptr %x.054.i, i64 0, i32 2
store ptr %17, ptr %parent11.i, align 8, !tbaa !17
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.060.i = phi ptr [ %y.058.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.055.i = phi ptr [ %x.054.i, %if.then10.i ], [ null, %if.end8.i ]
%parent13.i = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 2
%18 = load ptr, ptr %parent13.i, align 8, !tbaa !17
%cmp14.i62 = icmp eq ptr %18, null
br i1 %cmp14.i62, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 1
%19 = load ptr, ptr %left18.i, align 8, !tbaa !5
%cmp19.i = icmp eq ptr %y.060.i, %19
%left18..i = select i1 %cmp19.i, ptr %left18.i, ptr %18
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %left18..i, %if.else16.i ]
store ptr %x.055.i, ptr %left18.sink.i, align 8, !tbaa !16
%cmp28.not.i = icmp eq ptr %y.060.i, %retval.0.i55
br i1 %cmp28.not.i, label %for.inc, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i63 = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 3
%20 = load i32, ptr %key.i63, align 8, !tbaa !15
%key30.i = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 3
store i32 %20, ptr %key30.i, align 8, !tbaa !15
br label %for.inc
for.inc: ; preds = %if.then29.i, %if.end27.i, %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %i.067, 1
%21 = load i32, ptr %n, align 4, !tbaa !20
%cmp = icmp slt i32 %inc, %21
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !22
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = !{!6, !10, i64 24}
!16 = !{!7, !7, i64 0}
!17 = !{!6, !7, i64 16}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!10, !10, i64 0}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !12}
|
#include<stdio.h>
int main()
{
long long int n,A[5005],B[5005],C[5005],count[5],j,kl,ans,i,x,k,l;
scanf("%lld",&n);
for(i=1;i<=5;i++)
count[i]=0;
j=1;k=1;l=1;
for(i=1;i<=n;i++)
{
scanf("%lld",&x);
count[x]++;
if(x==1)
A[j++]=i;
else if(x==2)
B[k++]=i;
else
C[l++]=i;
}
if((count[1]<=count[2])&&(count[1]<=count[3]))
ans=count[1];
else if((count[2]<=count[1])&&(count[2]<=count[3]))
ans=count[2];
else if((count[3]<=count[1])&&(count[3]<=count[2]))
ans=count[3];
printf("%lld\n",ans);
for(i=1;i<=ans;i++)
printf("%lld %lld %lld\n",A[i],B[i],C[i]);
//getch();
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20668/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20668/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@.str.2 = private unnamed_addr constant [16 x i8] c"%lld %lld %lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
%A = alloca [5005 x i64], align 16
%B = alloca [5005 x i64], align 16
%C = alloca [5005 x i64], align 16
%count = alloca [5 x i64], align 16
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40040, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 40040, ptr nonnull %B) #4
call void @llvm.lifetime.start.p0(i64 40040, ptr nonnull %C) #4
call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %count) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%scevgep = getelementptr inbounds i8, ptr %count, i64 8
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %scevgep, i8 0, i64 40, i1 false), !tbaa !5
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp2.not82 = icmp slt i64 %0, 1
br i1 %cmp2.not82, label %for.end20, label %for.body3
for.body3: ; preds = %entry, %for.inc18
%l.086 = phi i64 [ %l.1, %for.inc18 ], [ 1, %entry ]
%k.085 = phi i64 [ %k.1, %for.inc18 ], [ 1, %entry ]
%i.184 = phi i64 [ %inc19, %for.inc18 ], [ 1, %entry ]
%j.083 = phi i64 [ %j.1, %for.inc18 ], [ 1, %entry ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%1 = load i64, ptr %x, align 8, !tbaa !5
%arrayidx5 = getelementptr inbounds [5 x i64], ptr %count, i64 0, i64 %1
%2 = load i64, ptr %arrayidx5, align 8, !tbaa !5
%inc6 = add nsw i64 %2, 1
store i64 %inc6, ptr %arrayidx5, align 8, !tbaa !5
switch i64 %1, label %if.else14 [
i64 1, label %if.then
i64 2, label %if.then11
]
if.then: ; preds = %for.body3
%inc8 = add nsw i64 %j.083, 1
%arrayidx9 = getelementptr inbounds [5005 x i64], ptr %A, i64 0, i64 %j.083
br label %for.inc18
if.then11: ; preds = %for.body3
%inc12 = add nsw i64 %k.085, 1
%arrayidx13 = getelementptr inbounds [5005 x i64], ptr %B, i64 0, i64 %k.085
br label %for.inc18
if.else14: ; preds = %for.body3
%inc15 = add nsw i64 %l.086, 1
%arrayidx16 = getelementptr inbounds [5005 x i64], ptr %C, i64 0, i64 %l.086
br label %for.inc18
for.inc18: ; preds = %if.then, %if.else14, %if.then11
%arrayidx9.sink = phi ptr [ %arrayidx9, %if.then ], [ %arrayidx16, %if.else14 ], [ %arrayidx13, %if.then11 ]
%j.1 = phi i64 [ %inc8, %if.then ], [ %j.083, %if.else14 ], [ %j.083, %if.then11 ]
%k.1 = phi i64 [ %k.085, %if.then ], [ %k.085, %if.else14 ], [ %inc12, %if.then11 ]
%l.1 = phi i64 [ %l.086, %if.then ], [ %inc15, %if.else14 ], [ %l.086, %if.then11 ]
store i64 %i.184, ptr %arrayidx9.sink, align 8, !tbaa !5
%inc19 = add nuw nsw i64 %i.184, 1
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp2.not.not = icmp slt i64 %i.184, %3
br i1 %cmp2.not.not, label %for.body3, label %for.end20.loopexit, !llvm.loop !9
for.end20.loopexit: ; preds = %for.inc18
%.pre = load i64, ptr %scevgep, align 8, !tbaa !5
%arrayidx22.phi.trans.insert = getelementptr inbounds [5 x i64], ptr %count, i64 0, i64 2
%.pre89 = load i64, ptr %arrayidx22.phi.trans.insert, align 16, !tbaa !5
%arrayidx25.phi.trans.insert = getelementptr inbounds [5 x i64], ptr %count, i64 0, i64 3
%.pre90 = load i64, ptr %arrayidx25.phi.trans.insert, align 8
br label %for.end20
for.end20: ; preds = %for.end20.loopexit, %entry
%4 = phi i64 [ %.pre90, %for.end20.loopexit ], [ 0, %entry ]
%5 = phi i64 [ %.pre89, %for.end20.loopexit ], [ 0, %entry ]
%6 = phi i64 [ %.pre, %for.end20.loopexit ], [ 0, %entry ]
%cmp23.not = icmp sgt i64 %6, %5
%cmp26.not = icmp sgt i64 %6, %4
%or.cond = select i1 %cmp23.not, i1 true, i1 %cmp26.not
%cmp32.not = icmp sgt i64 %5, %6
%cmp36.not = icmp sgt i64 %5, %4
%or.cond79 = select i1 %cmp32.not, i1 true, i1 %cmp36.not
%spec.select = select i1 %or.cond79, i64 %4, i64 %5
%ans.0 = select i1 %or.cond, i64 %spec.select, i64 %6
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0)
%cmp54.not87 = icmp slt i64 %ans.0, 1
br i1 %cmp54.not87, label %for.end62, label %for.body55
for.body55: ; preds = %for.end20, %for.body55
%i.288 = phi i64 [ %inc61, %for.body55 ], [ 1, %for.end20 ]
%arrayidx56 = getelementptr inbounds [5005 x i64], ptr %A, i64 0, i64 %i.288
%7 = load i64, ptr %arrayidx56, align 8, !tbaa !5
%arrayidx57 = getelementptr inbounds [5005 x i64], ptr %B, i64 0, i64 %i.288
%8 = load i64, ptr %arrayidx57, align 8, !tbaa !5
%arrayidx58 = getelementptr inbounds [5005 x i64], ptr %C, i64 0, i64 %i.288
%9 = load i64, ptr %arrayidx58, align 8, !tbaa !5
%call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %7, i64 noundef %8, i64 noundef %9)
%inc61 = add nuw i64 %i.288, 1
%exitcond.not = icmp eq i64 %i.288, %ans.0
br i1 %exitcond.not, label %for.end62, label %for.body55, !llvm.loop !11
for.end62: ; preds = %for.body55, %for.end20
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4
call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %count) #4
call void @llvm.lifetime.end.p0(i64 40040, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 40040, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 40040, 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 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
int main()
{
int a[200000][2],i,j,k,n,an[200001],fl[1000001];
long long l=0,r=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d%d",&a[i][0],&a[i][1]);
fl[a[i][0]]=i+1;
l=l+a[i][0];
r=r+a[i][1];
}
for(i=0;i<n;i++)
{
if(fl[a[i][1]]==0)
{
k=a[i][1];
break;
}
}
r=r-k;
l=l-r;
an[1]=l;
an[n]=r;
an[2]=a[fl[0]-1][1];
for(i=3;i<=n;i++)
{
an[i]=a[fl[an[i-2]]-1][1];
}
for(i=1;i<=n;i++)
printf("%d ",an[i]);
return(0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20673/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20673/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [200000 x [2 x i32]], align 16
%n = alloca i32, align 4
%an = alloca [200001 x i32], align 16
%fl = alloca [1000001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %an) #3
call void @llvm.lifetime.start.p0(i64 4000004, ptr nonnull %fl) #3
%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.end36
for.cond20.preheader: ; preds = %for.body
%cmp21107 = icmp sgt i32 %4, 0
br i1 %cmp21107, label %for.body23.preheader, label %for.end36
for.body23.preheader: ; preds = %for.cond20.preheader
%wide.trip.count = zext i32 %4 to i64
br label %for.body23
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%r.0104 = phi i64 [ %add19, %for.body ], [ 0, %entry ]
%l.0103 = phi i64 [ %add14, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200000 x [2 x i32]], ptr %a, i64 0, i64 %indvars.iv
%arrayidx4 = getelementptr inbounds [200000 x [2 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 1
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %arrayidx, align 8, !tbaa !5
%idxprom9 = sext i32 %1 to i64
%arrayidx10 = getelementptr inbounds [1000001 x i32], ptr %fl, i64 0, i64 %idxprom9
%2 = trunc i64 %indvars.iv.next to i32
store i32 %2, ptr %arrayidx10, align 4, !tbaa !5
%add14 = add nsw i64 %l.0103, %idxprom9
%3 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%conv18129 = zext i32 %3 to i64
%add19 = add i64 %r.0104, %conv18129
%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.cond20.preheader, !llvm.loop !9
for.cond20: ; preds = %for.body23
%indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1
%exitcond.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count
br i1 %exitcond.not, label %for.end36, label %for.body23, !llvm.loop !11
for.body23: ; preds = %for.body23.preheader, %for.cond20
%indvars.iv117 = phi i64 [ 0, %for.body23.preheader ], [ %indvars.iv.next118, %for.cond20 ]
%arrayidx26 = getelementptr inbounds [200000 x [2 x i32]], ptr %a, i64 0, i64 %indvars.iv117, i64 1
%6 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%idxprom27 = sext i32 %6 to i64
%arrayidx28 = getelementptr inbounds [1000001 x i32], ptr %fl, i64 0, i64 %idxprom27
%7 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%cmp29 = icmp eq i32 %7, 0
br i1 %cmp29, label %for.end36, label %for.cond20
for.end36: ; preds = %for.cond20, %for.body23, %entry, %for.cond20.preheader
%8 = phi i32 [ %4, %for.cond20.preheader ], [ %0, %entry ], [ %4, %for.body23 ], [ %4, %for.cond20 ]
%r.0.lcssa134 = phi i64 [ %add19, %for.cond20.preheader ], [ 0, %entry ], [ %add19, %for.body23 ], [ %add19, %for.cond20 ]
%l.0.lcssa133 = phi i64 [ %add14, %for.cond20.preheader ], [ 0, %entry ], [ %add14, %for.body23 ], [ %add14, %for.cond20 ]
%k.0 = phi i64 [ 0, %for.cond20.preheader ], [ 0, %entry ], [ 0, %for.cond20 ], [ %idxprom27, %for.body23 ]
%sub = sub i64 %r.0.lcssa134, %k.0
%sub38 = sub i64 %l.0.lcssa133, %sub
%conv39 = trunc i64 %sub38 to i32
%arrayidx40 = getelementptr inbounds [200001 x i32], ptr %an, i64 0, i64 1
store i32 %conv39, ptr %arrayidx40, align 4, !tbaa !5
%conv41 = trunc i64 %sub to i32
%idxprom42 = sext i32 %8 to i64
%arrayidx43 = getelementptr inbounds [200001 x i32], ptr %an, i64 0, i64 %idxprom42
store i32 %conv41, ptr %arrayidx43, align 4, !tbaa !5
%9 = load i32, ptr %fl, align 16, !tbaa !5
%sub45 = add nsw i32 %9, -1
%idxprom46 = sext i32 %sub45 to i64
%arrayidx48 = getelementptr inbounds [200000 x [2 x i32]], ptr %a, i64 0, i64 %idxprom46, i64 1
%10 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%arrayidx49 = getelementptr inbounds [200001 x i32], ptr %an, i64 0, i64 2
store i32 %10, ptr %arrayidx49, align 8, !tbaa !5
%cmp51.not111 = icmp slt i32 %8, 3
br i1 %cmp51.not111, label %for.cond68.preheader, label %for.body53.preheader
for.body53.preheader: ; preds = %for.end36
%11 = zext i32 %8 to i64
%xtraiter = and i64 %11, 1
%12 = icmp eq i32 %8, 3
br i1 %12, label %for.cond68.preheader.loopexit.unr-lcssa, label %for.body53.preheader.new
for.body53.preheader.new: ; preds = %for.body53.preheader
%13 = and i64 %11, 4294967294
%14 = add nsw i64 %13, -4
br label %for.body53
for.cond68.preheader.loopexit.unr-lcssa: ; preds = %for.body53, %for.body53.preheader
%indvars.iv120.unr = phi i64 [ 3, %for.body53.preheader ], [ %indvars.iv.next121.1, %for.body53 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond68.preheader, label %for.body53.epil
for.body53.epil: ; preds = %for.cond68.preheader.loopexit.unr-lcssa
%15 = add nsw i64 %indvars.iv120.unr, -2
%arrayidx56.epil = getelementptr inbounds [200001 x i32], ptr %an, i64 0, i64 %15
%16 = load i32, ptr %arrayidx56.epil, align 4, !tbaa !5
%idxprom57.epil = sext i32 %16 to i64
%arrayidx58.epil = getelementptr inbounds [1000001 x i32], ptr %fl, i64 0, i64 %idxprom57.epil
%17 = load i32, ptr %arrayidx58.epil, align 4, !tbaa !5
%sub59.epil = add nsw i32 %17, -1
%idxprom60.epil = sext i32 %sub59.epil to i64
%arrayidx62.epil = getelementptr inbounds [200000 x [2 x i32]], ptr %a, i64 0, i64 %idxprom60.epil, i64 1
%18 = load i32, ptr %arrayidx62.epil, align 4, !tbaa !5
%arrayidx64.epil = getelementptr inbounds [200001 x i32], ptr %an, i64 0, i64 %indvars.iv120.unr
store i32 %18, ptr %arrayidx64.epil, align 4, !tbaa !5
br label %for.cond68.preheader
for.cond68.preheader: ; preds = %for.body53.epil, %for.cond68.preheader.loopexit.unr-lcssa, %for.end36
%cmp69.not113 = icmp slt i32 %8, 1
br i1 %cmp69.not113, label %for.end77, label %for.body71
for.body53: ; preds = %for.body53, %for.body53.preheader.new
%indvars.iv120 = phi i64 [ 3, %for.body53.preheader.new ], [ %indvars.iv.next121.1, %for.body53 ]
%niter = phi i64 [ 0, %for.body53.preheader.new ], [ %niter.next.1, %for.body53 ]
%19 = add nsw i64 %indvars.iv120, -2
%arrayidx56 = getelementptr inbounds [200001 x i32], ptr %an, i64 0, i64 %19
%20 = load i32, ptr %arrayidx56, align 4, !tbaa !5
%idxprom57 = sext i32 %20 to i64
%arrayidx58 = getelementptr inbounds [1000001 x i32], ptr %fl, i64 0, i64 %idxprom57
%21 = load i32, ptr %arrayidx58, align 4, !tbaa !5
%sub59 = add nsw i32 %21, -1
%idxprom60 = sext i32 %sub59 to i64
%arrayidx62 = getelementptr inbounds [200000 x [2 x i32]], ptr %a, i64 0, i64 %idxprom60, i64 1
%22 = load i32, ptr %arrayidx62, align 4, !tbaa !5
%arrayidx64 = getelementptr inbounds [200001 x i32], ptr %an, i64 0, i64 %indvars.iv120
store i32 %22, ptr %arrayidx64, align 4, !tbaa !5
%indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
%23 = add nsw i64 %indvars.iv120, -1
%arrayidx56.1 = getelementptr inbounds [200001 x i32], ptr %an, i64 0, i64 %23
%24 = load i32, ptr %arrayidx56.1, align 4, !tbaa !5
%idxprom57.1 = sext i32 %24 to i64
%arrayidx58.1 = getelementptr inbounds [1000001 x i32], ptr %fl, i64 0, i64 %idxprom57.1
%25 = load i32, ptr %arrayidx58.1, align 4, !tbaa !5
%sub59.1 = add nsw i32 %25, -1
%idxprom60.1 = sext i32 %sub59.1 to i64
%arrayidx62.1 = getelementptr inbounds [200000 x [2 x i32]], ptr %a, i64 0, i64 %idxprom60.1, i64 1
%26 = load i32, ptr %arrayidx62.1, align 4, !tbaa !5
%arrayidx64.1 = getelementptr inbounds [200001 x i32], ptr %an, i64 0, i64 %indvars.iv.next121
store i32 %26, ptr %arrayidx64.1, align 4, !tbaa !5
%indvars.iv.next121.1 = add nuw nsw i64 %indvars.iv120, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter, %14
br i1 %niter.ncmp.1, label %for.cond68.preheader.loopexit.unr-lcssa, label %for.body53, !llvm.loop !12
for.body71: ; preds = %for.cond68.preheader, %for.body71
%indvars.iv126 = phi i64 [ %indvars.iv.next127, %for.body71 ], [ 1, %for.cond68.preheader ]
%arrayidx73 = getelementptr inbounds [200001 x i32], ptr %an, i64 0, i64 %indvars.iv126
%27 = load i32, ptr %arrayidx73, align 4, !tbaa !5
%call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %27)
%indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
%28 = load i32, ptr %n, align 4, !tbaa !5
%29 = sext i32 %28 to i64
%cmp69.not.not = icmp slt i64 %indvars.iv126, %29
br i1 %cmp69.not.not, label %for.body71, label %for.end77, !llvm.loop !13
for.end77: ; preds = %for.body71, %for.cond68.preheader
call void @llvm.lifetime.end.p0(i64 4000004, ptr nonnull %fl) #3
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %an) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
typedef struct node {
int key;
struct node *p , *r , *l;
} Node;
Node *root, *NIL;
Node * treeMinimum(Node *x) {
while(x->l != NIL) x = x->l;
return x;
}
Node * find(Node *u,int k) {
while(u != NIL && k != u->key) {
if( k < u->key) u = u->l;
else u = u->r;
}
return u;
}
Node * treeSuccessor(Node *x) {
if(x->r != NIL) return treeMinimum(x->r);
Node *y = x->p;
while(y != NIL && x == y->r) {
x = y;
y = y->p;
}
return y;
}
void treeDelete(Node *z) {
Node *y;
Node *x;
if(z->l == NIL || z->r == NIL) y = z;
else y = treeSuccessor(z);
if(y->l != NIL) {
x = y->l;
} else {
x = y->r;
}
if( x != NIL) {
x->p = y->p;
}
if(y->p == NIL) {
root = x;
} else {
if(y == y->p->l){
y->p->l = x;
} else {
y->p->r = x;
}
}
if(y !=z) {
z->key = y->key;
}
free(y);
}
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->l = NIL;
z->r = NIL;
while( x != NIL) {
y = x;
if(z->key < x->key) {
x = x->l;
} else {
x = x->r;
}
}
z->p = y;
if(y == NIL) {
root = z;
}
else {
if(z->key < y->key) {
y->l = z;
} else {
y->r = z;
}
}
}
void inorder(Node *u) {
if(u == NIL) return;
inorder(u->l);
printf(" %d", u->key);
inorder(u->r);
}
void preorder(Node *u) {
if(u == NIL) return;
printf(" %d", u->key);
preorder(u->l);
preorder(u->r);
}
int main() {
int n, i , x;
char com[6];
scanf("%d",&n);
for(i = 0; i < n; i++) {
scanf("%s\n", com);
if(strcmp(com, "insert") == 0) {
scanf("%d",&x);
insert(x);
} else if(strcmp(com, "print") == 0) {
inorder(root);
printf("\n");
preorder(root);
printf("\n");
}
else if(strcmp(com,"find") == 0) {
scanf("%d",&x);
Node *t = find(root,x);
if(t != NIL) printf("yes\n");
else printf("no\n");
} else if(strcmp(com , "delete") == 0) {
scanf("%d\n", &x);
treeDelete(find(root,x));
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206773/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206773/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, ptr, ptr, ptr }
@NIL = dso_local local_unnamed_addr global ptr null, align 8
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%s\0A\00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"insert\00", align 1
@.str.4 = private unnamed_addr constant [6 x i8] c"print\00", align 1
@.str.6 = private unnamed_addr constant [5 x i8] c"find\00", align 1
@.str.9 = private unnamed_addr constant [7 x i8] c"delete\00", align 1
@.str.10 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.11 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %1, %while.cond ]
%l = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 3
%1 = load ptr, ptr %l, align 8, !tbaa !9
%cmp.not = icmp eq ptr %1, %0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !12
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @find(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10 = icmp eq ptr %0, %u
br i1 %cmp.not10, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %while.body
%u.addr.011 = phi ptr [ %u.addr.1, %while.body ], [ %u, %entry ]
%1 = load i32, ptr %u.addr.011, align 8, !tbaa !14
%cmp1.not = icmp eq i32 %1, %k
br i1 %cmp1.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp3 = icmp sgt i32 %1, %k
%l = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 3
%r = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 2
%u.addr.1.in = select i1 %cmp3, ptr %l, ptr %r
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %u.addr.1, %0
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !15
while.end: ; preds = %land.rhs, %while.body, %entry
%u.addr.0.lcssa = phi ptr [ %u, %entry ], [ %0, %while.body ], [ %u.addr.011, %land.rhs ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%r = getelementptr inbounds %struct.node, ptr %x, i64 0, i32 2
%0 = load ptr, ptr %r, align 8, !tbaa !16
%1 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, %1
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %2, %while.cond.i ], [ %0, %entry ]
%l.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 3
%2 = load ptr, ptr %l.i, align 8, !tbaa !9
%cmp.not.i = icmp eq ptr %2, %1
br i1 %cmp.not.i, label %return, label %while.cond.i, !llvm.loop !12
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !17
%cmp2.not = icmp eq ptr %y.0, %0
br i1 %cmp2.not, label %return, label %land.rhs
land.rhs: ; preds = %while.cond
%r3 = getelementptr inbounds %struct.node, ptr %y.0, i64 0, i32 2
%3 = load ptr, ptr %r3, align 8, !tbaa !16
%cmp4 = icmp eq ptr %x.addr.0, %3
br i1 %cmp4, label %while.cond, label %return, !llvm.loop !18
return: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ %0, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%l = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
%0 = load ptr, ptr %l, align 8, !tbaa !9
%1 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%r = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 2
%2 = load ptr, ptr %r, align 8, !tbaa !16
%cmp1 = icmp eq ptr %2, %1
br i1 %cmp1, label %if.end, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %3, %while.cond.i.i ], [ %2, %lor.lhs.false ]
%l.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 3
%3 = load ptr, ptr %l.i.i, align 8, !tbaa !9
%cmp.not.i.i = icmp eq ptr %3, %1
br i1 %cmp.not.i.i, label %if.else6, label %while.cond.i.i, !llvm.loop !12
if.end: ; preds = %entry, %lor.lhs.false
%cmp3.not = icmp eq ptr %0, %1
br i1 %cmp3.not, label %if.else6, label %if.end8
if.else6: ; preds = %while.cond.i.i, %if.end
%y.057 = phi ptr [ %z, %if.end ], [ %x.addr.0.i.i, %while.cond.i.i ]
%r7 = getelementptr inbounds %struct.node, ptr %y.057, i64 0, i32 2
%4 = load ptr, ptr %r7, align 8, !tbaa !16
br label %if.end8
if.end8: ; preds = %if.end, %if.else6
%y.056 = phi ptr [ %y.057, %if.else6 ], [ %z, %if.end ]
%x.0 = phi ptr [ %4, %if.else6 ], [ %0, %if.end ]
%cmp9.not = icmp eq ptr %x.0, %1
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %if.end8
%p = getelementptr inbounds %struct.node, ptr %y.056, i64 0, i32 1
%5 = load ptr, ptr %p, align 8, !tbaa !17
%p11 = getelementptr inbounds %struct.node, ptr %x.0, i64 0, i32 1
store ptr %5, ptr %p11, align 8, !tbaa !17
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%p13 = getelementptr inbounds %struct.node, ptr %y.056, i64 0, i32 1
%6 = load ptr, ptr %p13, align 8, !tbaa !17
%cmp14 = icmp eq ptr %6, %1
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%l18 = getelementptr inbounds %struct.node, ptr %6, i64 0, i32 3
%7 = load ptr, ptr %l18, align 8, !tbaa !9
%cmp19 = icmp eq ptr %y.056, %7
%r25 = getelementptr inbounds %struct.node, ptr %6, i64 0, i32 2
%spec.select = select i1 %cmp19, ptr %l18, ptr %r25
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%l18.sink = phi ptr [ @root, %if.end12 ], [ %spec.select, %if.else16 ]
store ptr %x.0, ptr %l18.sink, align 8, !tbaa !5
%cmp28.not = icmp eq ptr %y.056, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%8 = load i32, ptr %y.056, align 8, !tbaa !14
store i32 %8, ptr %z, align 8, !tbaa !14
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
tail call void @free(ptr noundef nonnull %y.056) #10
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%1 = load ptr, ptr @root, align 8, !tbaa !5
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #11
store i32 %k, ptr %call, align 8, !tbaa !14
%l = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store ptr %0, ptr %l, align 8, !tbaa !9
%r = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %0, ptr %r, align 8, !tbaa !16
%cmp.not34 = icmp eq ptr %1, %0
br i1 %cmp.not34, label %while.end.thread, label %while.body
while.end.thread: ; preds = %entry
%p37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 1
store ptr %0, ptr %p37, align 8, !tbaa !17
br label %if.end17
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %1, %entry ]
%2 = load i32, ptr %x.035, align 8, !tbaa !14
%cmp3 = icmp sgt i32 %2, %k
%l4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%r5 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 2
%x.1.in = select i1 %cmp3, ptr %l4, ptr %r5
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %x.1, %0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !19
while.end: ; preds = %while.body
%p = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 1
store ptr %x.035, ptr %p, align 8, !tbaa !17
%cmp6 = icmp eq ptr %x.035, %0
br i1 %cmp6, label %if.end17, label %if.else8
if.else8: ; preds = %while.end
%3 = load i32, ptr %x.035, align 8, !tbaa !14
%cmp11 = icmp sgt i32 %3, %k
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else8
%l13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
br label %if.end17
if.else14: ; preds = %if.else8
%r15 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 2
br label %if.end17
if.end17: ; preds = %while.end, %while.end.thread, %if.then12, %if.else14
%l13.sink = phi ptr [ %l13, %if.then12 ], [ %r15, %if.else14 ], [ @root, %while.end.thread ], [ @root, %while.end ]
store ptr %call, ptr %l13.sink, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%l = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load ptr, ptr %l, align 8, !tbaa !9
tail call void @inorder(ptr noundef %1)
%2 = load i32, ptr %u.tr5, align 8, !tbaa !14
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%r = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 2
%3 = load ptr, ptr %r, align 8, !tbaa !16
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%1 = load i32, ptr %u.tr5, align 8, !tbaa !14
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%l = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%2 = load ptr, ptr %l, align 8, !tbaa !9
tail call void @preorder(ptr noundef %2)
%r = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 2
%3 = load ptr, ptr %r, align 8, !tbaa !16
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [6 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #10
call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %com) #10
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !20
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.067 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%call3 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %com, ptr noundef nonnull dereferenceable(7) @.str.3) #12
%cmp4 = icmp eq i32 %call3, 0
br i1 %cmp4, label %if.then, label %if.else
if.then: ; preds = %for.body
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%1 = load i32, ptr %x, align 4, !tbaa !20
%2 = load ptr, ptr @NIL, align 8, !tbaa !5
%3 = load ptr, ptr @root, align 8, !tbaa !5
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #11
store i32 %1, ptr %call.i, align 8, !tbaa !14
%l.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store ptr %2, ptr %l.i, align 8, !tbaa !9
%r.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %2, ptr %r.i, align 8, !tbaa !16
%cmp.not34.i = icmp eq ptr %3, %2
br i1 %cmp.not34.i, label %while.end.thread.i, label %while.body.i
while.end.thread.i: ; preds = %if.then
%p37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 1
store ptr %2, ptr %p37.i, align 8, !tbaa !17
br label %insert.exit
while.body.i: ; preds = %if.then, %while.body.i
%x.035.i = phi ptr [ %x.1.i, %while.body.i ], [ %3, %if.then ]
%4 = load i32, ptr %x.035.i, align 8, !tbaa !14
%cmp3.i = icmp sgt i32 %4, %1
%l4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%r5.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 2
%x.1.in.i = select i1 %cmp3.i, ptr %l4.i, ptr %r5.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %x.1.i, %2
br i1 %cmp.not.i, label %while.end.i, label %while.body.i, !llvm.loop !19
while.end.i: ; preds = %while.body.i
%p.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 1
store ptr %x.035.i, ptr %p.i, align 8, !tbaa !17
%cmp6.i = icmp eq ptr %x.035.i, %2
%spec.select64 = select i1 %cmp6.i, ptr @root, ptr %x.1.in.i
br label %insert.exit
insert.exit: ; preds = %while.end.i, %while.end.thread.i
%l13.sink.i = phi ptr [ @root, %while.end.thread.i ], [ %spec.select64, %while.end.i ]
store ptr %call.i, ptr %l13.sink.i, align 8, !tbaa !5
br label %for.inc
if.else: ; preds = %for.body
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %com, ptr noundef nonnull dereferenceable(6) @.str.4, i64 6)
%cmp8 = icmp eq i32 %bcmp, 0
br i1 %cmp8, label %if.then9, label %if.else12
if.then9: ; preds = %if.else
%5 = load ptr, ptr @root, align 8, !tbaa !5
call void @inorder(ptr noundef %5)
%putchar = call i32 @putchar(i32 10)
%6 = load ptr, ptr @root, align 8, !tbaa !5
call void @preorder(ptr noundef %6)
%putchar38 = call i32 @putchar(i32 10)
br label %for.inc
if.else12: ; preds = %if.else
%bcmp36 = call i32 @bcmp(ptr noundef nonnull dereferenceable(5) %com, ptr noundef nonnull dereferenceable(5) @.str.6, i64 5)
%cmp15 = icmp eq i32 %bcmp36, 0
br i1 %cmp15, label %if.then16, label %if.else24
if.then16: ; preds = %if.else12
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%7 = load ptr, ptr @root, align 8, !tbaa !5
%8 = load i32, ptr %x, align 4, !tbaa !20
%9 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10.i = icmp eq ptr %9, %7
br i1 %cmp.not10.i, label %find.exit, label %land.rhs.i
land.rhs.i: ; preds = %if.then16, %while.body.i39
%u.addr.011.i = phi ptr [ %u.addr.1.i, %while.body.i39 ], [ %7, %if.then16 ]
%10 = load i32, ptr %u.addr.011.i, align 8, !tbaa !14
%cmp1.not.i = icmp eq i32 %10, %8
br i1 %cmp1.not.i, label %find.exit, label %while.body.i39
while.body.i39: ; preds = %land.rhs.i
%cmp3.i40 = icmp sgt i32 %10, %8
%l.i41 = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 3
%r.i42 = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 2
%u.addr.1.in.i = select i1 %cmp3.i40, ptr %l.i41, ptr %r.i42
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !5
%cmp.not.i43 = icmp eq ptr %u.addr.1.i, %9
br i1 %cmp.not.i43, label %if.else22, label %land.rhs.i, !llvm.loop !15
find.exit: ; preds = %land.rhs.i, %if.then16
%u.addr.0.lcssa.i = phi ptr [ %7, %if.then16 ], [ %u.addr.011.i, %land.rhs.i ]
%cmp19.not = icmp eq ptr %u.addr.0.lcssa.i, %9
br i1 %cmp19.not, label %if.else22, label %if.then20
if.then20: ; preds = %find.exit
%puts37 = call i32 @puts(ptr nonnull dereferenceable(1) @str.11)
br label %for.inc
if.else22: ; preds = %while.body.i39, %find.exit
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.else24: ; preds = %if.else12
%call26 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %com, ptr noundef nonnull dereferenceable(7) @.str.9) #12
%cmp27 = icmp eq i32 %call26, 0
br i1 %cmp27, label %if.then28, label %for.inc
if.then28: ; preds = %if.else24
%call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.10, ptr noundef nonnull %x)
%11 = load ptr, ptr @root, align 8, !tbaa !5
%12 = load i32, ptr %x, align 4, !tbaa !20
%13 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10.i45 = icmp eq ptr %13, %11
br i1 %cmp.not10.i45, label %find.exit58, label %land.rhs.i46
land.rhs.i46: ; preds = %if.then28, %while.body.i49
%u.addr.011.i47 = phi ptr [ %u.addr.1.i54, %while.body.i49 ], [ %11, %if.then28 ]
%14 = load i32, ptr %u.addr.011.i47, align 8, !tbaa !14
%cmp1.not.i48 = icmp eq i32 %14, %12
br i1 %cmp1.not.i48, label %find.exit58, label %while.body.i49
while.body.i49: ; preds = %land.rhs.i46
%cmp3.i50 = icmp sgt i32 %14, %12
%l.i51 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 3
%r.i52 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 2
%u.addr.1.in.i53 = select i1 %cmp3.i50, ptr %l.i51, ptr %r.i52
%u.addr.1.i54 = load ptr, ptr %u.addr.1.in.i53, align 8, !tbaa !5
%cmp.not.i55 = icmp eq ptr %u.addr.1.i54, %13
br i1 %cmp.not.i55, label %find.exit58, label %land.rhs.i46, !llvm.loop !15
find.exit58: ; preds = %land.rhs.i46, %while.body.i49, %if.then28
%u.addr.0.lcssa.i57 = phi ptr [ %11, %if.then28 ], [ %u.addr.011.i47, %land.rhs.i46 ], [ %13, %while.body.i49 ]
%l.i59 = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i57, i64 0, i32 3
%15 = load ptr, ptr %l.i59, align 8, !tbaa !9
%cmp.i = icmp eq ptr %15, %13
br i1 %cmp.i, label %if.else6.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %find.exit58
%r.i60 = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i57, i64 0, i32 2
%16 = load ptr, ptr %r.i60, align 8, !tbaa !16
%cmp1.i = icmp eq ptr %16, %13
br i1 %cmp1.i, label %if.end8.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %17, %while.cond.i.i.i ], [ %16, %lor.lhs.false.i ]
%l.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 3
%17 = load ptr, ptr %l.i.i.i, align 8, !tbaa !9
%cmp.not.i.i.i = icmp eq ptr %17, %13
br i1 %cmp.not.i.i.i, label %if.else6.i, label %while.cond.i.i.i, !llvm.loop !12
if.else6.i: ; preds = %while.cond.i.i.i, %find.exit58
%y.057.i = phi ptr [ %u.addr.0.lcssa.i57, %find.exit58 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%r7.i = getelementptr inbounds %struct.node, ptr %y.057.i, i64 0, i32 2
%18 = load ptr, ptr %r7.i, align 8, !tbaa !16
br label %if.end8.i
if.end8.i: ; preds = %lor.lhs.false.i, %if.else6.i
%y.056.i = phi ptr [ %y.057.i, %if.else6.i ], [ %u.addr.0.lcssa.i57, %lor.lhs.false.i ]
%x.0.i = phi ptr [ %18, %if.else6.i ], [ %15, %lor.lhs.false.i ]
%cmp9.not.i = icmp eq ptr %x.0.i, %13
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i
%p.i61 = getelementptr inbounds %struct.node, ptr %y.056.i, i64 0, i32 1
%19 = load ptr, ptr %p.i61, align 8, !tbaa !17
%p11.i = getelementptr inbounds %struct.node, ptr %x.0.i, i64 0, i32 1
store ptr %19, ptr %p11.i, align 8, !tbaa !17
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%p13.i = getelementptr inbounds %struct.node, ptr %y.056.i, i64 0, i32 1
%20 = load ptr, ptr %p13.i, align 8, !tbaa !17
%cmp14.i = icmp eq ptr %20, %13
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%l18.i = getelementptr inbounds %struct.node, ptr %20, i64 0, i32 3
%21 = load ptr, ptr %l18.i, align 8, !tbaa !9
%cmp19.i = icmp eq ptr %y.056.i, %21
%r25.i = getelementptr inbounds %struct.node, ptr %20, i64 0, i32 2
%spec.select.i = select i1 %cmp19.i, ptr %l18.i, ptr %r25.i
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%l18.sink.i = phi ptr [ @root, %if.end12.i ], [ %spec.select.i, %if.else16.i ]
store ptr %x.0.i, ptr %l18.sink.i, align 8, !tbaa !5
%cmp28.not.i = icmp eq ptr %y.056.i, %u.addr.0.lcssa.i57
br i1 %cmp28.not.i, label %treeDelete.exit, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%22 = load i32, ptr %y.056.i, align 8, !tbaa !14
store i32 %22, ptr %u.addr.0.lcssa.i57, align 8, !tbaa !14
br label %treeDelete.exit
treeDelete.exit: ; preds = %if.end27.i, %if.then29.i
call void @free(ptr noundef nonnull %y.056.i) #10
br label %for.inc
for.inc: ; preds = %if.then20, %if.else22, %insert.exit, %treeDelete.exit, %if.else24, %if.then9
%inc = add nuw nsw i32 %i.067, 1
%23 = load i32, ptr %n, align 4, !tbaa !20
%cmp = icmp slt i32 %inc, %23
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !21
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %com) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #9
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: 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 #8 = { nofree nounwind willreturn memory(argmem: read) }
attributes #9 = { nofree nounwind }
attributes #10 = { nounwind }
attributes #11 = { nounwind allocsize(0) }
attributes #12 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"node", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!10, !11, i64 0}
!15 = distinct !{!15, !13}
!16 = !{!10, !6, i64 16}
!17 = !{!10, !6, i64 8}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = !{!11, !11, i64 0}
!21 = distinct !{!21, !13}
|
#include<stdio.h>
#include<stdlib.h>
#define NIL NULL
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node * Node;
Node root;
Node find(Node root,int key){
if(root==NIL||root->key==key)
return root;
if(root->key > key)
return find(root->left,key);
else
return find(root->right,key);
}
Node treeMinimum(Node x){
while(x->left!=NIL) x=x->left;
return x;
}
Node treeSuccessor(Node x){
if(x->right!=NIL) return treeMinimum(x->right);
Node y = x->parent;
while(y!=NIL&&x==y->right){
x=y;
y=y->parent;
}
return 0;
}
Node treeDelete(Node z){
Node y;
Node x;
if(z->left==NIL || z->right==NIL) y=z;
else y = treeSuccessor(z);
if(y->left!=NIL){
x=y->left;
}else{
x=y->right;
}
if(x!=NIL){
x->parent=y->parent;
}
if(y->parent==NIL){
root=x;
}else{
if(y==y->parent->left){
y->parent->left=x;
}else{
y->parent->right=x;
}
}
if(y!=z) z->key=y->key;
free(y);
return 0;
}
void insert(int key){
Node y = NIL;
Node x = root;
Node z;
z =malloc(sizeof(struct node));
z->key = key;
z->left = NIL;
z->right = NIL;
while(x!=NIL){
y=x;
if(z->key < x->key)x=x->left;
else x=x->right;
}
z->parent=y;
if(y==NIL)root=z;
else if(z->key <y->key)
y->left=z;
else
y->right=z;
}
void inorder(Node root){
if(root->left!=NIL)
inorder(root->left);
printf(" %d",root->key);
if(root->right!=NIL)
inorder(root->right);
}
void preorder(Node root){
if(root!=NIL)
printf(" %d",root->key);
if(root->left!=NIL)
preorder(root->left);
if(root->right!=NIL)
preorder(root->right);
}
int main(){
int n, i, x;
char s[10];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", s);
if ( s[0] == 'f' ){
scanf("%d", &x);
Node t = find(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
}
if ( s[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( s[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
} else if(s[0] == 'd'){
scanf("%d",&x);
treeDelete(find(root,x));
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206823/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206823/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { ptr, ptr, ptr, i32 }
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @find(ptr noundef readonly %root, i32 noundef %key) local_unnamed_addr #0 {
entry:
%cmp15 = icmp eq ptr %root, null
br i1 %cmp15, label %return, label %lor.lhs.false
lor.lhs.false: ; preds = %entry, %if.end
%root.tr16 = phi ptr [ %root.tr.be, %if.end ], [ %root, %entry ]
%key1 = getelementptr inbounds %struct.node, ptr %root.tr16, i64 0, i32 3
%0 = load i32, ptr %key1, align 8, !tbaa !5
%cmp2 = icmp eq i32 %0, %key
br i1 %cmp2, label %return, label %if.end
if.end: ; preds = %lor.lhs.false
%cmp4 = icmp sgt i32 %0, %key
%left = getelementptr inbounds %struct.node, ptr %root.tr16, i64 0, i32 1
%spec.select = select i1 %cmp4, ptr %left, ptr %root.tr16
%root.tr.be = load ptr, ptr %spec.select, align 8, !tbaa !11
%cmp = icmp eq ptr %root.tr.be, null
br i1 %cmp, label %return, label %lor.lhs.false
return: ; preds = %lor.lhs.false, %if.end, %entry
%retval.0 = phi ptr [ null, %entry ], [ null, %if.end ], [ %root.tr16, %lor.lhs.false ]
ret ptr %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !12
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !13
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr nocapture noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !15
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %return, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %left.i, align 8, !tbaa !12
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %return, label %while.cond.i, !llvm.loop !13
return: ; preds = %while.cond.i, %entry
%retval.0 = phi ptr [ null, %entry ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local noalias ptr @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !12
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load ptr, ptr %z, align 8, !tbaa !15
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !12
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !13
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%3 = load ptr, ptr %y.0.ph, align 8, !tbaa !15
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.059 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.055 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%parent = getelementptr inbounds %struct.node, ptr %y.059, i64 0, i32 2
%4 = load ptr, ptr %parent, align 8, !tbaa !16
%parent11 = getelementptr inbounds %struct.node, ptr %x.055, i64 0, i32 2
store ptr %4, ptr %parent11, align 8, !tbaa !16
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.061 = phi ptr [ %y.059, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.056 = phi ptr [ %x.055, %if.then10 ], [ null, %if.end8 ]
%parent13 = getelementptr inbounds %struct.node, ptr %y.061, i64 0, i32 2
%5 = load ptr, ptr %parent13, align 8, !tbaa !16
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %left18, align 8, !tbaa !12
%cmp19 = icmp eq ptr %y.061, %6
%left18. = select i1 %cmp19, ptr %left18, ptr %5
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %left18., %if.else16 ]
store ptr %x.056, ptr %left18.sink, align 8, !tbaa !11
%cmp28.not = icmp eq ptr %y.061, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.061, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !5
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !5
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
tail call void @free(ptr noundef nonnull %y.061) #9
ret ptr null
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %key) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !11
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
%key1 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %key, ptr %key1, align 8, !tbaa !5
%cmp.not35 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not35, label %if.then8, label %while.body
while.body: ; preds = %entry, %while.body
%x.036 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key3 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 3
%1 = load i32, ptr %key3, align 8, !tbaa !5
%cmp4 = icmp sgt i32 %1, %key
%left5 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 1
%x.1.in = select i1 %cmp4, ptr %left5, ptr %x.036
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !11
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else9, label %while.body, !llvm.loop !17
if.then8: ; preds = %entry
%parent38 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %parent38, align 8, !tbaa !16
br label %if.end18
if.else9: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.036, ptr %parent, align 8, !tbaa !16
%key11 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 3
%2 = load i32, ptr %key11, align 8, !tbaa !5
%cmp12 = icmp sgt i32 %2, %key
%left14 = getelementptr inbounds %struct.node, ptr %x.036, i64 0, i32 1
%spec.select = select i1 %cmp12, ptr %left14, ptr %x.036
br label %if.end18
if.end18: ; preds = %if.else9, %if.then8
%left14.sink = phi ptr [ @root, %if.then8 ], [ %spec.select, %if.else9 ]
store ptr %call, ptr %left14.sink, align 8, !tbaa !11
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr nocapture noundef readonly %root) local_unnamed_addr #4 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end, %entry
%root.tr = phi ptr [ %root, %entry ], [ %2, %if.end ]
%left = getelementptr inbounds %struct.node, ptr %root.tr, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !12
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %tailrecurse
tail call void @inorder(ptr noundef nonnull %0)
br label %if.end
if.end: ; preds = %if.then, %tailrecurse
%key = getelementptr inbounds %struct.node, ptr %root.tr, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %root.tr, align 8, !tbaa !15
%cmp2.not = icmp eq ptr %2, null
br i1 %cmp2.not, label %if.end5, label %tailrecurse
if.end5: ; preds = %if.end
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %root) local_unnamed_addr #4 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %if.end4, %entry
%root.tr = phi ptr [ %root, %entry ], [ %2, %if.end4 ]
%cmp.not = icmp eq ptr %root.tr, null
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %tailrecurse
%key = getelementptr inbounds %struct.node, ptr %root.tr, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
br label %if.end
if.end: ; preds = %if.then, %tailrecurse
%left = getelementptr inbounds %struct.node, ptr %root.tr, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !12
%cmp1.not = icmp eq ptr %1, null
br i1 %cmp1.not, label %if.end4, label %if.then2
if.then2: ; preds = %if.end
tail call void @preorder(ptr noundef nonnull %1)
br label %if.end4
if.end4: ; preds = %if.then2, %if.end
%2 = load ptr, ptr %root.tr, align 8, !tbaa !15
%cmp5.not = icmp eq ptr %2, null
br i1 %cmp5.not, label %if.end8, label %tailrecurse
if.end8: ; preds = %if.end4
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%s = alloca [10 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !18
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.064 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %s)
%1 = load i8, ptr %s, align 1, !tbaa !19
%cmp2 = icmp eq i8 %1, 102
br i1 %cmp2, label %if.then, label %if.end11
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !11
%3 = load i32, ptr %x, align 4, !tbaa !18
%cmp15.i = icmp eq ptr %2, null
br i1 %cmp15.i, label %if.end11thread-pre-split, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %if.then, %if.end.i
%root.tr16.i = phi ptr [ %root.tr.be.i, %if.end.i ], [ %2, %if.then ]
%key1.i = getelementptr inbounds %struct.node, ptr %root.tr16.i, i64 0, i32 3
%4 = load i32, ptr %key1.i, align 8, !tbaa !5
%cmp2.i = icmp eq i32 %4, %3
br i1 %cmp2.i, label %if.end11thread-pre-split, label %if.end.i
if.end.i: ; preds = %lor.lhs.false.i
%cmp4.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %root.tr16.i, i64 0, i32 1
%spec.select.i = select i1 %cmp4.i, ptr %left.i, ptr %root.tr16.i
%root.tr.be.i = load ptr, ptr %spec.select.i, align 8, !tbaa !11
%cmp.i = icmp eq ptr %root.tr.be.i, null
br i1 %cmp.i, label %if.end11thread-pre-split, label %lor.lhs.false.i
if.end11thread-pre-split: ; preds = %if.end.i, %lor.lhs.false.i, %if.then
%str.sink = phi ptr [ @str, %if.then ], [ @str.6, %lor.lhs.false.i ], [ @str, %if.end.i ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%.pr = load i8, ptr %s, align 1, !tbaa !19
br label %if.end11
if.end11: ; preds = %if.end11thread-pre-split, %for.body
%5 = phi i8 [ %.pr, %if.end11thread-pre-split ], [ %1, %for.body ]
switch i8 %5, label %for.inc [
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then16: ; preds = %if.end11
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%6 = load i32, ptr %x, align 4, !tbaa !18
%7 = load ptr, ptr @root, align 8, !tbaa !11
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
%key1.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %6, ptr %key1.i41, align 8, !tbaa !5
%cmp.not35.i = icmp eq ptr %7, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not35.i, label %insert.exit, label %while.body.i
while.body.i: ; preds = %if.then16, %while.body.i
%x.036.i = phi ptr [ %x.1.i, %while.body.i ], [ %7, %if.then16 ]
%key3.i = getelementptr inbounds %struct.node, ptr %x.036.i, i64 0, i32 3
%8 = load i32, ptr %key3.i, align 8, !tbaa !5
%cmp4.i42 = icmp sgt i32 %8, %6
%left5.i = getelementptr inbounds %struct.node, ptr %x.036.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp4.i42, ptr %left5.i, ptr %x.036.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !11
%cmp.not.i = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i, label %insert.exit, label %while.body.i, !llvm.loop !17
insert.exit: ; preds = %while.body.i, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.036.i, %while.body.i ]
%left14.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i ]
%parent38.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %parent38.i, align 8, !tbaa !16
store ptr %call.i, ptr %left14.sink.i, align 8, !tbaa !11
br label %for.inc
if.then23: ; preds = %if.end11
%9 = load ptr, ptr @root, align 8, !tbaa !11
call void @inorder(ptr noundef %9)
%putchar = call i32 @putchar(i32 10)
%10 = load ptr, ptr @root, align 8, !tbaa !11
call void @preorder(ptr noundef %10)
%putchar40 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %if.end11
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%11 = load ptr, ptr @root, align 8, !tbaa !11
%12 = load i32, ptr %x, align 4, !tbaa !18
%cmp15.i44 = icmp eq ptr %11, null
br i1 %cmp15.i44, label %find.exit56, label %lor.lhs.false.i45
lor.lhs.false.i45: ; preds = %if.then31, %if.end.i49
%root.tr16.i46 = phi ptr [ %root.tr.be.i53, %if.end.i49 ], [ %11, %if.then31 ]
%key1.i47 = getelementptr inbounds %struct.node, ptr %root.tr16.i46, i64 0, i32 3
%13 = load i32, ptr %key1.i47, align 8, !tbaa !5
%cmp2.i48 = icmp eq i32 %13, %12
br i1 %cmp2.i48, label %find.exit56, label %if.end.i49
if.end.i49: ; preds = %lor.lhs.false.i45
%cmp4.i50 = icmp sgt i32 %13, %12
%left.i51 = getelementptr inbounds %struct.node, ptr %root.tr16.i46, i64 0, i32 1
%spec.select.i52 = select i1 %cmp4.i50, ptr %left.i51, ptr %root.tr16.i46
%root.tr.be.i53 = load ptr, ptr %spec.select.i52, align 8, !tbaa !11
%cmp.i54 = icmp eq ptr %root.tr.be.i53, null
br i1 %cmp.i54, label %find.exit56, label %lor.lhs.false.i45
find.exit56: ; preds = %lor.lhs.false.i45, %if.end.i49, %if.then31
%retval.0.i55 = phi ptr [ null, %if.then31 ], [ %root.tr16.i46, %lor.lhs.false.i45 ], [ null, %if.end.i49 ]
%left.i57 = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 1
%14 = load ptr, ptr %left.i57, align 8, !tbaa !12
%cmp.i58 = icmp eq ptr %14, null
br i1 %cmp.i58, label %if.end8.i, label %lor.lhs.false.i59
lor.lhs.false.i59: ; preds = %find.exit56
%15 = load ptr, ptr %retval.0.i55, align 8, !tbaa !15
%cmp1.i = icmp eq ptr %15, null
br i1 %cmp1.i, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i59, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %16, %while.cond.i.i.i ], [ %15, %lor.lhs.false.i59 ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%16 = load ptr, ptr %left.i.i.i, align 8, !tbaa !12
%cmp.not.i.i.i = icmp eq ptr %16, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !13
if.end8.i: ; preds = %while.cond.i.i.i, %find.exit56
%y.0.ph.i = phi ptr [ %retval.0.i55, %find.exit56 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%17 = load ptr, ptr %y.0.ph.i, align 8, !tbaa !15
%cmp9.not.i = icmp eq ptr %17, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i59
%y.059.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %retval.0.i55, %lor.lhs.false.i59 ]
%x.055.i = phi ptr [ %17, %if.end8.i ], [ %14, %lor.lhs.false.i59 ]
%parent.i60 = getelementptr inbounds %struct.node, ptr %y.059.i, i64 0, i32 2
%18 = load ptr, ptr %parent.i60, align 8, !tbaa !16
%parent11.i = getelementptr inbounds %struct.node, ptr %x.055.i, i64 0, i32 2
store ptr %18, ptr %parent11.i, align 8, !tbaa !16
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.061.i = phi ptr [ %y.059.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.056.i = phi ptr [ %x.055.i, %if.then10.i ], [ null, %if.end8.i ]
%parent13.i = getelementptr inbounds %struct.node, ptr %y.061.i, i64 0, i32 2
%19 = load ptr, ptr %parent13.i, align 8, !tbaa !16
%cmp14.i = icmp eq ptr %19, null
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %19, i64 0, i32 1
%20 = load ptr, ptr %left18.i, align 8, !tbaa !12
%cmp19.i = icmp eq ptr %y.061.i, %20
%left18..i = select i1 %cmp19.i, ptr %left18.i, ptr %19
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %left18..i, %if.else16.i ]
store ptr %x.056.i, ptr %left18.sink.i, align 8, !tbaa !11
%cmp28.not.i = icmp eq ptr %y.061.i, %retval.0.i55
br i1 %cmp28.not.i, label %treeDelete.exit, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i = getelementptr inbounds %struct.node, ptr %y.061.i, i64 0, i32 3
%21 = load i32, ptr %key.i, align 8, !tbaa !5
%key30.i = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 3
store i32 %21, ptr %key30.i, align 8, !tbaa !5
br label %treeDelete.exit
treeDelete.exit: ; preds = %if.end27.i, %if.then29.i
call void @free(ptr noundef nonnull %y.061.i) #9
br label %for.inc
for.inc: ; preds = %if.end11, %insert.exit, %treeDelete.exit, %if.then23
%inc = add nuw nsw i32 %i.064, 1
%22 = load i32, ptr %n, align 4, !tbaa !18
%cmp = icmp slt i32 %inc, %22
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !20
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { 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, !10, i64 24}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!6, !7, i64 8}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!6, !7, i64 0}
!16 = !{!6, !7, i64 16}
!17 = distinct !{!17, !14}
!18 = !{!10, !10, i64 0}
!19 = !{!8, !8, i64 0}
!20 = distinct !{!20, !14}
|
#include<stdio.h>
#include<stdlib.h>
struct tree {
int data;
struct tree *left;
struct tree *right;
};
struct tree *sentinel, *root;
int Search(struct tree*, int);
struct tree *Insert(struct tree*, int);
struct tree *Alsearch(struct tree**);
struct tree *Remove(struct tree**, int);
void Dispm(struct tree*);
void Dispp(struct tree*);
int main(void)
{
int i, count, key;
char command[7];
sentinel = (struct tree*)malloc(sizeof(struct tree));
root = sentinel;
scanf("%d", &count);
for (i = 0; i < count; i++) {
scanf("%*c%s", command);
switch (command[0]) {
case 'f':
scanf(" %d", &key);
sentinel -> data = key;
if (Search(root, key)) {
printf("yes\n");
} else {
printf("no\n");
}
break;
case 'i':
scanf(" %d", &key);
sentinel -> data = key;
root = Insert(root, key);
break;
case 'd':
scanf(" %d", &key);
sentinel -> data = key;
Remove(&root, key);
break;
case 'p':
Dispm(root);
putchar('\n');
Dispp(root);
putchar('\n');
break;
}
}
return 0;
}
int Search(struct tree *p, int key)
{
if (p -> data > key) {
return Search(p -> left, key);
} else if (p -> data < key){
return Search(p -> right, key);
}
if (p == sentinel) return 0;
else return 1;
}
struct tree *Insert(struct tree *p, int key)
{
struct tree *q;
if (p -> data > key) {
p -> left = Insert(p -> left, key);
} else if (p -> data < key) {
p -> right = Insert(p -> right, key);
}
else {
q = (struct tree*)malloc(sizeof(struct tree));
q -> data = key;
q -> left = sentinel;
q -> right = sentinel;
return q;
}
return p;
}
struct tree *Alsearch(struct tree **p)
{
if ((*p) -> left == sentinel) {
struct tree *tmp = *p;
*p = (*p) -> right;
return tmp;
} else {
return Alsearch(&(*p) -> left);
}
}
struct tree *Remove(struct tree **p, int key)
{
if ((*p) -> data > key) {
(*p) -> left = Remove(&(*p) -> left, key);
} else if ((*p) -> data < key) {
(*p) -> right = Remove(&(*p) -> right, key);
} else {
struct tree *tmp = *p;
if (*p == sentinel) return sentinel;
if ((*p) -> right == sentinel) {
*p = (*p) -> left;
free(tmp);
}else if ((*p) -> left == sentinel) {
*p = (*p) -> right;
free(tmp);
} else {
struct tree *alter = Alsearch(&(*p) -> right);
alter -> left = (*p) -> left;
alter -> right = (*p) -> right;
*p = alter;
free(tmp);
}
}
return *p;
}
void Dispm(struct tree *p)
{
if (p != sentinel) {
Dispm(p -> left);
printf(" %d", p -> data);
Dispm(p -> right);
}
}
void Dispp(struct tree *p)
{
if (p != sentinel) {
printf(" %d", p -> data);
Dispp(p -> left);
Dispp(p -> right);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206867/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206867/source.c"
target datalayout = "e-m:e-p270: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.tree = type { i32, ptr, ptr }
@sentinel = dso_local local_unnamed_addr global ptr null, align 8
@root = dso_local global ptr null, align 8
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%*c%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
@str = 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: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%count = alloca i32, align 4
%key = alloca i32, align 4
%command = alloca [7 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %count) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #9
call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %command) #9
%call = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #10
store ptr %call, ptr @sentinel, align 8, !tbaa !5
store ptr %call, ptr @root, align 8, !tbaa !5
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %count)
%0 = load i32, ptr %count, align 4, !tbaa !9
%cmp21 = icmp sgt i32 %0, 0
br i1 %cmp21, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.022 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %command)
%1 = load i8, ptr %command, align 1, !tbaa !11
%conv = sext i8 %1 to i32
switch i32 %conv, label %for.inc [
i32 102, label %sw.bb
i32 105, label %sw.bb7
i32 100, label %sw.bb11
i32 112, label %sw.bb15
]
sw.bb: ; preds = %for.body
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %key)
%2 = load i32, ptr %key, align 4, !tbaa !9
%3 = load ptr, ptr @sentinel, align 8, !tbaa !5
store i32 %2, ptr %3, align 8, !tbaa !12
%4 = load i32, ptr %key, align 4, !tbaa !9
br label %tailrecurse.i
tailrecurse.i: ; preds = %tailrecurse.i.backedge, %sw.bb
%p.tr.i.in = phi ptr [ @root, %sw.bb ], [ %p.tr.i.in.be, %tailrecurse.i.backedge ]
%p.tr.i = load ptr, ptr %p.tr.i.in, align 8, !tbaa !5
%5 = load i32, ptr %p.tr.i, align 8, !tbaa !12
%cmp.i = icmp sgt i32 %5, %4
br i1 %cmp.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %tailrecurse.i
%left.i = getelementptr inbounds %struct.tree, ptr %p.tr.i, i64 0, i32 1
br label %tailrecurse.i.backedge
if.else.i: ; preds = %tailrecurse.i
%cmp2.i = icmp slt i32 %5, %4
br i1 %cmp2.i, label %if.then3.i, label %Search.exit
if.then3.i: ; preds = %if.else.i
%right.i = getelementptr inbounds %struct.tree, ptr %p.tr.i, i64 0, i32 2
br label %tailrecurse.i.backedge
tailrecurse.i.backedge: ; preds = %if.then3.i, %if.then.i
%p.tr.i.in.be = phi ptr [ %left.i, %if.then.i ], [ %right.i, %if.then3.i ]
br label %tailrecurse.i
Search.exit: ; preds = %if.else.i
%cmp6.i.not = icmp eq ptr %3, %p.tr.i
br i1 %cmp6.i.not, label %if.else, label %if.then
if.then: ; preds = %Search.exit
%puts19 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %for.inc
if.else: ; preds = %Search.exit
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
sw.bb7: ; preds = %for.body
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %key)
%6 = load i32, ptr %key, align 4, !tbaa !9
%7 = load ptr, ptr @sentinel, align 8, !tbaa !5
store i32 %6, ptr %7, align 8, !tbaa !12
%8 = load ptr, ptr @root, align 8, !tbaa !5
%9 = load i32, ptr %key, align 4, !tbaa !9
%call10 = call ptr @Insert(ptr noundef %8, i32 noundef %9)
store ptr %call10, ptr @root, align 8, !tbaa !5
br label %for.inc
sw.bb11: ; preds = %for.body
%call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %key)
%10 = load i32, ptr %key, align 4, !tbaa !9
%11 = load ptr, ptr @sentinel, align 8, !tbaa !5
store i32 %10, ptr %11, align 8, !tbaa !12
%12 = load i32, ptr %key, align 4, !tbaa !9
%call14 = call ptr @Remove(ptr noundef nonnull @root, i32 noundef %12)
br label %for.inc
sw.bb15: ; preds = %for.body
%13 = load ptr, ptr @root, align 8, !tbaa !5
call void @Dispm(ptr noundef %13)
%14 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i = call i32 @putc(i32 noundef 10, ptr noundef %14)
%15 = load ptr, ptr @root, align 8, !tbaa !5
call void @Dispp(ptr noundef %15)
%16 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i20 = call i32 @putc(i32 noundef 10, ptr noundef %16)
br label %for.inc
for.inc: ; preds = %sw.bb7, %sw.bb11, %sw.bb15, %for.body, %if.else, %if.then
%inc = add nuw nsw i32 %i.022, 1
%17 = load i32, ptr %count, align 4, !tbaa !9
%cmp = icmp slt i32 %inc, %17
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %command) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %count) #9
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @Search(ptr noundef readonly %p, i32 noundef %key) local_unnamed_addr #4 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%p.tr = phi ptr [ %p, %entry ], [ %p.tr.be, %tailrecurse.backedge ]
%0 = load i32, ptr %p.tr, align 8, !tbaa !12
%cmp = icmp sgt i32 %0, %key
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %tailrecurse
%left = getelementptr inbounds %struct.tree, ptr %p.tr, i64 0, i32 1
br label %tailrecurse.backedge
tailrecurse.backedge: ; preds = %if.then, %if.then3
%p.tr.be.in = phi ptr [ %left, %if.then ], [ %right, %if.then3 ]
%p.tr.be = load ptr, ptr %p.tr.be.in, align 8, !tbaa !5
br label %tailrecurse
if.else: ; preds = %tailrecurse
%cmp2 = icmp slt i32 %0, %key
br i1 %cmp2, label %if.then3, label %if.end5
if.then3: ; preds = %if.else
%right = getelementptr inbounds %struct.tree, ptr %p.tr, i64 0, i32 2
br label %tailrecurse.backedge
if.end5: ; preds = %if.else
%1 = load ptr, ptr @sentinel, align 8, !tbaa !5
%cmp6 = icmp ne ptr %1, %p.tr
%. = zext i1 %cmp6 to i32
ret i32 %.
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local ptr @Insert(ptr noundef %p, i32 noundef %key) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %p, align 8, !tbaa !12
%cmp = icmp sgt i32 %0, %key
br i1 %cmp, label %if.then, label %if.else
common.ret26: ; preds = %if.then4, %if.then, %if.else7
%common.ret26.op = phi ptr [ %call8, %if.else7 ], [ %p, %if.then ], [ %p, %if.then4 ]
ret ptr %common.ret26.op
if.then: ; preds = %entry
%left = getelementptr inbounds %struct.tree, ptr %p, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !16
%call = tail call ptr @Insert(ptr noundef %1, i32 noundef %key)
store ptr %call, ptr %left, align 8, !tbaa !16
br label %common.ret26
if.else: ; preds = %entry
%cmp3 = icmp slt i32 %0, %key
br i1 %cmp3, label %if.then4, label %if.else7
if.then4: ; preds = %if.else
%right = getelementptr inbounds %struct.tree, ptr %p, i64 0, i32 2
%2 = load ptr, ptr %right, align 8, !tbaa !17
%call5 = tail call ptr @Insert(ptr noundef %2, i32 noundef %key)
store ptr %call5, ptr %right, align 8, !tbaa !17
br label %common.ret26
if.else7: ; preds = %if.else
%call8 = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #10
store i32 %key, ptr %call8, align 8, !tbaa !12
%3 = load ptr, ptr @sentinel, align 8, !tbaa !5
%left10 = getelementptr inbounds %struct.tree, ptr %call8, i64 0, i32 1
store ptr %3, ptr %left10, align 8, !tbaa !16
%right11 = getelementptr inbounds %struct.tree, ptr %call8, i64 0, i32 2
store ptr %3, ptr %right11, align 8, !tbaa !17
br label %common.ret26
}
; Function Attrs: nounwind uwtable
define dso_local ptr @Remove(ptr nocapture noundef %p, i32 noundef %key) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %p, align 8, !tbaa !5
%1 = load i32, ptr %0, align 8, !tbaa !12
%cmp = icmp sgt i32 %1, %key
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%left = getelementptr inbounds %struct.tree, ptr %0, i64 0, i32 1
%call = tail call ptr @Remove(ptr noundef nonnull %left, i32 noundef %key)
%2 = load ptr, ptr %p, align 8, !tbaa !5
%left1 = getelementptr inbounds %struct.tree, ptr %2, i64 0, i32 1
store ptr %call, ptr %left1, align 8, !tbaa !16
br label %if.end29
if.else: ; preds = %entry
%cmp3 = icmp slt i32 %1, %key
br i1 %cmp3, label %if.then4, label %if.else7
if.then4: ; preds = %if.else
%right = getelementptr inbounds %struct.tree, ptr %0, i64 0, i32 2
%call5 = tail call ptr @Remove(ptr noundef nonnull %right, i32 noundef %key)
%3 = load ptr, ptr %p, align 8, !tbaa !5
%right6 = getelementptr inbounds %struct.tree, ptr %3, i64 0, i32 2
store ptr %call5, ptr %right6, align 8, !tbaa !17
br label %if.end29
if.else7: ; preds = %if.else
%4 = load ptr, ptr @sentinel, align 8, !tbaa !5
%cmp8.not = icmp eq ptr %0, %4
br i1 %cmp8.not, label %return, label %if.end
if.end: ; preds = %if.else7
%right10 = getelementptr inbounds %struct.tree, ptr %0, i64 0, i32 2
%5 = load ptr, ptr %right10, align 8, !tbaa !5
%cmp11 = icmp eq ptr %5, %4
%left13 = getelementptr inbounds %struct.tree, ptr %0, i64 0, i32 1
%6 = load ptr, ptr %left13, align 8, !tbaa !16
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.end
store ptr %6, ptr %p, align 8, !tbaa !5
tail call void @free(ptr noundef nonnull %0) #9
br label %if.end29
if.else14: ; preds = %if.end
%cmp16 = icmp eq ptr %6, %4
br i1 %cmp16, label %if.then17, label %tailrecurse.i
if.then17: ; preds = %if.else14
store ptr %5, ptr %p, align 8, !tbaa !5
tail call void @free(ptr noundef nonnull %0) #9
br label %if.end29
tailrecurse.i: ; preds = %if.else14, %tailrecurse.i
%7 = phi ptr [ %8, %tailrecurse.i ], [ %5, %if.else14 ]
%p.tr.i = phi ptr [ %left.i, %tailrecurse.i ], [ %right10, %if.else14 ]
%left.i = getelementptr inbounds %struct.tree, ptr %7, i64 0, i32 1
%8 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.i = icmp eq ptr %8, %4
br i1 %cmp.i, label %cleanup, label %tailrecurse.i
cleanup: ; preds = %tailrecurse.i
%right.i = getelementptr inbounds %struct.tree, ptr %7, i64 0, i32 2
%9 = load ptr, ptr %right.i, align 8, !tbaa !17
store ptr %9, ptr %p.tr.i, align 8, !tbaa !5
%10 = load ptr, ptr %p, align 8, !tbaa !5
%left22 = getelementptr inbounds %struct.tree, ptr %10, i64 0, i32 1
%11 = load ptr, ptr %left22, align 8, !tbaa !16
store ptr %11, ptr %left.i, align 8, !tbaa !16
%12 = load ptr, ptr %p, align 8, !tbaa !5
%right24 = getelementptr inbounds %struct.tree, ptr %12, i64 0, i32 2
%13 = load ptr, ptr %right24, align 8, !tbaa !17
store ptr %13, ptr %right.i, align 8, !tbaa !17
store ptr %7, ptr %p, align 8, !tbaa !5
tail call void @free(ptr noundef %0) #9
br label %if.end29
if.end29: ; preds = %cleanup, %if.then17, %if.then12, %if.then4, %if.then
%14 = load ptr, ptr %p, align 8, !tbaa !5
br label %return
return: ; preds = %if.else7, %if.end29
%retval.1 = phi ptr [ %14, %if.end29 ], [ %0, %if.else7 ]
ret ptr %retval.1
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @Dispm(ptr noundef readonly %p) local_unnamed_addr #5 {
entry:
%0 = load ptr, ptr @sentinel, align 8, !tbaa !5
%cmp.not4 = icmp eq ptr %0, %p
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%p.tr5 = phi ptr [ %3, %if.then ], [ %p, %entry ]
%left = getelementptr inbounds %struct.tree, ptr %p.tr5, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !16
tail call void @Dispm(ptr noundef %1)
%2 = load i32, ptr %p.tr5, align 8, !tbaa !12
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %2)
%right = getelementptr inbounds %struct.tree, ptr %p.tr5, i64 0, i32 2
%3 = load ptr, ptr %right, align 8, !tbaa !17
%4 = load ptr, ptr @sentinel, align 8, !tbaa !5
%cmp.not = icmp eq ptr %4, %3
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @Dispp(ptr noundef readonly %p) local_unnamed_addr #5 {
entry:
%0 = load ptr, ptr @sentinel, align 8, !tbaa !5
%cmp.not4 = icmp eq ptr %0, %p
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%p.tr5 = phi ptr [ %3, %if.then ], [ %p, %entry ]
%1 = load i32, ptr %p.tr5, align 8, !tbaa !12
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1)
%left = getelementptr inbounds %struct.tree, ptr %p.tr5, i64 0, i32 1
%2 = load ptr, ptr %left, align 8, !tbaa !16
tail call void @Dispp(ptr noundef %2)
%right = getelementptr inbounds %struct.tree, ptr %p.tr5, i64 0, i32 2
%3 = load ptr, ptr %right, align 8, !tbaa !17
%4 = load ptr, ptr @sentinel, align 8, !tbaa !5
%cmp.not = icmp eq ptr %4, %3
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local ptr @Alsearch(ptr nocapture noundef %p) local_unnamed_addr #6 {
entry:
%0 = load ptr, ptr @sentinel, align 8, !tbaa !5
%.pre = load ptr, ptr %p, align 8, !tbaa !5
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse, %entry
%1 = phi ptr [ %.pre, %entry ], [ %2, %tailrecurse ]
%p.tr = phi ptr [ %p, %entry ], [ %left, %tailrecurse ]
%left = getelementptr inbounds %struct.tree, ptr %1, i64 0, i32 1
%2 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %2, %0
br i1 %cmp, label %if.then, label %tailrecurse
if.then: ; preds = %tailrecurse
%right = getelementptr inbounds %struct.tree, ptr %1, i64 0, i32 2
%3 = load ptr, ptr %right, align 8, !tbaa !17
store ptr %3, ptr %p.tr, align 8, !tbaa !5
ret ptr %1
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #8
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree 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 #7 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"tree", !10, i64 0, !6, i64 8, !6, i64 16}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!13, !6, i64 8}
!17 = !{!13, !6, i64 16}
|
#include <stdio.h>
#include <stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *p;
int key;
};
typedef struct node * Node;
Node root,NIL;
Node treeMinimum(Node x){
while(x -> left != NIL){
x = x-> left;
}
return x;
}
Node treeMaximum(Node x){
while(x -> right != NIL){
x = x -> right;
}
return x;
}
Node treeSearch(Node u,int k){
while(u != NIL && k != u-> key){
if(k < u -> key) u = u-> left;
else u = u -> right;
}
return u;
}
Node treeSuccessor(Node x){
if(x -> right != NIL)
return treeMinimum(x -> right);
Node y = x -> p;
while(y != NIL && x == y -> right){
x = y;
y = y -> p;
}
return y;
}
void treeDelete(Node z){
Node y; // node to be deleted
Node x; // child of y
if(z -> left == NIL || z -> right == NIL) y = z;
else y = treeSuccessor(z);
if(y -> left != NIL) x = y -> left;
else x = y -> right;
if(x != NIL) x -> p = y -> p;
if(y -> p == NIL) root = x;
else if (y == y -> p -> left) y -> p -> left = x;
else y -> p -> right = x;
if(y != z) z -> key = y -> key;
free(y);
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z -> key = k;
z -> left = NIL;
z -> right = NIL;
while(x != NIL){
y = x;
if(z -> key < x -> key) x = x -> left;
else x = x -> right;
}
z -> p = y;
if(y == NIL) root = z;
else if (z -> key < y -> key) y -> left = z;
else y -> right = z;
}
void inorder(Node u){
if(u == NIL) return;
inorder(u -> left);
printf(" %d",u -> key);
inorder(u -> right);
}
void preorder(Node u){
if(u == NIL) return;
printf(" %d",u -> key);
preorder(u -> left);
preorder(u -> right);
}
int main(){
int n, i, x;
char com[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
}
else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
}
else if ( com[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
}
else if ( com[0] == 'd' ){
scanf("%d", &x);
treeDelete(treeSearch(root, x));
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_206953/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_206953/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { ptr, ptr, ptr, i32 }
@NIL = dso_local local_unnamed_addr global ptr null, align 8
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %1, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !9
%cmp.not = icmp eq ptr %1, %0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !12
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMaximum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %1, %while.cond ]
%1 = load ptr, ptr %x.addr.0, align 8, !tbaa !14
%cmp.not = icmp eq ptr %1, %0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !15
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10 = icmp eq ptr %0, %u
br i1 %cmp.not10, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %while.body
%u.addr.011 = phi ptr [ %u.addr.1, %while.body ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !16
%cmp1.not = icmp eq i32 %1, %k
br i1 %cmp1.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp3 = icmp sgt i32 %1, %k
%left = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 1
%u.addr.1.in = select i1 %cmp3, ptr %left, ptr %u.addr.011
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %u.addr.1, %0
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !17
while.end: ; preds = %land.rhs, %while.body, %entry
%u.addr.0.lcssa = phi ptr [ %u, %entry ], [ %0, %while.body ], [ %u.addr.011, %land.rhs ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !14
%1 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, %1
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %2, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%2 = load ptr, ptr %left.i, align 8, !tbaa !9
%cmp.not.i = icmp eq ptr %2, %1
br i1 %cmp.not.i, label %return, label %while.cond.i, !llvm.loop !12
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !18
%cmp2.not = icmp eq ptr %y.0, %0
br i1 %cmp2.not, label %return, label %land.rhs
land.rhs: ; preds = %while.cond
%3 = load ptr, ptr %y.0, align 8, !tbaa !14
%cmp4 = icmp eq ptr %x.addr.0, %3
br i1 %cmp4, label %while.cond, label %return, !llvm.loop !19
return: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ %0, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !9
%1 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%2 = load ptr, ptr %z, align 8, !tbaa !14
%cmp1 = icmp eq ptr %2, %1
br i1 %cmp1, label %if.end, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %3, %while.cond.i.i ], [ %2, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%3 = load ptr, ptr %left.i.i, align 8, !tbaa !9
%cmp.not.i.i = icmp eq ptr %3, %1
br i1 %cmp.not.i.i, label %if.else6, label %while.cond.i.i, !llvm.loop !12
if.end: ; preds = %entry, %lor.lhs.false
%cmp3.not = icmp eq ptr %0, %1
br i1 %cmp3.not, label %if.else6, label %if.end8
if.else6: ; preds = %while.cond.i.i, %if.end
%y.057 = phi ptr [ %z, %if.end ], [ %x.addr.0.i.i, %while.cond.i.i ]
%4 = load ptr, ptr %y.057, align 8, !tbaa !14
br label %if.end8
if.end8: ; preds = %if.end, %if.else6
%y.056 = phi ptr [ %y.057, %if.else6 ], [ %z, %if.end ]
%x.0 = phi ptr [ %4, %if.else6 ], [ %0, %if.end ]
%cmp9.not = icmp eq ptr %x.0, %1
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %if.end8
%p = getelementptr inbounds %struct.node, ptr %y.056, i64 0, i32 2
%5 = load ptr, ptr %p, align 8, !tbaa !18
%p11 = getelementptr inbounds %struct.node, ptr %x.0, i64 0, i32 2
store ptr %5, ptr %p11, align 8, !tbaa !18
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%p13 = getelementptr inbounds %struct.node, ptr %y.056, i64 0, i32 2
%6 = load ptr, ptr %p13, align 8, !tbaa !18
%cmp14 = icmp eq ptr %6, %1
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %6, i64 0, i32 1
%7 = load ptr, ptr %left18, align 8, !tbaa !9
%cmp19 = icmp eq ptr %y.056, %7
%left18. = select i1 %cmp19, ptr %left18, ptr %6
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %left18., %if.else16 ]
store ptr %x.0, ptr %left18.sink, align 8, !tbaa !5
%cmp28.not = icmp eq ptr %y.056, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.056, i64 0, i32 3
%8 = load i32, ptr %key, align 8, !tbaa !16
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %8, ptr %key30, align 8, !tbaa !16
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
tail call void @free(ptr noundef nonnull %y.056) #8
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%1 = load ptr, ptr @root, align 8, !tbaa !5
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !16
%left = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 1
store ptr %0, ptr %left, align 8, !tbaa !9
store ptr %0, ptr %call, align 8, !tbaa !14
%cmp.not34 = icmp eq ptr %1, %0
br i1 %cmp.not34, label %while.end.thread, label %while.body
while.end.thread: ; preds = %entry
%p37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %0, ptr %p37, align 8, !tbaa !18
br label %if.end17
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %1, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key2, align 8, !tbaa !16
%cmp3 = icmp sgt i32 %2, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %x.1, %0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !20
while.end: ; preds = %while.body
%p = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %p, align 8, !tbaa !18
%cmp6 = icmp eq ptr %x.035, %0
br i1 %cmp6, label %if.end17, label %if.else8
if.else8: ; preds = %while.end
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%3 = load i32, ptr %key10, align 8, !tbaa !16
%cmp11 = icmp sgt i32 %3, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %while.end, %while.end.thread
%left13.sink = phi ptr [ @root, %while.end.thread ], [ @root, %while.end ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !9
tail call void @inorder(ptr noundef %1)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%2 = load i32, ptr %key, align 8, !tbaa !16
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%3 = load ptr, ptr %u.tr5, align 8, !tbaa !14
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !16
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%2 = load ptr, ptr %left, align 8, !tbaa !9
tail call void @preorder(ptr noundef %2)
%3 = load ptr, ptr %u.tr5, align 8, !tbaa !14
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #8
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !21
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.067 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !22
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !5
%3 = load i32, ptr %x, align 4, !tbaa !21
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10.i = icmp eq ptr %4, %2
br i1 %cmp.not10.i, label %treeSearch.exit, label %land.rhs.i
land.rhs.i: ; preds = %if.then, %while.body.i
%u.addr.011.i = phi ptr [ %u.addr.1.i, %while.body.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 3
%5 = load i32, ptr %key.i, align 8, !tbaa !16
%cmp1.not.i = icmp eq i32 %5, %3
br i1 %cmp1.not.i, label %treeSearch.exit, label %while.body.i
while.body.i: ; preds = %land.rhs.i
%cmp3.i = icmp sgt i32 %5, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 1
%u.addr.1.in.i = select i1 %cmp3.i, ptr %left.i, ptr %u.addr.011.i
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %u.addr.1.i, %4
br i1 %cmp.not.i, label %if.else, label %land.rhs.i, !llvm.loop !17
treeSearch.exit: ; preds = %land.rhs.i, %if.then
%u.addr.0.lcssa.i = phi ptr [ %2, %if.then ], [ %u.addr.011.i, %land.rhs.i ]
%cmp6.not = icmp eq ptr %u.addr.0.lcssa.i, %4
br i1 %cmp6.not, label %if.else, label %if.then8
if.then8: ; preds = %treeSearch.exit
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %while.body.i, %treeSearch.exit
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%6 = load i32, ptr %x, align 4, !tbaa !21
%7 = load ptr, ptr @NIL, align 8, !tbaa !5
%8 = load ptr, ptr @root, align 8, !tbaa !5
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #9
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %6, ptr %key.i41, align 8, !tbaa !16
%left.i42 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 1
store ptr %7, ptr %left.i42, align 8, !tbaa !9
store ptr %7, ptr %call.i, align 8, !tbaa !14
%cmp.not34.i = icmp eq ptr %8, %7
br i1 %cmp.not34.i, label %while.end.thread.i, label %while.body.i43
while.end.thread.i: ; preds = %if.then16
%p37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %7, ptr %p37.i, align 8, !tbaa !18
br label %insert.exit
while.body.i43: ; preds = %if.then16, %while.body.i43
%x.035.i = phi ptr [ %x.1.i, %while.body.i43 ], [ %8, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%9 = load i32, ptr %key2.i, align 8, !tbaa !16
%cmp3.i44 = icmp sgt i32 %9, %6
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i44, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !5
%cmp.not.i45 = icmp eq ptr %x.1.i, %7
br i1 %cmp.not.i45, label %while.end.i, label %while.body.i43, !llvm.loop !20
while.end.i: ; preds = %while.body.i43
%p.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %x.035.i, ptr %p.i, align 8, !tbaa !18
%cmp6.i = icmp eq ptr %x.035.i, %7
%spec.select = select i1 %cmp6.i, ptr @root, ptr %x.1.in.i
br label %insert.exit
insert.exit: ; preds = %while.end.i, %while.end.thread.i
%left13.sink.i = phi ptr [ @root, %while.end.thread.i ], [ %spec.select, %while.end.i ]
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !5
br label %for.inc
if.then23: ; preds = %for.body
%10 = load ptr, ptr @root, align 8, !tbaa !5
call void @inorder(ptr noundef %10)
%putchar = call i32 @putchar(i32 10)
%11 = load ptr, ptr @root, align 8, !tbaa !5
call void @preorder(ptr noundef %11)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%12 = load ptr, ptr @root, align 8, !tbaa !5
%13 = load i32, ptr %x, align 4, !tbaa !21
%14 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10.i46 = icmp eq ptr %14, %12
br i1 %cmp.not10.i46, label %treeSearch.exit59, label %land.rhs.i47
land.rhs.i47: ; preds = %if.then31, %while.body.i51
%u.addr.011.i48 = phi ptr [ %u.addr.1.i55, %while.body.i51 ], [ %12, %if.then31 ]
%key.i49 = getelementptr inbounds %struct.node, ptr %u.addr.011.i48, i64 0, i32 3
%15 = load i32, ptr %key.i49, align 8, !tbaa !16
%cmp1.not.i50 = icmp eq i32 %15, %13
br i1 %cmp1.not.i50, label %treeSearch.exit59, label %while.body.i51
while.body.i51: ; preds = %land.rhs.i47
%cmp3.i52 = icmp sgt i32 %15, %13
%left.i53 = getelementptr inbounds %struct.node, ptr %u.addr.011.i48, i64 0, i32 1
%u.addr.1.in.i54 = select i1 %cmp3.i52, ptr %left.i53, ptr %u.addr.011.i48
%u.addr.1.i55 = load ptr, ptr %u.addr.1.in.i54, align 8, !tbaa !5
%cmp.not.i56 = icmp eq ptr %u.addr.1.i55, %14
br i1 %cmp.not.i56, label %treeSearch.exit59, label %land.rhs.i47, !llvm.loop !17
treeSearch.exit59: ; preds = %land.rhs.i47, %while.body.i51, %if.then31
%u.addr.0.lcssa.i58 = phi ptr [ %12, %if.then31 ], [ %u.addr.011.i48, %land.rhs.i47 ], [ %14, %while.body.i51 ]
%left.i60 = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i58, i64 0, i32 1
%16 = load ptr, ptr %left.i60, align 8, !tbaa !9
%cmp.i = icmp eq ptr %16, %14
br i1 %cmp.i, label %if.else6.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %treeSearch.exit59
%17 = load ptr, ptr %u.addr.0.lcssa.i58, align 8, !tbaa !14
%cmp1.i = icmp eq ptr %17, %14
br i1 %cmp1.i, label %if.end8.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %18, %while.cond.i.i.i ], [ %17, %lor.lhs.false.i ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%18 = load ptr, ptr %left.i.i.i, align 8, !tbaa !9
%cmp.not.i.i.i = icmp eq ptr %18, %14
br i1 %cmp.not.i.i.i, label %if.else6.i, label %while.cond.i.i.i, !llvm.loop !12
if.else6.i: ; preds = %while.cond.i.i.i, %treeSearch.exit59
%y.057.i = phi ptr [ %u.addr.0.lcssa.i58, %treeSearch.exit59 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%19 = load ptr, ptr %y.057.i, align 8, !tbaa !14
br label %if.end8.i
if.end8.i: ; preds = %lor.lhs.false.i, %if.else6.i
%y.056.i = phi ptr [ %y.057.i, %if.else6.i ], [ %u.addr.0.lcssa.i58, %lor.lhs.false.i ]
%x.0.i = phi ptr [ %19, %if.else6.i ], [ %16, %lor.lhs.false.i ]
%cmp9.not.i = icmp eq ptr %x.0.i, %14
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i
%p.i61 = getelementptr inbounds %struct.node, ptr %y.056.i, i64 0, i32 2
%20 = load ptr, ptr %p.i61, align 8, !tbaa !18
%p11.i = getelementptr inbounds %struct.node, ptr %x.0.i, i64 0, i32 2
store ptr %20, ptr %p11.i, align 8, !tbaa !18
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%p13.i = getelementptr inbounds %struct.node, ptr %y.056.i, i64 0, i32 2
%21 = load ptr, ptr %p13.i, align 8, !tbaa !18
%cmp14.i = icmp eq ptr %21, %14
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %21, i64 0, i32 1
%22 = load ptr, ptr %left18.i, align 8, !tbaa !9
%cmp19.i = icmp eq ptr %y.056.i, %22
%left18..i = select i1 %cmp19.i, ptr %left18.i, ptr %21
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %left18..i, %if.else16.i ]
store ptr %x.0.i, ptr %left18.sink.i, align 8, !tbaa !5
%cmp28.not.i = icmp eq ptr %y.056.i, %u.addr.0.lcssa.i58
br i1 %cmp28.not.i, label %treeDelete.exit, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i62 = getelementptr inbounds %struct.node, ptr %y.056.i, i64 0, i32 3
%23 = load i32, ptr %key.i62, align 8, !tbaa !16
%key30.i = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i58, i64 0, i32 3
store i32 %23, ptr %key30.i, align 8, !tbaa !16
br label %treeDelete.exit
treeDelete.exit: ; preds = %if.end27.i, %if.then29.i
call void @free(ptr noundef nonnull %y.056.i) #8
br label %for.inc
for.inc: ; preds = %for.body, %if.then8, %if.else, %if.then23, %treeDelete.exit, %insert.exit
%inc = add nuw nsw i32 %i.067, 1
%24 = load i32, ptr %n, align 4, !tbaa !21
%cmp = icmp slt i32 %inc, %24
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !23
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"node", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!10, !6, i64 0}
!15 = distinct !{!15, !13}
!16 = !{!10, !11, i64 24}
!17 = distinct !{!17, !13}
!18 = !{!10, !6, i64 16}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}
!21 = !{!11, !11, i64 0}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !13}
|
#include <stdio.h>
#include <stdlib.h>
typedef struct _node {
int key;
struct _node **parent;
struct _node *left;
struct _node *right;
} node;
typedef void(*FUNCP)(node *);
node *allocNode(int key) {
node *p = (node *)malloc(sizeof(node));
p->key = key;
p->parent = NULL;
p->left = NULL;
p->right = NULL;
return p;
}
void terminate(node *p) {
if (p == NULL) return;
terminate(p->left);
terminate(p->right);
free(p);
}
node *insert(node *p, node *c) {
if (p == NULL) return c;
if (c->key < p->key) {
p->left = insert(p->left, c);
p->left->parent = &(p->left);
}
else {
p->right = insert(p->right, c);
p->right->parent = &(p->right);
}
return p;
}
node *find(node *p, int key) {
if (p != NULL && p->key != key) {
if (key < p->key) p = find(p->left, key);
else p = find(p->right, key);
}
return p;
}
void delete(node **root, int key) {
node *next, *p;
node **right, **pp;
p = find(*root, key);
if (p == NULL) return;
pp = p->parent;
if (p->right == NULL) next = p->left;
else if (p->left == NULL) next = p->right;
else {
right = p->right->parent;
while ((*right)->left != NULL)
right = (*right)->left->parent;
next = *right;
*right = next->right;
next->left = p->left;
next->right = p->right;
}
if (pp != NULL) *pp = next; else *root = next;
if (next != NULL) next->parent = pp;
free(p);
}
void inParse(node *p) {
if (p == NULL) return;
inParse(p->left);
printf(" %d", p->key);
inParse(p->right);
}
void preParse(node *p) {
if (p == NULL) return;
printf(" %d", p->key);
preParse(p->left);
preParse(p->right);
}
void dump(node *p, FUNCP funcp) {
(funcp)(p);
printf("\n");
}
int main() {
int n, i, key;
char order[7];
node *p;
node *root = NULL;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%s", order);
switch (order[0])
{
case 'i':
scanf("%d", &key);
p = allocNode(key);
root = insert(root, p);
break;
case 'p':
dump(root, &inParse);
dump(root, &preParse);
break;
case 'f':
scanf("%d", &key);
if (find(root, key) != NULL) printf("yes\n");
else printf("no\n");
break;
case 'd':
scanf("%d", &key);
delete(&root,key);
break;
}
}
terminate(root);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207002/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207002/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct._node = type { i32, ptr, ptr, ptr }
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) uwtable
define dso_local noalias ptr @allocNode(i32 noundef %key) local_unnamed_addr #0 {
entry:
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #11
store i32 %key, ptr %call, align 8, !tbaa !5
%parent = getelementptr inbounds %struct._node, ptr %call, i64 0, i32 1
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %parent, i8 0, i64 24, i1 false)
ret ptr %call
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local void @terminate(ptr noundef %p) local_unnamed_addr #3 {
entry:
%cmp = icmp eq ptr %p, null
br i1 %cmp, label %common.ret4, label %if.end
common.ret4: ; preds = %entry, %if.end
ret void
if.end: ; preds = %entry
%left = getelementptr inbounds %struct._node, ptr %p, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !11
tail call void @terminate(ptr noundef %0)
%right = getelementptr inbounds %struct._node, ptr %p, i64 0, i32 3
%1 = load ptr, ptr %right, align 8, !tbaa !12
tail call void @terminate(ptr noundef %1)
tail call void @free(ptr noundef nonnull %p) #12
br label %common.ret4
}
; 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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local ptr @insert(ptr noundef %p, ptr noundef %c) local_unnamed_addr #5 {
entry:
%cmp = icmp eq ptr %p, null
br i1 %cmp, label %common.ret, label %if.end
if.end: ; preds = %entry
%0 = load i32, ptr %c, align 8, !tbaa !5
%1 = load i32, ptr %p, align 8, !tbaa !5
%cmp2 = icmp slt i32 %0, %1
br i1 %cmp2, label %if.then3, label %if.else
common.ret.sink.split: ; preds = %if.then3, %if.else
%call7.sink = phi ptr [ %call7, %if.else ], [ %call, %if.then3 ]
%right.sink = phi ptr [ %right, %if.else ], [ %left, %if.then3 ]
%parent11 = getelementptr inbounds %struct._node, ptr %call7.sink, i64 0, i32 1
store ptr %right.sink, ptr %parent11, align 8, !tbaa !13
br label %common.ret
common.ret: ; preds = %common.ret.sink.split, %entry
%common.ret.op = phi ptr [ %c, %entry ], [ %p, %common.ret.sink.split ]
ret ptr %common.ret.op
if.then3: ; preds = %if.end
%left = getelementptr inbounds %struct._node, ptr %p, i64 0, i32 2
%2 = load ptr, ptr %left, align 8, !tbaa !11
%call = tail call ptr @insert(ptr noundef %2, ptr noundef nonnull %c)
store ptr %call, ptr %left, align 8, !tbaa !11
br label %common.ret.sink.split
if.else: ; preds = %if.end
%right = getelementptr inbounds %struct._node, ptr %p, i64 0, i32 3
%3 = load ptr, ptr %right, align 8, !tbaa !12
%call7 = tail call ptr @insert(ptr noundef %3, ptr noundef nonnull %c)
store ptr %call7, ptr %right, align 8, !tbaa !12
br label %common.ret.sink.split
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @find(ptr noundef readonly %p, i32 noundef %key) local_unnamed_addr #6 {
entry:
%cmp.not16 = icmp eq ptr %p, null
br i1 %cmp.not16, label %if.end7, label %land.lhs.true
land.lhs.true: ; preds = %entry, %if.then
%p.tr17 = phi ptr [ %p.tr.be, %if.then ], [ %p, %entry ]
%0 = load i32, ptr %p.tr17, align 8, !tbaa !5
%cmp2.not = icmp eq i32 %0, %key
br i1 %cmp2.not, label %if.end7, label %if.then
if.then: ; preds = %land.lhs.true
%cmp4 = icmp sgt i32 %0, %key
%left = getelementptr inbounds %struct._node, ptr %p.tr17, i64 0, i32 2
%right = getelementptr inbounds %struct._node, ptr %p.tr17, i64 0, i32 3
%p.tr.be.in = select i1 %cmp4, ptr %left, ptr %right
%p.tr.be = load ptr, ptr %p.tr.be.in, align 8, !tbaa !14
%cmp.not = icmp eq ptr %p.tr.be, null
br i1 %cmp.not, label %if.end7, label %land.lhs.true
if.end7: ; preds = %if.then, %land.lhs.true, %entry
%p.addr.0 = phi ptr [ null, %entry ], [ %p.tr17, %land.lhs.true ], [ null, %if.then ]
ret ptr %p.addr.0
}
; Function Attrs: nounwind uwtable
define dso_local void @delete(ptr nocapture noundef %root, i32 noundef %key) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr %root, align 8, !tbaa !14
%cmp.not16.i = icmp eq ptr %0, null
br i1 %cmp.not16.i, label %cleanup, label %land.lhs.true.i
land.lhs.true.i: ; preds = %entry, %if.then.i
%p.tr17.i = phi ptr [ %p.tr.be.i, %if.then.i ], [ %0, %entry ]
%1 = load i32, ptr %p.tr17.i, align 8, !tbaa !5
%cmp2.not.i = icmp eq i32 %1, %key
%right1 = getelementptr inbounds %struct._node, ptr %p.tr17.i, i64 0, i32 3
br i1 %cmp2.not.i, label %if.end, label %if.then.i
if.then.i: ; preds = %land.lhs.true.i
%cmp4.i = icmp sgt i32 %1, %key
%left.i = getelementptr inbounds %struct._node, ptr %p.tr17.i, i64 0, i32 2
%p.tr.be.in.i = select i1 %cmp4.i, ptr %left.i, ptr %right1
%p.tr.be.i = load ptr, ptr %p.tr.be.in.i, align 8, !tbaa !14
%cmp.not.i = icmp eq ptr %p.tr.be.i, null
br i1 %cmp.not.i, label %cleanup, label %land.lhs.true.i
if.end: ; preds = %land.lhs.true.i
%parent = getelementptr inbounds %struct._node, ptr %p.tr17.i, i64 0, i32 1
%2 = load ptr, ptr %parent, align 8, !tbaa !13
%3 = load ptr, ptr %right1, align 8, !tbaa !12
%cmp2 = icmp eq ptr %3, null
%left = getelementptr inbounds %struct._node, ptr %p.tr17.i, i64 0, i32 2
%4 = load ptr, ptr %left, align 8, !tbaa !11
br i1 %cmp2, label %if.end21, label %if.else
if.else: ; preds = %if.end
%cmp5 = icmp eq ptr %4, null
br i1 %cmp5, label %if.end21, label %while.cond
while.cond: ; preds = %if.else, %while.cond
%.pn = phi ptr [ %6, %while.cond ], [ %3, %if.else ]
%right.0.in = getelementptr inbounds %struct._node, ptr %.pn, i64 0, i32 1
%right.0 = load ptr, ptr %right.0.in, align 8, !tbaa !13
%5 = load ptr, ptr %right.0, align 8, !tbaa !14
%left11 = getelementptr inbounds %struct._node, ptr %5, i64 0, i32 2
%6 = load ptr, ptr %left11, align 8, !tbaa !11
%cmp12.not = icmp eq ptr %6, null
br i1 %cmp12.not, label %while.end, label %while.cond, !llvm.loop !15
while.end: ; preds = %while.cond
%left11.le = getelementptr inbounds %struct._node, ptr %5, i64 0, i32 2
%right15 = getelementptr inbounds %struct._node, ptr %5, i64 0, i32 3
%7 = load ptr, ptr %right15, align 8, !tbaa !12
store ptr %7, ptr %right.0, align 8, !tbaa !14
%8 = load <2 x ptr>, ptr %left, align 8, !tbaa !14
store <2 x ptr> %8, ptr %left11.le, align 8, !tbaa !14
br label %if.end21
if.end21: ; preds = %if.end, %if.else, %while.end
%next.0 = phi ptr [ %5, %while.end ], [ %3, %if.else ], [ %4, %if.end ]
%cmp22.not = icmp eq ptr %2, null
%root. = select i1 %cmp22.not, ptr %root, ptr %2
store ptr %next.0, ptr %root., align 8, !tbaa !14
%cmp26.not = icmp eq ptr %next.0, null
br i1 %cmp26.not, label %if.end29, label %if.then27
if.then27: ; preds = %if.end21
%parent28 = getelementptr inbounds %struct._node, ptr %next.0, i64 0, i32 1
store ptr %2, ptr %parent28, align 8, !tbaa !13
br label %if.end29
if.end29: ; preds = %if.then27, %if.end21
tail call void @free(ptr noundef nonnull %p.tr17.i) #12
br label %cleanup
cleanup: ; preds = %if.then.i, %entry, %if.end29
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @inParse(ptr noundef readonly %p) local_unnamed_addr #7 {
entry:
%cmp4 = icmp eq ptr %p, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%p.tr5 = phi ptr [ %2, %if.end ], [ %p, %entry ]
%left = getelementptr inbounds %struct._node, ptr %p.tr5, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !11
tail call void @inParse(ptr noundef %0)
%1 = load i32, ptr %p.tr5, align 8, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%right = getelementptr inbounds %struct._node, ptr %p.tr5, i64 0, i32 3
%2 = load ptr, ptr %right, align 8, !tbaa !12
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind uwtable
define dso_local void @preParse(ptr noundef readonly %p) local_unnamed_addr #7 {
entry:
%cmp4 = icmp eq ptr %p, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%p.tr5 = phi ptr [ %2, %if.end ], [ %p, %entry ]
%0 = load i32, ptr %p.tr5, align 8, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%left = getelementptr inbounds %struct._node, ptr %p.tr5, i64 0, i32 2
%1 = load ptr, ptr %left, align 8, !tbaa !11
tail call void @preParse(ptr noundef %1)
%right = getelementptr inbounds %struct._node, ptr %p.tr5, i64 0, i32 3
%2 = load ptr, ptr %right, align 8, !tbaa !12
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local void @dump(ptr noundef %p, ptr nocapture noundef readonly %funcp) local_unnamed_addr #3 {
entry:
tail call void %funcp(ptr noundef %p) #12
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%n = alloca i32, align 4
%key = alloca i32, align 4
%order = alloca [7 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #12
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %key) #12
call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %order) #12
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !17
%cmp29 = icmp sgt i32 %0, 0
br i1 %cmp29, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.031 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%root.030 = phi ptr [ %root.3, %for.inc ], [ null, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %order)
%1 = load i8, ptr %order, align 1, !tbaa !18
%conv = sext i8 %1 to i32
switch i32 %conv, label %for.inc [
i32 105, label %sw.bb
i32 112, label %sw.bb5
i32 102, label %sw.bb6
i32 100, label %sw.bb13
]
sw.bb: ; preds = %for.body
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %key)
%2 = load i32, ptr %key, align 4, !tbaa !17
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #11
store i32 %2, ptr %call.i, align 8, !tbaa !5
%parent.i = getelementptr inbounds %struct._node, ptr %call.i, i64 0, i32 1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %parent.i, i8 0, i64 24, i1 false)
%call4 = call ptr @insert(ptr noundef %root.030, ptr noundef nonnull %call.i)
br label %for.inc
sw.bb5: ; preds = %for.body
call void @inParse(ptr noundef %root.030) #12
%putchar.i = call i32 @putchar(i32 10)
call void @preParse(ptr noundef %root.030) #12
%putchar.i17 = call i32 @putchar(i32 10)
br label %for.inc
sw.bb6: ; preds = %for.body
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %key)
%3 = load i32, ptr %key, align 4, !tbaa !17
%cmp.not16.i = icmp eq ptr %root.030, null
br i1 %cmp.not16.i, label %if.else, label %land.lhs.true.i
land.lhs.true.i: ; preds = %sw.bb6, %if.then.i
%p.tr17.i = phi ptr [ %p.tr.be.i, %if.then.i ], [ %root.030, %sw.bb6 ]
%4 = load i32, ptr %p.tr17.i, align 8, !tbaa !5
%cmp2.not.i = icmp eq i32 %4, %3
br i1 %cmp2.not.i, label %if.then, label %if.then.i
if.then.i: ; preds = %land.lhs.true.i
%cmp4.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct._node, ptr %p.tr17.i, i64 0, i32 2
%right.i = getelementptr inbounds %struct._node, ptr %p.tr17.i, i64 0, i32 3
%p.tr.be.in.i = select i1 %cmp4.i, ptr %left.i, ptr %right.i
%p.tr.be.i = load ptr, ptr %p.tr.be.in.i, align 8, !tbaa !14
%cmp.not.i = icmp eq ptr %p.tr.be.i, null
br i1 %cmp.not.i, label %if.else, label %land.lhs.true.i
if.then: ; preds = %land.lhs.true.i
%puts16 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %if.then.i, %sw.bb6
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
sw.bb13: ; preds = %for.body
%call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %key)
%5 = load i32, ptr %key, align 4, !tbaa !17
%cmp.not16.i.i = icmp eq ptr %root.030, null
br i1 %cmp.not16.i.i, label %for.inc, label %land.lhs.true.i.i
land.lhs.true.i.i: ; preds = %sw.bb13, %if.then.i.i
%p.tr17.i.i = phi ptr [ %p.tr.be.i.i, %if.then.i.i ], [ %root.030, %sw.bb13 ]
%6 = load i32, ptr %p.tr17.i.i, align 8, !tbaa !5
%cmp2.not.i.i = icmp eq i32 %6, %5
%right1.i = getelementptr inbounds %struct._node, ptr %p.tr17.i.i, i64 0, i32 3
br i1 %cmp2.not.i.i, label %if.end.i, label %if.then.i.i
if.then.i.i: ; preds = %land.lhs.true.i.i
%cmp4.i.i = icmp sgt i32 %6, %5
%left.i.i = getelementptr inbounds %struct._node, ptr %p.tr17.i.i, i64 0, i32 2
%p.tr.be.in.i.i = select i1 %cmp4.i.i, ptr %left.i.i, ptr %right1.i
%p.tr.be.i.i = load ptr, ptr %p.tr.be.in.i.i, align 8, !tbaa !14
%cmp.not.i.i = icmp eq ptr %p.tr.be.i.i, null
br i1 %cmp.not.i.i, label %for.inc, label %land.lhs.true.i.i
if.end.i: ; preds = %land.lhs.true.i.i
%parent.i18 = getelementptr inbounds %struct._node, ptr %p.tr17.i.i, i64 0, i32 1
%7 = load ptr, ptr %parent.i18, align 8, !tbaa !13
%8 = load ptr, ptr %right1.i, align 8, !tbaa !12
%cmp2.i = icmp eq ptr %8, null
%left.i19 = getelementptr inbounds %struct._node, ptr %p.tr17.i.i, i64 0, i32 2
%9 = load ptr, ptr %left.i19, align 8, !tbaa !11
br i1 %cmp2.i, label %if.end21.i, label %if.else.i
if.else.i: ; preds = %if.end.i
%cmp5.i = icmp eq ptr %9, null
br i1 %cmp5.i, label %if.end21.i, label %while.cond.i
while.cond.i: ; preds = %if.else.i, %while.cond.i
%.pn.i = phi ptr [ %11, %while.cond.i ], [ %8, %if.else.i ]
%right.0.in.i = getelementptr inbounds %struct._node, ptr %.pn.i, i64 0, i32 1
%right.0.i = load ptr, ptr %right.0.in.i, align 8, !tbaa !13
%10 = load ptr, ptr %right.0.i, align 8, !tbaa !14
%left11.i = getelementptr inbounds %struct._node, ptr %10, i64 0, i32 2
%11 = load ptr, ptr %left11.i, align 8, !tbaa !11
%cmp12.not.i = icmp eq ptr %11, null
br i1 %cmp12.not.i, label %while.end.i, label %while.cond.i, !llvm.loop !15
while.end.i: ; preds = %while.cond.i
%left11.i.le = getelementptr inbounds %struct._node, ptr %10, i64 0, i32 2
%right15.i = getelementptr inbounds %struct._node, ptr %10, i64 0, i32 3
%12 = load ptr, ptr %right15.i, align 8, !tbaa !12
store ptr %12, ptr %right.0.i, align 8, !tbaa !14
%13 = load <2 x ptr>, ptr %left.i19, align 8, !tbaa !14
store <2 x ptr> %13, ptr %left11.i.le, align 8, !tbaa !14
br label %if.end21.i
if.end21.i: ; preds = %while.end.i, %if.else.i, %if.end.i
%next.0.i = phi ptr [ %10, %while.end.i ], [ %8, %if.else.i ], [ %9, %if.end.i ]
%cmp22.not.i = icmp eq ptr %7, null
br i1 %cmp22.not.i, label %if.end21.i.cont, label %if.end21.i.else
if.end21.i.else: ; preds = %if.end21.i
store ptr %next.0.i, ptr %7, align 8, !tbaa !14
br label %if.end21.i.cont
if.end21.i.cont: ; preds = %if.end21.i, %if.end21.i.else
%root.1 = phi ptr [ %root.030, %if.end21.i.else ], [ %next.0.i, %if.end21.i ]
%cmp26.not.i = icmp eq ptr %next.0.i, null
br i1 %cmp26.not.i, label %if.end29.i, label %if.then27.i
if.then27.i: ; preds = %if.end21.i.cont
%parent28.i = getelementptr inbounds %struct._node, ptr %next.0.i, i64 0, i32 1
store ptr %7, ptr %parent28.i, align 8, !tbaa !13
br label %if.end29.i
if.end29.i: ; preds = %if.then27.i, %if.end21.i.cont
call void @free(ptr noundef nonnull %p.tr17.i.i) #12
br label %for.inc
for.inc: ; preds = %if.then.i.i, %if.end29.i, %sw.bb13, %sw.bb, %sw.bb5, %for.body, %if.else, %if.then
%root.3 = phi ptr [ %root.030, %for.body ], [ %root.030, %if.else ], [ %root.030, %if.then ], [ %root.030, %sw.bb5 ], [ %call4, %sw.bb ], [ null, %sw.bb13 ], [ %root.1, %if.end29.i ], [ %root.030, %if.then.i.i ]
%inc = add nuw nsw i32 %i.031, 1
%14 = load i32, ptr %n, align 4, !tbaa !17
%cmp = icmp slt i32 %inc, %14
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !19
for.end: ; preds = %for.inc, %entry
%root.0.lcssa = phi ptr [ null, %entry ], [ %root.3, %for.inc ]
call void @terminate(ptr noundef %root.0.lcssa)
call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %order) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %key) #12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #12
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #9
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #10
attributes #0 = { mustprogress nofree nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind }
attributes #10 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #11 = { nounwind allocsize(0) }
attributes #12 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_node", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !10, i64 16}
!12 = !{!6, !10, i64 24}
!13 = !{!6, !10, i64 8}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!7, !7, i64 0}
!18 = !{!8, !8, i64 0}
!19 = distinct !{!19, !16}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Node {
int key;
struct Node *right, *left, *parent;
};
typedef struct Node Node;
Node *root, *NIL;
Node * treeMinimum(Node *x) {
while(x->left != NIL)
x = x->left;
return x;
}
Node * find(Node *u, int k) {
while(u != NIL && k != u->key) {
if(k < u->key) u = u->left;
else u = u->right;
}
return u;
}
Node * treeSuccessor(Node *x) {
if(x->right != NIL) return treeMinimum(x->right);
Node *y = x->parent;
while(y != NIL && x == y->right) {
x = y;
y = y->parent;
}
return y;
}
void treeDelete(Node *z) {
Node *y; // 削除する対象
Node *x; // yの子
// 削除する節点を決める
if(z->left == NIL || z->right == NIL) y = z;
else y = treeSuccessor(z);
// yの子xを決める
if(y->left != NIL) {
x = y->left;
} else {
x = y->right;
}
if(x != NIL) {
x->parent = y->parent;
}
if(y->parent == NIL) {
root = x;
} else {
if(y == y->parent->left) {
y->parent->left = x;
} else {
y->parent->right = x;
}
}
if(y != z) {
z->key = y->key;
}
}
void insert(int k) {
Node *y = NIL;
Node *x = root;
Node *z;
z = (Node *)malloc(sizeof(Node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x != NIL) {
y = x;
if(z->key < x->key) {
x = x->left;
} else {
x = x->right;
}
}
z->parent = y;
if(y == NIL) {
root = z;
} else {
if( z->key < y->key) {
y->left = z;
} else {
y->right = z;
}
}
}
void inorder(Node *u) {
if(u == NIL) return;
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
void preorder(Node *u) {
if(u == NIL) return;
printf(" %d",u->key);
preorder(u->left);
preorder(u->right);
}
int main(void) {
int n, i, x;
char com[16];
scanf("%d",&n);
for(i=0;i<n;i++) {
scanf("%s",com);
if(!strcmp(com,"find")) {
scanf("%d",&x);
Node *t = find(root,x);
if(t != NIL) printf("yes\n");
else printf("no\n");
} else if(!strcmp(com,"insert")) {
scanf("%d",&x);
insert(x);
} else if(!strcmp(com,"print")) {
inorder(root);
printf("\n");
preorder(root);
printf("\n");
} else if(!strcmp(com,"delete")) {
scanf("%d",&x);
treeDelete(find(root,x));
}
}
return 0;
}
/*
18
insert 8
insert 2
insert 3
insert 7
insert 22
insert 1
find 1
find 2
find 3
find 4
find 5
find 6
find 7
find 8
print
delete 3
delete 7
print
*/
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207046/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207046/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.Node = type { i32, ptr, ptr, ptr }
@NIL = dso_local local_unnamed_addr global ptr null, align 8
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\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"find\00", align 1
@.str.6 = private unnamed_addr constant [7 x i8] c"insert\00", align 1
@.str.7 = private unnamed_addr constant [6 x i8] c"print\00", align 1
@.str.9 = private unnamed_addr constant [7 x i8] c"delete\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.10 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %1, %while.cond ]
%left = getelementptr inbounds %struct.Node, ptr %x.addr.0, i64 0, i32 2
%1 = load ptr, ptr %left, align 8, !tbaa !9
%cmp.not = icmp eq ptr %1, %0
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !12
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @find(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10 = icmp eq ptr %0, %u
br i1 %cmp.not10, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %while.body
%u.addr.011 = phi ptr [ %u.addr.1, %while.body ], [ %u, %entry ]
%1 = load i32, ptr %u.addr.011, align 8, !tbaa !14
%cmp1.not = icmp eq i32 %1, %k
br i1 %cmp1.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp3 = icmp sgt i32 %1, %k
%left = getelementptr inbounds %struct.Node, ptr %u.addr.011, i64 0, i32 2
%right = getelementptr inbounds %struct.Node, ptr %u.addr.011, i64 0, i32 1
%u.addr.1.in = select i1 %cmp3, ptr %left, ptr %right
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %u.addr.1, %0
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !15
while.end: ; preds = %land.rhs, %while.body, %entry
%u.addr.0.lcssa = phi ptr [ %u, %entry ], [ %0, %while.body ], [ %u.addr.011, %land.rhs ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%right = getelementptr inbounds %struct.Node, ptr %x, i64 0, i32 1
%0 = load ptr, ptr %right, align 8, !tbaa !16
%1 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, %1
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %2, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i, i64 0, i32 2
%2 = load ptr, ptr %left.i, align 8, !tbaa !9
%cmp.not.i = icmp eq ptr %2, %1
br i1 %cmp.not.i, label %return, label %while.cond.i, !llvm.loop !12
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.Node, ptr %x.addr.0, i64 0, i32 3
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !17
%cmp2.not = icmp eq ptr %y.0, %0
br i1 %cmp2.not, label %return, label %land.rhs
land.rhs: ; preds = %while.cond
%right3 = getelementptr inbounds %struct.Node, ptr %y.0, i64 0, i32 1
%3 = load ptr, ptr %right3, align 8, !tbaa !16
%cmp4 = icmp eq ptr %x.addr.0, %3
br i1 %cmp4, label %while.cond, label %return, !llvm.loop !18
return: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ %0, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.Node, ptr %z, i64 0, i32 2
%0 = load ptr, ptr %left, align 8, !tbaa !9
%1 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %0, %1
br i1 %cmp, label %if.end, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%right = getelementptr inbounds %struct.Node, ptr %z, i64 0, i32 1
%2 = load ptr, ptr %right, align 8, !tbaa !16
%cmp1 = icmp eq ptr %2, %1
br i1 %cmp1, label %if.end, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %3, %while.cond.i.i ], [ %2, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i.i, i64 0, i32 2
%3 = load ptr, ptr %left.i.i, align 8, !tbaa !9
%cmp.not.i.i = icmp eq ptr %3, %1
br i1 %cmp.not.i.i, label %if.else6, label %while.cond.i.i, !llvm.loop !12
if.end: ; preds = %entry, %lor.lhs.false
%cmp3.not = icmp eq ptr %0, %1
br i1 %cmp3.not, label %if.else6, label %if.end8
if.else6: ; preds = %while.cond.i.i, %if.end
%y.056 = phi ptr [ %z, %if.end ], [ %x.addr.0.i.i, %while.cond.i.i ]
%right7 = getelementptr inbounds %struct.Node, ptr %y.056, i64 0, i32 1
%4 = load ptr, ptr %right7, align 8, !tbaa !16
br label %if.end8
if.end8: ; preds = %if.end, %if.else6
%y.055 = phi ptr [ %y.056, %if.else6 ], [ %z, %if.end ]
%x.0 = phi ptr [ %4, %if.else6 ], [ %0, %if.end ]
%cmp9.not = icmp eq ptr %x.0, %1
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %if.end8
%parent = getelementptr inbounds %struct.Node, ptr %y.055, i64 0, i32 3
%5 = load ptr, ptr %parent, align 8, !tbaa !17
%parent11 = getelementptr inbounds %struct.Node, ptr %x.0, i64 0, i32 3
store ptr %5, ptr %parent11, align 8, !tbaa !17
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%parent13 = getelementptr inbounds %struct.Node, ptr %y.055, i64 0, i32 3
%6 = load ptr, ptr %parent13, align 8, !tbaa !17
%cmp14 = icmp eq ptr %6, %1
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.Node, ptr %6, i64 0, i32 2
%7 = load ptr, ptr %left18, align 8, !tbaa !9
%cmp19 = icmp eq ptr %y.055, %7
%right25 = getelementptr inbounds %struct.Node, ptr %6, i64 0, i32 1
%spec.select = select i1 %cmp19, ptr %left18, ptr %right25
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %spec.select, %if.else16 ]
store ptr %x.0, ptr %left18.sink, align 8, !tbaa !5
%cmp28.not = icmp eq ptr %y.055, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%8 = load i32, ptr %y.055, align 8, !tbaa !14
store i32 %8, ptr %z, align 8, !tbaa !14
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%1 = load ptr, ptr @root, align 8, !tbaa !5
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
store i32 %k, ptr %call, align 8, !tbaa !14
%left = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 2
store ptr %0, ptr %left, align 8, !tbaa !9
%right = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 1
store ptr %0, ptr %right, align 8, !tbaa !16
%cmp.not34 = icmp eq ptr %1, %0
br i1 %cmp.not34, label %while.end.thread, label %while.body
while.end.thread: ; preds = %entry
%parent37 = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 3
store ptr %0, ptr %parent37, align 8, !tbaa !17
br label %if.end17
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %1, %entry ]
%2 = load i32, ptr %x.035, align 8, !tbaa !14
%cmp3 = icmp sgt i32 %2, %k
%left4 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 2
%right5 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %right5
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !5
%cmp.not = icmp eq ptr %x.1, %0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !19
while.end: ; preds = %while.body
%parent = getelementptr inbounds %struct.Node, ptr %call, i64 0, i32 3
store ptr %x.035, ptr %parent, align 8, !tbaa !17
%cmp6 = icmp eq ptr %x.035, %0
br i1 %cmp6, label %if.end17, label %if.else8
if.else8: ; preds = %while.end
%3 = load i32, ptr %x.035, align 8, !tbaa !14
%cmp11 = icmp sgt i32 %3, %k
br i1 %cmp11, label %if.then12, label %if.else14
if.then12: ; preds = %if.else8
%left13 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 2
br label %if.end17
if.else14: ; preds = %if.else8
%right15 = getelementptr inbounds %struct.Node, ptr %x.035, i64 0, i32 1
br label %if.end17
if.end17: ; preds = %while.end, %while.end.thread, %if.then12, %if.else14
%left13.sink = phi ptr [ %left13, %if.then12 ], [ %right15, %if.else14 ], [ @root, %while.end.thread ], [ @root, %while.end ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%left = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 2
%1 = load ptr, ptr %left, align 8, !tbaa !9
tail call void @inorder(ptr noundef %1)
%2 = load i32, ptr %u.tr5, align 8, !tbaa !14
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%right = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 1
%3 = load ptr, ptr %right, align 8, !tbaa !16
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp4 = icmp eq ptr %0, %u
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %3, %if.end ], [ %u, %entry ]
%1 = load i32, ptr %u.tr5, align 8, !tbaa !14
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%left = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 2
%2 = load ptr, ptr %left, align 8, !tbaa !9
tail call void @preorder(ptr noundef %2)
%right = getelementptr inbounds %struct.Node, ptr %u.tr5, i64 0, i32 1
%3 = load ptr, ptr %right, align 8, !tbaa !16
%4 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp = icmp eq ptr %4, %3
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; 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
%com = alloca [16 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !20
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.067 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(5) %com, ptr noundef nonnull dereferenceable(5) @.str.3, i64 5)
%tobool.not = icmp eq i32 %bcmp, 0
br i1 %tobool.not, label %if.then, label %if.else10
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%1 = load ptr, ptr @root, align 8, !tbaa !5
%2 = load i32, ptr %x, align 4, !tbaa !20
%3 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10.i = icmp eq ptr %3, %1
br i1 %cmp.not10.i, label %find.exit, label %land.rhs.i
land.rhs.i: ; preds = %if.then, %while.body.i
%u.addr.011.i = phi ptr [ %u.addr.1.i, %while.body.i ], [ %1, %if.then ]
%4 = load i32, ptr %u.addr.011.i, align 8, !tbaa !14
%cmp1.not.i = icmp eq i32 %4, %2
br i1 %cmp1.not.i, label %find.exit, label %while.body.i
while.body.i: ; preds = %land.rhs.i
%cmp3.i = icmp sgt i32 %4, %2
%left.i = getelementptr inbounds %struct.Node, ptr %u.addr.011.i, i64 0, i32 2
%right.i = getelementptr inbounds %struct.Node, ptr %u.addr.011.i, i64 0, i32 1
%u.addr.1.in.i = select i1 %cmp3.i, ptr %left.i, ptr %right.i
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %u.addr.1.i, %3
br i1 %cmp.not.i, label %if.else, label %land.rhs.i, !llvm.loop !15
find.exit: ; preds = %land.rhs.i, %if.then
%u.addr.0.lcssa.i = phi ptr [ %1, %if.then ], [ %u.addr.011.i, %land.rhs.i ]
%cmp6.not = icmp eq ptr %u.addr.0.lcssa.i, %3
br i1 %cmp6.not, label %if.else, label %if.then7
if.then7: ; preds = %find.exit
%puts35 = call i32 @puts(ptr nonnull dereferenceable(1) @str.10)
br label %for.inc
if.else: ; preds = %while.body.i, %find.exit
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.else10: ; preds = %for.body
%bcmp36 = call i32 @bcmp(ptr noundef nonnull dereferenceable(7) %com, ptr noundef nonnull dereferenceable(7) @.str.6, i64 7)
%tobool13.not = icmp eq i32 %bcmp36, 0
br i1 %tobool13.not, label %if.then14, label %if.else16
if.then14: ; preds = %if.else10
%call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !20
%6 = load ptr, ptr @NIL, align 8, !tbaa !5
%7 = load ptr, ptr @root, align 8, !tbaa !5
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
store i32 %5, ptr %call.i, align 8, !tbaa !14
%left.i40 = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 2
store ptr %6, ptr %left.i40, align 8, !tbaa !9
%right.i41 = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 1
store ptr %6, ptr %right.i41, align 8, !tbaa !16
%cmp.not34.i = icmp eq ptr %7, %6
br i1 %cmp.not34.i, label %while.end.thread.i, label %while.body.i42
while.end.thread.i: ; preds = %if.then14
%parent37.i = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 3
store ptr %6, ptr %parent37.i, align 8, !tbaa !17
br label %insert.exit
while.body.i42: ; preds = %if.then14, %while.body.i42
%x.035.i = phi ptr [ %x.1.i, %while.body.i42 ], [ %7, %if.then14 ]
%8 = load i32, ptr %x.035.i, align 8, !tbaa !14
%cmp3.i43 = icmp sgt i32 %8, %5
%left4.i = getelementptr inbounds %struct.Node, ptr %x.035.i, i64 0, i32 2
%right5.i = getelementptr inbounds %struct.Node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i43, ptr %left4.i, ptr %right5.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !5
%cmp.not.i44 = icmp eq ptr %x.1.i, %6
br i1 %cmp.not.i44, label %while.end.i, label %while.body.i42, !llvm.loop !19
while.end.i: ; preds = %while.body.i42
%parent.i = getelementptr inbounds %struct.Node, ptr %call.i, i64 0, i32 3
store ptr %x.035.i, ptr %parent.i, align 8, !tbaa !17
%cmp6.i = icmp eq ptr %x.035.i, %6
%spec.select64 = select i1 %cmp6.i, ptr @root, ptr %x.1.in.i
br label %insert.exit
insert.exit: ; preds = %while.end.i, %while.end.thread.i
%left13.sink.i = phi ptr [ @root, %while.end.thread.i ], [ %spec.select64, %while.end.i ]
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !5
br label %for.inc
if.else16: ; preds = %if.else10
%bcmp37 = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %com, ptr noundef nonnull dereferenceable(6) @.str.7, i64 6)
%tobool19.not = icmp eq i32 %bcmp37, 0
br i1 %tobool19.not, label %if.then20, label %if.else23
if.then20: ; preds = %if.else16
%9 = load ptr, ptr @root, align 8, !tbaa !5
call void @inorder(ptr noundef %9)
%putchar = call i32 @putchar(i32 10)
%10 = load ptr, ptr @root, align 8, !tbaa !5
call void @preorder(ptr noundef %10)
%putchar38 = call i32 @putchar(i32 10)
br label %for.inc
if.else23: ; preds = %if.else16
%bcmp39 = call i32 @bcmp(ptr noundef nonnull dereferenceable(7) %com, ptr noundef nonnull dereferenceable(7) @.str.9, i64 7)
%tobool26.not = icmp eq i32 %bcmp39, 0
br i1 %tobool26.not, label %if.then27, label %for.inc
if.then27: ; preds = %if.else23
%call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%11 = load ptr, ptr @root, align 8, !tbaa !5
%12 = load i32, ptr %x, align 4, !tbaa !20
%13 = load ptr, ptr @NIL, align 8, !tbaa !5
%cmp.not10.i45 = icmp eq ptr %13, %11
br i1 %cmp.not10.i45, label %find.exit58, label %land.rhs.i46
land.rhs.i46: ; preds = %if.then27, %while.body.i49
%u.addr.011.i47 = phi ptr [ %u.addr.1.i54, %while.body.i49 ], [ %11, %if.then27 ]
%14 = load i32, ptr %u.addr.011.i47, align 8, !tbaa !14
%cmp1.not.i48 = icmp eq i32 %14, %12
br i1 %cmp1.not.i48, label %find.exit58, label %while.body.i49
while.body.i49: ; preds = %land.rhs.i46
%cmp3.i50 = icmp sgt i32 %14, %12
%left.i51 = getelementptr inbounds %struct.Node, ptr %u.addr.011.i47, i64 0, i32 2
%right.i52 = getelementptr inbounds %struct.Node, ptr %u.addr.011.i47, i64 0, i32 1
%u.addr.1.in.i53 = select i1 %cmp3.i50, ptr %left.i51, ptr %right.i52
%u.addr.1.i54 = load ptr, ptr %u.addr.1.in.i53, align 8, !tbaa !5
%cmp.not.i55 = icmp eq ptr %u.addr.1.i54, %13
br i1 %cmp.not.i55, label %find.exit58, label %land.rhs.i46, !llvm.loop !15
find.exit58: ; preds = %land.rhs.i46, %while.body.i49, %if.then27
%u.addr.0.lcssa.i57 = phi ptr [ %11, %if.then27 ], [ %u.addr.011.i47, %land.rhs.i46 ], [ %13, %while.body.i49 ]
%left.i59 = getelementptr inbounds %struct.Node, ptr %u.addr.0.lcssa.i57, i64 0, i32 2
%15 = load ptr, ptr %left.i59, align 8, !tbaa !9
%cmp.i = icmp eq ptr %15, %13
br i1 %cmp.i, label %if.else6.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %find.exit58
%right.i60 = getelementptr inbounds %struct.Node, ptr %u.addr.0.lcssa.i57, i64 0, i32 1
%16 = load ptr, ptr %right.i60, align 8, !tbaa !16
%cmp1.i = icmp eq ptr %16, %13
br i1 %cmp1.i, label %if.end8.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %17, %while.cond.i.i.i ], [ %16, %lor.lhs.false.i ]
%left.i.i.i = getelementptr inbounds %struct.Node, ptr %x.addr.0.i.i.i, i64 0, i32 2
%17 = load ptr, ptr %left.i.i.i, align 8, !tbaa !9
%cmp.not.i.i.i = icmp eq ptr %17, %13
br i1 %cmp.not.i.i.i, label %if.else6.i, label %while.cond.i.i.i, !llvm.loop !12
if.else6.i: ; preds = %while.cond.i.i.i, %find.exit58
%y.056.i = phi ptr [ %u.addr.0.lcssa.i57, %find.exit58 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%right7.i = getelementptr inbounds %struct.Node, ptr %y.056.i, i64 0, i32 1
%18 = load ptr, ptr %right7.i, align 8, !tbaa !16
br label %if.end8.i
if.end8.i: ; preds = %lor.lhs.false.i, %if.else6.i
%y.055.i = phi ptr [ %y.056.i, %if.else6.i ], [ %u.addr.0.lcssa.i57, %lor.lhs.false.i ]
%x.0.i = phi ptr [ %18, %if.else6.i ], [ %15, %lor.lhs.false.i ]
%cmp9.not.i = icmp eq ptr %x.0.i, %13
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i
%parent.i61 = getelementptr inbounds %struct.Node, ptr %y.055.i, i64 0, i32 3
%19 = load ptr, ptr %parent.i61, align 8, !tbaa !17
%parent11.i = getelementptr inbounds %struct.Node, ptr %x.0.i, i64 0, i32 3
store ptr %19, ptr %parent11.i, align 8, !tbaa !17
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%parent13.i = getelementptr inbounds %struct.Node, ptr %y.055.i, i64 0, i32 3
%20 = load ptr, ptr %parent13.i, align 8, !tbaa !17
%cmp14.i = icmp eq ptr %20, %13
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.Node, ptr %20, i64 0, i32 2
%21 = load ptr, ptr %left18.i, align 8, !tbaa !9
%cmp19.i = icmp eq ptr %y.055.i, %21
%right25.i = getelementptr inbounds %struct.Node, ptr %20, i64 0, i32 1
%spec.select.i = select i1 %cmp19.i, ptr %left18.i, ptr %right25.i
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %spec.select.i, %if.else16.i ]
store ptr %x.0.i, ptr %left18.sink.i, align 8, !tbaa !5
%cmp28.not.i = icmp eq ptr %y.055.i, %u.addr.0.lcssa.i57
br i1 %cmp28.not.i, label %for.inc, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%22 = load i32, ptr %y.055.i, align 8, !tbaa !14
store i32 %22, ptr %u.addr.0.lcssa.i57, align 8, !tbaa !14
br label %for.inc
for.inc: ; preds = %if.then29.i, %if.end27.i, %if.then7, %if.else, %if.then20, %if.else23, %insert.exit
%inc = add nuw nsw i32 %i.067, 1
%23 = load i32, ptr %n, align 4, !tbaa !20
%cmp = icmp slt i32 %inc, %23
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !21
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-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 willreturn memory(argmem: read) }
attributes #7 = { nofree nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"Node", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!10, !11, i64 0}
!15 = distinct !{!15, !13}
!16 = !{!10, !6, i64 8}
!17 = !{!10, !6, i64 24}
!18 = distinct !{!18, !13}
!19 = distinct !{!19, !13}
!20 = !{!11, !11, i64 0}
!21 = distinct !{!21, !13}
|
#include<stdio.h>
long long int n;
long long int pr[5005];
long long int m[5005];
long long int pe[5005];
long long int p,ma,f;
long long int h=1,g=1,j=1;
int main(){
scanf("%lld",&n);
long long int i,t;
for(i=1;i<=n;i++){
scanf("%lld",&t);
if (t==1){
pr[h]=i;
p++;
h++;
}
if(t==2){
m[g]=i;
ma++;
g++;
}
if(t==3){
pe[j]=i;
f++;
j++;
}
}
long long int min;
if(p<=ma && p<=f){
min=p;
}else if(ma<=f && ma<=p){
min=ma;
}
else if (f<=p && f<=ma){min=f;}
printf("%lld\n",min);
if (min==0){ return 0; }
for(i=1;i<=min;i++){
printf ( "%lld %lld %lld\n",pr[i],m[i],pe[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20709/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20709/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@h = dso_local local_unnamed_addr global i64 1, align 8
@g = dso_local local_unnamed_addr global i64 1, align 8
@j = dso_local local_unnamed_addr global i64 1, align 8
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@n = dso_local global i64 0, align 8
@pr = dso_local local_unnamed_addr global [5005 x i64] zeroinitializer, align 16
@p = dso_local local_unnamed_addr global i64 0, align 8
@m = dso_local local_unnamed_addr global [5005 x i64] zeroinitializer, align 16
@ma = dso_local local_unnamed_addr global i64 0, align 8
@pe = dso_local local_unnamed_addr global [5005 x i64] zeroinitializer, align 16
@f = dso_local local_unnamed_addr global i64 0, align 8
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.2 = private unnamed_addr constant [16 x i8] c"%lld %lld %lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i64, align 8
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #3
%0 = load i64, ptr @n, align 8, !tbaa !5
%cmp.not65 = icmp slt i64 %0, 1
br i1 %cmp.not65, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.066 = phi i64 [ %inc16, %for.inc ], [ 1, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%1 = load i64, ptr %t, align 8, !tbaa !5
switch i64 %1, label %for.inc [
i64 1, label %if.end.thread
i64 2, label %if.then5
i64 3, label %if.then11
]
if.end.thread: ; preds = %for.body
%2 = load i64, ptr @h, align 8, !tbaa !5
%arrayidx = getelementptr inbounds [5005 x i64], ptr @pr, i64 0, i64 %2
br label %for.inc.sink.split
if.then5: ; preds = %for.body
%3 = load i64, ptr @g, align 8, !tbaa !5
%arrayidx6 = getelementptr inbounds [5005 x i64], ptr @m, i64 0, i64 %3
br label %for.inc.sink.split
if.then11: ; preds = %for.body
%4 = load i64, ptr @j, align 8, !tbaa !5
%arrayidx12 = getelementptr inbounds [5005 x i64], ptr @pe, i64 0, i64 %4
br label %for.inc.sink.split
for.inc.sink.split: ; preds = %if.then11, %if.end.thread, %if.then5
%arrayidx6.sink = phi ptr [ %arrayidx6, %if.then5 ], [ %arrayidx, %if.end.thread ], [ %arrayidx12, %if.then11 ]
%ma.sink71 = phi ptr [ @ma, %if.then5 ], [ @p, %if.end.thread ], [ @f, %if.then11 ]
%.sink = phi i64 [ %3, %if.then5 ], [ %2, %if.end.thread ], [ %4, %if.then11 ]
%g.sink = phi ptr [ @g, %if.then5 ], [ @h, %if.end.thread ], [ @j, %if.then11 ]
store i64 %i.066, ptr %arrayidx6.sink, align 8, !tbaa !5
%5 = load i64, ptr %ma.sink71, align 8, !tbaa !5
%inc7 = add nsw i64 %5, 1
store i64 %inc7, ptr %ma.sink71, align 8, !tbaa !5
%inc8 = add nsw i64 %.sink, 1
store i64 %inc8, ptr %g.sink, align 8, !tbaa !5
br label %for.inc
for.inc: ; preds = %for.inc.sink.split, %for.body
%inc16 = add nuw nsw i64 %i.066, 1
%6 = load i64, ptr @n, align 8, !tbaa !5
%cmp.not.not = icmp slt i64 %i.066, %6
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%7 = load i64, ptr @p, align 8
%8 = load i64, ptr @ma, align 8, !tbaa !5
%cmp17.not = icmp sgt i64 %7, %8
%9 = load i64, ptr @f, align 8
%cmp18.not = icmp sgt i64 %7, %9
%or.cond = select i1 %cmp17.not, i1 true, i1 %cmp18.not
%cmp20.not = icmp sgt i64 %8, %9
%cmp22.not = icmp sgt i64 %8, %7
%or.cond61 = or i1 %cmp22.not, %cmp20.not
%spec.select = select i1 %or.cond61, i64 %9, i64 %8
%min.0 = select i1 %or.cond, i64 %spec.select, i64 %7
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %min.0)
%cmp37.not67 = icmp slt i64 %min.0, 1
br i1 %cmp37.not67, label %cleanup, label %for.body38
for.body38: ; preds = %for.end, %for.body38
%i.168 = phi i64 [ %inc44, %for.body38 ], [ 1, %for.end ]
%arrayidx39 = getelementptr inbounds [5005 x i64], ptr @pr, i64 0, i64 %i.168
%10 = load i64, ptr %arrayidx39, align 8, !tbaa !5
%arrayidx40 = getelementptr inbounds [5005 x i64], ptr @m, i64 0, i64 %i.168
%11 = load i64, ptr %arrayidx40, align 8, !tbaa !5
%arrayidx41 = getelementptr inbounds [5005 x i64], ptr @pe, i64 0, i64 %i.168
%12 = load i64, ptr %arrayidx41, align 8, !tbaa !5
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %10, i64 noundef %11, i64 noundef %12)
%inc44 = add nuw i64 %i.168, 1
%exitcond.not = icmp eq i64 %i.168, %min.0
br i1 %exitcond.not, label %cleanup, label %for.body38, !llvm.loop !11
cleanup: ; preds = %for.body38, %for.end
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node* Node;
#define NIL NULL
struct node a[500000];
int size=0;
Node root = NIL;
Node treeMinimum(Node x){
while(x->left!=NIL)x=x->left;
return x;
}
Node treeSearch(Node u, int k){
Node i=u;
while(i!=NIL){
if(i->key==k)return i;
else if(i->key<k)i=i->right;
else i=i->left;
}
return NIL;
}
Node treeSuccessor(Node x){
if(x->right!=NIL)return treeMinimum(x->right);
Node y=x->parent;
while(y!=NIL&&x==y->right){
x=y;
y=y->parent;
}
return y;
}
void treeDelete(Node z){
Node y; // node to be deleted
Node x; // child of y
if(z->left==NIL||z->right==NIL)y=z;
else y=treeSuccessor(z);
if(y->left!=NIL)x=y->left;
else x=y->right;
if(x!=NIL)x->parent=y->parent;
if(y->parent==NIL)root=x;
else if(y==y->parent->left)y->parent->left=x;
else y->parent->right=x;
if(y!=z)z->key=y->key;
//free(y);
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = &a[size++];
z->key = k;
z->left = NIL;
z->right = NIL;
while(x!=NIL){
y=x;
if(z->key<x->key)x=x->left;
else x=x->right;
}
z->parent=y;
if(y==NIL)root=z;
else if(z->key<y->key)y->left=z;
else y->right=z;
}
void inorder(Node u){
if(u==NIL)return;
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
void preorder(Node u){
if(u==NIL)return;
printf(" %d",u->key);
preorder(u->left);
preorder(u->right);
}
int main(){
int n,x;
char str[20];
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%s", str);
if(str[0]=='f'){
scanf("%d",&x);
Node t=treeSearch(root,x);
if (t!=NIL) printf("yes\n");
else printf("no\n");
}else if(str[0]=='i'){
scanf("%d",&x);
insert(x);
}else if(str[0]=='p'){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
}else if(str[0]=='d'){
scanf("%d",&x);
treeDelete(treeSearch(root,x));
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207132/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207132/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { ptr, ptr, ptr, i32 }
@size = dso_local local_unnamed_addr global i32 0, align 4
@root = dso_local local_unnamed_addr global ptr null, align 8
@a = dso_local global [500000 x %struct.node] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp.not13 = icmp eq ptr %u, null
br i1 %cmp.not13, label %cleanup, label %while.body
while.body: ; preds = %entry, %if.else
%i.014 = phi ptr [ %i.1, %if.else ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %i.014, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !13
%cmp1 = icmp eq i32 %0, %k
br i1 %cmp1, label %cleanup, label %if.else
if.else: ; preds = %while.body
%cmp3 = icmp slt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %i.014, i64 0, i32 1
%i.1.in = select i1 %cmp3, ptr %i.014, ptr %left
%i.1 = load ptr, ptr %i.1.in, align 8, !tbaa !14
%cmp.not = icmp eq ptr %i.1, null
br i1 %cmp.not, label %cleanup, label %while.body, !llvm.loop !15
cleanup: ; preds = %while.body, %if.else, %entry
%i.0.lcssa = phi ptr [ null, %entry ], [ null, %if.else ], [ %i.014, %while.body ]
ret ptr %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 norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !16
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %return, label %while.cond.i, !llvm.loop !11
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !17
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %return, label %land.rhs
land.rhs: ; preds = %while.cond
%2 = load ptr, ptr %y.0, align 8, !tbaa !16
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %return, !llvm.loop !18
return: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load ptr, ptr %z, align 8, !tbaa !16
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !5
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !11
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%3 = load ptr, ptr %y.0.ph, align 8, !tbaa !16
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.058 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.054 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%parent = getelementptr inbounds %struct.node, ptr %y.058, i64 0, i32 2
%4 = load ptr, ptr %parent, align 8, !tbaa !17
%parent11 = getelementptr inbounds %struct.node, ptr %x.054, i64 0, i32 2
store ptr %4, ptr %parent11, align 8, !tbaa !17
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.060 = phi ptr [ %y.058, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.055 = phi ptr [ %x.054, %if.then10 ], [ null, %if.end8 ]
%parent13 = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 2
%5 = load ptr, ptr %parent13, align 8, !tbaa !17
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %left18, align 8, !tbaa !5
%cmp19 = icmp eq ptr %y.060, %6
%left18. = select i1 %cmp19, ptr %left18, ptr %5
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %left18., %if.else16 ]
store ptr %x.055, ptr %left18.sink, align 8, !tbaa !14
%cmp28.not = icmp eq ptr %y.060, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !13
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !13
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !14
%1 = load i32, ptr @size, align 4, !tbaa !19
%inc = add nsw i32 %1, 1
store i32 %inc, ptr @size, align 4, !tbaa !19
%idxprom = sext i32 %1 to i64
%arrayidx = getelementptr inbounds [500000 x %struct.node], ptr @a, i64 0, i64 %idxprom
%key = getelementptr inbounds [500000 x %struct.node], ptr @a, i64 0, i64 %idxprom, i32 3
store i32 %k, ptr %key, align 8, !tbaa !13
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key2, align 8, !tbaa !13
%cmp3 = icmp sgt i32 %2, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !14
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !20
if.then7: ; preds = %entry
%parent37 = getelementptr inbounds [500000 x %struct.node], ptr @a, i64 0, i64 %idxprom, i32 2
store ptr null, ptr %parent37, align 16, !tbaa !17
br label %if.end17
if.else8: ; preds = %while.body
%parent = getelementptr inbounds [500000 x %struct.node], ptr @a, i64 0, i64 %idxprom, i32 2
store ptr %x.035, ptr %parent, align 16, !tbaa !17
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%3 = load i32, ptr %key10, align 8, !tbaa !13
%cmp11 = icmp sgt i32 %3, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%left13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %arrayidx, ptr %left13.sink, align 8, !tbaa !14
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #4 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @inorder(ptr noundef %0)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !13
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !16
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #4 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !13
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @preorder(ptr noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !16
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%str = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #8
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %str) #8
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !19
%cmp64 = icmp sgt i32 %0, 0
br i1 %cmp64, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %str) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #8
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.065 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %str)
%1 = load i8, ptr %str, align 16, !tbaa !21
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !14
%3 = load i32, ptr %x, align 4, !tbaa !19
%cmp.not13.i = icmp eq ptr %2, null
br i1 %cmp.not13.i, label %if.else, label %while.body.i
while.body.i: ; preds = %if.then, %if.else.i
%i.014.i = phi ptr [ %i.1.i, %if.else.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %i.014.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !13
%cmp1.i = icmp eq i32 %4, %3
br i1 %cmp1.i, label %if.then8, label %if.else.i
if.else.i: ; preds = %while.body.i
%cmp3.i = icmp slt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %i.014.i, i64 0, i32 1
%i.1.in.i = select i1 %cmp3.i, ptr %i.014.i, ptr %left.i
%i.1.i = load ptr, ptr %i.1.in.i, align 8, !tbaa !14
%cmp.not.i = icmp eq ptr %i.1.i, null
br i1 %cmp.not.i, label %if.else, label %while.body.i, !llvm.loop !15
if.then8: ; preds = %while.body.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %if.else.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !19
%6 = load ptr, ptr @root, align 8, !tbaa !14
%7 = load i32, ptr @size, align 4, !tbaa !19
%inc.i = add nsw i32 %7, 1
store i32 %inc.i, ptr @size, align 4, !tbaa !19
%idxprom.i = sext i32 %7 to i64
%arrayidx.i = getelementptr inbounds [500000 x %struct.node], ptr @a, i64 0, i64 %idxprom.i
%key.i41 = getelementptr inbounds [500000 x %struct.node], ptr @a, i64 0, i64 %idxprom.i, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !13
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %arrayidx.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i42
while.body.i42: ; preds = %if.then16, %while.body.i42
%x.035.i = phi ptr [ %x.1.i, %while.body.i42 ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%8 = load i32, ptr %key2.i, align 8, !tbaa !13
%cmp3.i43 = icmp sgt i32 %8, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i43, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !14
%cmp.not.i44 = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i44, label %insert.exit, label %while.body.i42, !llvm.loop !20
insert.exit: ; preds = %while.body.i42, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i42 ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i42 ]
%parent37.i = getelementptr inbounds [500000 x %struct.node], ptr @a, i64 0, i64 %idxprom.i, i32 2
store ptr %.sink, ptr %parent37.i, align 16, !tbaa !17
store ptr %arrayidx.i, ptr %left13.sink.i, align 8, !tbaa !14
br label %for.inc
if.then23: ; preds = %for.body
%9 = load ptr, ptr @root, align 8, !tbaa !14
call void @inorder(ptr noundef %9)
%putchar = call i32 @putchar(i32 10)
%10 = load ptr, ptr @root, align 8, !tbaa !14
call void @preorder(ptr noundef %10)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%11 = load ptr, ptr @root, align 8, !tbaa !14
%12 = load i32, ptr %x, align 4, !tbaa !19
%cmp.not13.i45 = icmp eq ptr %11, null
br i1 %cmp.not13.i45, label %treeSearch.exit57, label %while.body.i46
while.body.i46: ; preds = %if.then31, %if.else.i50
%i.014.i47 = phi ptr [ %i.1.i54, %if.else.i50 ], [ %11, %if.then31 ]
%key.i48 = getelementptr inbounds %struct.node, ptr %i.014.i47, i64 0, i32 3
%13 = load i32, ptr %key.i48, align 8, !tbaa !13
%cmp1.i49 = icmp eq i32 %13, %12
br i1 %cmp1.i49, label %treeSearch.exit57, label %if.else.i50
if.else.i50: ; preds = %while.body.i46
%cmp3.i51 = icmp slt i32 %13, %12
%left.i52 = getelementptr inbounds %struct.node, ptr %i.014.i47, i64 0, i32 1
%i.1.in.i53 = select i1 %cmp3.i51, ptr %i.014.i47, ptr %left.i52
%i.1.i54 = load ptr, ptr %i.1.in.i53, align 8, !tbaa !14
%cmp.not.i55 = icmp eq ptr %i.1.i54, null
br i1 %cmp.not.i55, label %treeSearch.exit57, label %while.body.i46, !llvm.loop !15
treeSearch.exit57: ; preds = %while.body.i46, %if.else.i50, %if.then31
%i.0.lcssa.i56 = phi ptr [ null, %if.then31 ], [ %i.014.i47, %while.body.i46 ], [ null, %if.else.i50 ]
%left.i58 = getelementptr inbounds %struct.node, ptr %i.0.lcssa.i56, i64 0, i32 1
%14 = load ptr, ptr %left.i58, align 8, !tbaa !5
%cmp.i = icmp eq ptr %14, null
br i1 %cmp.i, label %if.end8.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %treeSearch.exit57
%15 = load ptr, ptr %i.0.lcssa.i56, align 8, !tbaa !16
%cmp1.i59 = icmp eq ptr %15, null
br i1 %cmp1.i59, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %16, %while.cond.i.i.i ], [ %15, %lor.lhs.false.i ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%16 = load ptr, ptr %left.i.i.i, align 8, !tbaa !5
%cmp.not.i.i.i = icmp eq ptr %16, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !11
if.end8.i: ; preds = %while.cond.i.i.i, %treeSearch.exit57
%y.0.ph.i = phi ptr [ %i.0.lcssa.i56, %treeSearch.exit57 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%17 = load ptr, ptr %y.0.ph.i, align 8, !tbaa !16
%cmp9.not.i = icmp eq ptr %17, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i
%y.058.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %i.0.lcssa.i56, %lor.lhs.false.i ]
%x.054.i = phi ptr [ %17, %if.end8.i ], [ %14, %lor.lhs.false.i ]
%parent.i60 = getelementptr inbounds %struct.node, ptr %y.058.i, i64 0, i32 2
%18 = load ptr, ptr %parent.i60, align 8, !tbaa !17
%parent11.i = getelementptr inbounds %struct.node, ptr %x.054.i, i64 0, i32 2
store ptr %18, ptr %parent11.i, align 8, !tbaa !17
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.060.i = phi ptr [ %y.058.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.055.i = phi ptr [ %x.054.i, %if.then10.i ], [ null, %if.end8.i ]
%parent13.i = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 2
%19 = load ptr, ptr %parent13.i, align 8, !tbaa !17
%cmp14.i = icmp eq ptr %19, null
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %19, i64 0, i32 1
%20 = load ptr, ptr %left18.i, align 8, !tbaa !5
%cmp19.i = icmp eq ptr %y.060.i, %20
%left18..i = select i1 %cmp19.i, ptr %left18.i, ptr %19
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %left18..i, %if.else16.i ]
store ptr %x.055.i, ptr %left18.sink.i, align 8, !tbaa !14
%cmp28.not.i = icmp eq ptr %y.060.i, %i.0.lcssa.i56
br i1 %cmp28.not.i, label %for.inc, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i61 = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 3
%21 = load i32, ptr %key.i61, align 8, !tbaa !13
%key30.i = getelementptr inbounds %struct.node, ptr %i.0.lcssa.i56, i64 0, i32 3
store i32 %21, ptr %key30.i, align 8, !tbaa !13
br label %for.inc
for.inc: ; preds = %if.then29.i, %if.end27.i, %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %i.065, 1
%22 = load i32, ptr %n, align 4, !tbaa !19
%cmp = icmp slt i32 %inc, %22
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !22
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE 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 8}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !10, i64 24}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !12}
!16 = !{!6, !7, i64 0}
!17 = !{!6, !7, i64 16}
!18 = distinct !{!18, !12}
!19 = !{!10, !10, i64 0}
!20 = distinct !{!20, !12}
!21 = !{!8, !8, i64 0}
!22 = distinct !{!22, !12}
|
#include <stdio.h>
#include <stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node * Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x){
while(x->left != NIL) x = x->left;
return x;
}
/*Node treeMaximum(Node x){
}*/
Node treeSearch(Node u, int k){
if(u == NIL || k == u->key) return u;
if(k < u->key)return treeSearch(u->left, k);
else return treeSearch(u->right, k);
return NIL;
}
Node treeSuccessor(Node x){
if(x->right != NIL)return treeMinimum(x->right);
Node y;
y = x->parent;
while(y !=NIL && x == y->right){
x = y;
y = y->parent;
}
return y;
}
void treeDelete(Node z){
Node y;
Node x;
if(z->left == NIL || z->right == NIL) y=z;
else y = treeSuccessor(z);
if(y->left != NIL)x = y->left;
else x = y->right;
if(x != NIL)x->parent = y->parent;
if(y->parent == NIL)root = x;
else if(y == y->parent->left)y->parent->left = x;
else y->parent->right = x;
if(y != z)z->key = y->key;
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x != NIL){
y = x;
if(z->key < x->key)x = x->left;
else x = x->right;
}
z->parent = y;
if(y == NIL)root = z;
else if(z->key < y->key)y->left = z;
else y->right = z;
}
void inorder(Node u){
int i=0;
if(u != NIL){
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
}
void preorder(Node u){
int i=0;
if(u != NIL){
printf(" ");
printf("%d",u->key);
preorder(u->left);
preorder(u->right);
}
}
int main(){
int n, i, x;
char com[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
} else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( com[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
} else if ( com[0] == 'd' ){
scanf("%d", &x);
treeDelete(treeSearch(root, x));
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207176/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207176/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { ptr, ptr, ptr, i32 }
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.7 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp14 = icmp eq ptr %u, null
br i1 %cmp14, label %return, label %lor.lhs.false
lor.lhs.false: ; preds = %entry, %if.end
%u.tr15 = phi ptr [ %u.tr.be, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr15, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !13
%cmp1 = icmp eq i32 %0, %k
br i1 %cmp1, label %return, label %if.end
if.end: ; preds = %lor.lhs.false
%cmp3 = icmp sgt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %u.tr15, i64 0, i32 1
%spec.select = select i1 %cmp3, ptr %left, ptr %u.tr15
%u.tr.be = load ptr, ptr %spec.select, align 8, !tbaa !14
%cmp = icmp eq ptr %u.tr.be, null
br i1 %cmp, label %return, label %lor.lhs.false
return: ; preds = %lor.lhs.false, %if.end, %entry
%retval.0 = phi ptr [ null, %entry ], [ null, %if.end ], [ %u.tr15, %lor.lhs.false ]
ret ptr %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !15
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %return, label %while.cond.i, !llvm.loop !11
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !16
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %return, label %land.rhs
land.rhs: ; preds = %while.cond
%2 = load ptr, ptr %y.0, align 8, !tbaa !15
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %return, !llvm.loop !17
return: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load ptr, ptr %z, align 8, !tbaa !15
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !5
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !11
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%3 = load ptr, ptr %y.0.ph, align 8, !tbaa !15
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.058 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.054 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%parent = getelementptr inbounds %struct.node, ptr %y.058, i64 0, i32 2
%4 = load ptr, ptr %parent, align 8, !tbaa !16
%parent11 = getelementptr inbounds %struct.node, ptr %x.054, i64 0, i32 2
store ptr %4, ptr %parent11, align 8, !tbaa !16
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.060 = phi ptr [ %y.058, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.055 = phi ptr [ %x.054, %if.then10 ], [ null, %if.end8 ]
%parent13 = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 2
%5 = load ptr, ptr %parent13, align 8, !tbaa !16
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %left18, align 8, !tbaa !5
%cmp19 = icmp eq ptr %y.060, %6
%left18. = select i1 %cmp19, ptr %left18, ptr %5
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %left18., %if.else16 ]
store ptr %x.055, ptr %left18.sink, align 8, !tbaa !14
%cmp28.not = icmp eq ptr %y.060, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.060, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !13
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !13
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !14
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !13
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !13
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !14
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !18
if.then7: ; preds = %entry
%parent37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %parent37, align 8, !tbaa !16
br label %if.end17
if.else8: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %parent, align 8, !tbaa !16
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !13
%cmp11 = icmp sgt i32 %2, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%left13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !14
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%cmp.not4 = icmp eq ptr %u, null
br i1 %cmp.not4, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%u.tr5 = phi ptr [ %2, %if.then ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @inorder(ptr noundef %0)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !13
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !15
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #3 {
entry:
%cmp.not5 = icmp eq ptr %u, null
br i1 %cmp.not5, label %if.end, label %if.then
if.then: ; preds = %entry, %if.then
%u.tr6 = phi ptr [ %2, %if.then ], [ %u, %entry ]
%putchar = tail call i32 @putchar(i32 32)
%key = getelementptr inbounds %struct.node, ptr %u.tr6, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !13
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr6, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @preorder(ptr noundef %1)
%2 = load ptr, ptr %u.tr6, align 8, !tbaa !15
%cmp.not = icmp eq ptr %2, null
br i1 %cmp.not, label %if.end, label %if.then
if.end: ; preds = %if.then, %entry
ret void
}
; 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
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !19
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.067 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !20
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !14
%3 = load i32, ptr %x, align 4, !tbaa !19
%cmp14.i = icmp eq ptr %2, null
br i1 %cmp14.i, label %if.else, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %if.then, %if.end.i
%u.tr15.i = phi ptr [ %u.tr.be.i, %if.end.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.tr15.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !13
%cmp1.i = icmp eq i32 %4, %3
br i1 %cmp1.i, label %if.then8, label %if.end.i
if.end.i: ; preds = %lor.lhs.false.i
%cmp3.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.tr15.i, i64 0, i32 1
%spec.select.i = select i1 %cmp3.i, ptr %left.i, ptr %u.tr15.i
%u.tr.be.i = load ptr, ptr %spec.select.i, align 8, !tbaa !14
%cmp.i = icmp eq ptr %u.tr.be.i, null
br i1 %cmp.i, label %if.else, label %lor.lhs.false.i
if.then8: ; preds = %lor.lhs.false.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.7)
br label %for.inc
if.else: ; preds = %if.end.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !19
%6 = load ptr, ptr @root, align 8, !tbaa !14
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #8
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !13
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i
while.body.i: ; preds = %if.then16, %while.body.i
%x.035.i = phi ptr [ %x.1.i, %while.body.i ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !13
%cmp3.i42 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i42, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !14
%cmp.not.i = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i, label %insert.exit, label %while.body.i, !llvm.loop !18
insert.exit: ; preds = %while.body.i, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i ]
%parent37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %parent37.i, align 8, !tbaa !16
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !14
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !14
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !14
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !14
%11 = load i32, ptr %x, align 4, !tbaa !19
%cmp14.i44 = icmp eq ptr %10, null
br i1 %cmp14.i44, label %treeSearch.exit56, label %lor.lhs.false.i45
lor.lhs.false.i45: ; preds = %if.then31, %if.end.i49
%u.tr15.i46 = phi ptr [ %u.tr.be.i53, %if.end.i49 ], [ %10, %if.then31 ]
%key.i47 = getelementptr inbounds %struct.node, ptr %u.tr15.i46, i64 0, i32 3
%12 = load i32, ptr %key.i47, align 8, !tbaa !13
%cmp1.i48 = icmp eq i32 %12, %11
br i1 %cmp1.i48, label %treeSearch.exit56, label %if.end.i49
if.end.i49: ; preds = %lor.lhs.false.i45
%cmp3.i50 = icmp sgt i32 %12, %11
%left.i51 = getelementptr inbounds %struct.node, ptr %u.tr15.i46, i64 0, i32 1
%spec.select.i52 = select i1 %cmp3.i50, ptr %left.i51, ptr %u.tr15.i46
%u.tr.be.i53 = load ptr, ptr %spec.select.i52, align 8, !tbaa !14
%cmp.i54 = icmp eq ptr %u.tr.be.i53, null
br i1 %cmp.i54, label %treeSearch.exit56, label %lor.lhs.false.i45
treeSearch.exit56: ; preds = %lor.lhs.false.i45, %if.end.i49, %if.then31
%retval.0.i55 = phi ptr [ null, %if.then31 ], [ %u.tr15.i46, %lor.lhs.false.i45 ], [ null, %if.end.i49 ]
%left.i57 = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 1
%13 = load ptr, ptr %left.i57, align 8, !tbaa !5
%cmp.i58 = icmp eq ptr %13, null
br i1 %cmp.i58, label %if.end8.i, label %lor.lhs.false.i59
lor.lhs.false.i59: ; preds = %treeSearch.exit56
%14 = load ptr, ptr %retval.0.i55, align 8, !tbaa !15
%cmp1.i60 = icmp eq ptr %14, null
br i1 %cmp1.i60, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i59, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %15, %while.cond.i.i.i ], [ %14, %lor.lhs.false.i59 ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%15 = load ptr, ptr %left.i.i.i, align 8, !tbaa !5
%cmp.not.i.i.i = icmp eq ptr %15, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !11
if.end8.i: ; preds = %while.cond.i.i.i, %treeSearch.exit56
%y.0.ph.i = phi ptr [ %retval.0.i55, %treeSearch.exit56 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%16 = load ptr, ptr %y.0.ph.i, align 8, !tbaa !15
%cmp9.not.i = icmp eq ptr %16, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i59
%y.058.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %retval.0.i55, %lor.lhs.false.i59 ]
%x.054.i = phi ptr [ %16, %if.end8.i ], [ %13, %lor.lhs.false.i59 ]
%parent.i61 = getelementptr inbounds %struct.node, ptr %y.058.i, i64 0, i32 2
%17 = load ptr, ptr %parent.i61, align 8, !tbaa !16
%parent11.i = getelementptr inbounds %struct.node, ptr %x.054.i, i64 0, i32 2
store ptr %17, ptr %parent11.i, align 8, !tbaa !16
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.060.i = phi ptr [ %y.058.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.055.i = phi ptr [ %x.054.i, %if.then10.i ], [ null, %if.end8.i ]
%parent13.i = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 2
%18 = load ptr, ptr %parent13.i, align 8, !tbaa !16
%cmp14.i62 = icmp eq ptr %18, null
br i1 %cmp14.i62, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 1
%19 = load ptr, ptr %left18.i, align 8, !tbaa !5
%cmp19.i = icmp eq ptr %y.060.i, %19
%left18..i = select i1 %cmp19.i, ptr %left18.i, ptr %18
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %left18..i, %if.else16.i ]
store ptr %x.055.i, ptr %left18.sink.i, align 8, !tbaa !14
%cmp28.not.i = icmp eq ptr %y.060.i, %retval.0.i55
br i1 %cmp28.not.i, label %for.inc, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i63 = getelementptr inbounds %struct.node, ptr %y.060.i, i64 0, i32 3
%20 = load i32, ptr %key.i63, align 8, !tbaa !13
%key30.i = getelementptr inbounds %struct.node, ptr %retval.0.i55, i64 0, i32 3
store i32 %20, ptr %key30.i, align 8, !tbaa !13
br label %for.inc
for.inc: ; preds = %if.then29.i, %if.end27.i, %for.body, %if.then8, %if.else, %if.then23, %insert.exit
%inc = add nuw nsw i32 %i.067, 1
%21 = load i32, ptr %n, align 4, !tbaa !19
%cmp = icmp slt i32 %inc, %21
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !21
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !10, i64 24}
!14 = !{!7, !7, i64 0}
!15 = !{!6, !7, i64 0}
!16 = !{!6, !7, i64 16}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = !{!10, !10, i64 0}
!20 = !{!8, !8, i64 0}
!21 = distinct !{!21, !12}
|
#include<stdio.h>
#include<stdlib.h>
struct node{
struct node *right;
struct node *left;
struct node *parent;
int key;
};
typedef struct node * Node;
#define NIL NULL
Node root;
Node treeMinimum(Node x){
while(x->left!=NIL)
x =x->left;
return x;
}
Node treeMaximum(Node x){
while(x->right != NIL)
x = x->right;
return x;
}
Node treeSearch(Node u, int k){
while(u!=NIL && k!=u->key){
if(k < u->key) u=u->left;
else u=u->right;
}
return u;
}
Node treeSuccessor(Node x){
Node y;
if(x->right != NIL) return treeMinimum(x->right);
y = x->parent;
while(y != NIL && x == y->right){
x = y;
y = y->parent;
}
return y;
}
void treeDelete(Node z){
Node y; // node to be deleted
Node x; // child of y
if(z->left==NIL || z->right==NIL) y = z;
else y = treeSuccessor(z);
if(y->left != NIL) x=y->left;
else x = y->right;
if(x!=NIL) x->parent = y->parent;
if(y->parent==NIL) root = x;
else if(y == y->parent->left) y->parent->left = x;
else y->parent->right =x;
if(y!= z) z->key = y->key;
free(y);
}
void insert(int k){
Node y = NIL;
Node x = root;
Node z;
z = malloc(sizeof(struct node));
z->key = k;
z->left = NIL;
z->right = NIL;
while(x!=NIL){
y = x;
if(z->key < x->key) x = x->left;
else x = x->right;
}
z->parent = y;
if(y==NIL) root = z;
else if(z->key < y->key) y->left = z;
else y->right = z;
}
void inorder(Node u){
if(u == NIL)return;
inorder(u->left);
printf(" %d",u->key);
inorder(u->right);
}
void preorder(Node u){
if(u ==NIL)return;
printf(" %d",u->key);
preorder(u->left);
preorder(u->right);
}
int main(){
int n, i, x;
char com[20];
scanf("%d", &n);
for ( i = 0; i < n; i++ ){
scanf("%s", com);
if ( com[0] == 'f' ){
scanf("%d", &x);
Node t = treeSearch(root, x);
if ( t != NIL ) printf("yes\n");
else printf("no\n");
} else if ( com[0] == 'i' ){
scanf("%d", &x);
insert(x);
} else if ( com[0] == 'p' ){
inorder(root);
printf("\n");
preorder(root);
printf("\n");
} else if ( com[0] == 'd' ){
scanf("%d", &x);
treeDelete(treeSearch(root, x));
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207219/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207219/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { ptr, ptr, ptr, i32 }
@root = dso_local local_unnamed_addr global ptr null, align 8
@.str = private unnamed_addr constant [4 x i8] c" %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [3 x i8] c"no\00", align 1
@str.6 = private unnamed_addr constant [4 x i8] c"yes\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMinimum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%left = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !11
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeMaximum(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%x.addr.0 = phi ptr [ %x, %entry ], [ %0, %while.cond ]
%0 = load ptr, ptr %x.addr.0, align 8, !tbaa !13
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !14
while.end: ; preds = %while.cond
ret ptr %x.addr.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSearch(ptr noundef readonly %u, i32 noundef %k) local_unnamed_addr #0 {
entry:
%cmp.not10 = icmp eq ptr %u, null
br i1 %cmp.not10, label %while.end, label %land.rhs
land.rhs: ; preds = %entry, %while.body
%u.addr.011 = phi ptr [ %u.addr.1, %while.body ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !15
%cmp1.not = icmp eq i32 %0, %k
br i1 %cmp1.not, label %while.end, label %while.body
while.body: ; preds = %land.rhs
%cmp3 = icmp sgt i32 %0, %k
%left = getelementptr inbounds %struct.node, ptr %u.addr.011, i64 0, i32 1
%u.addr.1.in = select i1 %cmp3, ptr %left, ptr %u.addr.011
%u.addr.1 = load ptr, ptr %u.addr.1.in, align 8, !tbaa !16
%cmp.not = icmp eq ptr %u.addr.1, null
br i1 %cmp.not, label %while.end, label %land.rhs, !llvm.loop !17
while.end: ; preds = %land.rhs, %while.body, %entry
%u.addr.0.lcssa = phi ptr [ null, %entry ], [ null, %while.body ], [ %u.addr.011, %land.rhs ]
ret ptr %u.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local ptr @treeSuccessor(ptr noundef readonly %x) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr %x, align 8, !tbaa !13
%cmp.not = icmp eq ptr %0, null
br i1 %cmp.not, label %while.cond, label %while.cond.i
while.cond.i: ; preds = %entry, %while.cond.i
%x.addr.0.i = phi ptr [ %1, %while.cond.i ], [ %0, %entry ]
%left.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i, i64 0, i32 1
%1 = load ptr, ptr %left.i, align 8, !tbaa !5
%cmp.not.i = icmp eq ptr %1, null
br i1 %cmp.not.i, label %cleanup, label %while.cond.i, !llvm.loop !11
while.cond: ; preds = %entry, %land.rhs
%x.addr.0 = phi ptr [ %y.0, %land.rhs ], [ %x, %entry ]
%y.0.in = getelementptr inbounds %struct.node, ptr %x.addr.0, i64 0, i32 2
%y.0 = load ptr, ptr %y.0.in, align 8, !tbaa !18
%cmp2.not = icmp eq ptr %y.0, null
br i1 %cmp2.not, label %cleanup, label %land.rhs
land.rhs: ; preds = %while.cond
%2 = load ptr, ptr %y.0, align 8, !tbaa !13
%cmp4 = icmp eq ptr %x.addr.0, %2
br i1 %cmp4, label %while.cond, label %cleanup, !llvm.loop !19
cleanup: ; preds = %while.cond.i, %land.rhs, %while.cond
%retval.0 = phi ptr [ %y.0, %land.rhs ], [ null, %while.cond ], [ %x.addr.0.i, %while.cond.i ]
ret ptr %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local void @treeDelete(ptr noundef %z) local_unnamed_addr #2 {
entry:
%left = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.end8, label %lor.lhs.false
lor.lhs.false: ; preds = %entry
%1 = load ptr, ptr %z, align 8, !tbaa !13
%cmp1 = icmp eq ptr %1, null
br i1 %cmp1, label %if.then10, label %while.cond.i.i
while.cond.i.i: ; preds = %lor.lhs.false, %while.cond.i.i
%x.addr.0.i.i = phi ptr [ %2, %while.cond.i.i ], [ %1, %lor.lhs.false ]
%left.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i, i64 0, i32 1
%2 = load ptr, ptr %left.i.i, align 8, !tbaa !5
%cmp.not.i.i = icmp eq ptr %2, null
br i1 %cmp.not.i.i, label %if.end8, label %while.cond.i.i, !llvm.loop !11
if.end8: ; preds = %while.cond.i.i, %entry
%y.0.ph = phi ptr [ %z, %entry ], [ %x.addr.0.i.i, %while.cond.i.i ]
%3 = load ptr, ptr %y.0.ph, align 8, !tbaa !13
%cmp9.not = icmp eq ptr %3, null
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %lor.lhs.false, %if.end8
%y.059 = phi ptr [ %y.0.ph, %if.end8 ], [ %z, %lor.lhs.false ]
%x.055 = phi ptr [ %3, %if.end8 ], [ %0, %lor.lhs.false ]
%parent = getelementptr inbounds %struct.node, ptr %y.059, i64 0, i32 2
%4 = load ptr, ptr %parent, align 8, !tbaa !18
%parent11 = getelementptr inbounds %struct.node, ptr %x.055, i64 0, i32 2
store ptr %4, ptr %parent11, align 8, !tbaa !18
br label %if.end12
if.end12: ; preds = %if.then10, %if.end8
%y.061 = phi ptr [ %y.059, %if.then10 ], [ %y.0.ph, %if.end8 ]
%x.056 = phi ptr [ %x.055, %if.then10 ], [ null, %if.end8 ]
%parent13 = getelementptr inbounds %struct.node, ptr %y.061, i64 0, i32 2
%5 = load ptr, ptr %parent13, align 8, !tbaa !18
%cmp14 = icmp eq ptr %5, null
br i1 %cmp14, label %if.end27, label %if.else16
if.else16: ; preds = %if.end12
%left18 = getelementptr inbounds %struct.node, ptr %5, i64 0, i32 1
%6 = load ptr, ptr %left18, align 8, !tbaa !5
%cmp19 = icmp eq ptr %y.061, %6
%left18. = select i1 %cmp19, ptr %left18, ptr %5
br label %if.end27
if.end27: ; preds = %if.else16, %if.end12
%left18.sink = phi ptr [ @root, %if.end12 ], [ %left18., %if.else16 ]
store ptr %x.056, ptr %left18.sink, align 8, !tbaa !16
%cmp28.not = icmp eq ptr %y.061, %z
br i1 %cmp28.not, label %if.end31, label %if.then29
if.then29: ; preds = %if.end27
%key = getelementptr inbounds %struct.node, ptr %y.061, i64 0, i32 3
%7 = load i32, ptr %key, align 8, !tbaa !15
%key30 = getelementptr inbounds %struct.node, ptr %z, i64 0, i32 3
store i32 %7, ptr %key30, align 8, !tbaa !15
br label %if.end31
if.end31: ; preds = %if.then29, %if.end27
tail call void @free(ptr noundef nonnull %y.061) #9
ret void
}
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(i32 noundef %k) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr @root, align 8, !tbaa !16
%call = tail call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
%key = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 3
store i32 %k, ptr %key, align 8, !tbaa !15
%cmp.not34 = icmp eq ptr %0, null
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call, i8 0, i64 16, i1 false)
br i1 %cmp.not34, label %if.then7, label %while.body
while.body: ; preds = %entry, %while.body
%x.035 = phi ptr [ %x.1, %while.body ], [ %0, %entry ]
%key2 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%1 = load i32, ptr %key2, align 8, !tbaa !15
%cmp3 = icmp sgt i32 %1, %k
%left4 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%x.1.in = select i1 %cmp3, ptr %left4, ptr %x.035
%x.1 = load ptr, ptr %x.1.in, align 8, !tbaa !16
%cmp.not = icmp eq ptr %x.1, null
br i1 %cmp.not, label %if.else8, label %while.body, !llvm.loop !20
if.then7: ; preds = %entry
%parent37 = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr null, ptr %parent37, align 8, !tbaa !18
br label %if.end17
if.else8: ; preds = %while.body
%parent = getelementptr inbounds %struct.node, ptr %call, i64 0, i32 2
store ptr %x.035, ptr %parent, align 8, !tbaa !18
%key10 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 3
%2 = load i32, ptr %key10, align 8, !tbaa !15
%cmp11 = icmp sgt i32 %2, %k
%left13 = getelementptr inbounds %struct.node, ptr %x.035, i64 0, i32 1
%spec.select = select i1 %cmp11, ptr %left13, ptr %x.035
br label %if.end17
if.end17: ; preds = %if.else8, %if.then7
%left13.sink = phi ptr [ @root, %if.then7 ], [ %spec.select, %if.else8 ]
store ptr %call, ptr %left13.sink, align 8, !tbaa !16
ret void
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind uwtable
define dso_local void @inorder(ptr noundef readonly %u) local_unnamed_addr #4 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%0 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @inorder(ptr noundef %0)
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%1 = load i32, ptr %key, align 8, !tbaa !15
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !13
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind uwtable
define dso_local void @preorder(ptr noundef readonly %u) local_unnamed_addr #4 {
entry:
%cmp4 = icmp eq ptr %u, null
br i1 %cmp4, label %return, label %if.end
if.end: ; preds = %entry, %if.end
%u.tr5 = phi ptr [ %2, %if.end ], [ %u, %entry ]
%key = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 3
%0 = load i32, ptr %key, align 8, !tbaa !15
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%left = getelementptr inbounds %struct.node, ptr %u.tr5, i64 0, i32 1
%1 = load ptr, ptr %left, align 8, !tbaa !5
tail call void @preorder(ptr noundef %1)
%2 = load ptr, ptr %u.tr5, align 8, !tbaa !13
%cmp = icmp eq ptr %2, null
br i1 %cmp, label %return, label %if.end
return: ; preds = %if.end, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%x = alloca i32, align 4
%com = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %com) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !21
%cmp63 = icmp sgt i32 %0, 0
br i1 %cmp63, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.064 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %com)
%1 = load i8, ptr %com, align 16, !tbaa !22
switch i8 %1, label %for.inc [
i8 102, label %if.then
i8 105, label %if.then16
i8 112, label %if.then23
i8 100, label %if.then31
]
if.then: ; preds = %for.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%2 = load ptr, ptr @root, align 8, !tbaa !16
%3 = load i32, ptr %x, align 4, !tbaa !21
%cmp.not10.i = icmp eq ptr %2, null
br i1 %cmp.not10.i, label %if.else, label %land.rhs.i
land.rhs.i: ; preds = %if.then, %while.body.i
%u.addr.011.i = phi ptr [ %u.addr.1.i, %while.body.i ], [ %2, %if.then ]
%key.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 3
%4 = load i32, ptr %key.i, align 8, !tbaa !15
%cmp1.not.i = icmp eq i32 %4, %3
br i1 %cmp1.not.i, label %if.then8, label %while.body.i
while.body.i: ; preds = %land.rhs.i
%cmp3.i = icmp sgt i32 %4, %3
%left.i = getelementptr inbounds %struct.node, ptr %u.addr.011.i, i64 0, i32 1
%u.addr.1.in.i = select i1 %cmp3.i, ptr %left.i, ptr %u.addr.011.i
%u.addr.1.i = load ptr, ptr %u.addr.1.in.i, align 8, !tbaa !16
%cmp.not.i = icmp eq ptr %u.addr.1.i, null
br i1 %cmp.not.i, label %if.else, label %land.rhs.i, !llvm.loop !17
if.then8: ; preds = %land.rhs.i
%puts40 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6)
br label %for.inc
if.else: ; preds = %while.body.i, %if.then
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc
if.then16: ; preds = %for.body
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%5 = load i32, ptr %x, align 4, !tbaa !21
%6 = load ptr, ptr @root, align 8, !tbaa !16
%call.i = call noalias dereferenceable_or_null(32) ptr @malloc(i64 noundef 32) #10
%key.i41 = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 3
store i32 %5, ptr %key.i41, align 8, !tbaa !15
%cmp.not34.i = icmp eq ptr %6, null
call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %call.i, i8 0, i64 16, i1 false)
br i1 %cmp.not34.i, label %insert.exit, label %while.body.i42
while.body.i42: ; preds = %if.then16, %while.body.i42
%x.035.i = phi ptr [ %x.1.i, %while.body.i42 ], [ %6, %if.then16 ]
%key2.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 3
%7 = load i32, ptr %key2.i, align 8, !tbaa !15
%cmp3.i43 = icmp sgt i32 %7, %5
%left4.i = getelementptr inbounds %struct.node, ptr %x.035.i, i64 0, i32 1
%x.1.in.i = select i1 %cmp3.i43, ptr %left4.i, ptr %x.035.i
%x.1.i = load ptr, ptr %x.1.in.i, align 8, !tbaa !16
%cmp.not.i44 = icmp eq ptr %x.1.i, null
br i1 %cmp.not.i44, label %insert.exit, label %while.body.i42, !llvm.loop !20
insert.exit: ; preds = %while.body.i42, %if.then16
%.sink = phi ptr [ null, %if.then16 ], [ %x.035.i, %while.body.i42 ]
%left13.sink.i = phi ptr [ @root, %if.then16 ], [ %x.1.in.i, %while.body.i42 ]
%parent37.i = getelementptr inbounds %struct.node, ptr %call.i, i64 0, i32 2
store ptr %.sink, ptr %parent37.i, align 8, !tbaa !18
store ptr %call.i, ptr %left13.sink.i, align 8, !tbaa !16
br label %for.inc
if.then23: ; preds = %for.body
%8 = load ptr, ptr @root, align 8, !tbaa !16
call void @inorder(ptr noundef %8)
%putchar = call i32 @putchar(i32 10)
%9 = load ptr, ptr @root, align 8, !tbaa !16
call void @preorder(ptr noundef %9)
%putchar39 = call i32 @putchar(i32 10)
br label %for.inc
if.then31: ; preds = %for.body
%call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x)
%10 = load ptr, ptr @root, align 8, !tbaa !16
%11 = load i32, ptr %x, align 4, !tbaa !21
%cmp.not10.i45 = icmp eq ptr %10, null
br i1 %cmp.not10.i45, label %treeSearch.exit57, label %land.rhs.i46
land.rhs.i46: ; preds = %if.then31, %while.body.i50
%u.addr.011.i47 = phi ptr [ %u.addr.1.i54, %while.body.i50 ], [ %10, %if.then31 ]
%key.i48 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 3
%12 = load i32, ptr %key.i48, align 8, !tbaa !15
%cmp1.not.i49 = icmp eq i32 %12, %11
br i1 %cmp1.not.i49, label %treeSearch.exit57, label %while.body.i50
while.body.i50: ; preds = %land.rhs.i46
%cmp3.i51 = icmp sgt i32 %12, %11
%left.i52 = getelementptr inbounds %struct.node, ptr %u.addr.011.i47, i64 0, i32 1
%u.addr.1.in.i53 = select i1 %cmp3.i51, ptr %left.i52, ptr %u.addr.011.i47
%u.addr.1.i54 = load ptr, ptr %u.addr.1.in.i53, align 8, !tbaa !16
%cmp.not.i55 = icmp eq ptr %u.addr.1.i54, null
br i1 %cmp.not.i55, label %treeSearch.exit57, label %land.rhs.i46, !llvm.loop !17
treeSearch.exit57: ; preds = %land.rhs.i46, %while.body.i50, %if.then31
%u.addr.0.lcssa.i56 = phi ptr [ null, %if.then31 ], [ %u.addr.011.i47, %land.rhs.i46 ], [ null, %while.body.i50 ]
%left.i58 = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i56, i64 0, i32 1
%13 = load ptr, ptr %left.i58, align 8, !tbaa !5
%cmp.i = icmp eq ptr %13, null
br i1 %cmp.i, label %if.end8.i, label %lor.lhs.false.i
lor.lhs.false.i: ; preds = %treeSearch.exit57
%14 = load ptr, ptr %u.addr.0.lcssa.i56, align 8, !tbaa !13
%cmp1.i = icmp eq ptr %14, null
br i1 %cmp1.i, label %if.then10.i, label %while.cond.i.i.i
while.cond.i.i.i: ; preds = %lor.lhs.false.i, %while.cond.i.i.i
%x.addr.0.i.i.i = phi ptr [ %15, %while.cond.i.i.i ], [ %14, %lor.lhs.false.i ]
%left.i.i.i = getelementptr inbounds %struct.node, ptr %x.addr.0.i.i.i, i64 0, i32 1
%15 = load ptr, ptr %left.i.i.i, align 8, !tbaa !5
%cmp.not.i.i.i = icmp eq ptr %15, null
br i1 %cmp.not.i.i.i, label %if.end8.i, label %while.cond.i.i.i, !llvm.loop !11
if.end8.i: ; preds = %while.cond.i.i.i, %treeSearch.exit57
%y.0.ph.i = phi ptr [ %u.addr.0.lcssa.i56, %treeSearch.exit57 ], [ %x.addr.0.i.i.i, %while.cond.i.i.i ]
%16 = load ptr, ptr %y.0.ph.i, align 8, !tbaa !13
%cmp9.not.i = icmp eq ptr %16, null
br i1 %cmp9.not.i, label %if.end12.i, label %if.then10.i
if.then10.i: ; preds = %if.end8.i, %lor.lhs.false.i
%y.059.i = phi ptr [ %y.0.ph.i, %if.end8.i ], [ %u.addr.0.lcssa.i56, %lor.lhs.false.i ]
%x.055.i = phi ptr [ %16, %if.end8.i ], [ %13, %lor.lhs.false.i ]
%parent.i59 = getelementptr inbounds %struct.node, ptr %y.059.i, i64 0, i32 2
%17 = load ptr, ptr %parent.i59, align 8, !tbaa !18
%parent11.i = getelementptr inbounds %struct.node, ptr %x.055.i, i64 0, i32 2
store ptr %17, ptr %parent11.i, align 8, !tbaa !18
br label %if.end12.i
if.end12.i: ; preds = %if.then10.i, %if.end8.i
%y.061.i = phi ptr [ %y.059.i, %if.then10.i ], [ %y.0.ph.i, %if.end8.i ]
%x.056.i = phi ptr [ %x.055.i, %if.then10.i ], [ null, %if.end8.i ]
%parent13.i = getelementptr inbounds %struct.node, ptr %y.061.i, i64 0, i32 2
%18 = load ptr, ptr %parent13.i, align 8, !tbaa !18
%cmp14.i = icmp eq ptr %18, null
br i1 %cmp14.i, label %if.end27.i, label %if.else16.i
if.else16.i: ; preds = %if.end12.i
%left18.i = getelementptr inbounds %struct.node, ptr %18, i64 0, i32 1
%19 = load ptr, ptr %left18.i, align 8, !tbaa !5
%cmp19.i = icmp eq ptr %y.061.i, %19
%left18..i = select i1 %cmp19.i, ptr %left18.i, ptr %18
br label %if.end27.i
if.end27.i: ; preds = %if.else16.i, %if.end12.i
%left18.sink.i = phi ptr [ @root, %if.end12.i ], [ %left18..i, %if.else16.i ]
store ptr %x.056.i, ptr %left18.sink.i, align 8, !tbaa !16
%cmp28.not.i = icmp eq ptr %y.061.i, %u.addr.0.lcssa.i56
br i1 %cmp28.not.i, label %treeDelete.exit, label %if.then29.i
if.then29.i: ; preds = %if.end27.i
%key.i60 = getelementptr inbounds %struct.node, ptr %y.061.i, i64 0, i32 3
%20 = load i32, ptr %key.i60, align 8, !tbaa !15
%key30.i = getelementptr inbounds %struct.node, ptr %u.addr.0.lcssa.i56, i64 0, i32 3
store i32 %20, ptr %key30.i, align 8, !tbaa !15
br label %treeDelete.exit
treeDelete.exit: ; preds = %if.end27.i, %if.then29.i
call void @free(ptr noundef nonnull %y.061.i) #9
br label %for.inc
for.inc: ; preds = %for.body, %if.then8, %if.else, %if.then23, %treeDelete.exit, %insert.exit
%inc = add nuw nsw i32 %i.064, 1
%21 = load i32, ptr %n, align 4, !tbaa !21
%cmp = icmp slt i32 %inc, %21
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !23
for.end: ; preds = %for.inc, %entry
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %com) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8
attributes #0 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind "no-trapping-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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!6, !7, i64 0}
!14 = distinct !{!14, !12}
!15 = !{!6, !10, i64 24}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !12}
!18 = !{!6, !7, i64 16}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!10, !10, i64 0}
!22 = !{!8, !8, i64 0}
!23 = distinct !{!23, !12}
|
#include<stdio.h>
int getmin(int x,int y,int z);
int main () {
int n,k,l,c,d,p,nl,np;
int x,y,z;
while (scanf("%d%d%d%d%d%d%d%d",&n,&k,&l,&c,&d,&p,&nl,&np)!=EOF) {
x = k*l/nl;
y = c*d;
z = p/np;
printf("%d\n",getmin(x,y,z)/n);
}
return 0;
}
int getmin(int x,int y,int z) {
if (x<y) {
if (x<z) return x;
return z;
} else {
if (y<z) return y;
return z;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20727/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20727/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [17 x i8] c"%d%d%d%d%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:
%n = alloca i32, align 4
%k = alloca i32, align 4
%l = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%p = alloca i32, align 4
%nl = alloca i32, align 4
%np = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nl) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %np) #5
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %l, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %p, ptr noundef nonnull %nl, ptr noundef nonnull %np)
%cmp.not7 = icmp eq i32 %call6, -1
br i1 %cmp.not7, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %k, align 4, !tbaa !5
%1 = load i32, ptr %l, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %nl, align 4, !tbaa !5
%div = sdiv i32 %mul, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%4 = load i32, ptr %d, align 4, !tbaa !5
%mul1 = mul nsw i32 %4, %3
%5 = load i32, ptr %p, align 4, !tbaa !5
%6 = load i32, ptr %np, align 4, !tbaa !5
%div2 = sdiv i32 %5, %6
%minmaxop.i = call i32 @llvm.smin.i32(i32 %div, i32 %mul1)
%retval.0.i = call i32 @llvm.smin.i32(i32 %minmaxop.i, i32 %div2)
%7 = load i32, ptr %n, align 4, !tbaa !5
%div4 = sdiv i32 %retval.0.i, %7
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div4)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %l, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %p, ptr noundef nonnull %nl, ptr noundef nonnull %np)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %np) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nl) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @getmin(i32 noundef %x, i32 noundef %y, i32 noundef %z) local_unnamed_addr #3 {
entry:
%minmaxop = tail call i32 @llvm.smin.i32(i32 %x, i32 %y)
%retval.0 = tail call i32 @llvm.smin.i32(i32 %minmaxop, i32 %z)
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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 = { 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 #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"}
|
#include <stdio.h>
#include <string.h>
int main() {
char S[20];
char T[21];
scanf("%s",S);
scanf("%s",T);
int sizeS = strlen(S);
int sizeT = strlen(T);
int count = 0;
if(sizeS>=1 && sizeS<=10 && sizeT==sizeS+1) {
for(int i=0;S[i]!='\0';i++) {
if(S[i]==T[i]) {
count++;
}
}
if(count==sizeS && T[sizeT-1]>=97 && T[sizeT-1]<=122) {
printf("Yes");
}else {
printf("No");
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207312/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207312/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [20 x i8], align 16
%T = alloca [21 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %T) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #5
%conv = trunc i64 %call4 to i32
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %T) #5
%0 = add i32 %conv, -1
%or.cond = icmp ult i32 %0, 10
%conv7 = trunc i64 %call6 to i32
%add = add nuw nsw i32 %conv, 1
%cmp12 = icmp eq i32 %add, %conv7
%or.cond56 = select i1 %or.cond, i1 %cmp12, i1 false
br i1 %or.cond56, label %for.cond.preheader, label %if.end46
for.cond.preheader: ; preds = %entry
%1 = load i8, ptr %S, align 16, !tbaa !5
%cmp15.not58 = icmp eq i8 %1, 0
br i1 %cmp15.not58, label %for.cond.cleanup, label %for.body
for.cond.cleanup: ; preds = %for.body, %for.cond.preheader
%count.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %spec.select, %for.body ]
%cmp27 = icmp eq i32 %count.0.lcssa, %conv
br i1 %cmp27, label %land.lhs.true29, label %if.else
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%2 = phi i8 [ %4, %for.body ], [ %1, %for.cond.preheader ]
%count.059 = phi i32 [ %spec.select, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx21 = getelementptr inbounds [21 x i8], ptr %T, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx21, align 1, !tbaa !5
%cmp23 = icmp eq i8 %2, %3
%inc = zext i1 %cmp23 to i32
%spec.select = add nuw nsw i32 %count.059, %inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [20 x i8], ptr %S, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp15.not = icmp eq i8 %4, 0
br i1 %cmp15.not, label %for.cond.cleanup, label %for.body, !llvm.loop !8
land.lhs.true29: ; preds = %for.cond.cleanup
%sub = add i64 %call6, 4294967295
%idxprom30 = and i64 %sub, 4294967295
%arrayidx31 = getelementptr inbounds [21 x i8], ptr %T, i64 0, i64 %idxprom30
%5 = load i8, ptr %arrayidx31, align 1, !tbaa !5
%6 = add i8 %5, -97
%or.cond57 = icmp ult i8 %6, 26
br i1 %or.cond57, label %if.end46.sink.split, label %if.else
if.else: ; preds = %land.lhs.true29, %for.cond.cleanup
br label %if.end46.sink.split
if.end46.sink.split: ; preds = %land.lhs.true29, %if.else
%.str.1.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %land.lhs.true29 ]
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
br label %if.end46
if.end46: ; preds = %if.end46.sink.split, %entry
call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %T) #4
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#define N 100
int main(void){
int j,F = 1;
char s[N],s_n[N];
scanf("%s",&s);
//printf("s = %s\n",s); //OK
scanf("%s",&s_n);
//check(&s);
for(j = 0; s[j] != '\0';j++){
//printf("s = %c, s_n = %c\n",s[j],s_n[j]);
if(s[j] != s_n[j]){
printf("No\n");
F = 0;
break;
}
}
if(F)
printf("Yes\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207363/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207363/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = 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:
%s = alloca [100 x i8], align 16
%s_n = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s_n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s_n)
%0 = load i8, ptr %s, align 16, !tbaa !5
%cmp.not.not19 = icmp eq i8 %0, 0
br i1 %cmp.not.not19, label %if.end14, label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%1 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not.not = icmp eq i8 %1, 0
br i1 %cmp.not.not, label %if.end14, label %for.body, !llvm.loop !8
for.body: ; preds = %entry, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%2 = phi i8 [ %1, %for.cond ], [ %0, %entry ]
%arrayidx7 = getelementptr inbounds [100 x i8], ptr %s_n, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx7, align 1, !tbaa !5
%cmp9.not = icmp eq i8 %2, %3
br i1 %cmp9.not, label %for.cond, label %if.end14
if.end14: ; preds = %for.cond, %for.body, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ @str, %for.body ], [ @str.3, %for.cond ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s_n) #4
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(){
char s[20];
char t[21];
int ans=0;
scanf("%s ",s);
scanf(" %s ",t);
for(int i=0;i<strlen(s);++i){
if(s[i]!=t[i]){
ans+=1;
break;
}
}
if(ans==0){
printf("Yes\n");
}else {
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207406/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207406/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%s \00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c" %s \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:
%s = alloca [20 x i8], align 16
%t = alloca [21 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 21, ptr nonnull %t) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%cmp.not26.not = icmp eq i64 %call4, 0
br i1 %cmp.not26.not, label %if.end17, label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %call4
br i1 %exitcond.not, label %if.end17, label %for.body, !llvm.loop !5
for.body: ; preds = %entry, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%arrayidx8 = getelementptr inbounds [21 x i8], ptr %t, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx8, align 1, !tbaa !7
%cmp10.not = icmp eq i8 %0, %1
br i1 %cmp10.not, label %for.cond, label %if.end17
if.end17: ; preds = %for.body, %for.cond, %entry
%str.sink = phi ptr [ @str.4, %entry ], [ @str.4, %for.cond ], [ @str, %for.body ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 21, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int min(int a,int b,int c)
{
if(a<b&&a<c)
return a;
else if(b<a&&b<c)
return b;
else
return c;
}
int main()
{
int n,k,l,c,d,p,nl,np,a;
scanf("%d %d %d %d %d %d %d %d",&n,&k,&l,&c,&d,&p,&nl,&np);
a=min(k*l/nl,c*d,p/np)/n;
printf("%d\n",a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20745/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20745/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [24 x i8] c"%d %d %d %d %d %d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 {
entry:
%cmp = icmp slt i32 %a, %b
%cmp1 = icmp slt i32 %a, %c
%or.cond = and i1 %cmp, %cmp1
%cmp2 = icmp slt i32 %b, %a
%cmp4 = icmp slt i32 %b, %c
%or.cond15 = and i1 %cmp2, %cmp4
%spec.select = select i1 %or.cond15, i32 %b, i32 %c
%retval.0 = select i1 %or.cond, i32 %a, i32 %spec.select
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%l = alloca i32, align 4
%c = alloca i32, align 4
%d = alloca i32, align 4
%p = alloca i32, align 4
%nl = alloca i32, align 4
%np = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %nl) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %np) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %l, ptr noundef nonnull %c, ptr noundef nonnull %d, ptr noundef nonnull %p, ptr noundef nonnull %nl, ptr noundef nonnull %np)
%0 = load i32, ptr %k, align 4, !tbaa !5
%1 = load i32, ptr %l, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %nl, align 4, !tbaa !5
%div = sdiv i32 %mul, %2
%3 = load i32, ptr %c, align 4, !tbaa !5
%4 = load i32, ptr %d, align 4, !tbaa !5
%mul1 = mul nsw i32 %4, %3
%5 = load i32, ptr %p, align 4, !tbaa !5
%6 = load i32, ptr %np, align 4, !tbaa !5
%div2 = sdiv i32 %5, %6
%cmp.i = icmp slt i32 %div, %mul1
%cmp1.i = icmp slt i32 %div, %div2
%or.cond.i = and i1 %cmp.i, %cmp1.i
%cmp2.i = icmp slt i32 %mul1, %div
%cmp4.i = icmp slt i32 %mul1, %div2
%or.cond15.i = and i1 %cmp2.i, %cmp4.i
%spec.select.i = select i1 %or.cond15.i, i32 %mul1, i32 %div2
%retval.0.i = select i1 %or.cond.i, i32 %div, i32 %spec.select.i
%7 = load i32, ptr %n, align 4, !tbaa !5
%div4 = sdiv i32 %retval.0.i, %7
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %np) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %nl) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<string.h>
int main(){
int len;
char S[20],T[20];
scanf("%s%s",S,T);
len=strlen(S);
for(int i=0;i<len;++i){
if(S[i]!=T[i]){
printf("No\n");
return 0;
}
}
printf("Yes\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207493/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207493/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@str = 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:
%S = alloca [20 x i8], align 16
%T = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %S) #5
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %T) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %T)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6
%conv = trunc i64 %call3 to i32
%cmp.not20 = icmp sgt i32 %conv, 0
br i1 %cmp.not20, label %for.body.preheader, label %cleanup13
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call3, 4294967295
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup13, label %for.body, !llvm.loop !5
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds [20 x i8], ptr %S, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !7
%arrayidx7 = getelementptr inbounds [20 x i8], ptr %T, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx7, align 1, !tbaa !7
%cmp9.not = icmp eq i8 %0, %1
br i1 %cmp9.not, label %for.cond, label %cleanup13
cleanup13: ; preds = %for.cond, %for.body, %entry
%str.sink = phi ptr [ @str.3, %entry ], [ @str, %for.body ], [ @str.3, %for.cond ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %S) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
int K,A,B,i;
char str1[1000],str2[1000];
fgets(str1, sizeof(str1), stdin);
fgets(str2, sizeof(str2), stdin);
if(strncmp(str1,str2,(strlen(str1)-1)) == 0){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207536/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207536/source.c"
target datalayout = "e-m:e-p270: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"No\00", align 1
@str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str1 = alloca [1000 x i8], align 16
%str2 = alloca [1000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %str1) #5
call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %str2) #5
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %str1, i32 noundef 1000, ptr noundef %0)
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call2 = call ptr @fgets(ptr noundef nonnull %str2, i32 noundef 1000, ptr noundef %1)
%call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str1) #6
%sub = add i64 %call6, -1
%call7 = call i32 @strncmp(ptr noundef nonnull %str1, ptr noundef nonnull %str2, i64 noundef %sub) #6
%cmp = icmp eq i32 %call7, 0
%str.2.str = select i1 %cmp, ptr @str.2, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.2.str)
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %str2) #5
call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %str1) #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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3
; 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main(void){
char S[100];
char T[100];
scanf("%s",S);
scanf("%s",T);
int a = strlen(S);
int b = strlen(T);
int count=0;
for(int i=0;i<a;i++){
if (S[i]==T[i]) count++;
}
if(count==a) printf("Yes");
else printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207587/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207587/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca [100 x i8], align 16
%T = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %S) #5
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %T) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %T)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %S) #6
%conv = trunc i64 %call4 to i32
%cmp27 = icmp sgt i32 %conv, 0
br i1 %cmp27, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call4, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count, 8
br i1 %min.iters.check, label %for.body.preheader35, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.mod.vf = and i64 %call4, 7
%n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi31 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%0 = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i8, ptr %0, i64 4
%wide.load32 = load <4 x i8>, ptr %1, align 4, !tbaa !5
%2 = getelementptr inbounds [100 x i8], ptr %T, i64 0, i64 %index
%wide.load33 = load <4 x i8>, ptr %2, align 8, !tbaa !5
%3 = getelementptr inbounds i8, ptr %2, i64 4
%wide.load34 = load <4 x i8>, ptr %3, align 4, !tbaa !5
%4 = icmp eq <4 x i8> %wide.load, %wide.load33
%5 = icmp eq <4 x i8> %wide.load32, %wide.load34
%6 = zext <4 x i1> %4 to <4 x i32>
%7 = zext <4 x i1> %5 to <4 x i32>
%8 = add <4 x i32> %vec.phi, %6
%9 = add <4 x i32> %vec.phi31, %7
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %9, %8
%11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader35
for.body.preheader35: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%count.028.ph = phi i32 [ 0, %for.body.preheader ], [ %11, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%count.0.lcssa = phi i32 [ 0, %entry ], [ %11, %middle.block ], [ %spec.select, %for.body ]
%cmp16 = icmp eq i32 %count.0.lcssa, %conv
%.str.1..str.2 = select i1 %cmp16, ptr @.str.1, ptr @.str.2
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %T) #5
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %S) #5
ret i32 0
for.body: ; preds = %for.body.preheader35, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader35 ]
%count.028 = phi i32 [ %spec.select, %for.body ], [ %count.028.ph, %for.body.preheader35 ]
%arrayidx = getelementptr inbounds [100 x i8], ptr %S, i64 0, i64 %indvars.iv
%12 = load i8, ptr %arrayidx, align 1, !tbaa !5
%arrayidx11 = getelementptr inbounds [100 x i8], ptr %T, i64 0, i64 %indvars.iv
%13 = load i8, ptr %arrayidx11, align 1, !tbaa !5
%cmp13 = icmp eq i8 %12, %13
%inc = zext i1 %cmp13 to i32
%spec.select = add nuw nsw i32 %count.028, %inc
%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 !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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; 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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !11, !10}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(void){
char s[11],t[12];
scanf("%s%s",s,t);
int a=strlen(s);
if(strncmp(s,t,a)==0)
printf("Yes");
else
{
printf("No");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207651/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207651/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [11 x i8], align 1
%t = alloca [12 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5
%sext = shl i64 %call3, 32
%conv6 = ashr exact i64 %sext, 32
%call7 = call i32 @strncmp(ptr noundef nonnull %s, ptr noundef nonnull %t, i64 noundef %conv6) #5
%cmp = icmp eq i32 %call7, 0
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, 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 memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main(){
char s[20],t[20];
int i;
scanf("%s %s",s,t);
for(i=0;s[i];i++){
if(s[i]!=t[i]){
printf("No\n");
return 0;
}
}
if(t[i]==0||t[i+1]){
printf("No\n");
return 0;
}
printf("Yes\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207716/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207716/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1
@str = 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:
%s = alloca [20 x i8], align 16
%t = 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 %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%0 = load i8, ptr %s, align 16, !tbaa !5
%tobool.not33 = icmp eq i8 %0, 0
br i1 %tobool.not33, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%1 = phi i8 [ %3, %for.inc ], [ %0, %entry ]
%arrayidx5 = getelementptr inbounds [20 x i8], ptr %t, i64 0, i64 %indvars.iv
%2 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%cmp.not = icmp eq i8 %1, %2
br i1 %cmp.not, label %for.inc, label %cleanup
for.inc: ; preds = %for.body
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [20 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx, align 1, !tbaa !5
%tobool.not = icmp eq i8 %3, 0
br i1 %tobool.not, label %for.end.loopexit, label %for.body, !llvm.loop !8
for.end.loopexit: ; preds = %for.inc
%4 = add i64 %indvars.iv, 2
%5 = and i64 %4, 4294967295
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%i.0.lcssa = phi i64 [ 1, %entry ], [ %5, %for.end.loopexit ]
%idxprom.lcssa = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.end.loopexit ]
%arrayidx10 = getelementptr inbounds [20 x i8], ptr %t, i64 0, i64 %idxprom.lcssa
%6 = load i8, ptr %arrayidx10, align 1, !tbaa !5
%cmp12 = icmp eq i8 %6, 0
br i1 %cmp12, label %cleanup, label %lor.lhs.false
lor.lhs.false: ; preds = %for.end
%arrayidx15 = getelementptr inbounds [20 x i8], ptr %t, i64 0, i64 %i.0.lcssa
%7 = load i8, ptr %arrayidx15, align 1, !tbaa !5
%tobool17.not = icmp eq i8 %7, 0
%spec.select = select i1 %tobool17.not, ptr @str, ptr @str.4
br label %cleanup
cleanup: ; preds = %for.body, %lor.lhs.false, %for.end
%str.sink = phi ptr [ @str.4, %for.end ], [ %spec.select, %lor.lhs.false ], [ @str.4, %for.body ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
char judge(int hand[5]);
void sort(int *hand);
int main(void)
{
int hand[5];
char rank;
int OF;
while (scanf(" %d,", &OF) != EOF){
hand[0] = OF;
scanf("%d,%d,%d,%d", &hand[1], &hand[2]
, &hand[3], &hand[4]);
sort(hand);
rank = judge(hand);
switch (rank){
case ('S'):
printf("four card\n");
break;
case ('A'):
printf("full house\n");
break;
case ('B'):
printf("straight\n");
break;
case ('C'):
printf("three card\n");
break;
case ('D'):
printf("two pair\n");
break;
case ('E'):
printf("one pair\n");
break;
case ('F'):
printf("null\n");
break;
}
}
return (0);
}
void sort(int *hand)
{
int i, j;
int tmp;
for (i = 0; i < 5; i++){
for (j = 0; j < 5; j++){
if (hand[i] < hand[j]){
tmp = hand[i];
hand[i] = hand[j];
hand[j] = tmp;
}
}
}
}
char judge(int hand[5])
{
int pair = 0;
int card_3 = 0, card_4 = 0;
char rank;
int straight = 0;
int i;
int sum = 0;
for (i = 0; i < 5; i++){
sum += hand[i];
if (hand[i] == hand[i + 1]){
pair++;
if (hand[i] == hand[i + 2]){
pair--;
card_3++;
if (hand[i] == hand[i + 3]){
card_3--;
card_4++;
i++;
i++;
}
else {
i++;
}
}
}
if (hand[i] + 1 == hand[i + 1]){
straight++;
}
}
if (card_4 == 1){
rank = 'S';
}
else if (card_3 == 1 && pair == 1){
rank = 'A';
}
else if (straight == 4){
rank = 'B';
}
else if (straight == 3 && sum == 47){
rank = 'B';
}
else if (card_3 == 1){
rank = 'C';
}
else if (pair == 2){
rank = 'D';
}
else if (pair == 1){
rank = 'E';
}
else {
rank = 'F';
}
return (rank);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207767/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207767/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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,\00", align 1
@.str.1 = private unnamed_addr constant [12 x i8] c"%d,%d,%d,%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"null\00", align 1
@str.9 = private unnamed_addr constant [9 x i8] c"one pair\00", align 1
@str.10 = private unnamed_addr constant [9 x i8] c"two pair\00", align 1
@str.11 = private unnamed_addr constant [11 x i8] c"three card\00", align 1
@str.12 = private unnamed_addr constant [9 x i8] c"straight\00", align 1
@str.13 = private unnamed_addr constant [11 x i8] c"full house\00", align 1
@str.14 = private unnamed_addr constant [10 x i8] c"four card\00", align 1
@reltable.main = private unnamed_addr constant [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint (ptr @str.12 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.11 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.10 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str.9 to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint (ptr @str to i64), i64 ptrtoint (ptr @reltable.main to i64)) to i32)], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%hand = alloca [5 x i32], align 16
%OF = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %hand) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %OF) #7
%call35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %OF)
%cmp.not36 = icmp eq i32 %call35, -1
br i1 %cmp.not36, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%arrayidx1 = getelementptr inbounds [5 x i32], ptr %hand, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [5 x i32], ptr %hand, i64 0, i64 2
%arrayidx3 = getelementptr inbounds [5 x i32], ptr %hand, i64 0, i64 3
%arrayidx4 = getelementptr inbounds [5 x i32], ptr %hand, i64 0, i64 4
br label %while.body
while.body: ; preds = %while.body.lr.ph, %sw.epilog.sink.split
%0 = load i32, ptr %OF, align 4, !tbaa !5
store i32 %0, ptr %hand, align 16, !tbaa !5
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4)
%1 = load i32, ptr %hand, align 16, !tbaa !5
%2 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp6.1.i = icmp slt i32 %1, %2
br i1 %cmp6.1.i, label %if.then.1.i, label %for.inc.1.i
if.then.1.i: ; preds = %while.body
store i32 %2, ptr %hand, align 16, !tbaa !5
store i32 %1, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.1.i
for.inc.1.i: ; preds = %if.then.1.i, %while.body
%3 = phi i32 [ %1, %if.then.1.i ], [ %2, %while.body ]
%4 = phi i32 [ %2, %if.then.1.i ], [ %1, %while.body ]
%5 = load i32, ptr %arrayidx2, align 8, !tbaa !5
%cmp6.2.i = icmp slt i32 %4, %5
br i1 %cmp6.2.i, label %if.then.2.i, label %for.inc.2.i
if.then.2.i: ; preds = %for.inc.1.i
store i32 %5, ptr %hand, align 16, !tbaa !5
store i32 %4, ptr %arrayidx2, align 8, !tbaa !5
br label %for.inc.2.i
for.inc.2.i: ; preds = %if.then.2.i, %for.inc.1.i
%6 = phi i32 [ %4, %if.then.2.i ], [ %5, %for.inc.1.i ]
%7 = phi i32 [ %5, %if.then.2.i ], [ %4, %for.inc.1.i ]
%8 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp6.3.i = icmp slt i32 %7, %8
br i1 %cmp6.3.i, label %if.then.3.i, label %for.inc.3.i
if.then.3.i: ; preds = %for.inc.2.i
store i32 %8, ptr %hand, align 16, !tbaa !5
store i32 %7, ptr %arrayidx3, align 4, !tbaa !5
br label %for.inc.3.i
for.inc.3.i: ; preds = %if.then.3.i, %for.inc.2.i
%9 = phi i32 [ %7, %if.then.3.i ], [ %8, %for.inc.2.i ]
%10 = phi i32 [ %8, %if.then.3.i ], [ %7, %for.inc.2.i ]
%11 = load i32, ptr %arrayidx4, align 16, !tbaa !5
%cmp6.4.i = icmp slt i32 %10, %11
br i1 %cmp6.4.i, label %if.then.4.i, label %for.inc.4.i
if.then.4.i: ; preds = %for.inc.3.i
store i32 %11, ptr %hand, align 16, !tbaa !5
store i32 %10, ptr %arrayidx4, align 16, !tbaa !5
br label %for.inc.4.i
for.inc.4.i: ; preds = %if.then.4.i, %for.inc.3.i
%12 = phi i32 [ %10, %if.then.4.i ], [ %11, %for.inc.3.i ]
%13 = phi i32 [ %11, %if.then.4.i ], [ %10, %for.inc.3.i ]
%cmp6.136.i = icmp slt i32 %3, %13
br i1 %cmp6.136.i, label %if.then.137.i, label %for.inc.1.1.i
if.then.137.i: ; preds = %for.inc.4.i
store i32 %13, ptr %arrayidx1, align 4, !tbaa !5
store i32 %3, ptr %hand, align 16, !tbaa !5
br label %for.inc.1.1.i
for.inc.1.1.i: ; preds = %if.then.137.i, %for.inc.4.i
%14 = phi i32 [ %3, %if.then.137.i ], [ %13, %for.inc.4.i ]
%15 = phi i32 [ %13, %if.then.137.i ], [ %3, %for.inc.4.i ]
%cmp6.2.1.i = icmp slt i32 %15, %6
br i1 %cmp6.2.1.i, label %if.then.2.1.i, label %for.inc.2.1.i
if.then.2.1.i: ; preds = %for.inc.1.1.i
store i32 %6, ptr %arrayidx1, align 4, !tbaa !5
store i32 %15, ptr %arrayidx2, align 8, !tbaa !5
br label %for.inc.2.1.i
for.inc.2.1.i: ; preds = %if.then.2.1.i, %for.inc.1.1.i
%16 = phi i32 [ %15, %if.then.2.1.i ], [ %6, %for.inc.1.1.i ]
%17 = phi i32 [ %6, %if.then.2.1.i ], [ %15, %for.inc.1.1.i ]
%cmp6.3.1.i = icmp slt i32 %17, %9
br i1 %cmp6.3.1.i, label %if.then.3.1.i, label %for.inc.3.1.i
if.then.3.1.i: ; preds = %for.inc.2.1.i
store i32 %9, ptr %arrayidx1, align 4, !tbaa !5
store i32 %17, ptr %arrayidx3, align 4, !tbaa !5
br label %for.inc.3.1.i
for.inc.3.1.i: ; preds = %if.then.3.1.i, %for.inc.2.1.i
%18 = phi i32 [ %17, %if.then.3.1.i ], [ %9, %for.inc.2.1.i ]
%19 = phi i32 [ %9, %if.then.3.1.i ], [ %17, %for.inc.2.1.i ]
%cmp6.4.1.i = icmp slt i32 %19, %12
br i1 %cmp6.4.1.i, label %if.then.4.1.i, label %for.inc.4.1.i
if.then.4.1.i: ; preds = %for.inc.3.1.i
store i32 %12, ptr %arrayidx1, align 4, !tbaa !5
store i32 %19, ptr %arrayidx4, align 16, !tbaa !5
br label %for.inc.4.1.i
for.inc.4.1.i: ; preds = %if.then.4.1.i, %for.inc.3.1.i
%20 = phi i32 [ %19, %if.then.4.1.i ], [ %12, %for.inc.3.1.i ]
%21 = phi i32 [ %12, %if.then.4.1.i ], [ %19, %for.inc.3.1.i ]
%cmp6.239.i = icmp slt i32 %16, %14
br i1 %cmp6.239.i, label %if.then.240.i, label %for.inc.241.i
if.then.240.i: ; preds = %for.inc.4.1.i
store i32 %14, ptr %arrayidx2, align 8, !tbaa !5
store i32 %16, ptr %hand, align 16, !tbaa !5
br label %for.inc.241.i
for.inc.241.i: ; preds = %if.then.240.i, %for.inc.4.1.i
%22 = phi i32 [ %16, %if.then.240.i ], [ %14, %for.inc.4.1.i ]
%23 = phi i32 [ %14, %if.then.240.i ], [ %16, %for.inc.4.1.i ]
%cmp6.1.2.i = icmp slt i32 %23, %21
br i1 %cmp6.1.2.i, label %if.then.1.2.i, label %for.inc.2.2.i
if.then.1.2.i: ; preds = %for.inc.241.i
store i32 %21, ptr %arrayidx2, align 8, !tbaa !5
store i32 %23, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.2.2.i
for.inc.2.2.i: ; preds = %if.then.1.2.i, %for.inc.241.i
%24 = phi i32 [ %23, %if.then.1.2.i ], [ %21, %for.inc.241.i ]
%25 = phi i32 [ %21, %if.then.1.2.i ], [ %23, %for.inc.241.i ]
%cmp6.3.2.i = icmp slt i32 %25, %18
br i1 %cmp6.3.2.i, label %if.then.3.2.i, label %for.inc.3.2.i
if.then.3.2.i: ; preds = %for.inc.2.2.i
store i32 %18, ptr %arrayidx2, align 8, !tbaa !5
store i32 %25, ptr %arrayidx3, align 4, !tbaa !5
br label %for.inc.3.2.i
for.inc.3.2.i: ; preds = %if.then.3.2.i, %for.inc.2.2.i
%26 = phi i32 [ %25, %if.then.3.2.i ], [ %18, %for.inc.2.2.i ]
%27 = phi i32 [ %18, %if.then.3.2.i ], [ %25, %for.inc.2.2.i ]
%cmp6.4.2.i = icmp slt i32 %27, %20
br i1 %cmp6.4.2.i, label %if.then.4.2.i, label %for.inc.4.2.i
if.then.4.2.i: ; preds = %for.inc.3.2.i
store i32 %20, ptr %arrayidx2, align 8, !tbaa !5
store i32 %27, ptr %arrayidx4, align 16, !tbaa !5
br label %for.inc.4.2.i
for.inc.4.2.i: ; preds = %if.then.4.2.i, %for.inc.3.2.i
%28 = phi i32 [ %27, %if.then.4.2.i ], [ %20, %for.inc.3.2.i ]
%29 = phi i32 [ %20, %if.then.4.2.i ], [ %27, %for.inc.3.2.i ]
%cmp6.342.i = icmp slt i32 %26, %22
br i1 %cmp6.342.i, label %if.then.343.i, label %for.inc.344.i
if.then.343.i: ; preds = %for.inc.4.2.i
store i32 %22, ptr %arrayidx3, align 4, !tbaa !5
store i32 %26, ptr %hand, align 16, !tbaa !5
br label %for.inc.344.i
for.inc.344.i: ; preds = %if.then.343.i, %for.inc.4.2.i
%30 = phi i32 [ %26, %if.then.343.i ], [ %22, %for.inc.4.2.i ]
%31 = phi i32 [ %22, %if.then.343.i ], [ %26, %for.inc.4.2.i ]
%cmp6.1.3.i = icmp slt i32 %31, %24
br i1 %cmp6.1.3.i, label %if.then.1.3.i, label %for.inc.1.3.i
if.then.1.3.i: ; preds = %for.inc.344.i
store i32 %24, ptr %arrayidx3, align 4, !tbaa !5
store i32 %31, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.1.3.i
for.inc.1.3.i: ; preds = %if.then.1.3.i, %for.inc.344.i
%32 = phi i32 [ %31, %if.then.1.3.i ], [ %24, %for.inc.344.i ]
%33 = phi i32 [ %24, %if.then.1.3.i ], [ %31, %for.inc.344.i ]
%cmp6.2.3.i = icmp slt i32 %33, %29
br i1 %cmp6.2.3.i, label %if.then.2.3.i, label %for.inc.3.3.i
if.then.2.3.i: ; preds = %for.inc.1.3.i
store i32 %29, ptr %arrayidx3, align 4, !tbaa !5
store i32 %33, ptr %arrayidx2, align 8, !tbaa !5
br label %for.inc.3.3.i
for.inc.3.3.i: ; preds = %if.then.2.3.i, %for.inc.1.3.i
%34 = phi i32 [ %33, %if.then.2.3.i ], [ %29, %for.inc.1.3.i ]
%35 = phi i32 [ %29, %if.then.2.3.i ], [ %33, %for.inc.1.3.i ]
%cmp6.4.3.i = icmp slt i32 %35, %28
br i1 %cmp6.4.3.i, label %if.then.4.3.i, label %for.inc.4.3.i
if.then.4.3.i: ; preds = %for.inc.3.3.i
store i32 %28, ptr %arrayidx3, align 4, !tbaa !5
store i32 %35, ptr %arrayidx4, align 16, !tbaa !5
br label %for.inc.4.3.i
for.inc.4.3.i: ; preds = %if.then.4.3.i, %for.inc.3.3.i
%36 = phi i32 [ %28, %if.then.4.3.i ], [ %35, %for.inc.3.3.i ]
%37 = phi i32 [ %35, %if.then.4.3.i ], [ %28, %for.inc.3.3.i ]
%cmp6.445.i = icmp slt i32 %37, %30
br i1 %cmp6.445.i, label %if.then.446.i, label %for.inc.447.i
if.then.446.i: ; preds = %for.inc.4.3.i
store i32 %30, ptr %arrayidx4, align 16, !tbaa !5
store i32 %37, ptr %hand, align 16, !tbaa !5
br label %for.inc.447.i
for.inc.447.i: ; preds = %if.then.446.i, %for.inc.4.3.i
%.pre.i = phi i32 [ %37, %if.then.446.i ], [ %30, %for.inc.4.3.i ]
%38 = phi i32 [ %30, %if.then.446.i ], [ %37, %for.inc.4.3.i ]
%cmp6.1.4.i = icmp slt i32 %38, %32
br i1 %cmp6.1.4.i, label %if.then.1.4.i, label %for.inc.1.4.i
if.then.1.4.i: ; preds = %for.inc.447.i
store i32 %32, ptr %arrayidx4, align 16, !tbaa !5
store i32 %38, ptr %arrayidx1, align 4, !tbaa !5
br label %for.inc.1.4.i
for.inc.1.4.i: ; preds = %if.then.1.4.i, %for.inc.447.i
%39 = phi i32 [ %32, %if.then.1.4.i ], [ %38, %for.inc.447.i ]
%cmp6.2.4.i = icmp slt i32 %39, %34
br i1 %cmp6.2.4.i, label %if.then.2.4.i, label %for.inc.2.4.i
if.then.2.4.i: ; preds = %for.inc.1.4.i
store i32 %34, ptr %arrayidx4, align 16, !tbaa !5
store i32 %39, ptr %arrayidx2, align 8, !tbaa !5
br label %for.inc.2.4.i
for.inc.2.4.i: ; preds = %if.then.2.4.i, %for.inc.1.4.i
%40 = phi i32 [ %34, %if.then.2.4.i ], [ %39, %for.inc.1.4.i ]
%cmp6.3.4.i = icmp slt i32 %40, %36
br i1 %cmp6.3.4.i, label %if.then.3.4.i, label %for.body.i.preheader
if.then.3.4.i: ; preds = %for.inc.2.4.i
store i32 %36, ptr %arrayidx4, align 16, !tbaa !5
store i32 %40, ptr %arrayidx3, align 4, !tbaa !5
br label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.inc.2.4.i, %if.then.3.4.i
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %if.end28.i
%41 = phi i32 [ %46, %if.end28.i ], [ %.pre.i, %for.body.i.preheader ]
%sum.0110.i = phi i32 [ %add.i, %if.end28.i ], [ 0, %for.body.i.preheader ]
%i.0109.i = phi i32 [ %add32.i, %if.end28.i ], [ 0, %for.body.i.preheader ]
%straight.0108.i = phi i32 [ %spec.select.i, %if.end28.i ], [ 0, %for.body.i.preheader ]
%card_4.0107.i = phi i32 [ %card_4.1.i, %if.end28.i ], [ 0, %for.body.i.preheader ]
%card_3.0106.i = phi i32 [ %card_3.1.i, %if.end28.i ], [ 0, %for.body.i.preheader ]
%pair.0105.i = phi i32 [ %pair.1.i, %if.end28.i ], [ 0, %for.body.i.preheader ]
%idxprom.i = sext i32 %i.0109.i to i64
%add.i = add nsw i32 %sum.0110.i, %41
%add3.i = add nsw i32 %i.0109.i, 1
%idxprom4.i = sext i32 %add3.i to i64
%arrayidx5.i = getelementptr inbounds i32, ptr %hand, i64 %idxprom4.i
%42 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp6.i = icmp eq i32 %41, %42
br i1 %cmp6.i, label %if.then.i, label %if.end28.i
if.then.i: ; preds = %for.body.i
%inc.i = add nsw i32 %pair.0105.i, 1
%add9.i = add nsw i32 %i.0109.i, 2
%idxprom10.i = sext i32 %add9.i to i64
%arrayidx11.i = getelementptr inbounds i32, ptr %hand, i64 %idxprom10.i
%43 = load i32, ptr %arrayidx11.i, align 4, !tbaa !5
%cmp12.i = icmp eq i32 %41, %43
br i1 %cmp12.i, label %if.then13.i, label %if.end28.i
if.then13.i: ; preds = %if.then.i
%add17.i = add nsw i32 %i.0109.i, 3
%idxprom18.i = sext i32 %add17.i to i64
%arrayidx19.i = getelementptr inbounds i32, ptr %hand, i64 %idxprom18.i
%44 = load i32, ptr %arrayidx19.i, align 4, !tbaa !5
%cmp20.i = icmp eq i32 %41, %44
br i1 %cmp20.i, label %if.then21.i, label %if.else.i
if.then21.i: ; preds = %if.then13.i
%inc23.i = add nsw i32 %card_4.0107.i, 1
br label %if.end28.i
if.else.i: ; preds = %if.then13.i
%inc14.i = add nsw i32 %card_3.0106.i, 1
br label %if.end28.i
if.end28.i: ; preds = %if.else.i, %if.then21.i, %if.then.i, %for.body.i
%idxprom29.pre-phi.i = phi i64 [ %idxprom.i, %if.then.i ], [ %idxprom4.i, %if.else.i ], [ %idxprom10.i, %if.then21.i ], [ %idxprom.i, %for.body.i ]
%pair.1.i = phi i32 [ %inc.i, %if.then.i ], [ %pair.0105.i, %if.else.i ], [ %pair.0105.i, %if.then21.i ], [ %pair.0105.i, %for.body.i ]
%card_3.1.i = phi i32 [ %card_3.0106.i, %if.then.i ], [ %inc14.i, %if.else.i ], [ %card_3.0106.i, %if.then21.i ], [ %card_3.0106.i, %for.body.i ]
%card_4.1.i = phi i32 [ %card_4.0107.i, %if.then.i ], [ %card_4.0107.i, %if.else.i ], [ %inc23.i, %if.then21.i ], [ %card_4.0107.i, %for.body.i ]
%i.1.i = phi i32 [ %i.0109.i, %if.then.i ], [ %add3.i, %if.else.i ], [ %add9.i, %if.then21.i ], [ %i.0109.i, %for.body.i ]
%arrayidx30.i = getelementptr inbounds i32, ptr %hand, i64 %idxprom29.pre-phi.i
%45 = load i32, ptr %arrayidx30.i, align 4, !tbaa !5
%add31.i = add nsw i32 %45, 1
%add32.i = add nsw i32 %i.1.i, 1
%idxprom33.i = sext i32 %add32.i to i64
%arrayidx34.i = getelementptr inbounds i32, ptr %hand, i64 %idxprom33.i
%46 = load i32, ptr %arrayidx34.i, align 4, !tbaa !5
%cmp35.i = icmp eq i32 %add31.i, %46
%inc37.i = zext i1 %cmp35.i to i32
%spec.select.i = add nuw nsw i32 %straight.0108.i, %inc37.i
%cmp.i = icmp slt i32 %i.1.i, 4
br i1 %cmp.i, label %for.body.i, label %for.end.i, !llvm.loop !9
for.end.i: ; preds = %if.end28.i
%cmp40.i = icmp eq i32 %card_4.1.i, 1
br i1 %cmp40.i, label %sw.epilog.sink.split, label %if.else42.i
if.else42.i: ; preds = %for.end.i
%cmp43.i = icmp eq i32 %card_3.1.i, 1
%cmp44.i = icmp eq i32 %pair.1.i, 1
%or.cond.i = select i1 %cmp43.i, i1 %cmp44.i, i1 false
br i1 %or.cond.i, label %sw.epilog.sink.split, label %if.else46.i
if.else46.i: ; preds = %if.else42.i
%cmp47.i = icmp eq i32 %spec.select.i, 4
br i1 %cmp47.i, label %sw.epilog.sink.split, label %switch.lookup
switch.lookup: ; preds = %if.else46.i
%cmp50.i = icmp eq i32 %spec.select.i, 3
%cmp52.i = icmp eq i32 %add.i, 47
%or.cond71.i = select i1 %cmp50.i, i1 %cmp52.i, i1 false
%cmp58.i = icmp eq i32 %pair.1.i, 2
%47 = select i1 %cmp44.i, i64 3, i64 4
%48 = select i1 %cmp58.i, i64 2, i64 %47
%49 = select i1 %cmp43.i, i64 1, i64 %48
%50 = select i1 %or.cond71.i, i64 0, i64 %49
%reltable.shift = shl i64 %50, 2
%reltable.intrinsic = call ptr @llvm.load.relative.i64(ptr @reltable.main, i64 %reltable.shift)
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %switch.lookup, %if.else46.i, %if.else42.i, %for.end.i
%str.sink = phi ptr [ @str.14, %for.end.i ], [ @str.13, %if.else42.i ], [ @str.12, %if.else46.i ], [ %reltable.intrinsic, %switch.lookup ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %OF)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %sw.epilog.sink.split, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %OF) #7
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %hand) #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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @sort(ptr nocapture noundef %hand) local_unnamed_addr #3 {
for.inc:
%0 = load i32, ptr %hand, align 4, !tbaa !5
%arrayidx5.1 = getelementptr inbounds i32, ptr %hand, i64 1
%1 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5
%cmp6.1 = icmp slt i32 %0, %1
br i1 %cmp6.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
store i32 %1, ptr %hand, align 4, !tbaa !5
store i32 %0, ptr %arrayidx5.1, align 4, !tbaa !5
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%2 = phi i32 [ %0, %if.then.1 ], [ %1, %for.inc ]
%3 = phi i32 [ %1, %if.then.1 ], [ %0, %for.inc ]
%arrayidx5.2 = getelementptr inbounds i32, ptr %hand, i64 2
%4 = load i32, ptr %arrayidx5.2, align 4, !tbaa !5
%cmp6.2 = icmp slt i32 %3, %4
br i1 %cmp6.2, label %if.then.2, label %for.inc.2
if.then.2: ; preds = %for.inc.1
store i32 %4, ptr %hand, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.2, align 4, !tbaa !5
br label %for.inc.2
for.inc.2: ; preds = %if.then.2, %for.inc.1
%5 = phi i32 [ %3, %if.then.2 ], [ %4, %for.inc.1 ]
%6 = phi i32 [ %4, %if.then.2 ], [ %3, %for.inc.1 ]
%arrayidx5.3 = getelementptr inbounds i32, ptr %hand, i64 3
%7 = load i32, ptr %arrayidx5.3, align 4, !tbaa !5
%cmp6.3 = icmp slt i32 %6, %7
br i1 %cmp6.3, label %if.then.3, label %for.inc.3
if.then.3: ; preds = %for.inc.2
store i32 %7, ptr %hand, align 4, !tbaa !5
store i32 %6, ptr %arrayidx5.3, align 4, !tbaa !5
br label %for.inc.3
for.inc.3: ; preds = %if.then.3, %for.inc.2
%8 = phi i32 [ %6, %if.then.3 ], [ %7, %for.inc.2 ]
%9 = phi i32 [ %7, %if.then.3 ], [ %6, %for.inc.2 ]
%arrayidx5.4 = getelementptr inbounds i32, ptr %hand, i64 4
%10 = load i32, ptr %arrayidx5.4, align 4, !tbaa !5
%cmp6.4 = icmp slt i32 %9, %10
br i1 %cmp6.4, label %if.then.4, label %for.inc.4
if.then.4: ; preds = %for.inc.3
store i32 %10, ptr %hand, align 4, !tbaa !5
store i32 %9, ptr %arrayidx5.4, align 4, !tbaa !5
br label %for.inc.4
for.inc.4: ; preds = %if.then.4, %for.inc.3
%11 = phi i32 [ %9, %if.then.4 ], [ %10, %for.inc.3 ]
%12 = phi i32 [ %10, %if.then.4 ], [ %9, %for.inc.3 ]
%cmp6.136 = icmp slt i32 %2, %12
br i1 %cmp6.136, label %if.then.137, label %for.inc.1.1
if.then.137: ; preds = %for.inc.4
store i32 %12, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %2, ptr %hand, align 4, !tbaa !5
br label %for.inc.1.1
for.inc.1.1: ; preds = %for.inc.4, %if.then.137
%13 = phi i32 [ %2, %if.then.137 ], [ %12, %for.inc.4 ]
%14 = phi i32 [ %12, %if.then.137 ], [ %2, %for.inc.4 ]
%cmp6.2.1 = icmp slt i32 %14, %5
br i1 %cmp6.2.1, label %if.then.2.1, label %for.inc.2.1
if.then.2.1: ; preds = %for.inc.1.1
store i32 %5, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %14, ptr %arrayidx5.2, align 4, !tbaa !5
br label %for.inc.2.1
for.inc.2.1: ; preds = %if.then.2.1, %for.inc.1.1
%15 = phi i32 [ %14, %if.then.2.1 ], [ %5, %for.inc.1.1 ]
%16 = phi i32 [ %5, %if.then.2.1 ], [ %14, %for.inc.1.1 ]
%cmp6.3.1 = icmp slt i32 %16, %8
br i1 %cmp6.3.1, label %if.then.3.1, label %for.inc.3.1
if.then.3.1: ; preds = %for.inc.2.1
store i32 %8, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %16, ptr %arrayidx5.3, align 4, !tbaa !5
br label %for.inc.3.1
for.inc.3.1: ; preds = %if.then.3.1, %for.inc.2.1
%17 = phi i32 [ %16, %if.then.3.1 ], [ %8, %for.inc.2.1 ]
%18 = phi i32 [ %8, %if.then.3.1 ], [ %16, %for.inc.2.1 ]
%cmp6.4.1 = icmp slt i32 %18, %11
br i1 %cmp6.4.1, label %if.then.4.1, label %for.inc.4.1
if.then.4.1: ; preds = %for.inc.3.1
store i32 %11, ptr %arrayidx5.1, align 4, !tbaa !5
store i32 %18, ptr %arrayidx5.4, align 4, !tbaa !5
br label %for.inc.4.1
for.inc.4.1: ; preds = %if.then.4.1, %for.inc.3.1
%19 = phi i32 [ %18, %if.then.4.1 ], [ %11, %for.inc.3.1 ]
%20 = phi i32 [ %11, %if.then.4.1 ], [ %18, %for.inc.3.1 ]
%cmp6.239 = icmp slt i32 %15, %13
br i1 %cmp6.239, label %if.then.240, label %for.inc.241
if.then.240: ; preds = %for.inc.4.1
store i32 %13, ptr %arrayidx5.2, align 4, !tbaa !5
store i32 %15, ptr %hand, align 4, !tbaa !5
br label %for.inc.241
for.inc.241: ; preds = %if.then.240, %for.inc.4.1
%21 = phi i32 [ %15, %if.then.240 ], [ %13, %for.inc.4.1 ]
%22 = phi i32 [ %13, %if.then.240 ], [ %15, %for.inc.4.1 ]
%cmp6.1.2 = icmp slt i32 %22, %20
br i1 %cmp6.1.2, label %if.then.1.2, label %for.inc.2.2
if.then.1.2: ; preds = %for.inc.241
store i32 %20, ptr %arrayidx5.2, align 4, !tbaa !5
store i32 %22, ptr %arrayidx5.1, align 4, !tbaa !5
br label %for.inc.2.2
for.inc.2.2: ; preds = %for.inc.241, %if.then.1.2
%23 = phi i32 [ %22, %if.then.1.2 ], [ %20, %for.inc.241 ]
%24 = phi i32 [ %20, %if.then.1.2 ], [ %22, %for.inc.241 ]
%cmp6.3.2 = icmp slt i32 %24, %17
br i1 %cmp6.3.2, label %if.then.3.2, label %for.inc.3.2
if.then.3.2: ; preds = %for.inc.2.2
store i32 %17, ptr %arrayidx5.2, align 4, !tbaa !5
store i32 %24, ptr %arrayidx5.3, align 4, !tbaa !5
br label %for.inc.3.2
for.inc.3.2: ; preds = %if.then.3.2, %for.inc.2.2
%25 = phi i32 [ %24, %if.then.3.2 ], [ %17, %for.inc.2.2 ]
%26 = phi i32 [ %17, %if.then.3.2 ], [ %24, %for.inc.2.2 ]
%cmp6.4.2 = icmp slt i32 %26, %19
br i1 %cmp6.4.2, label %if.then.4.2, label %for.inc.4.2
if.then.4.2: ; preds = %for.inc.3.2
store i32 %19, ptr %arrayidx5.2, align 4, !tbaa !5
store i32 %26, ptr %arrayidx5.4, align 4, !tbaa !5
br label %for.inc.4.2
for.inc.4.2: ; preds = %if.then.4.2, %for.inc.3.2
%27 = phi i32 [ %26, %if.then.4.2 ], [ %19, %for.inc.3.2 ]
%28 = phi i32 [ %19, %if.then.4.2 ], [ %26, %for.inc.3.2 ]
%cmp6.342 = icmp slt i32 %25, %21
br i1 %cmp6.342, label %if.then.343, label %for.inc.344
if.then.343: ; preds = %for.inc.4.2
store i32 %21, ptr %arrayidx5.3, align 4, !tbaa !5
store i32 %25, ptr %hand, align 4, !tbaa !5
br label %for.inc.344
for.inc.344: ; preds = %if.then.343, %for.inc.4.2
%29 = phi i32 [ %25, %if.then.343 ], [ %21, %for.inc.4.2 ]
%30 = phi i32 [ %21, %if.then.343 ], [ %25, %for.inc.4.2 ]
%cmp6.1.3 = icmp slt i32 %30, %23
br i1 %cmp6.1.3, label %if.then.1.3, label %for.inc.1.3
if.then.1.3: ; preds = %for.inc.344
store i32 %23, ptr %arrayidx5.3, align 4, !tbaa !5
store i32 %30, ptr %arrayidx5.1, align 4, !tbaa !5
br label %for.inc.1.3
for.inc.1.3: ; preds = %if.then.1.3, %for.inc.344
%31 = phi i32 [ %30, %if.then.1.3 ], [ %23, %for.inc.344 ]
%32 = phi i32 [ %23, %if.then.1.3 ], [ %30, %for.inc.344 ]
%cmp6.2.3 = icmp slt i32 %32, %28
br i1 %cmp6.2.3, label %if.then.2.3, label %for.inc.3.3
if.then.2.3: ; preds = %for.inc.1.3
store i32 %28, ptr %arrayidx5.3, align 4, !tbaa !5
store i32 %32, ptr %arrayidx5.2, align 4, !tbaa !5
br label %for.inc.3.3
for.inc.3.3: ; preds = %for.inc.1.3, %if.then.2.3
%33 = phi i32 [ %32, %if.then.2.3 ], [ %28, %for.inc.1.3 ]
%34 = phi i32 [ %28, %if.then.2.3 ], [ %32, %for.inc.1.3 ]
%cmp6.4.3 = icmp slt i32 %34, %27
br i1 %cmp6.4.3, label %if.then.4.3, label %for.inc.4.3
if.then.4.3: ; preds = %for.inc.3.3
store i32 %27, ptr %arrayidx5.3, align 4, !tbaa !5
store i32 %34, ptr %arrayidx5.4, align 4, !tbaa !5
br label %for.inc.4.3
for.inc.4.3: ; preds = %if.then.4.3, %for.inc.3.3
%35 = phi i32 [ %27, %if.then.4.3 ], [ %34, %for.inc.3.3 ]
%36 = phi i32 [ %34, %if.then.4.3 ], [ %27, %for.inc.3.3 ]
%cmp6.445 = icmp slt i32 %36, %29
br i1 %cmp6.445, label %if.then.446, label %for.inc.447
if.then.446: ; preds = %for.inc.4.3
store i32 %29, ptr %arrayidx5.4, align 4, !tbaa !5
store i32 %36, ptr %hand, align 4, !tbaa !5
br label %for.inc.447
for.inc.447: ; preds = %if.then.446, %for.inc.4.3
%37 = phi i32 [ %29, %if.then.446 ], [ %36, %for.inc.4.3 ]
%cmp6.1.4 = icmp slt i32 %37, %31
br i1 %cmp6.1.4, label %if.then.1.4, label %for.inc.1.4
if.then.1.4: ; preds = %for.inc.447
store i32 %31, ptr %arrayidx5.4, align 4, !tbaa !5
store i32 %37, ptr %arrayidx5.1, align 4, !tbaa !5
br label %for.inc.1.4
for.inc.1.4: ; preds = %if.then.1.4, %for.inc.447
%38 = phi i32 [ %31, %if.then.1.4 ], [ %37, %for.inc.447 ]
%cmp6.2.4 = icmp slt i32 %38, %33
br i1 %cmp6.2.4, label %if.then.2.4, label %for.inc.2.4
if.then.2.4: ; preds = %for.inc.1.4
store i32 %33, ptr %arrayidx5.4, align 4, !tbaa !5
store i32 %38, ptr %arrayidx5.2, align 4, !tbaa !5
br label %for.inc.2.4
for.inc.2.4: ; preds = %if.then.2.4, %for.inc.1.4
%39 = phi i32 [ %33, %if.then.2.4 ], [ %38, %for.inc.1.4 ]
%cmp6.3.4 = icmp slt i32 %39, %35
br i1 %cmp6.3.4, label %if.then.3.4, label %for.inc.4.4
if.then.3.4: ; preds = %for.inc.2.4
store i32 %35, ptr %arrayidx5.4, align 4, !tbaa !5
store i32 %39, ptr %arrayidx5.3, align 4, !tbaa !5
br label %for.inc.4.4
for.inc.4.4: ; preds = %for.inc.2.4, %if.then.3.4
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local signext i8 @judge(ptr nocapture noundef readonly %hand) local_unnamed_addr #4 {
entry:
%.pre = load i32, ptr %hand, align 4, !tbaa !5
br label %for.body
for.body: ; preds = %entry, %if.end28
%0 = phi i32 [ %.pre, %entry ], [ %5, %if.end28 ]
%sum.0110 = phi i32 [ 0, %entry ], [ %add, %if.end28 ]
%i.0109 = phi i32 [ 0, %entry ], [ %add32, %if.end28 ]
%straight.0108 = phi i32 [ 0, %entry ], [ %spec.select, %if.end28 ]
%card_4.0107 = phi i32 [ 0, %entry ], [ %card_4.1, %if.end28 ]
%card_3.0106 = phi i32 [ 0, %entry ], [ %card_3.1, %if.end28 ]
%pair.0105 = phi i32 [ 0, %entry ], [ %pair.1, %if.end28 ]
%idxprom = sext i32 %i.0109 to i64
%add = add nsw i32 %0, %sum.0110
%add3 = add nsw i32 %i.0109, 1
%idxprom4 = sext i32 %add3 to i64
%arrayidx5 = getelementptr inbounds i32, ptr %hand, i64 %idxprom4
%1 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp6 = icmp eq i32 %0, %1
br i1 %cmp6, label %if.then, label %if.end28
if.then: ; preds = %for.body
%inc = add nsw i32 %pair.0105, 1
%add9 = add nsw i32 %i.0109, 2
%idxprom10 = sext i32 %add9 to i64
%arrayidx11 = getelementptr inbounds i32, ptr %hand, i64 %idxprom10
%2 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp eq i32 %0, %2
br i1 %cmp12, label %if.then13, label %if.end28
if.then13: ; preds = %if.then
%add17 = add nsw i32 %i.0109, 3
%idxprom18 = sext i32 %add17 to i64
%arrayidx19 = getelementptr inbounds i32, ptr %hand, i64 %idxprom18
%3 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%cmp20 = icmp eq i32 %0, %3
br i1 %cmp20, label %if.then21, label %if.else
if.then21: ; preds = %if.then13
%inc23 = add nsw i32 %card_4.0107, 1
br label %if.end28
if.else: ; preds = %if.then13
%inc14 = add nsw i32 %card_3.0106, 1
br label %if.end28
if.end28: ; preds = %if.then, %if.else, %if.then21, %for.body
%idxprom29.pre-phi = phi i64 [ %idxprom, %if.then ], [ %idxprom4, %if.else ], [ %idxprom10, %if.then21 ], [ %idxprom, %for.body ]
%pair.1 = phi i32 [ %inc, %if.then ], [ %pair.0105, %if.else ], [ %pair.0105, %if.then21 ], [ %pair.0105, %for.body ]
%card_3.1 = phi i32 [ %card_3.0106, %if.then ], [ %inc14, %if.else ], [ %card_3.0106, %if.then21 ], [ %card_3.0106, %for.body ]
%card_4.1 = phi i32 [ %card_4.0107, %if.then ], [ %card_4.0107, %if.else ], [ %inc23, %if.then21 ], [ %card_4.0107, %for.body ]
%i.1 = phi i32 [ %i.0109, %if.then ], [ %add3, %if.else ], [ %add9, %if.then21 ], [ %i.0109, %for.body ]
%arrayidx30 = getelementptr inbounds i32, ptr %hand, i64 %idxprom29.pre-phi
%4 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%add31 = add nsw i32 %4, 1
%add32 = add nsw i32 %i.1, 1
%idxprom33 = sext i32 %add32 to i64
%arrayidx34 = getelementptr inbounds i32, ptr %hand, i64 %idxprom33
%5 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%cmp35 = icmp eq i32 %add31, %5
%inc37 = zext i1 %cmp35 to i32
%spec.select = add nuw nsw i32 %straight.0108, %inc37
%cmp = icmp slt i32 %i.1, 4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end28
%cmp40 = icmp eq i32 %card_4.1, 1
br i1 %cmp40, label %if.end70, label %if.else42
if.else42: ; preds = %for.end
%cmp43 = icmp eq i32 %card_3.1, 1
%cmp44 = icmp eq i32 %pair.1, 1
%or.cond = select i1 %cmp43, i1 %cmp44, i1 false
br i1 %or.cond, label %if.end70, label %if.else46
if.else46: ; preds = %if.else42
%cmp47 = icmp eq i32 %spec.select, 4
br i1 %cmp47, label %if.end70, label %if.else49
if.else49: ; preds = %if.else46
%cmp50 = icmp eq i32 %spec.select, 3
%cmp52 = icmp eq i32 %add, 47
%or.cond71 = select i1 %cmp50, i1 %cmp52, i1 false
%brmerge = or i1 %cmp43, %or.cond71
%.mux = select i1 %or.cond71, i8 66, i8 67
br i1 %brmerge, label %if.end70, label %if.else57
if.else57: ; preds = %if.else49
%cmp58 = icmp eq i32 %pair.1, 2
%. = select i1 %cmp44, i8 69, i8 70
%spec.select104 = select i1 %cmp58, i8 68, i8 %.
br label %if.end70
if.end70: ; preds = %if.else57, %if.else49, %if.else46, %if.else42, %for.end
%rank.0 = phi i8 [ 83, %for.end ], [ 65, %if.else42 ], [ 66, %if.else46 ], [ %.mux, %if.else49 ], [ %spec.select104, %if.else57 ]
ret i8 %rank.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: read)
declare ptr @llvm.load.relative.i64(ptr, i64) #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 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: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nocallback nofree nosync nounwind willreturn memory(argmem: read) }
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}
|
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int n,m;
scanf("%d%d",&n,&m);
int i,j,k,v;
int member[n+1];//0-n
int wwe;
memset(member,0,sizeof(int)*(n+1));
/* for(v=0;v<=n;v++){
printf("%d:%d\n",v,member[v]);
} */
for(i=0;i<m;i++){
memset(member,0,sizeof(int)*(n+1));
wwe=1;
scanf("%d",&k);
for(j=0;j<k;j++){
scanf("%d",&v);//v:1-n,-1--n
if(v>0){
if(member[v]<0){
wwe=0;
}else{
member[v]++;
}
}else if(v<0){
if(member[v*-1]>0){
wwe=0;
}else{
member[v*-1]--;
}
}
/* for(v=0;v<=n;v++){
printf("%d ",member[v]);
}puts(""); */
}
if(wwe){
puts("YES");
return 0;
}
}
puts("NO");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20781/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20781/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%k = alloca i32, align 4
%v = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %v) #5
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%add1 = add nsw i32 %3, 1
%conv = sext i32 %add1 to i64
%mul = shl nsw i64 %conv, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla, i8 0, i64 %mul, i1 false)
%4 = load i32, ptr %m, align 4, !tbaa !5
%cmp58 = icmp sgt i32 %4, 0
br i1 %cmp58, label %for.body, label %cleanup
for.cond: ; preds = %for.end
%inc41 = add nuw nsw i32 %i.059, 1
%5 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc41, %5
br i1 %cmp, label %for.body, label %cleanup, !llvm.loop !9
for.body: ; preds = %entry, %for.cond
%i.059 = phi i32 [ %inc41, %for.cond ], [ 0, %entry ]
%6 = load i32, ptr %n, align 4, !tbaa !5
%add3 = add nsw i32 %6, 1
%conv4 = sext i32 %add3 to i64
%mul5 = shl nsw i64 %conv4, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla, i8 0, i64 %mul5, i1 false)
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k)
%7 = load i32, ptr %k, align 4, !tbaa !5
%cmp855 = icmp sgt i32 %7, 0
br i1 %cmp855, label %for.body10, label %cleanup
for.body10: ; preds = %for.body, %for.inc
%wwe.057 = phi i32 [ %wwe.1, %for.inc ], [ 1, %for.body ]
%j.056 = phi i32 [ %inc36, %for.inc ], [ 0, %for.body ]
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %v)
%8 = load i32, ptr %v, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %8, 0
br i1 %cmp12, label %if.then, label %if.else19
if.then: ; preds = %for.body10
%idxprom = zext i32 %8 to i64
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %idxprom
%9 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp14 = icmp slt i32 %9, 0
br i1 %cmp14, label %for.inc, label %if.else
if.else: ; preds = %if.then
%inc = add nuw nsw i32 %9, 1
store i32 %inc, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
if.else19: ; preds = %for.body10
%cmp20 = icmp slt i32 %8, 0
br i1 %cmp20, label %if.then22, label %for.inc
if.then22: ; preds = %if.else19
%mul23 = sub nsw i32 0, %8
%idxprom24 = zext i32 %mul23 to i64
%arrayidx25 = getelementptr inbounds i32, ptr %vla, i64 %idxprom24
%10 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp26 = icmp sgt i32 %10, 0
br i1 %cmp26, label %for.inc, label %if.else29
if.else29: ; preds = %if.then22
%dec = add nsw i32 %10, -1
store i32 %dec, ptr %arrayidx25, align 4, !tbaa !5
br label %for.inc
for.inc: ; preds = %if.then22, %if.then, %if.else, %if.else29, %if.else19
%wwe.1 = phi i32 [ %wwe.057, %if.else ], [ %wwe.057, %if.else29 ], [ %wwe.057, %if.else19 ], [ 0, %if.then ], [ 0, %if.then22 ]
%inc36 = add nuw nsw i32 %j.056, 1
%11 = load i32, ptr %k, align 4, !tbaa !5
%cmp8 = icmp slt i32 %inc36, %11
br i1 %cmp8, label %for.body10, label %for.end, !llvm.loop !11
for.end: ; preds = %for.inc
%tobool.not = icmp eq i32 %wwe.1, 0
br i1 %tobool.not, label %for.cond, label %cleanup
cleanup: ; preds = %for.cond, %for.end, %for.body, %entry
%.str.3.sink = phi ptr [ @.str.3, %entry ], [ @.str.2, %for.body ], [ @.str.2, %for.end ], [ @.str.3, %for.cond ]
%call43 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void) {
long k,mod = 0;
scanf("%ld", &k);
for (long i = 1; i <= k; i++) {
mod = mod*10+7;
mod %= k;
if (mod == 0) {
printf("%ld\n", i);
return 0;
}
}
printf("-1\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207910/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207910/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@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:
%k = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %k)
%0 = load i64, ptr %k, align 8, !tbaa !5
%cmp.not11 = icmp slt i64 %0, 1
br i1 %cmp.not11, label %for.end, label %for.body
for.body: ; preds = %entry, %for.inc
%i.013 = phi i64 [ %inc, %for.inc ], [ 1, %entry ]
%mod.012 = phi i64 [ %rem, %for.inc ], [ 0, %entry ]
%mul = mul nsw i64 %mod.012, 10
%add = add nsw i64 %mul, 7
%rem = srem i64 %add, %0
%cmp1 = icmp eq i64 %rem, 0
br i1 %cmp1, label %if.then, label %for.inc
if.then: ; preds = %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %i.013)
br label %cleanup4
for.inc: ; preds = %for.body
%inc = add nuw i64 %i.013, 1
%exitcond.not = icmp eq i64 %i.013, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup4
cleanup4: ; preds = %if.then, %for.end
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
int main(){
int i,k,num=7;
scanf("%d",&k);
for(i=1;i<=k;i++){
if(num%k==0){
printf("%d\n",i);
return 0;
}
num%=k;
num=num*10+7;
}
puts("-1");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207954/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207954/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%k = alloca i32, align 4
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 %k)
%0 = load i32, ptr %k, align 4, !tbaa !5
%cmp.not12 = icmp slt i32 %0, 1
br i1 %cmp.not12, label %for.end, label %for.body
for.body: ; preds = %entry, %if.end
%num.014 = phi i32 [ %add, %if.end ], [ 7, %entry ]
%i.013 = phi i32 [ %inc, %if.end ], [ 1, %entry ]
%rem = srem i32 %num.014, %0
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %if.then, label %if.end
if.then: ; preds = %for.body
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.013)
br label %cleanup
if.end: ; preds = %for.body
%mul = mul nsw i32 %rem, 10
%add = add nsw i32 %mul, 7
%inc = add nuw i32 %i.013, 1
%exitcond.not = icmp eq i32 %i.013, %0
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %if.end, %entry
%call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
cleanup: ; preds = %for.end, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
int f(const void *a,const void *b){
return *(int*)b-*(int*)a;
}
int main(){
int N,K;
int H[200002];
scanf("%d %d",&N,&K);
for(int i=0;i<N;i++)
scanf("%d",H+i);
qsort(H,N,sizeof(int),f);
long long int ans=0LL;
for(int i=K;i<N;i++)
ans+=(long long int)H[i];
printf("%lld\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_207998/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_207998/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @f(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
%H = alloca [200002 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #6
call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %H) #6
%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
%cmp19 = icmp sgt i32 %0, 0
br i1 %cmp19, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %14, %for.body ]
call void @qsort(ptr noundef nonnull %H, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @f) #6
%1 = load i32, ptr %K, align 4, !tbaa !5
%2 = load i32, ptr %N, align 4, !tbaa !5
%cmp521 = icmp slt i32 %1, %2
br i1 %cmp521, label %for.body8.preheader, label %for.cond.cleanup7
for.body8.preheader: ; preds = %for.cond.cleanup
%3 = sext i32 %1 to i64
%wide.trip.count = sext i32 %2 to i64
%4 = sub nsw i64 %wide.trip.count, %3
%min.iters.check = icmp ult i64 %4, 4
br i1 %min.iters.check, label %for.body8.preheader32, label %vector.ph
vector.ph: ; preds = %for.body8.preheader
%n.vec = and i64 %4, -4
%ind.end = add nsw i64 %n.vec, %3
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%vec.phi30 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %10, %vector.body ]
%offset.idx = add i64 %index, %3
%5 = getelementptr inbounds [200002 x i32], ptr %H, i64 0, i64 %offset.idx
%wide.load = load <2 x i32>, ptr %5, align 4, !tbaa !5
%6 = getelementptr inbounds i32, ptr %5, i64 2
%wide.load31 = load <2 x i32>, ptr %6, align 4, !tbaa !5
%7 = sext <2 x i32> %wide.load to <2 x i64>
%8 = sext <2 x i32> %wide.load31 to <2 x i64>
%9 = add <2 x i64> %vec.phi, %7
%10 = add <2 x i64> %vec.phi30, %8
%index.next = add nuw i64 %index, 4
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %10, %9
%12 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
br i1 %cmp.n, label %for.cond.cleanup7, label %for.body8.preheader32
for.body8.preheader32: ; preds = %for.body8.preheader, %middle.block
%indvars.iv27.ph = phi i64 [ %3, %for.body8.preheader ], [ %ind.end, %middle.block ]
%ans.022.ph = phi i64 [ 0, %for.body8.preheader ], [ %12, %middle.block ]
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr %H, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %add.ptr)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%13 = load i32, ptr %N, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp = icmp slt i64 %indvars.iv.next, %14
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond.cleanup7: ; preds = %for.body8, %middle.block, %for.cond.cleanup
%ans.0.lcssa = phi i64 [ 0, %for.cond.cleanup ], [ %12, %middle.block ], [ %add, %for.body8 ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %H) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
for.body8: ; preds = %for.body8.preheader32, %for.body8
%indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body8 ], [ %indvars.iv27.ph, %for.body8.preheader32 ]
%ans.022 = phi i64 [ %add, %for.body8 ], [ %ans.022.ph, %for.body8.preheader32 ]
%arrayidx = getelementptr inbounds [200002 x i32], ptr %H, i64 0, i64 %indvars.iv27
%15 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv9 = sext i32 %15 to i64
%add = add nsw i64 %ans.022, %conv9
%indvars.iv.next28 = add nsw i64 %indvars.iv27, 1
%exitcond.not = icmp eq i64 %indvars.iv.next28, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup7, label %for.body8, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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, !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}
|
#include <stdio.h>
#include <stdlib.h>
//ソート用の判定関数
int compare_int(const void *a, const void *b){
return *(long int*)b - *(long int*)a; // 降順
}
int main(int argc, char const *argv[]) {
/* code */
int n, k;
int i;
long int result=0;
scanf("%d %d", &n, &k);
long int h[n];
for(i=0; i<n; i++){
scanf("%ld", &h[i]);
}
qsort(h, n, sizeof(long int), compare_int);
if(n>k){
for(i=k; i<n; i++){
result += h[i];
}
}
printf("%ld", result);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208047/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208047/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%k = 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 %k) #7
%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 !9
%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 !9
%cmp21 = icmp sgt i32 %3, 0
br i1 %cmp21, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %3 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds 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 !9
%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 !11
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %5, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 8, ptr noundef nonnull @compare_int) #7
%6 = load i32, ptr %n, align 4, !tbaa !9
%7 = load i32, ptr %k, align 4, !tbaa !9
%cmp2 = icmp sgt i32 %6, %7
br i1 %cmp2, label %for.body7.preheader, label %if.end
for.body7.preheader: ; preds = %for.end
%8 = sext i32 %7 to i64
%wide.trip.count = sext i32 %6 to i64
%9 = sub nsw i64 %wide.trip.count, %8
%min.iters.check = icmp ult i64 %9, 4
br i1 %min.iters.check, label %for.body7.preheader32, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.vec = and i64 %9, -4
%ind.end = add nsw i64 %n.vec, %8
%invariant.gep = getelementptr i64, ptr %vla, i64 %8
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%vec.phi30 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%gep = getelementptr i64, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i64>, ptr %gep, align 8, !tbaa !5
%10 = getelementptr inbounds i64, ptr %gep, i64 2
%wide.load31 = load <2 x i64>, ptr %10, align 8, !tbaa !5
%11 = add <2 x i64> %wide.load, %vec.phi
%12 = add <2 x i64> %wide.load31, %vec.phi30
%index.next = add nuw i64 %index, 4
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %12, %11
%14 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %9, %n.vec
br i1 %cmp.n, label %if.end, label %for.body7.preheader32
for.body7.preheader32: ; preds = %for.body7.preheader, %middle.block
%indvars.iv27.ph = phi i64 [ %8, %for.body7.preheader ], [ %ind.end, %middle.block ]
%result.023.ph = phi i64 [ 0, %for.body7.preheader ], [ %14, %middle.block ]
br label %for.body7
for.body7: ; preds = %for.body7.preheader32, %for.body7
%indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body7 ], [ %indvars.iv27.ph, %for.body7.preheader32 ]
%result.023 = phi i64 [ %add, %for.body7 ], [ %result.023.ph, %for.body7.preheader32 ]
%arrayidx9 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv27
%15 = load i64, ptr %arrayidx9, align 8, !tbaa !5
%add = add nsw i64 %15, %result.023
%indvars.iv.next28 = add nsw i64 %indvars.iv27, 1
%exitcond.not = icmp eq i64 %indvars.iv.next28, %wide.trip.count
br i1 %exitcond.not, label %if.end, label %for.body7, !llvm.loop !16
if.end: ; preds = %for.body7, %middle.block, %for.end
%result.1 = phi i64 [ 0, %for.end ], [ %14, %middle.block ], [ %add, %for.body7 ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %result.1)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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) #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
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #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 i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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", !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"}
!16 = distinct !{!16, !12, !15, !14}
|
#include <stdio.h>
#include <stdlib.h>
int compare(const void *a,const void *b){
if(*(int *)a>*(int *)b)return -1;
return 1;
}
int main(){
int n,k;
scanf("%d %d",&n,&k);
int h[n],i;
for(i = 0;i<n;i++){
scanf("%d",&h[i]);
}
long long count;
count = 0;
qsort(h,n,sizeof(int),compare);
for(i=k;i<n;i++){
count+=h[i];
}
printf("%lld",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208098/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208098/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%. = select i1 %cmp, i32 -1, i32 1
ret i32 %.
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %3, 0
br i1 %cmp19, label %for.body, label %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %3 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, 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.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %5, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare) #7
%6 = load i32, ptr %k, align 4, !tbaa !5
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp321 = icmp slt i32 %6, %7
br i1 %cmp321, label %for.body5.preheader, label %for.end11
for.body5.preheader: ; preds = %for.end
%8 = sext i32 %6 to i64
%wide.trip.count = sext i32 %7 to i64
%9 = sub nsw i64 %wide.trip.count, %8
%min.iters.check = icmp ult i64 %9, 4
br i1 %min.iters.check, label %for.body5.preheader32, label %vector.ph
vector.ph: ; preds = %for.body5.preheader
%n.vec = and i64 %9, -4
%ind.end = add nsw i64 %n.vec, %8
%invariant.gep = getelementptr i32, ptr %vla, i64 %8
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%vec.phi30 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%gep = getelementptr i32, ptr %invariant.gep, i64 %index
%wide.load = load <2 x i32>, ptr %gep, align 4, !tbaa !5
%10 = getelementptr inbounds i32, ptr %gep, i64 2
%wide.load31 = load <2 x i32>, ptr %10, align 4, !tbaa !5
%11 = sext <2 x i32> %wide.load to <2 x i64>
%12 = sext <2 x i32> %wide.load31 to <2 x i64>
%13 = add <2 x i64> %vec.phi, %11
%14 = add <2 x i64> %vec.phi30, %12
%index.next = add nuw i64 %index, 4
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %14, %13
%16 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %9, %n.vec
br i1 %cmp.n, label %for.end11, label %for.body5.preheader32
for.body5.preheader32: ; preds = %for.body5.preheader, %middle.block
%indvars.iv27.ph = phi i64 [ %8, %for.body5.preheader ], [ %ind.end, %middle.block ]
%count.023.ph = phi i64 [ 0, %for.body5.preheader ], [ %16, %middle.block ]
br label %for.body5
for.body5: ; preds = %for.body5.preheader32, %for.body5
%indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body5 ], [ %indvars.iv27.ph, %for.body5.preheader32 ]
%count.023 = phi i64 [ %add, %for.body5 ], [ %count.023.ph, %for.body5.preheader32 ]
%arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv27
%17 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%conv8 = sext i32 %17 to i64
%add = add nsw i64 %count.023, %conv8
%indvars.iv.next28 = add nsw i64 %indvars.iv27, 1
%exitcond.not = icmp eq i64 %indvars.iv.next28, %wide.trip.count
br i1 %exitcond.not, label %for.end11, label %for.body5, !llvm.loop !14
for.end11: ; preds = %for.body5, %middle.block, %for.end
%count.0.lcssa = phi i64 [ 0, %for.end ], [ %16, %middle.block ], [ %add, %for.body5 ]
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %count.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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) #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
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
//set many funcs template
//Ver.20190820
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#include<assert.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int nHr(int a,int b){return nCr(a+b-1,b);}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}
int sankaku(int x){return ((1+x)*x)/2;}
void swap(int *a,int *b){int c;c=(*a);(*a)=(*b);(*b)=c;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
void llswap(long long *a,long long *b){long long c;c=(*a);(*a)=(*b);(*b)=c;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
void dbswap(double *a,double *b){double c;c=(*a);(*a)=(*b);(*b)=c;}
void chswap(char *a,char *b){char c;c=(*a);(*a)=(*b);(*b)=c;}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}
int chsortfncsj(const void *a,const void *b){if(*(char *)a>*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
int chsortfnckj(const void *a,const void *b){if(*(char *)a<*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
void shuffledget(int x[],int n){
int i,b[524288],p,c;
for(i=0;i<n;i++){
b[i]=i;
}
for(i=n;i>=1;i--){
p=rand()%i;
c=b[i-1];b[i-1]=b[p];b[p]=c;
}
for(i=0;i<n;i++){
scanf("%d",&x[b[i]]);
}
}
int dx4[4]={1,-1,0,0};
int dy4[4]={0,0,1,-1};
int dx8[8]={-1,-1,-1,0,0,1,1,1};
int dy8[8]={-1,0,1,-1,1,-1,0,1};
int search(int x,int a[],int n){
int st=0,fi=n-1,te;
while(st<=fi){
te=(st+fi)/2;
if(a[te]<x){st=te+1;}else{fi=te-1;}
}
return st;
}
void prarr(int arr[],int n){
int i;
for(i=0;i<n;i++){
if(i){printf(" ");}
printf("%d",arr[i]);
}
printf("\n");
return;
}
void getperm(int a[],int n){
int i,p;
for(i=0;i<n;i++){
a[i]=i;
}
for(i=n-1;i>=1;i--){
p=rand()%(i+1);
swap(&a[p],&a[i]);
}
}
typedef struct{
int val;
int node;
}sd;
int sdsortfnc(const void *a,const void *b){
if(((sd*)a)->val < ((sd*)b)->val){return -1;}
if(((sd*)a)->val > ((sd*)b)->val){return 1;}
return 0;
}
void coordinate_comp(int a[],int n){
int i,c=0;
sd dat[524288];
for(i=0;i<n;i++){
dat[i].val=a[i];
dat[i].node=i;
}
qsort(dat,n,sizeof(dat[0]),sdsortfnc);
a[dat[0].node]=c;
for(i=1;i<n;i++){
if(dat[i-1].val!=dat[i].val){c++;}
a[dat[i].node]=c;
}
}
int main(void){
long long i,j,n,m,k,a[524288],b,c,h,w,r=0,l,t;
scanf("%lld%lld",&n,&k);
for(i=0;i<n;i++){scanf("%lld",&a[i]);}
qsort(a,n,sizeof(long long),llsortfnckj);
for(i=k;i<n;i++){scanf("%lld",&a[i]);r+=a[i];}
printf("%lld\n",r);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208155/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208155/source.c"
target datalayout = "e-m:e-p270: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.sd = type { i32, i32 }
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16
@dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16
@dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16
@dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16
@.str.3 = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1
@.str.4 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.5 = 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 i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i32 %a, %b
%sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true)
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%mul = shl nsw i32 %rem, 1
%cmp.not = icmp sge i32 %mul, %b
%div1 = sdiv i32 %a, %b
%add = zext i1 %cmp.not to i32
%retval.0 = add nsw i32 %div1, %add
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %a, %b
%add = zext i1 %cmp to i32
%retval.0 = add nsw i32 %div, %add
ret i32 %retval.0
}
; 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:
%cmp.not4 = icmp eq i32 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.06, %b.addr.05
%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.05, %while.body ]
ret i32 %a.addr.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i32 %b, 0
br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.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, %entry
%a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i32 %a, %a.addr.0.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i32 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i32 %a, 1
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, 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 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i32 %add, %i.07
%mul = mul nsw i32 %r.08, %sub
%div = sdiv i32 %mul, %i.07
%inc = add nuw i32 %i.07, 1
%sub.1 = sub i32 %add, %inc
%mul.1 = mul nsw i32 %div, %sub.1
%div.1 = sdiv i32 %mul.1, %inc
%inc.1 = add nuw i32 %i.07, 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 !7
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.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
%sub.epil = sub i32 %add, %i.07.unr
%mul.epil = mul nsw i32 %r.08.unr, %sub.epil
%div.epil = sdiv i32 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %b, %a
%cmp.not6.i = icmp slt i32 %b, 1
br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i32 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i32 %add, %i.07.i
%mul.i = mul nsw i32 %sub.i, %r.08.i
%div.i = sdiv i32 %mul.i, %i.07.i
%inc.i = add nuw i32 %i.07.i, 1
%sub.i.1 = sub i32 %add, %inc.i
%mul.i.1 = mul nsw i32 %sub.i.1, %div.i
%div.i.1 = sdiv i32 %mul.i.1, %inc.i
%inc.i.1 = add nuw i32 %i.07.i, 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 %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7
nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i32 %add, %i.07.i.unr
%mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr
br label %nCr.exit
nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i32 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i32 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %a, 8
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %a, -8
%ind.end = or i32 %n.vec, 1
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> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = mul <4 x i32> %vec.phi, %vec.ind
%1 = mul <4 x i32> %vec.phi7, %step.add
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %a
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ]
%i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ]
%mul = mul nsw i32 %r.06, %i.05
%inc = add nuw i32 %i.05, 1
%exitcond.not = icmp eq i32 %i.05, %a
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i32 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %b, 8
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %b, -8
%ind.end = or i32 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%0 = mul <4 x i32> %vec.phi, %broadcast.splat
%1 = mul <4 x i32> %vec.phi6, %broadcast.splat
%index.next = add nuw i32 %index, 8
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %b
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ]
%i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ]
%mul = mul nsw i32 %r.05, %a
%inc = add nuw i32 %i.04, 1
%exitcond.not = icmp eq i32 %i.04, %b
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i32 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.05, 10
%add = add nsw i32 %r.06, %rem
%div = sdiv i32 %x.addr.05, 10
%x.addr.05.off = add i32 %x.addr.05, 9
%tobool.not = icmp ult i32 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i32 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.06, %b
%add = add nsw i32 %rem, %r.07
%div = sdiv i32 %x.addr.06, %b
%tobool.not = icmp eq i32 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i32 %x, 1
%mul = mul nsw i32 %add, %x
%div = sdiv i32 %mul, 2
ret i32 %div
}
; 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 #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !16
%1 = load i32, ptr %b, align 4, !tbaa !16
store i32 %1, ptr %a, align 4, !tbaa !16
store i32 %0, ptr %b, align 4, !tbaa !16
ret void
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i64 %a, %b
%sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true)
ret i64 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%mul = shl nsw i64 %rem, 1
%cmp.not = icmp sge i64 %mul, %b
%div1 = sdiv i64 %a, %b
%add = zext i1 %cmp.not to i64
%retval.0 = add nsw i64 %div1, %add
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %a, %b
%add = zext i1 %cmp to i64
%retval.0 = add nsw i64 %div, %add
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i64 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i64 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !20
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i64 %a.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i64 %b, 0
br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i64 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !20
llgcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i64 %a, %a.addr.0.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i64 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i64 %a, 1
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i64 %add, %i.07
%mul = mul nsw i64 %r.08, %sub
%div = sdiv i64 %mul, %i.07
%inc = add nuw i64 %i.07, 1
%sub.1 = sub i64 %add, %inc
%mul.1 = mul nsw i64 %div, %sub.1
%div.1 = sdiv i64 %mul.1, %inc
%inc.1 = add nuw i64 %i.07, 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 !21
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.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
%sub.epil = sub i64 %add, %i.07.unr
%mul.epil = mul nsw i64 %r.08.unr, %sub.epil
%div.epil = sdiv i64 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i64 %b, %a
%cmp.not6.i = icmp slt i64 %b, 1
br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i64 %add, %i.07.i
%mul.i = mul nsw i64 %sub.i, %r.08.i
%div.i = sdiv i64 %mul.i, %i.07.i
%inc.i = add nuw i64 %i.07.i, 1
%sub.i.1 = sub i64 %add, %inc.i
%mul.i.1 = mul nsw i64 %sub.i.1, %div.i
%div.i.1 = sdiv i64 %mul.i.1, %inc.i
%inc.i.1 = add nuw i64 %i.07.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 %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !21
llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i64 %add, %i.07.i.unr
%mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr
br label %llnCr.exit
llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i64 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i64 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %a, 7
%0 = icmp ult i64 %a, 8
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 %a, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.06, %i.05
%inc = add nuw nsw i64 %i.05, 1
%mul.1 = mul nsw i64 %mul, %inc
%inc.1 = add nuw nsw i64 %i.05, 2
%mul.2 = mul nsw i64 %mul.1, %inc.1
%inc.2 = add nuw nsw i64 %i.05, 3
%mul.3 = mul nsw i64 %mul.2, %inc.2
%inc.3 = add nuw nsw i64 %i.05, 4
%mul.4 = mul nsw i64 %mul.3, %inc.3
%inc.4 = add nuw nsw i64 %i.05, 5
%mul.5 = mul nsw i64 %mul.4, %inc.4
%inc.5 = add nuw nsw i64 %i.05, 6
%mul.6 = mul nsw i64 %mul.5, %inc.5
%inc.6 = add nuw i64 %i.05, 7
%mul.7 = mul nsw i64 %mul.6, %inc.6
%inc.7 = add nuw i64 %i.05, 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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !22
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %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
%r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ]
%i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.06.epil, %i.05.epil
%inc.epil = add nuw i64 %i.05.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 !23
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i64 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
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 %b, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.05, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !25
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.05.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !26
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i64 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.05, 10
%add = add nsw i64 %r.06, %rem
%div = sdiv i64 %x.addr.05, 10
%x.addr.05.off = add i64 %x.addr.05, 9
%tobool.not = icmp ult i64 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !27
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i64 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.06, %b
%add = add nsw i64 %rem, %r.07
%div = sdiv i64 %x.addr.06, %b
%tobool.not = icmp eq i64 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !28
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i64 %x, 1
%mul = mul nsw i64 %add, %x
%div = sdiv i64 %mul, 2
ret i64 %div
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @llswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
store i64 %1, ptr %a, align 8, !tbaa !29
store i64 %0, ptr %b, align 8, !tbaa !29
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp ogt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp olt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp.i = fcmp ogt double %a, %b
%a.b.i = select i1 %cmp.i, double %a, double %b
%cmp.i4 = fcmp olt double %a, %b
%a.b.i5 = select i1 %cmp.i4, double %a, double %b
%sub = fsub double %a.b.i, %a.b.i5
ret double %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @dbswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
store double %1, ptr %a, align 8, !tbaa !31
store double %0, ptr %b, align 8, !tbaa !31
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @chswap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
store i8 %1, ptr %a, align 1, !tbaa !33
store i8 %0, ptr %b, align 1, !tbaa !33
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !16
%1 = load i32, ptr %b, align 4, !tbaa !16
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !16
%1 = load i32, ptr %b, align 4, !tbaa !16
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp ogt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #16
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #16
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp sgt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nounwind uwtable
define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #8 {
entry:
%b = alloca [524288 x i32], align 16
call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #17
%cmp40 = icmp sgt i32 %n, 0
br i1 %cmp40, label %for.body.preheader, label %for.end25
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader57, 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.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !16
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 16, !tbaa !16
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !34
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader57
for.body.preheader57: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond1.preheader: ; preds = %for.body, %middle.block
br i1 %cmp40, label %for.body3.preheader, label %for.end25
for.body3.preheader: ; preds = %for.cond1.preheader
%3 = zext i32 %n to i64
br label %for.body3
for.body: ; preds = %for.body.preheader57, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader57 ]
%arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 4, !tbaa !16
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !35
for.cond15.preheader: ; preds = %for.body3
br i1 %cmp40, label %for.body17.preheader, label %for.end25
for.body17.preheader: ; preds = %for.cond15.preheader
%wide.trip.count54 = zext i32 %n to i64
br label %for.body17
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv47 = phi i64 [ %3, %for.body3.preheader ], [ %indvars.iv.next48, %for.body3 ]
%call = tail call i32 @rand() #17
%5 = trunc i64 %indvars.iv47 to i32
%rem = srem i32 %call, %5
%indvars.iv.next48 = add nsw i64 %indvars.iv47, -1
%idxprom4 = and i64 %indvars.iv.next48, 4294967295
%arrayidx5 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom4
%6 = load i32, ptr %arrayidx5, align 4, !tbaa !16
%idxprom6 = sext i32 %rem to i64
%arrayidx7 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom6
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !16
store i32 %7, ptr %arrayidx5, align 4, !tbaa !16
store i32 %6, ptr %arrayidx7, align 4, !tbaa !16
%cmp2 = icmp ugt i64 %indvars.iv47, 1
br i1 %cmp2, label %for.body3, label %for.cond15.preheader, !llvm.loop !36
for.body17: ; preds = %for.body17.preheader, %for.body17
%indvars.iv50 = phi i64 [ 0, %for.body17.preheader ], [ %indvars.iv.next51, %for.body17 ]
%arrayidx19 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv50
%8 = load i32, ptr %arrayidx19, align 4, !tbaa !16
%idxprom20 = sext i32 %8 to i64
%arrayidx21 = getelementptr inbounds i32, ptr %x, i64 %idxprom20
%call22 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx21)
%indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
%exitcond55.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count54
br i1 %exitcond55.not, label %for.end25, label %for.body17, !llvm.loop !37
for.end25: ; preds = %for.body17, %entry, %for.cond1.preheader, %for.cond15.preheader
call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #17
ret void
}
; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #9
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #11 {
entry:
%cmp.not9 = icmp slt i32 %n, 1
br i1 %cmp.not9, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ]
%fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ]
%add = add nsw i32 %st.011, %fi.010
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !16
%cmp1 = icmp slt i32 %0, %x
%add2 = add nsw i32 %div, 1
%sub3 = add nsw i32 %div, -1
%fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3
%st.1 = select i1 %cmp1, i32 %add2, i32 %st.011
%cmp.not = icmp sgt i32 %st.1, %fi.1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !38
while.end: ; preds = %while.body, %entry
%st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ]
ret i32 %st.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @prarr(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #12 {
entry:
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%.pre = load i32, ptr %arr, align 4, !tbaa !16
%call1.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %n, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar6 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !16
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !39
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #10
; Function Attrs: nounwind uwtable
define dso_local void @getperm(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #8 {
entry:
%cmp20 = icmp sgt i32 %n, 0
br i1 %cmp20, label %for.body.preheader, label %for.end9
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
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, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds i32, ptr %a, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 4, !tbaa !16
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 4, !tbaa !16
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !41
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond1.preheader, 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.cond1.preheader: ; preds = %for.body, %middle.block
%cmp222 = icmp sgt i32 %n, 1
br i1 %cmp222, label %for.body3.preheader, label %for.end9
for.body3.preheader: ; preds = %for.cond1.preheader
%3 = zext i32 %n to i64
br label %for.body3
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 i32, ptr %a, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 4, !tbaa !16
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !42
for.body3: ; preds = %for.body3.preheader, %for.body3
%indvars.iv25 = phi i64 [ %3, %for.body3.preheader ], [ %indvars.iv.next26, %for.body3 ]
%indvars.iv.next26 = add nsw i64 %indvars.iv25, -1
%call = tail call i32 @rand() #17
%5 = trunc i64 %indvars.iv25 to i32
%rem = srem i32 %call, %5
%idxprom4 = sext i32 %rem to i64
%arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %idxprom4
%idxprom6 = and i64 %indvars.iv.next26, 4294967295
%arrayidx7 = getelementptr inbounds i32, ptr %a, i64 %idxprom6
%6 = load i32, ptr %arrayidx5, align 4, !tbaa !16
%7 = load i32, ptr %arrayidx7, align 4, !tbaa !16
store i32 %7, ptr %arrayidx5, align 4, !tbaa !16
store i32 %6, ptr %arrayidx7, align 4, !tbaa !16
%cmp2 = icmp ugt i64 %indvars.iv25, 2
br i1 %cmp2, label %for.body3, label %for.end9, !llvm.loop !43
for.end9: ; preds = %for.body3, %entry, %for.cond1.preheader
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !44
%1 = load i32, ptr %b, align 4, !tbaa !44
%cmp = icmp slt i32 %0, %1
%cmp4 = icmp sgt i32 %0, %1
%. = zext i1 %cmp4 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @coordinate_comp(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #12 {
entry:
%dat = alloca [524288 x %struct.sd], align 16
call void @llvm.lifetime.start.p0(i64 4194304, ptr nonnull %dat) #17
%cmp46 = icmp sgt i32 %n, 0
br i1 %cmp46, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 4
br i1 %min.iters.check, label %for.body.preheader61, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.ind = phi <2 x i32> [ <i32 0, i32 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <2 x i32> %vec.ind, <i32 2, i32 2>
%0 = or i64 %index, 2
%1 = getelementptr inbounds i32, ptr %a, i64 %index
%wide.load = load <2 x i32>, ptr %1, align 4, !tbaa !16
%2 = getelementptr inbounds i32, ptr %1, i64 2
%wide.load59 = load <2 x i32>, ptr %2, align 4, !tbaa !16
%3 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %index
%4 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %0
%interleaved.vec = shufflevector <2 x i32> %wide.load, <2 x i32> %vec.ind, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec, ptr %3, align 16, !tbaa !16
%interleaved.vec60 = shufflevector <2 x i32> %wide.load59, <2 x i32> %step.add, <4 x i32> <i32 0, i32 2, i32 1, i32 3>
store <4 x i32> %interleaved.vec60, ptr %4, align 16, !tbaa !16
%index.next = add nuw i64 %index, 4
%vec.ind.next = add <2 x i32> %vec.ind, <i32 4, i32 4>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !46
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.preheader61
for.body.preheader61: ; 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.preheader61, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%6 = load i32, ptr %arrayidx, align 4, !tbaa !16
%arrayidx2 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv
store i32 %6, ptr %arrayidx2, align 8, !tbaa !44
%node = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv, i32 1
%7 = trunc i64 %indvars.iv to i32
store i32 %7, ptr %node, align 4, !tbaa !47
%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 !48
for.end: ; preds = %for.body, %middle.block, %entry
%conv = sext i32 %n to i64
call void @qsort(ptr noundef nonnull %dat, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @sdsortfnc) #17
%node6 = getelementptr inbounds %struct.sd, ptr %dat, i64 0, i32 1
%8 = load i32, ptr %node6, align 4, !tbaa !47
%idxprom7 = sext i32 %8 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %a, i64 %idxprom7
store i32 0, ptr %arrayidx8, align 4, !tbaa !16
%cmp1048 = icmp sgt i32 %n, 1
br i1 %cmp1048, label %for.body12.preheader, label %for.end29
for.body12.preheader: ; preds = %for.end
%wide.trip.count56 = zext i32 %n to i64
%.pre = load i32, ptr %dat, align 16, !tbaa !44
%9 = add nsw i64 %wide.trip.count56, -1
%xtraiter = and i64 %9, 1
%10 = icmp eq i32 %n, 2
br i1 %10, label %for.end29.loopexit.unr-lcssa, label %for.body12.preheader.new
for.body12.preheader.new: ; preds = %for.body12.preheader
%unroll_iter = and i64 %9, -2
br label %for.body12
for.body12: ; preds = %for.body12, %for.body12.preheader.new
%11 = phi i32 [ %.pre, %for.body12.preheader.new ], [ %14, %for.body12 ]
%indvars.iv52 = phi i64 [ 1, %for.body12.preheader.new ], [ %indvars.iv.next53.1, %for.body12 ]
%c.050 = phi i32 [ 0, %for.body12.preheader.new ], [ %spec.select.1, %for.body12 ]
%niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ]
%arrayidx17 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52
%12 = load i32, ptr %arrayidx17, align 8, !tbaa !44
%cmp19.not = icmp ne i32 %11, %12
%inc21 = zext i1 %cmp19.not to i32
%spec.select = add nuw nsw i32 %c.050, %inc21
%node24 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52, i32 1
%13 = load i32, ptr %node24, align 4, !tbaa !47
%idxprom25 = sext i32 %13 to i64
%arrayidx26 = getelementptr inbounds i32, ptr %a, i64 %idxprom25
store i32 %spec.select, ptr %arrayidx26, align 4, !tbaa !16
%indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
%arrayidx17.1 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv.next53
%14 = load i32, ptr %arrayidx17.1, align 8, !tbaa !44
%cmp19.not.1 = icmp ne i32 %12, %14
%inc21.1 = zext i1 %cmp19.not.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc21.1
%node24.1 = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv.next53, i32 1
%15 = load i32, ptr %node24.1, align 4, !tbaa !47
%idxprom25.1 = sext i32 %15 to i64
%arrayidx26.1 = getelementptr inbounds i32, ptr %a, i64 %idxprom25.1
store i32 %spec.select.1, ptr %arrayidx26.1, align 4, !tbaa !16
%indvars.iv.next53.1 = add nuw nsw i64 %indvars.iv52, 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.end29.loopexit.unr-lcssa, label %for.body12, !llvm.loop !49
for.end29.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader
%.unr = phi i32 [ %.pre, %for.body12.preheader ], [ %14, %for.body12 ]
%indvars.iv52.unr = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next53.1, %for.body12 ]
%c.050.unr = phi i32 [ 0, %for.body12.preheader ], [ %spec.select.1, %for.body12 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end29, label %for.body12.epil
for.body12.epil: ; preds = %for.end29.loopexit.unr-lcssa
%arrayidx17.epil = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52.unr
%16 = load i32, ptr %arrayidx17.epil, align 8, !tbaa !44
%cmp19.not.epil = icmp ne i32 %.unr, %16
%inc21.epil = zext i1 %cmp19.not.epil to i32
%spec.select.epil = add nuw nsw i32 %c.050.unr, %inc21.epil
%node24.epil = getelementptr inbounds [524288 x %struct.sd], ptr %dat, i64 0, i64 %indvars.iv52.unr, i32 1
%17 = load i32, ptr %node24.epil, align 4, !tbaa !47
%idxprom25.epil = sext i32 %17 to i64
%arrayidx26.epil = getelementptr inbounds i32, ptr %a, i64 %idxprom25.epil
store i32 %spec.select.epil, ptr %arrayidx26.epil, align 4, !tbaa !16
br label %for.end29
for.end29: ; preds = %for.body12.epil, %for.end29.loopexit.unr-lcssa, %for.end
call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %dat) #17
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #13
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #12 {
entry:
%n = alloca i64, align 8
%k = alloca i64, align 8
%a = alloca [524288 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #17
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #17
call void @llvm.lifetime.start.p0(i64 4194304, ptr nonnull %a) #17
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i64, ptr %n, align 8, !tbaa !29
%cmp19 = icmp sgt i64 %0, 0
br i1 %cmp19, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%i.020 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [524288 x i64], ptr %a, i64 0, i64 %i.020
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.020, 1
%1 = load i64, ptr %n, align 8, !tbaa !29
%cmp = icmp slt i64 %inc, %1
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !50
for.end: ; preds = %for.body, %entry
%.lcssa = phi i64 [ %0, %entry ], [ %1, %for.body ]
call void @qsort(ptr noundef nonnull %a, i64 noundef %.lcssa, i64 noundef 8, ptr noundef nonnull @llsortfnckj) #17
%2 = load i64, ptr %k, align 8, !tbaa !29
%3 = load i64, ptr %n, align 8, !tbaa !29
%cmp321 = icmp slt i64 %2, %3
br i1 %cmp321, label %for.body4, label %for.end10
for.body4: ; preds = %for.end, %for.body4
%i.123 = phi i64 [ %inc9, %for.body4 ], [ %2, %for.end ]
%r.022 = phi i64 [ %add, %for.body4 ], [ 0, %for.end ]
%arrayidx5 = getelementptr inbounds [524288 x i64], ptr %a, i64 0, i64 %i.123
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %arrayidx5)
%4 = load i64, ptr %arrayidx5, align 8, !tbaa !29
%add = add nsw i64 %4, %r.022
%inc9 = add nsw i64 %i.123, 1
%5 = load i64, ptr %n, align 8, !tbaa !29
%cmp3 = icmp slt i64 %inc9, %5
br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !51
for.end10: ; preds = %for.body4, %for.end
%r.0.lcssa = phi i64 [ 0, %for.end ], [ %add, %for.body4 ]
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %r.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4194304, ptr nonnull %a) #17
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #17
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #17
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #15
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { 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 #8 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { 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 #12 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #13 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #14 = { nofree nounwind }
attributes #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #16 = { nounwind willreturn memory(read) }
attributes #17 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6, !9, !10}
!9 = !{!"llvm.loop.isvectorized", i32 1}
!10 = !{!"llvm.loop.unroll.runtime.disable"}
!11 = distinct !{!11, !6, !10, !9}
!12 = distinct !{!12, !6, !9, !10}
!13 = distinct !{!13, !6, !10, !9}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = !{!17, !17, i64 0}
!17 = !{!"int", !18, i64 0}
!18 = !{!"omnipotent char", !19, i64 0}
!19 = !{!"Simple C/C++ TBAA"}
!20 = distinct !{!20, !6}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !6}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
!25 = distinct !{!25, !6}
!26 = distinct !{!26, !24}
!27 = distinct !{!27, !6}
!28 = distinct !{!28, !6}
!29 = !{!30, !30, i64 0}
!30 = !{!"long long", !18, i64 0}
!31 = !{!32, !32, i64 0}
!32 = !{!"double", !18, i64 0}
!33 = !{!18, !18, i64 0}
!34 = distinct !{!34, !6, !9, !10}
!35 = distinct !{!35, !6, !10, !9}
!36 = distinct !{!36, !6}
!37 = distinct !{!37, !6}
!38 = distinct !{!38, !6}
!39 = distinct !{!39, !6, !40}
!40 = !{!"llvm.loop.peeled.count", i32 1}
!41 = distinct !{!41, !6, !9, !10}
!42 = distinct !{!42, !6, !10, !9}
!43 = distinct !{!43, !6}
!44 = !{!45, !17, i64 0}
!45 = !{!"", !17, i64 0, !17, i64 4}
!46 = distinct !{!46, !6, !9, !10}
!47 = !{!45, !17, i64 4}
!48 = distinct !{!48, !6, !10, !9}
!49 = distinct !{!49, !6}
!50 = distinct !{!50, !6}
!51 = distinct !{!51, !6}
|
#include <stdio.h>
int main() {
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==b){
printf("%d\n",c);
}
if(a==c){
printf("%d\n",b);
}
if(b==c){
printf("%d\n",a);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208199/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208199/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = icmp eq i32 %0, %1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%2 = load i32, ptr %c, align 4, !tbaa !5
%call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%.pre = load i32, ptr %a, align 4, !tbaa !5
%.pre11.pre = load i32, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%.pre11 = phi i32 [ %.pre11.pre, %if.then ], [ %1, %entry ]
%3 = phi i32 [ %.pre, %if.then ], [ %0, %entry ]
%4 = load i32, ptr %c, align 4, !tbaa !5
%cmp2 = icmp eq i32 %3, %4
br i1 %cmp2, label %if.then3, label %if.end5
if.then3: ; preds = %if.end
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre11)
%.pre10 = load i32, ptr %b, align 4, !tbaa !5
%.pre12 = load i32, ptr %c, align 4, !tbaa !5
br label %if.end5
if.end5: ; preds = %if.then3, %if.end
%5 = phi i32 [ %.pre12, %if.then3 ], [ %4, %if.end ]
%6 = phi i32 [ %.pre10, %if.then3 ], [ %.pre11, %if.end ]
%cmp6 = icmp eq i32 %6, %5
br i1 %cmp6, label %if.then7, label %if.end9
if.then7: ; preds = %if.end5
%7 = load i32, ptr %a, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
br label %if.end9
if.end9: ; preds = %if.then7, %if.end5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int num1,num2,num3;
char str[16];
fgets(str,sizeof(str),stdin);
sscanf(str,"%d%d%d",&num1,&num2,&num3);
if(num1 == num2)
{
printf("%d\n",num3);
}else if(num1 == num3)
{
printf("%d\n",num2);
}else
{
printf("%d\n",num1);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208249/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208249/source.c"
target datalayout = "e-m:e-p270: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 [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:
%num1 = alloca i32, align 4
%num2 = alloca i32, align 4
%num3 = alloca i32, align 4
%str = alloca [16 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num1) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num2) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num3) #3
call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %str) #3
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 16, ptr noundef %0)
%call2 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %str, ptr noundef nonnull @.str, ptr noundef nonnull %num1, ptr noundef nonnull %num2, ptr noundef nonnull %num3) #3
%1 = load i32, ptr %num1, align 4, !tbaa !9
%2 = load i32, ptr %num2, align 4, !tbaa !9
%cmp = icmp eq i32 %1, %2
%3 = load i32, ptr %num3, align 4, !tbaa !9
%cmp4 = icmp eq i32 %1, %3
%. = select i1 %cmp4, i32 %2, i32 %1
%.sink = select i1 %cmp, i32 %3, i32 %.
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %str) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num3) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num2) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num1) #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 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!"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}
|
#include <stdio.h>
int main(void){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
if(a==b)printf("%d",c);
else if(b==c)printf("%d",a);
else if(c==a)printf("%d",b);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208292/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208292/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%2 = load i32, ptr %c, align 4, !tbaa !5
br i1 %cmp, label %if.end10.sink.split, label %if.else
if.else: ; preds = %entry
%cmp2 = icmp eq i32 %1, %2
br i1 %cmp2, label %if.end10.sink.split, label %if.else5
if.else5: ; preds = %if.else
%cmp6 = icmp eq i32 %2, %0
br i1 %cmp6, label %if.end10.sink.split, label %if.end10
if.end10.sink.split: ; preds = %if.else5, %if.else, %entry
%.sink = phi i32 [ %2, %entry ], [ %0, %if.else ], [ %1, %if.else5 ]
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
br label %if.end10
if.end10: ; preds = %if.end10.sink.split, %if.else5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
void run(void){
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
printf("%d\n",a==b?c:a==c?b:a);
}
int main(void){
run();
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208335/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208335/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 void @run() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4
%1 = load i32, ptr %b, align 4
%cmp = icmp eq i32 %0, %1
%2 = load i32, ptr %c, align 4
%cmp1 = icmp eq i32 %0, %2
%cond = select i1 %cmp1, i32 %1, i32 %0
%cond5 = select i1 %cmp, i32 %2, i32 %cond
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond5)
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 void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a.i = alloca i32, align 4
%b.i = alloca i32, align 4
%c.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a.i) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b.i) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c.i) #3
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a.i, ptr noundef nonnull %b.i, ptr noundef nonnull %c.i)
%0 = load i32, ptr %a.i, align 4
%1 = load i32, ptr %b.i, align 4
%cmp.i = icmp eq i32 %0, %1
%2 = load i32, ptr %c.i, align 4
%cmp1.i = icmp eq i32 %0, %2
%cond.i = select i1 %cmp1.i, i32 %1, i32 %0
%cond5.i = select i1 %cmp.i, i32 %2, i32 %cond.i
%call6.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond5.i)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c.i) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b.i) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a.i) #3
ret i32 0
}
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
|
#include<stdio.h>
int main(void)
{
int A,B,C;
scanf("%d",&A);
scanf("%d",&B);
scanf("%d",&C);
if(A == B){
printf("%d",C);
}else if(A == C){
printf("%d",B);
}else{
printf("%d",A);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208386/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208386/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca i32, align 4
%B = alloca i32, align 4
%C = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %A) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %C) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %C)
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
%2 = load i32, ptr %C, align 4, !tbaa !5
%cmp4 = icmp eq i32 %0, %2
%. = select i1 %cmp4, i32 %1, i32 %0
%.sink = select i1 %cmp, i32 %2, i32 %.
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(int argc, char *argv[])
{
int a,b,c;
while( scanf("%d%d%d",&a,&b,&c) !=EOF ){
if( a == b )printf("%d\n",c);
else if( a == c )printf("%d\n",b);
else printf("%d\n",a);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208429/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208429/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%cmp.not11 = icmp eq i32 %call10, -1
br i1 %cmp.not11, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp1 = icmp eq i32 %0, %1
%2 = load i32, ptr %c, align 4, !tbaa !5
%cmp3 = icmp eq i32 %0, %2
%. = select i1 %cmp3, i32 %1, i32 %0
%.sink = select i1 %cmp1, i32 %2, i32 %.
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.sink)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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>
#include<string.h>
int main(void)
{
int i;
int len;
char s[200001];
char t[200001];
int s_n[200001]={0};
int t_n[200001]={0};
int s_a[26]={0};
int t_a[26]={0};
scanf("%s%s",s,t);
len=strlen(s);
for(i=0;i<len;i++){
s_a[s[i]-'a']++;
s_n[i]=s_a[s[i]-'a'];
}
for(i=0;i<len;i++){
t_a[t[i]-'a']++;
t_n[i]=t_a[t[i]-'a'];
}
for(i=0;i<len;i++){
if(t_n[i]!=s_n[i]){
printf("No");
return 0;
}
}
printf("Yes");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208472/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208472/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [200001 x i8], align 16
%t = alloca [200001 x i8], align 16
%s_n = alloca [200001 x i32], align 16
%t_n = alloca [200001 x i32], align 16
%s_a = alloca [26 x i32], align 16
%t_a = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 200001, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 200001, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %s_n) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) %s_n, i8 0, i64 800004, i1 false)
call void @llvm.lifetime.start.p0(i64 800004, ptr nonnull %t_n) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800004) %t_n, i8 0, i64 800004, i1 false)
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %s_a) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %s_a, i8 0, i64 104, i1 false)
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %t_a) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %t_a, i8 0, i64 104, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #6
%conv = trunc i64 %call3 to i32
%cmp76 = icmp sgt i32 %conv, 0
br i1 %cmp76, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call3, 4294967295
%0 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %call3, 1
%1 = icmp eq i64 %0, 0
br i1 %1, label %for.cond17.preheader.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = sub nsw i64 %wide.trip.count, %xtraiter
br label %for.body
for.cond17.preheader.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.cond17.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond17.preheader.unr-lcssa
%arrayidx.epil = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv.unr
%2 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%conv5.epil = sext i8 %2 to i64
%sub.epil = add nsw i64 %conv5.epil, -97
%arrayidx7.epil = getelementptr inbounds [26 x i32], ptr %s_a, i64 0, i64 %sub.epil
%3 = load i32, ptr %arrayidx7.epil, align 4, !tbaa !8
%inc.epil = add nsw i32 %3, 1
store i32 %inc.epil, ptr %arrayidx7.epil, align 4, !tbaa !8
%arrayidx15.epil = getelementptr inbounds [200001 x i32], ptr %s_n, i64 0, i64 %indvars.iv.unr
store i32 %inc.epil, ptr %arrayidx15.epil, align 4, !tbaa !8
br label %for.cond17.preheader
for.cond17.preheader: ; preds = %for.cond17.preheader.unr-lcssa, %for.body.epil
br i1 %cmp76, label %for.body20.preheader, label %cleanup
for.body20.preheader: ; preds = %for.cond17.preheader
%xtraiter93 = and i64 %call3, 1
%4 = icmp eq i64 %0, 0
br i1 %4, label %for.cond39.preheader.unr-lcssa, label %for.body20.preheader.new
for.body20.preheader.new: ; preds = %for.body20.preheader
%unroll_iter95 = sub nsw i64 %wide.trip.count, %xtraiter93
br label %for.body20
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 [200001 x i8], ptr %s, i64 0, i64 %indvars.iv
%5 = load i8, ptr %arrayidx, align 2, !tbaa !5
%conv5 = sext i8 %5 to i64
%sub = add nsw i64 %conv5, -97
%arrayidx7 = getelementptr inbounds [26 x i32], ptr %s_a, i64 0, i64 %sub
%6 = load i32, ptr %arrayidx7, align 4, !tbaa !8
%inc = add nsw i32 %6, 1
store i32 %inc, ptr %arrayidx7, align 4, !tbaa !8
%arrayidx15 = getelementptr inbounds [200001 x i32], ptr %s_n, i64 0, i64 %indvars.iv
store i32 %inc, ptr %arrayidx15, align 8, !tbaa !8
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%7 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%conv5.1 = sext i8 %7 to i64
%sub.1 = add nsw i64 %conv5.1, -97
%arrayidx7.1 = getelementptr inbounds [26 x i32], ptr %s_a, i64 0, i64 %sub.1
%8 = load i32, ptr %arrayidx7.1, align 4, !tbaa !8
%inc.1 = add nsw i32 %8, 1
store i32 %inc.1, ptr %arrayidx7.1, align 4, !tbaa !8
%arrayidx15.1 = getelementptr inbounds [200001 x i32], ptr %s_n, i64 0, i64 %indvars.iv.next
store i32 %inc.1, ptr %arrayidx15.1, align 4, !tbaa !8
%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.cond17.preheader.unr-lcssa, label %for.body, !llvm.loop !10
for.cond39.preheader.unr-lcssa: ; preds = %for.body20, %for.body20.preheader
%indvars.iv83.unr = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next84.1, %for.body20 ]
%lcmp.mod94.not = icmp eq i64 %xtraiter93, 0
br i1 %lcmp.mod94.not, label %for.cond39.preheader, label %for.body20.epil
for.body20.epil: ; preds = %for.cond39.preheader.unr-lcssa
%arrayidx22.epil = getelementptr inbounds [200001 x i8], ptr %t, i64 0, i64 %indvars.iv83.unr
%9 = load i8, ptr %arrayidx22.epil, align 1, !tbaa !5
%conv23.epil = sext i8 %9 to i64
%sub24.epil = add nsw i64 %conv23.epil, -97
%arrayidx26.epil = getelementptr inbounds [26 x i32], ptr %t_a, i64 0, i64 %sub24.epil
%10 = load i32, ptr %arrayidx26.epil, align 4, !tbaa !8
%inc27.epil = add nsw i32 %10, 1
store i32 %inc27.epil, ptr %arrayidx26.epil, align 4, !tbaa !8
%arrayidx35.epil = getelementptr inbounds [200001 x i32], ptr %t_n, i64 0, i64 %indvars.iv83.unr
store i32 %inc27.epil, ptr %arrayidx35.epil, align 4, !tbaa !8
br label %for.cond39.preheader
for.cond39.preheader: ; preds = %for.cond39.preheader.unr-lcssa, %for.body20.epil
br i1 %cmp76, label %for.body42.preheader, label %cleanup
for.body42.preheader: ; preds = %for.cond39.preheader
%wide.trip.count91 = and i64 %call3, 4294967295
br label %for.body42
for.body20: ; preds = %for.body20, %for.body20.preheader.new
%indvars.iv83 = phi i64 [ 0, %for.body20.preheader.new ], [ %indvars.iv.next84.1, %for.body20 ]
%niter96 = phi i64 [ 0, %for.body20.preheader.new ], [ %niter96.next.1, %for.body20 ]
%arrayidx22 = getelementptr inbounds [200001 x i8], ptr %t, i64 0, i64 %indvars.iv83
%11 = load i8, ptr %arrayidx22, align 2, !tbaa !5
%conv23 = sext i8 %11 to i64
%sub24 = add nsw i64 %conv23, -97
%arrayidx26 = getelementptr inbounds [26 x i32], ptr %t_a, i64 0, i64 %sub24
%12 = load i32, ptr %arrayidx26, align 4, !tbaa !8
%inc27 = add nsw i32 %12, 1
store i32 %inc27, ptr %arrayidx26, align 4, !tbaa !8
%arrayidx35 = getelementptr inbounds [200001 x i32], ptr %t_n, i64 0, i64 %indvars.iv83
store i32 %inc27, ptr %arrayidx35, align 8, !tbaa !8
%indvars.iv.next84 = or i64 %indvars.iv83, 1
%arrayidx22.1 = getelementptr inbounds [200001 x i8], ptr %t, i64 0, i64 %indvars.iv.next84
%13 = load i8, ptr %arrayidx22.1, align 1, !tbaa !5
%conv23.1 = sext i8 %13 to i64
%sub24.1 = add nsw i64 %conv23.1, -97
%arrayidx26.1 = getelementptr inbounds [26 x i32], ptr %t_a, i64 0, i64 %sub24.1
%14 = load i32, ptr %arrayidx26.1, align 4, !tbaa !8
%inc27.1 = add nsw i32 %14, 1
store i32 %inc27.1, ptr %arrayidx26.1, align 4, !tbaa !8
%arrayidx35.1 = getelementptr inbounds [200001 x i32], ptr %t_n, i64 0, i64 %indvars.iv.next84
store i32 %inc27.1, ptr %arrayidx35.1, align 4, !tbaa !8
%indvars.iv.next84.1 = add nuw nsw i64 %indvars.iv83, 2
%niter96.next.1 = add i64 %niter96, 2
%niter96.ncmp.1 = icmp eq i64 %niter96.next.1, %unroll_iter95
br i1 %niter96.ncmp.1, label %for.cond39.preheader.unr-lcssa, label %for.body20, !llvm.loop !12
for.cond39: ; preds = %for.body42
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%exitcond92.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count91
br i1 %exitcond92.not, label %cleanup, label %for.body42, !llvm.loop !13
for.body42: ; preds = %for.body42.preheader, %for.cond39
%indvars.iv88 = phi i64 [ 0, %for.body42.preheader ], [ %indvars.iv.next89, %for.cond39 ]
%arrayidx44 = getelementptr inbounds [200001 x i32], ptr %t_n, i64 0, i64 %indvars.iv88
%15 = load i32, ptr %arrayidx44, align 4, !tbaa !8
%arrayidx46 = getelementptr inbounds [200001 x i32], ptr %s_n, i64 0, i64 %indvars.iv88
%16 = load i32, ptr %arrayidx46, align 4, !tbaa !8
%cmp47.not = icmp eq i32 %15, %16
br i1 %cmp47.not, label %for.cond39, label %cleanup
cleanup: ; preds = %for.cond39, %for.body42, %for.cond39.preheader, %for.cond17.preheader, %entry
%.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.2, %for.cond17.preheader ], [ @.str.2, %for.cond39.preheader ], [ @.str.1, %for.body42 ], [ @.str.2, %for.cond39 ]
%call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %t_a) #5
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %s_a) #5
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %t_n) #5
call void @llvm.lifetime.end.p0(i64 800004, ptr nonnull %s_n) #5
call void @llvm.lifetime.end.p0(i64 200001, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 200001, 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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
|
#include<stdio.h>
int main(){
char s[200001],t[200001];
int change[26]={-1},change2[26],i;
for(i=0;i<26;i++){
change[i]=-1;
change2[i]=-1;
}
scanf("%s%s",s,t);
for(i=0;s[i]!=0;i++){
if(change[s[i]-'a']==-1||change[s[i]-'a']==t[i]-'a'){
change[s[i]-'a']=t[i]-'a';
}else {
puts("No");
return 0;
}
if(change2[t[i]-'a']==-1||change2[t[i]-'a']==s[i]-'a'){
change2[t[i]-'a']=s[i]-'a';
}else {
puts("No");
return 0;
}
}
puts("Yes");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208515/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208515/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [200001 x i8], align 16
%t = alloca [200001 x i8], align 16
%change = alloca [26 x i32], align 16
%change2 = alloca [26 x i32], align 16
call void @llvm.lifetime.start.p0(i64 200001, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 200001, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %change) #4
call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %change2) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %change, i8 -1, i64 104, i1 false), !tbaa !5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %change2, i8 -1, i64 104, i1 false), !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%0 = load i8, ptr %s, align 16, !tbaa !9
%cmp7.not100 = icmp eq i8 %0, 0
br i1 %cmp7.not100, label %cleanup, label %for.body9
for.body9: ; preds = %entry, %if.then61
%indvars.iv = phi i64 [ %indvars.iv.next, %if.then61 ], [ 0, %entry ]
%1 = phi i8 [ %4, %if.then61 ], [ %0, %entry ]
%conv = sext i8 %1 to i64
%sub = add nsw i64 %conv, -97
%arrayidx14 = getelementptr inbounds [26 x i32], ptr %change, i64 0, i64 %sub
%2 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%cmp15 = icmp eq i32 %2, -1
%arrayidx30.phi.trans.insert = getelementptr inbounds [200001 x i8], ptr %t, i64 0, i64 %indvars.iv
%.pre = load i8, ptr %arrayidx30.phi.trans.insert, align 1, !tbaa !9
%.pre104 = sext i8 %.pre to i32
%.pre105 = add nsw i32 %.pre104, -97
%cmp27 = icmp eq i32 %2, %.pre105
%or.cond106 = select i1 %cmp15, i1 true, i1 %cmp27
br i1 %or.cond106, label %if.then, label %cleanup
if.then: ; preds = %for.body9
store i32 %.pre105, ptr %arrayidx14, align 4, !tbaa !5
%conv42 = sext i8 %.pre to i64
%sub43 = add nsw i64 %conv42, -97
%arrayidx45 = getelementptr inbounds [26 x i32], ptr %change2, i64 0, i64 %sub43
%3 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%cmp46 = icmp eq i32 %3, -1
%conv57 = sext i8 %1 to i32
%sub58 = add nsw i32 %conv57, -97
%cmp59 = icmp eq i32 %3, %sub58
%or.cond = select i1 %cmp46, i1 true, i1 %cmp59
br i1 %or.cond, label %if.then61, label %cleanup
if.then61: ; preds = %if.then
store i32 %sub58, ptr %arrayidx45, align 4, !tbaa !5
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%arrayidx6 = getelementptr inbounds [200001 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%4 = load i8, ptr %arrayidx6, align 1, !tbaa !9
%cmp7.not = icmp eq i8 %4, 0
br i1 %cmp7.not, label %cleanup, label %for.body9, !llvm.loop !10
cleanup: ; preds = %if.then61, %if.then, %for.body9, %entry
%.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %for.body9 ], [ @.str.1, %if.then ], [ @.str.2, %if.then61 ]
%call78 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %change2) #4
call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %change) #4
call void @llvm.lifetime.end.p0(i64 200001, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 200001, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int a, b, c, d, p;
scanf("%d %d %d %d %d",&a,&b,&c,&d,&p);
a = a * p;
if (p > c) {
b = b + (p - c) * d;
}
if (a < b) {
printf("%d\n",a);
}else{
printf("%d\n",b);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208638/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208638/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [15 x i8] c"%d %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
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #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, ptr noundef nonnull %p)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %p, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
store i32 %mul, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%cmp = icmp sgt i32 %1, %2
%.pre = load i32, ptr %b, align 4, !tbaa !5
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%sub = sub nsw i32 %1, %2
%3 = load i32, ptr %d, align 4, !tbaa !5
%mul1 = mul nsw i32 %3, %sub
%add = add nsw i32 %mul1, %.pre
store i32 %add, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%4 = phi i32 [ %add, %if.then ], [ %.pre, %entry ]
%mul. = call i32 @llvm.smin.i32(i32 %mul, i32 %4)
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul.)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int x1,y,ylim,y1,p,xsum,ysum;
scanf("%d%d%d%d%d",&x1,&y,&ylim,&y1,&p);
xsum=p*x1;
if(ylim < p)
ysum=y+(p-ylim)*y1;
else
ysum=y;
if(xsum<=ysum)
printf("%d\n",xsum);
else
printf("%d\n",ysum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208689/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208689/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [11 x i8] c"%d%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:
%x1 = alloca i32, align 4
%y = alloca i32, align 4
%ylim = alloca i32, align 4
%y1 = alloca i32, align 4
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ylim) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y, ptr noundef nonnull %ylim, ptr noundef nonnull %y1, ptr noundef nonnull %p)
%0 = load i32, ptr %p, align 4, !tbaa !5
%1 = load i32, ptr %x1, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %ylim, align 4, !tbaa !5
%cmp = icmp slt i32 %2, %0
%3 = load i32, ptr %y, align 4, !tbaa !5
%sub = sub nsw i32 %0, %2
%4 = load i32, ptr %y1, align 4
%mul1 = mul nsw i32 %4, %sub
%add = select i1 %cmp, i32 %mul1, i32 0
%ysum.0 = add nsw i32 %3, %add
%ysum.0.sink = call i32 @llvm.smin.i32(i32 %mul, i32 %ysum.0)
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ysum.0.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ylim) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int a,b,c,d,p,sum;
scanf("%d",&a);
scanf("%d",&b);
scanf("%d",&c);
scanf("%d",&d);
scanf("%d",&p);
int J;
J=a*p;
if(p>c){
int K;
K=p-c;
sum=d*K;
b=b+sum;
}
if(J>b){
printf("%d",b);
}
else if(J==b){
printf("%d",b);
}
else if(J<b){
printf("%d",J);
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208731/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208731/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%p = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %p) #5
%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)
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %p)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %p, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%cmp = icmp sgt i32 %1, %2
%.pre = load i32, ptr %b, align 4, !tbaa !5
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%sub = sub nsw i32 %1, %2
%3 = load i32, ptr %d, align 4, !tbaa !5
%mul5 = mul nsw i32 %3, %sub
%add = add nsw i32 %.pre, %mul5
store i32 %add, ptr %b, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %if.then, %entry
%4 = phi i32 [ %add, %if.then ], [ %.pre, %entry ]
%mul = mul nsw i32 %1, %0
%spec.select = call i32 @llvm.smin.i32(i32 %mul, i32 %4)
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %spec.select)
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %p) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind 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 @putchar(i32 noundef) local_unnamed_addr #3
; 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 nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#define MAX 10000
typedef struct node{
int id;
int rootid;
struct node *up;
}node;
int Getrootid(node N[],int x){
node *p;
if(N[x].up==NULL)N[x].rootid=x;
else{
p=N[x].up;
while(p->up != NULL)p=p->up;
N[x].rootid=p->id;
N[x].up=p;
}
return N[x].rootid;
}
int main(){
int n,q,i;
int com;
int x,y;
node N[MAX];
scanf("%d %d",&n,&q);
for(i=0;i<n;i++){
N[i].id=i;
N[i].rootid=-1;
N[i].up=NULL;
}
for(i=0;i<q;i++){
scanf("%d",&com);
if(com==0){/*unite*/
scanf("%d %d",&x,&y);
N[x].rootid=Getrootid(N,x);
N[y].rootid=Getrootid(N,y);
if(N[x].rootid != N[y].rootid)
N[ N[x].rootid ].up=&(N[ N[y].rootid ]);
}
else if(com==1){/*same*/
scanf("%d %d",&x,&y);
N[x].rootid=Getrootid(N,x);
N[y].rootid=Getrootid(N,y);
if(N[x].rootid==N[y].rootid)
printf("1\n");
else printf("0\n");
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208775/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208775/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct.node = type { i32, i32, ptr }
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [2 x i8] c"0\00", align 1
@str.4 = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @Getrootid(ptr nocapture noundef %N, i32 noundef %x) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %x to i64
%up = getelementptr inbounds %struct.node, ptr %N, i64 %idxprom, i32 2
%0 = load ptr, ptr %up, align 8, !tbaa !5
%cmp = icmp eq ptr %0, null
br i1 %cmp, label %if.then, label %while.cond
if.then: ; preds = %entry
%rootid = getelementptr inbounds %struct.node, ptr %N, i64 %idxprom, i32 1
store i32 %x, ptr %rootid, align 4, !tbaa !11
br label %if.end
while.cond: ; preds = %entry, %while.cond
%p.0 = phi ptr [ %1, %while.cond ], [ %0, %entry ]
%up6 = getelementptr inbounds %struct.node, ptr %p.0, i64 0, i32 2
%1 = load ptr, ptr %up6, align 8, !tbaa !5
%cmp7.not = icmp eq ptr %1, null
br i1 %cmp7.not, label %while.end, label %while.cond, !llvm.loop !12
while.end: ; preds = %while.cond
%2 = load i32, ptr %p.0, align 8, !tbaa !14
%rootid11 = getelementptr inbounds %struct.node, ptr %N, i64 %idxprom, i32 1
store i32 %2, ptr %rootid11, align 4, !tbaa !11
store ptr %p.0, ptr %up, align 8, !tbaa !5
br label %if.end
if.end: ; preds = %while.end, %if.then
%3 = phi i32 [ %2, %while.end ], [ %x, %if.then ]
ret i32 %3
}
; 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
%q = alloca i32, align 4
%com = alloca i32, align 4
%x = alloca i32, align 4
%y = alloca i32, align 4
%N = alloca [10000 x %struct.node], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %com) #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 160000, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q)
%0 = load i32, ptr %n, align 4, !tbaa !15
%cmp115 = icmp sgt i32 %0, 0
br i1 %cmp115, label %for.body.preheader, label %for.cond5.preheader
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %0 to i64
%xtraiter = and i64 %wide.trip.count, 1
%1 = icmp eq i32 %0, 1
br i1 %1, label %for.cond5.preheader.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body
for.cond5.preheader.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond5.preheader, label %for.body.epil
for.body.epil: ; preds = %for.cond5.preheader.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %indvars.iv.unr
%2 = trunc i64 %indvars.iv.unr to i32
store i32 %2, ptr %arrayidx.epil, align 16, !tbaa !14
%rootid.epil = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %indvars.iv.unr, i32 1
store i32 -1, ptr %rootid.epil, align 4, !tbaa !11
%up.epil = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %indvars.iv.unr, i32 2
store ptr null, ptr %up.epil, align 8, !tbaa !5
br label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.body.epil, %for.cond5.preheader.loopexit.unr-lcssa, %entry
%3 = load i32, ptr %q, align 4, !tbaa !15
%cmp6117 = icmp sgt i32 %3, 0
br i1 %cmp6117, label %for.body7, label %for.end68
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 [10000 x %struct.node], ptr %N, i64 0, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 16, !tbaa !14
%rootid = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %indvars.iv, i32 1
store i32 -1, ptr %rootid, align 4, !tbaa !11
%up = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %indvars.iv, i32 2
store ptr null, ptr %up, align 8, !tbaa !5
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %indvars.iv.next
%5 = trunc i64 %indvars.iv.next to i32
store i32 %5, ptr %arrayidx.1, align 16, !tbaa !14
%rootid.1 = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %indvars.iv.next, i32 1
store i32 -1, ptr %rootid.1, align 4, !tbaa !11
%up.1 = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %indvars.iv.next, i32 2
store ptr null, ptr %up.1, align 8, !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.cond5.preheader.loopexit.unr-lcssa, label %for.body, !llvm.loop !16
for.body7: ; preds = %for.cond5.preheader, %for.inc66
%i.1118 = phi i32 [ %inc67, %for.inc66 ], [ 0, %for.cond5.preheader ]
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %com)
%6 = load i32, ptr %com, align 4, !tbaa !15
switch i32 %6, label %for.inc66 [
i32 0, label %if.then
i32 1, label %if.then40
]
if.then: ; preds = %for.body7
%call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%7 = load i32, ptr %x, align 4, !tbaa !15
%idxprom.i = sext i32 %7 to i64
%up.i = getelementptr inbounds %struct.node, ptr %N, i64 %idxprom.i, i32 2
%8 = load ptr, ptr %up.i, align 8, !tbaa !5
%cmp.i = icmp eq ptr %8, null
br i1 %cmp.i, label %Getrootid.exit, label %while.cond.i
while.cond.i: ; preds = %if.then, %while.cond.i
%p.0.i = phi ptr [ %9, %while.cond.i ], [ %8, %if.then ]
%up6.i = getelementptr inbounds %struct.node, ptr %p.0.i, i64 0, i32 2
%9 = load ptr, ptr %up6.i, align 8, !tbaa !5
%cmp7.not.i = icmp eq ptr %9, null
br i1 %cmp7.not.i, label %while.end.i, label %while.cond.i, !llvm.loop !12
while.end.i: ; preds = %while.cond.i
%10 = load i32, ptr %p.0.i, align 8, !tbaa !14
store ptr %p.0.i, ptr %up.i, align 8, !tbaa !5
br label %Getrootid.exit
Getrootid.exit: ; preds = %if.then, %while.end.i
%11 = phi i32 [ %10, %while.end.i ], [ %7, %if.then ]
%rootid14 = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %idxprom.i, i32 1
store i32 %11, ptr %rootid14, align 4, !tbaa !11
%12 = load i32, ptr %y, align 4, !tbaa !15
%idxprom.i79 = sext i32 %12 to i64
%up.i80 = getelementptr inbounds %struct.node, ptr %N, i64 %idxprom.i79, i32 2
%13 = load ptr, ptr %up.i80, align 8, !tbaa !5
%cmp.i81 = icmp eq ptr %13, null
br i1 %cmp.i81, label %Getrootid.exit90, label %while.cond.i82
while.cond.i82: ; preds = %Getrootid.exit, %while.cond.i82
%p.0.i83 = phi ptr [ %14, %while.cond.i82 ], [ %13, %Getrootid.exit ]
%up6.i84 = getelementptr inbounds %struct.node, ptr %p.0.i83, i64 0, i32 2
%14 = load ptr, ptr %up6.i84, align 8, !tbaa !5
%cmp7.not.i85 = icmp eq ptr %14, null
br i1 %cmp7.not.i85, label %while.end.i86, label %while.cond.i82, !llvm.loop !12
while.end.i86: ; preds = %while.cond.i82
%15 = load i32, ptr %p.0.i83, align 8, !tbaa !14
store ptr %p.0.i83, ptr %up.i80, align 8, !tbaa !5
br label %Getrootid.exit90
Getrootid.exit90: ; preds = %Getrootid.exit, %while.end.i86
%16 = phi i32 [ %15, %while.end.i86 ], [ %12, %Getrootid.exit ]
%rootid19 = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %idxprom.i79, i32 1
store i32 %16, ptr %rootid19, align 4, !tbaa !11
%17 = load i32, ptr %rootid14, align 4, !tbaa !11
%cmp26.not = icmp eq i32 %17, %16
br i1 %cmp26.not, label %for.inc66, label %if.then27
if.then27: ; preds = %Getrootid.exit90
%idxprom31 = sext i32 %16 to i64
%arrayidx32 = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %idxprom31
%idxprom36 = sext i32 %17 to i64
%up38 = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %idxprom36, i32 2
store ptr %arrayidx32, ptr %up38, align 8, !tbaa !5
br label %for.inc66
if.then40: ; preds = %for.body7
%call41 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y)
%18 = load i32, ptr %x, align 4, !tbaa !15
%idxprom.i91 = sext i32 %18 to i64
%up.i92 = getelementptr inbounds %struct.node, ptr %N, i64 %idxprom.i91, i32 2
%19 = load ptr, ptr %up.i92, align 8, !tbaa !5
%cmp.i93 = icmp eq ptr %19, null
br i1 %cmp.i93, label %Getrootid.exit102, label %while.cond.i94
while.cond.i94: ; preds = %if.then40, %while.cond.i94
%p.0.i95 = phi ptr [ %20, %while.cond.i94 ], [ %19, %if.then40 ]
%up6.i96 = getelementptr inbounds %struct.node, ptr %p.0.i95, i64 0, i32 2
%20 = load ptr, ptr %up6.i96, align 8, !tbaa !5
%cmp7.not.i97 = icmp eq ptr %20, null
br i1 %cmp7.not.i97, label %while.end.i98, label %while.cond.i94, !llvm.loop !12
while.end.i98: ; preds = %while.cond.i94
%21 = load i32, ptr %p.0.i95, align 8, !tbaa !14
store ptr %p.0.i95, ptr %up.i92, align 8, !tbaa !5
br label %Getrootid.exit102
Getrootid.exit102: ; preds = %if.then40, %while.end.i98
%22 = phi i32 [ %21, %while.end.i98 ], [ %18, %if.then40 ]
%rootid46 = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %idxprom.i91, i32 1
store i32 %22, ptr %rootid46, align 4, !tbaa !11
%23 = load i32, ptr %y, align 4, !tbaa !15
%idxprom.i103 = sext i32 %23 to i64
%up.i104 = getelementptr inbounds %struct.node, ptr %N, i64 %idxprom.i103, i32 2
%24 = load ptr, ptr %up.i104, align 8, !tbaa !5
%cmp.i105 = icmp eq ptr %24, null
br i1 %cmp.i105, label %Getrootid.exit114, label %while.cond.i106
while.cond.i106: ; preds = %Getrootid.exit102, %while.cond.i106
%p.0.i107 = phi ptr [ %25, %while.cond.i106 ], [ %24, %Getrootid.exit102 ]
%up6.i108 = getelementptr inbounds %struct.node, ptr %p.0.i107, i64 0, i32 2
%25 = load ptr, ptr %up6.i108, align 8, !tbaa !5
%cmp7.not.i109 = icmp eq ptr %25, null
br i1 %cmp7.not.i109, label %while.end.i110, label %while.cond.i106, !llvm.loop !12
while.end.i110: ; preds = %while.cond.i106
%26 = load i32, ptr %p.0.i107, align 8, !tbaa !14
store ptr %p.0.i107, ptr %up.i104, align 8, !tbaa !5
br label %Getrootid.exit114
Getrootid.exit114: ; preds = %Getrootid.exit102, %while.end.i110
%27 = phi i32 [ %26, %while.end.i110 ], [ %23, %Getrootid.exit102 ]
%rootid51 = getelementptr inbounds [10000 x %struct.node], ptr %N, i64 0, i64 %idxprom.i103, i32 1
store i32 %27, ptr %rootid51, align 4, !tbaa !11
%28 = load i32, ptr %rootid46, align 4, !tbaa !11
%cmp58 = icmp eq i32 %28, %27
br i1 %cmp58, label %if.then59, label %if.else61
if.then59: ; preds = %Getrootid.exit114
%puts78 = call i32 @puts(ptr nonnull dereferenceable(1) @str.4)
br label %for.inc66
if.else61: ; preds = %Getrootid.exit114
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %for.inc66
for.inc66: ; preds = %for.body7, %if.then27, %Getrootid.exit90, %if.then59, %if.else61
%inc67 = add nuw nsw i32 %i.1118, 1
%29 = load i32, ptr %q, align 4, !tbaa !15
%cmp6 = icmp slt i32 %inc67, %29
br i1 %cmp6, label %for.body7, label %for.end68, !llvm.loop !17
for.end68: ; preds = %for.inc66, %for.cond5.preheader
call void @llvm.lifetime.end.p0(i64 160000, ptr nonnull %N) #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 4, ptr nonnull %com) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: 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 #4
attributes #0 = { nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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, !10, i64 8}
!6 = !{!"node", !7, i64 0, !7, i64 4, !10, i64 8}
!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 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!6, !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
|
#include <stdio.h>
#include <stdlib.h>
int asc(const void *a, const void *b) {
return *(int *)b - *(int *)a;
}
int main()
{
int n,l[2000],i,j,k;
long long ans = 0;
scanf("%d",&n);
for(i = 0; i < n;i++)scanf("%d",&l[i]);
qsort(l,n,sizeof(int),asc);
for (i = 0; i < n; i++)
{
for (j = i + 1; j < n; j++)
{
for (k = j + 1; k < n; k++)
{
if(l[i] < l[j] + l[k])ans++;
}
}
}
printf("%lld",ans);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208832/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208832/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%l = alloca [2000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %l) #6
%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 %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [2000 x i32], ptr %l, 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, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull %l, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @asc) #6
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp357 = icmp sgt i32 %3, 0
br i1 %cmp357, label %for.body5.preheader, label %for.end33
for.body5.preheader: ; preds = %for.end
%4 = zext i32 %3 to i64
%wide.trip.count78 = zext i32 %3 to i64
%5 = add i32 %3, -3
br label %for.body5
for.cond2.loopexit: ; preds = %for.cond6.loopexit, %for.body5
%ans.1.lcssa = phi i64 [ %ans.059, %for.body5 ], [ %ans.2.lcssa, %for.cond6.loopexit ]
%indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%exitcond79.not = icmp eq i64 %indvars.iv.next76, %wide.trip.count78
br i1 %exitcond79.not, label %for.end33, label %for.body5, !llvm.loop !11
for.body5: ; preds = %for.body5.preheader, %for.cond2.loopexit
%indvars.iv75 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next76, %for.cond2.loopexit ]
%indvars.iv70 = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next71, %for.cond2.loopexit ]
%indvars.iv63 = phi i64 [ 2, %for.body5.preheader ], [ %indvars.iv.next64, %for.cond2.loopexit ]
%ans.059 = phi i64 [ 0, %for.body5.preheader ], [ %ans.1.lcssa, %for.cond2.loopexit ]
%6 = trunc i64 %indvars.iv75 to i32
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%cmp753 = icmp ult i64 %indvars.iv.next76, %4
br i1 %cmp753, label %for.body9.lr.ph, label %for.cond2.loopexit
for.body9.lr.ph: ; preds = %for.body5
%arrayidx16 = getelementptr inbounds [2000 x i32], ptr %l, i64 0, i64 %indvars.iv75
br label %for.body9
for.cond6.loopexit: ; preds = %for.body14, %middle.block, %for.body9
%ans.2.lcssa = phi i64 [ %ans.155, %for.body9 ], [ %26, %middle.block ], [ %spec.select, %for.body14 ]
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%exitcond.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count78
%indvar.next = add i32 %indvar, 1
br i1 %exitcond.not, label %for.cond2.loopexit, label %for.body9, !llvm.loop !12
for.body9: ; preds = %for.body9.lr.ph, %for.cond6.loopexit
%indvar = phi i32 [ 0, %for.body9.lr.ph ], [ %indvar.next, %for.cond6.loopexit ]
%indvars.iv72 = phi i64 [ %indvars.iv70, %for.body9.lr.ph ], [ %indvars.iv.next73, %for.cond6.loopexit ]
%indvars.iv65 = phi i64 [ %indvars.iv63, %for.body9.lr.ph ], [ %indvars.iv.next66, %for.cond6.loopexit ]
%ans.155 = phi i64 [ %ans.059, %for.body9.lr.ph ], [ %ans.2.lcssa, %for.cond6.loopexit ]
%7 = add i32 %indvar, %6
%8 = sub i32 %5, %7
%9 = zext i32 %8 to i64
%10 = add nuw nsw i64 %9, 1
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%11 = trunc i64 %indvars.iv.next73 to i32
%cmp1249 = icmp sgt i32 %3, %11
br i1 %cmp1249, label %for.body14.lr.ph, label %for.cond6.loopexit
for.body14.lr.ph: ; preds = %for.body9
%12 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [2000 x i32], ptr %l, i64 0, i64 %indvars.iv72
%13 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%min.iters.check = icmp ult i32 %8, 3
br i1 %min.iters.check, label %for.body14.preheader, label %vector.ph
vector.ph: ; preds = %for.body14.lr.ph
%n.vec = and i64 %10, 8589934588
%ind.end = add nuw i64 %indvars.iv65, %n.vec
%14 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %ans.155, i64 0
%broadcast.splatinsert = insertelement <2 x i32> poison, i32 %13, i64 0
%broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer
%broadcast.splatinsert82 = insertelement <2 x i32> poison, i32 %12, i64 0
%broadcast.splat83 = shufflevector <2 x i32> %broadcast.splatinsert82, <2 x i32> poison, <2 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %14, %vector.ph ], [ %23, %vector.body ]
%vec.phi80 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %24, %vector.body ]
%offset.idx = add i64 %indvars.iv65, %index
%15 = getelementptr inbounds [2000 x i32], ptr %l, i64 0, i64 %offset.idx
%wide.load = load <2 x i32>, ptr %15, align 4, !tbaa !5
%16 = getelementptr inbounds i32, ptr %15, i64 2
%wide.load81 = load <2 x i32>, ptr %16, align 4, !tbaa !5
%17 = add nsw <2 x i32> %wide.load, %broadcast.splat
%18 = add nsw <2 x i32> %wide.load81, %broadcast.splat
%19 = icmp slt <2 x i32> %broadcast.splat83, %17
%20 = icmp slt <2 x i32> %broadcast.splat83, %18
%21 = zext <2 x i1> %19 to <2 x i64>
%22 = zext <2 x i1> %20 to <2 x i64>
%23 = add <2 x i64> %vec.phi, %21
%24 = add <2 x i64> %vec.phi80, %22
%index.next = add nuw i64 %index, 4
%25 = icmp eq i64 %index.next, %n.vec
br i1 %25, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %24, %23
%26 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %10, %n.vec
br i1 %cmp.n, label %for.cond6.loopexit, label %for.body14.preheader
for.body14.preheader: ; preds = %for.body14.lr.ph, %middle.block
%indvars.iv67.ph = phi i64 [ %indvars.iv65, %for.body14.lr.ph ], [ %ind.end, %middle.block ]
%ans.251.ph = phi i64 [ %ans.155, %for.body14.lr.ph ], [ %26, %middle.block ]
br label %for.body14
for.body14: ; preds = %for.body14.preheader, %for.body14
%indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.body14 ], [ %indvars.iv67.ph, %for.body14.preheader ]
%ans.251 = phi i64 [ %spec.select, %for.body14 ], [ %ans.251.ph, %for.body14.preheader ]
%arrayidx20 = getelementptr inbounds [2000 x i32], ptr %l, i64 0, i64 %indvars.iv67
%27 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%add21 = add nsw i32 %27, %13
%cmp22 = icmp slt i32 %12, %add21
%inc24 = zext i1 %cmp22 to i64
%spec.select = add nsw i64 %ans.251, %inc24
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%28 = trunc i64 %indvars.iv.next68 to i32
%cmp12 = icmp sgt i32 %3, %28
br i1 %cmp12, label %for.body14, label %for.cond6.loopexit, !llvm.loop !16
for.end33: ; preds = %for.cond2.loopexit, %for.end
%ans.0.lcssa = phi i64 [ 0, %for.end ], [ %ans.1.lcssa, %for.cond2.loopexit ]
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %l) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: 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 i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
|
#include<stdio.h>
#include<stdlib.h>
int compare_int(const void *a, const void *b){
return *(int*)a - *(int*)b;
}
int main(void){
int N,i,j,k,L[2001],s,ans=0;
scanf("%d",&N);
for(i = 0;i < N;i++){
scanf("%d",&L[i]);
}
qsort(L,N,sizeof(int),compare_int);
for(i = 0;i < N;i++){
for(j = i + 1;j < N;j++){
for(k = j + 1;k < N;k++){
if(L[i] + L[j] > L[k]){
ans++;
}else{
break;
}
}
}
}
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208883/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208883/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%N = alloca i32, align 4
%L = alloca [2001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 8004, ptr nonnull %L) #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 %entry.for.end_crit_edge
entry.for.end_crit_edge: ; preds = %entry
%.pre = sext i32 %0 to i64
br label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [2001 x i32], ptr %L, 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, %entry.for.end_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.end_crit_edge ], [ %2, %for.body ]
call void @qsort(ptr noundef nonnull %L, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare_int) #5
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp358 = icmp sgt i32 %3, 0
br i1 %cmp358, label %for.body5.preheader, label %for.end33
for.body5.preheader: ; preds = %for.end
%4 = zext i32 %3 to i64
%wide.trip.count79 = zext i32 %3 to i64
br label %for.body5
for.cond2.loopexit: ; preds = %for.inc28, %for.body5
%ans.1.lcssa = phi i32 [ %ans.060, %for.body5 ], [ %ans.2.lcssa, %for.inc28 ]
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%exitcond80.not = icmp eq i64 %indvars.iv.next77, %wide.trip.count79
br i1 %exitcond80.not, label %for.end33, label %for.body5, !llvm.loop !11
for.body5: ; preds = %for.body5.preheader, %for.cond2.loopexit
%indvars.iv76 = phi i64 [ 0, %for.body5.preheader ], [ %indvars.iv.next77, %for.cond2.loopexit ]
%indvars.iv71 = phi i64 [ 1, %for.body5.preheader ], [ %indvars.iv.next72, %for.cond2.loopexit ]
%indvars.iv64 = phi i64 [ 2, %for.body5.preheader ], [ %indvars.iv.next65, %for.cond2.loopexit ]
%ans.060 = phi i32 [ 0, %for.body5.preheader ], [ %ans.1.lcssa, %for.cond2.loopexit ]
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%cmp754 = icmp ult i64 %indvars.iv.next77, %4
br i1 %cmp754, label %for.body9.lr.ph, label %for.cond2.loopexit
for.body9.lr.ph: ; preds = %for.body5
%arrayidx16 = getelementptr inbounds [2001 x i32], ptr %L, i64 0, i64 %indvars.iv76
br label %for.body9
for.body9: ; preds = %for.body9.lr.ph, %for.inc28
%indvars.iv73 = phi i64 [ %indvars.iv71, %for.body9.lr.ph ], [ %indvars.iv.next74, %for.inc28 ]
%indvars.iv66 = phi i64 [ %indvars.iv64, %for.body9.lr.ph ], [ %indvars.iv.next67, %for.inc28 ]
%ans.156 = phi i32 [ %ans.060, %for.body9.lr.ph ], [ %ans.2.lcssa, %for.inc28 ]
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%5 = trunc i64 %indvars.iv.next74 to i32
%cmp1249 = icmp sgt i32 %3, %5
br i1 %cmp1249, label %for.body14.lr.ph, label %for.inc28
for.body14.lr.ph: ; preds = %for.body9
%6 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds [2001 x i32], ptr %L, i64 0, i64 %indvars.iv73
%7 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%add19 = add nsw i32 %7, %6
br label %for.body14
for.body14: ; preds = %for.body14.lr.ph, %if.then
%indvars.iv68 = phi i64 [ %indvars.iv66, %for.body14.lr.ph ], [ %indvars.iv.next69, %if.then ]
%ans.251 = phi i32 [ %ans.156, %for.body14.lr.ph ], [ %inc24, %if.then ]
%arrayidx21 = getelementptr inbounds [2001 x i32], ptr %L, i64 0, i64 %indvars.iv68
%8 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %add19, %8
br i1 %cmp22, label %if.then, label %for.inc28
if.then: ; preds = %for.body14
%inc24 = add nsw i32 %ans.251, 1
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%9 = trunc i64 %indvars.iv.next69 to i32
%cmp12 = icmp sgt i32 %3, %9
br i1 %cmp12, label %for.body14, label %for.inc28, !llvm.loop !12
for.inc28: ; preds = %for.body14, %if.then, %for.body9
%ans.2.lcssa = phi i32 [ %ans.156, %for.body9 ], [ %inc24, %if.then ], [ %ans.251, %for.body14 ]
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%exitcond.not = icmp eq i64 %indvars.iv.next74, %wide.trip.count79
br i1 %exitcond.not, label %for.cond2.loopexit, label %for.body9, !llvm.loop !13
for.end33: ; preds = %for.cond2.loopexit, %for.end
%ans.0.lcssa = phi i32 [ 0, %for.end ], [ %ans.1.lcssa, %for.cond2.loopexit ]
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 8004, ptr nonnull %L) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int func(int a, int b, int c){
if(a < b+c && b < a+c && c < a+b){
return 1;
}
return 0;
}
void swap(int* a, int* b){
int buf = *a;
*a = *b;
*b = buf;
}
void sort(int* a, int n){
if(n <= 1){
return;
}
int l = 0, r = n-1;
int p = *(a + (n/2));
while(l <= r){
while(*(a+l) > p){
l++;
}
while(p > *(a+r)){
r--;
}
if(r <= l){
break;
}
swap(a+l, a+r);
l++;
r--;
}
sort(a, l);
sort(a+r+1, n-r-1);
}
int main(){
int n;
scanf("%d", &n);
int l[n];
for(int i=0; i<n; i++){
scanf("%d", &l[i]);
}
sort(l, n);
int ans = 0;
for(int i=0; i<n; i++){
for(int j=i+1; j<n; j++){
for(int k=j+1; k<n; k++){
if(func(l[i], l[j], l[k]) == 1){
//printf("%d %d %d\n", l[i], l[j], l[k]);
ans++;
}else{
break;
}
}
}
}
printf("%d", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208940/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208940/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @func(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 {
entry:
%add = add nsw i32 %c, %b
%cmp = icmp sgt i32 %add, %a
%add1 = add nsw i32 %c, %a
%cmp2 = icmp sgt i32 %add1, %b
%or.cond = select i1 %cmp, i1 %cmp2, i1 false
%add4 = add nsw i32 %b, %a
%cmp5 = icmp sgt i32 %add4, %c
%or.cond12 = select i1 %or.cond, i1 %cmp5, i1 false
%retval.0 = zext i1 %or.cond12 to i32
ret i32 %retval.0
}
; 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 #1 {
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @sort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #3 {
entry:
%cmp56 = icmp slt i32 %n, 2
br i1 %cmp56, label %return, label %if.end
if.end: ; preds = %entry, %while.end22
%n.tr58 = phi i32 [ %sub27, %while.end22 ], [ %n, %entry ]
%a.tr57 = phi ptr [ %add.ptr25, %while.end22 ], [ %a, %entry ]
%div51 = lshr i32 %n.tr58, 1
%idx.ext = zext i32 %div51 to i64
%add.ptr = getelementptr inbounds i32, ptr %a.tr57, i64 %idx.ext
%0 = load i32, ptr %add.ptr, align 4, !tbaa !5
%r.053 = add nsw i32 %n.tr58, -1
br label %while.cond2.preheader
while.cond2.preheader: ; preds = %if.end, %if.end15
%r.055 = phi i32 [ %r.053, %if.end ], [ %r.0, %if.end15 ]
%l.054 = phi i32 [ 0, %if.end ], [ %inc20, %if.end15 ]
%1 = sext i32 %l.054 to i64
br label %while.cond2
while.cond2: ; preds = %while.cond2, %while.cond2.preheader
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond2 ], [ %1, %while.cond2.preheader ]
%add.ptr4 = getelementptr inbounds i32, ptr %a.tr57, i64 %indvars.iv
%2 = load i32, ptr %add.ptr4, align 4, !tbaa !5
%cmp5 = icmp sgt i32 %2, %0
%indvars.iv.next = add i64 %indvars.iv, 1
br i1 %cmp5, label %while.cond2, label %while.cond7.preheader, !llvm.loop !9
while.cond7.preheader: ; preds = %while.cond2
%add.ptr4.le = getelementptr inbounds i32, ptr %a.tr57, i64 %indvars.iv
%3 = trunc i64 %indvars.iv to i32
%4 = sext i32 %r.055 to i64
br label %while.cond7
while.cond7: ; preds = %while.cond7, %while.cond7.preheader
%indvars.iv61 = phi i64 [ %indvars.iv.next62, %while.cond7 ], [ %4, %while.cond7.preheader ]
%add.ptr9 = getelementptr inbounds i32, ptr %a.tr57, i64 %indvars.iv61
%5 = load i32, ptr %add.ptr9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %0, %5
%indvars.iv.next62 = add i64 %indvars.iv61, -1
br i1 %cmp10, label %while.cond7, label %while.end12, !llvm.loop !11
while.end12: ; preds = %while.cond7
%6 = trunc i64 %indvars.iv61 to i32
%cmp13.not = icmp sgt i32 %6, %3
br i1 %cmp13.not, label %if.end15, label %while.end22
if.end15: ; preds = %while.end12
%add.ptr9.le = getelementptr inbounds i32, ptr %a.tr57, i64 %indvars.iv61
store i32 %5, ptr %add.ptr4.le, align 4, !tbaa !5
store i32 %2, ptr %add.ptr9.le, align 4, !tbaa !5
%inc20 = add nsw i32 %3, 1
%r.0 = add nsw i32 %6, -1
%cmp1.not.not = icmp slt i32 %inc20, %6
br i1 %cmp1.not.not, label %while.cond2.preheader, label %while.end22, !llvm.loop !12
while.end22: ; preds = %while.end12, %if.end15
%r.2 = phi i32 [ %6, %while.end12 ], [ %r.0, %if.end15 ]
%l.2 = phi i32 [ %3, %while.end12 ], [ %inc20, %if.end15 ]
tail call void @sort(ptr noundef nonnull %a.tr57, i32 noundef %l.2)
%idx.ext23 = sext i32 %r.2 to i64
%add.ptr24 = getelementptr inbounds i32, ptr %a.tr57, i64 %idx.ext23
%add.ptr25 = getelementptr inbounds i32, ptr %add.ptr24, i64 1
%7 = xor i32 %r.2, -1
%sub27 = add i32 %n.tr58, %7
%cmp = icmp slt i32 %sub27, 2
br i1 %cmp, label %return, label %if.end
return: ; preds = %while.end22, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp51 = icmp sgt i32 %3, 0
br i1 %cmp51, label %for.body, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %entry
call void @sort(ptr noundef nonnull %vla, i32 noundef %3)
br label %for.cond.cleanup5
for.cond.cleanup: ; preds = %for.body
call void @sort(ptr noundef nonnull %vla, i32 noundef %5)
%cmp462 = icmp sgt i32 %5, 0
br i1 %cmp462, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond.cleanup
%4 = zext i32 %5 to i64
%wide.trip.count83 = zext i32 %5 to i64
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond3.loopexit: ; preds = %cleanup, %for.body6
%ans.1.lcssa = phi i32 [ %ans.063, %for.body6 ], [ %ans.2.lcssa, %cleanup ]
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
%exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
br i1 %exitcond84.not, label %for.cond.cleanup5, label %for.body6, !llvm.loop !14
for.cond.cleanup5: ; preds = %for.cond3.loopexit, %for.cond.cleanup.thread, %for.cond.cleanup
%ans.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ 0, %for.cond.cleanup.thread ], [ %ans.1.lcssa, %for.cond3.loopexit ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
for.body6: ; preds = %for.body6.preheader, %for.cond3.loopexit
%indvars.iv80 = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next81, %for.cond3.loopexit ]
%indvars.iv75 = phi i64 [ 1, %for.body6.preheader ], [ %indvars.iv.next76, %for.cond3.loopexit ]
%indvars.iv68 = phi i64 [ 2, %for.body6.preheader ], [ %indvars.iv.next69, %for.cond3.loopexit ]
%ans.063 = phi i32 [ 0, %for.body6.preheader ], [ %ans.1.lcssa, %for.cond3.loopexit ]
%indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
%cmp858 = icmp ult i64 %indvars.iv.next81, %4
br i1 %cmp858, label %for.body10.lr.ph, label %for.cond3.loopexit
for.body10.lr.ph: ; preds = %for.body6
%arrayidx17 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv80
br label %for.body10
for.body10: ; preds = %for.body10.lr.ph, %cleanup
%indvars.iv77 = phi i64 [ %indvars.iv75, %for.body10.lr.ph ], [ %indvars.iv.next78, %cleanup ]
%indvars.iv70 = phi i64 [ %indvars.iv68, %for.body10.lr.ph ], [ %indvars.iv.next71, %cleanup ]
%ans.159 = phi i32 [ %ans.063, %for.body10.lr.ph ], [ %ans.2.lcssa, %cleanup ]
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%7 = trunc i64 %indvars.iv.next78 to i32
%cmp1353 = icmp sgt i32 %5, %7
br i1 %cmp1353, label %for.body15.lr.ph, label %cleanup
for.body15.lr.ph: ; preds = %for.body10
%8 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv77
%9 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%add4.i = add nsw i32 %9, %8
br label %for.body15
for.body15: ; preds = %for.body15.lr.ph, %if.then
%indvars.iv72 = phi i64 [ %indvars.iv70, %for.body15.lr.ph ], [ %indvars.iv.next73, %if.then ]
%ans.254 = phi i32 [ %ans.159, %for.body15.lr.ph ], [ %inc24, %if.then ]
%arrayidx21 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv72
%10 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%add.i = add nsw i32 %10, %9
%cmp.i = icmp sle i32 %add.i, %8
%add1.i = add nsw i32 %10, %8
%cmp2.i = icmp sle i32 %add1.i, %9
%or.cond.i.not = select i1 %cmp.i, i1 true, i1 %cmp2.i
%cmp5.i = icmp sle i32 %add4.i, %10
%or.cond12.i = select i1 %or.cond.i.not, i1 true, i1 %cmp5.i
br i1 %or.cond12.i, label %cleanup, label %if.then
if.then: ; preds = %for.body15
%inc24 = add nsw i32 %ans.254, 1
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%11 = trunc i64 %indvars.iv.next73 to i32
%cmp13 = icmp sgt i32 %5, %11
br i1 %cmp13, label %for.body15, label %cleanup, !llvm.loop !15
cleanup: ; preds = %if.then, %for.body15, %for.body10
%ans.2.lcssa = phi i32 [ %ans.159, %for.body10 ], [ %ans.254, %for.body15 ], [ %inc24, %if.then ]
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%exitcond.not = icmp eq i64 %indvars.iv.next78, %wide.trip.count83
br i1 %exitcond.not, label %for.cond3.loopexit, label %for.body10, !llvm.loop !16
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nocallback nofree nosync nounwind willreturn }
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}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef long long int type;
typedef struct array{
type *a;
long long int length;
} array;
array ar_init(int n){
array a;
a.a = calloc(sizeof(type),n);
return a;
}
void ar_push(array* a,type x){
a->a[a->length++] = x;
}
type ar_pop(array* a){
return a->a[a->length--];
}
type ar_get(array* a,int n){
return a->a[n];
}
void ar_set(array* a,int n,type x){
a->a[n] = x;
}
int main(void){
long long int n;
long long int x;
long long int sum = 0;
long long int i;
int mod = 0;
array a;
scanf("%lld",&n);
a = ar_init(n+1);
for(i=0;i<n;i++){
scanf("%lld",&x);
ar_push(&a,x);
sum += x;
}
for(i=0;i<n;i++){
if(ar_get(&a,i) % 2){
if(ar_get(&a,i+1)){
ar_set(&a,i+1,ar_get(&a,i+1)-1);
}else{
mod++;
}
}
}
printf("%lld\n", (sum-mod)/2);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_208984/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_208984/source.c"
target datalayout = "e-m:e-p270: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.array = type { ptr, i64 }
@.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: mustprogress nofree nounwind willreturn memory(inaccessiblemem: readwrite) uwtable
define dso_local { ptr, i64 } @ar_init(i32 noundef %n) local_unnamed_addr #0 {
entry:
%conv = sext i32 %n to i64
%call = tail call noalias ptr @calloc(i64 noundef 8, i64 noundef %conv) #8
%.fca.0.insert = insertvalue { ptr, i64 } poison, ptr %call, 0
%.fca.1.insert = insertvalue { ptr, i64 } %.fca.0.insert, i64 undef, 1
ret { ptr, i64 } %.fca.1.insert
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @ar_push(ptr nocapture noundef %a, i64 noundef %x) local_unnamed_addr #2 {
entry:
%0 = load ptr, ptr %a, align 8, !tbaa !5
%length = getelementptr inbounds %struct.array, ptr %a, i64 0, i32 1
%1 = load i64, ptr %length, align 8, !tbaa !11
%inc = add nsw i64 %1, 1
store i64 %inc, ptr %length, align 8, !tbaa !11
%arrayidx = getelementptr inbounds i64, ptr %0, i64 %1
store i64 %x, ptr %arrayidx, align 8, !tbaa !12
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local i64 @ar_pop(ptr nocapture noundef %a) local_unnamed_addr #3 {
entry:
%0 = load ptr, ptr %a, align 8, !tbaa !5
%length = getelementptr inbounds %struct.array, ptr %a, i64 0, i32 1
%1 = load i64, ptr %length, align 8, !tbaa !11
%dec = add nsw i64 %1, -1
store i64 %dec, ptr %length, align 8, !tbaa !11
%arrayidx = getelementptr inbounds i64, ptr %0, i64 %1
%2 = load i64, ptr %arrayidx, align 8, !tbaa !12
ret i64 %2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable
define dso_local i64 @ar_get(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #4 {
entry:
%0 = load ptr, ptr %a, align 8, !tbaa !5
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i64, ptr %0, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8, !tbaa !12
ret i64 %1
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @ar_set(ptr nocapture noundef readonly %a, i32 noundef %n, i64 noundef %x) local_unnamed_addr #2 {
entry:
%0 = load ptr, ptr %a, align 8, !tbaa !5
%idxprom = sext i32 %n to i64
%arrayidx = getelementptr inbounds i64, ptr %0, i64 %idxprom
store i64 %x, ptr %arrayidx, align 8, !tbaa !12
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%n = alloca i64, align 8
%x = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !12
%conv = shl i64 %0, 32
%sext = add i64 %conv, 4294967296
%conv.i = ashr exact i64 %sext, 32
%call.i = call noalias ptr @calloc(i64 noundef 8, i64 noundef %conv.i) #8
%cmp51 = icmp sgt i64 %0, 0
br i1 %cmp51, label %for.body, label %for.end25
for.cond5.preheader: ; preds = %for.body
%cmp656 = icmp sgt i64 %2, 0
br i1 %cmp656, label %for.body8, label %for.end25
for.body: ; preds = %entry, %for.body
%sum.054 = phi i64 [ %add4, %for.body ], [ 0, %entry ]
%i.053 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%a.sroa.8.052 = phi i64 [ %inc.i, %for.body ], [ undef, %entry ]
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%1 = load i64, ptr %x, align 8, !tbaa !12
%inc.i = add nsw i64 %a.sroa.8.052, 1
%arrayidx.i = getelementptr inbounds i64, ptr %call.i, i64 %a.sroa.8.052
store i64 %1, ptr %arrayidx.i, align 8, !tbaa !12
%add4 = add nsw i64 %1, %sum.054
%inc = add nuw nsw i64 %i.053, 1
%2 = load i64, ptr %n, align 8, !tbaa !12
%cmp = icmp slt i64 %inc, %2
br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !13
for.body8: ; preds = %for.cond5.preheader, %for.inc23
%i.158 = phi i64 [ %inc24, %for.inc23 ], [ 0, %for.cond5.preheader ]
%mod.057 = phi i32 [ %mod.1, %for.inc23 ], [ 0, %for.cond5.preheader ]
%sext49 = shl i64 %i.158, 32
%idxprom.i = ashr exact i64 %sext49, 32
%arrayidx.i38 = getelementptr inbounds i64, ptr %call.i, i64 %idxprom.i
%3 = load i64, ptr %arrayidx.i38, align 8, !tbaa !12
%4 = and i64 %3, 1
%tobool.not = icmp eq i64 %4, 0
br i1 %tobool.not, label %for.inc23, label %if.then
if.then: ; preds = %for.body8
%sext50 = add i64 %sext49, 4294967296
%idxprom.i39 = ashr exact i64 %sext50, 32
%arrayidx.i40 = getelementptr inbounds i64, ptr %call.i, i64 %idxprom.i39
%5 = load i64, ptr %arrayidx.i40, align 8, !tbaa !12
%tobool14.not = icmp eq i64 %5, 0
br i1 %tobool14.not, label %if.else, label %if.then15
if.then15: ; preds = %if.then
%sub = add nsw i64 %5, -1
store i64 %sub, ptr %arrayidx.i40, align 8, !tbaa !12
br label %for.inc23
if.else: ; preds = %if.then
%inc21 = add nsw i32 %mod.057, 1
br label %for.inc23
for.inc23: ; preds = %for.body8, %if.else, %if.then15
%mod.1 = phi i32 [ %mod.057, %if.then15 ], [ %inc21, %if.else ], [ %mod.057, %for.body8 ]
%inc24 = add nuw nsw i64 %i.158, 1
%exitcond.not = icmp eq i64 %inc24, %2
br i1 %exitcond.not, label %for.end25.loopexit, label %for.body8, !llvm.loop !15
for.end25.loopexit: ; preds = %for.inc23
%6 = sext i32 %mod.1 to i64
br label %for.end25
for.end25: ; preds = %entry, %for.end25.loopexit, %for.cond5.preheader
%sum.0.lcssa64 = phi i64 [ %add4, %for.cond5.preheader ], [ %add4, %for.end25.loopexit ], [ 0, %entry ]
%mod.0.lcssa = phi i64 [ 0, %for.cond5.preheader ], [ %6, %for.end25.loopexit ], [ 0, %entry ]
%sub27 = sub nsw i64 %sum.0.lcssa64, %mod.0.lcssa
%div = sdiv i64 %sub27, 2
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #6
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
attributes #0 = { mustprogress nofree nounwind willreturn memory(inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"array", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long long", !8, i64 0}
!11 = !{!6, !10, i64 8}
!12 = !{!10, !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
|
#include <stdio.h>
#include <string.h>
#define SEGTREE_MAX 131072
typedef struct {
int max_num;
int push_num;
} segtree_t;
segtree_t segtree[SEGTREE_MAX*2-1];
void segtree_push(int youso) {
if(youso*2+1<SEGTREE_MAX*2-1) {
segtree[youso*2+1].push_num+=segtree[youso].push_num;
segtree[youso*2+2].push_num+=segtree[youso].push_num;
}
segtree[youso].max_num+=segtree[youso].push_num;
segtree[youso].push_num=0;
}
void segtree_add_internal(
int youso,int add,int start,int end,int kstart,int kend) {
segtree_push(youso);
if(end<=kstart || kend<=start)return;
if(start<=kstart && kend<=end) {
segtree[youso].push_num+=add;
segtree_push(youso);
} else {
segtree_add_internal(youso*2+1,add,start,end,
kstart,kstart+(kend-kstart)/2);
segtree_add_internal(youso*2+2,add,start,end,
kstart+(kend-kstart)/2,kend);
segtree[youso].max_num=segtree[youso*2+1].max_num;
if(segtree[youso].max_num<segtree[youso*2+2].max_num) {
segtree[youso].max_num=segtree[youso*2+2].max_num;
}
}
}
int segtree_getmax_internal(
int youso,int start,int end,int kstart,int kend) {
int r1,r2;
segtree_push(youso);
if(end<=kstart || kend<=start)return 0;
if(start<=kstart && kend<=end) {
return segtree[youso].max_num;
} else {
r1=segtree_getmax_internal(youso*2+1,start,end,
kstart,kstart+(kend-kstart)/2);
r2=segtree_getmax_internal(youso*2+2,start,end,
kstart+(kend-kstart)/2,kend);
if(r1>r2)return r1; else return r2;
}
}
void segtree_init(void) {
memset(segtree,0,sizeof(segtree));
}
void segtree_add(int start,int end,int add) {
segtree_add_internal(0,add,start,end,0,SEGTREE_MAX);
}
int segtree_getmax(int start,int end) {
return segtree_getmax_internal(0,start,end,0,SEGTREE_MAX);
}
int main(void) {
int n,i;
int h,m,s;
int start,end;
while(1) {
scanf("%d",&n);
if(n==0)break;
segtree_init();
for(i=0;i<n;i++) {
scanf("%d:%d:%d",&h,&m,&s);
start=h*60*60+m*60+s;
scanf("%d:%d:%d",&h,&m,&s);
end=h*60*60+m*60+s;
segtree_add(start,end,1);
}
printf("%d\n",segtree_getmax(0,24*60*60));
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209026/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209026/source.c"
target datalayout = "e-m:e-p270: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.segtree_t = type { i32, i32 }
@segtree = dso_local local_unnamed_addr global [262143 x %struct.segtree_t] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d:%d:%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @segtree_push(i32 noundef %youso) local_unnamed_addr #0 {
entry:
%mul = shl nsw i32 %youso, 1
%add = or i32 %mul, 1
%cmp = icmp slt i32 %add, 262143
%idxprom = sext i32 %youso to i64
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%push_num = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom, i32 1
%0 = load i32, ptr %push_num, align 4, !tbaa !5
%idxprom3 = sext i32 %add to i64
%push_num5 = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom3, i32 1
%1 = load i32, ptr %push_num5, align 4, !tbaa !5
%add6 = add nsw i32 %1, %0
store i32 %add6, ptr %push_num5, align 4, !tbaa !5
%2 = load i32, ptr %push_num, align 4, !tbaa !5
%add11 = add nsw i32 %mul, 2
%idxprom12 = sext i32 %add11 to i64
%push_num14 = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom12, i32 1
%3 = load i32, ptr %push_num14, align 4, !tbaa !5
%add15 = add nsw i32 %3, %2
store i32 %add15, ptr %push_num14, align 4, !tbaa !5
br label %if.end
if.end: ; preds = %entry, %if.then
%arrayidx17 = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom
%push_num18 = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom, i32 1
%4 = load i32, ptr %push_num18, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx17, align 8, !tbaa !10
%add21 = add nsw i32 %5, %4
store i32 %add21, ptr %arrayidx17, align 8, !tbaa !10
store i32 0, ptr %push_num18, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @segtree_add_internal(i32 noundef %youso, i32 noundef %add, i32 noundef %start, i32 noundef %end, i32 noundef %kstart, i32 noundef %kend) local_unnamed_addr #1 {
entry:
%mul.i = shl nsw i32 %youso, 1
%add.i = or i32 %mul.i, 1
%cmp.i = icmp slt i32 %add.i, 262143
%idxprom.i = sext i32 %youso to i64
br i1 %cmp.i, label %if.then.i, label %segtree_push.exit
if.then.i: ; preds = %entry
%push_num.i = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom.i, i32 1
%0 = load i32, ptr %push_num.i, align 4, !tbaa !5
%idxprom3.i = sext i32 %add.i to i64
%push_num5.i = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom3.i, i32 1
%1 = load i32, ptr %push_num5.i, align 4, !tbaa !5
%add6.i = add nsw i32 %1, %0
store i32 %add6.i, ptr %push_num5.i, align 4, !tbaa !5
%2 = load i32, ptr %push_num.i, align 4, !tbaa !5
%add11.i = add nsw i32 %mul.i, 2
%idxprom12.i = sext i32 %add11.i to i64
%push_num14.i = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom12.i, i32 1
%3 = load i32, ptr %push_num14.i, align 4, !tbaa !5
%add15.i = add nsw i32 %3, %2
store i32 %add15.i, ptr %push_num14.i, align 4, !tbaa !5
br label %segtree_push.exit
segtree_push.exit: ; preds = %entry, %if.then.i
%arrayidx17.i = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom.i
%push_num18.i = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom.i, i32 1
%4 = load i32, ptr %push_num18.i, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx17.i, align 8, !tbaa !10
%add21.i = add nsw i32 %5, %4
store i32 %add21.i, ptr %arrayidx17.i, align 8, !tbaa !10
store i32 0, ptr %push_num18.i, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %end, %kstart
%cmp1.not = icmp sgt i32 %kend, %start
%or.cond = and i1 %cmp.not, %cmp1.not
br i1 %or.cond, label %if.end, label %common.ret86
if.end: ; preds = %segtree_push.exit
%cmp2.not = icmp sgt i32 %start, %kstart
%cmp3.not = icmp sgt i32 %kend, %end
%or.cond68 = or i1 %cmp2.not, %cmp3.not
br i1 %or.cond68, label %if.else, label %if.then4
if.then4: ; preds = %if.end
store i32 %add, ptr %push_num18.i, align 4, !tbaa !5
br i1 %cmp.i, label %if.then.i76, label %segtree_push.exit85
if.then.i76: ; preds = %if.then4
%idxprom3.i78 = sext i32 %add.i to i64
%push_num5.i79 = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom3.i78, i32 1
%6 = load i32, ptr %push_num5.i79, align 4, !tbaa !5
%add6.i80 = add nsw i32 %6, %add
store i32 %add6.i80, ptr %push_num5.i79, align 4, !tbaa !5
%7 = load i32, ptr %push_num18.i, align 4, !tbaa !5
%add11.i81 = add nsw i32 %mul.i, 2
%idxprom12.i82 = sext i32 %add11.i81 to i64
%push_num14.i83 = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom12.i82, i32 1
%8 = load i32, ptr %push_num14.i83, align 4, !tbaa !5
%add15.i84 = add nsw i32 %8, %7
store i32 %add15.i84, ptr %push_num14.i83, align 4, !tbaa !5
%.pre = load i32, ptr %push_num18.i, align 4, !tbaa !5
br label %segtree_push.exit85
segtree_push.exit85: ; preds = %if.then4, %if.then.i76
%9 = phi i32 [ %add, %if.then4 ], [ %.pre, %if.then.i76 ]
%add21.i75 = add nsw i32 %9, %add21.i
store i32 %add21.i75, ptr %arrayidx17.i, align 8, !tbaa !10
store i32 0, ptr %push_num18.i, align 4, !tbaa !5
br label %common.ret86
common.ret86: ; preds = %segtree_push.exit, %segtree_push.exit85, %if.else
ret void
if.else: ; preds = %if.end
%sub = sub nsw i32 %kend, %kstart
%div = sdiv i32 %sub, 2
%add7 = add nsw i32 %div, %kstart
tail call void @segtree_add_internal(i32 noundef %add.i, i32 noundef %add, i32 noundef %start, i32 noundef %end, i32 noundef %kstart, i32 noundef %add7)
%add9 = add nsw i32 %mul.i, 2
tail call void @segtree_add_internal(i32 noundef %add9, i32 noundef %add, i32 noundef %start, i32 noundef %end, i32 noundef %add7, i32 noundef %kend)
%idxprom15 = sext i32 %add.i to i64
%arrayidx16 = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom15
%10 = load i32, ptr %arrayidx16, align 8, !tbaa !10
store i32 %10, ptr %arrayidx17.i, align 8, !tbaa !10
%idxprom25 = sext i32 %add9 to i64
%arrayidx26 = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom25
%11 = load i32, ptr %arrayidx26, align 16, !tbaa !10
%spec.store.select = tail call i32 @llvm.smax.i32(i32 %10, i32 %11)
store i32 %spec.store.select, ptr %arrayidx17.i, align 8
br label %common.ret86
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @segtree_getmax_internal(i32 noundef %youso, i32 noundef %start, i32 noundef %end, i32 noundef %kstart, i32 noundef %kend) local_unnamed_addr #1 {
entry:
%mul.i = shl nsw i32 %youso, 1
%add.i = or i32 %mul.i, 1
%cmp.i = icmp slt i32 %add.i, 262143
%idxprom.i = sext i32 %youso to i64
br i1 %cmp.i, label %if.then.i, label %segtree_push.exit
if.then.i: ; preds = %entry
%push_num.i = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom.i, i32 1
%0 = load i32, ptr %push_num.i, align 4, !tbaa !5
%idxprom3.i = sext i32 %add.i to i64
%push_num5.i = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom3.i, i32 1
%1 = load i32, ptr %push_num5.i, align 4, !tbaa !5
%add6.i = add nsw i32 %1, %0
store i32 %add6.i, ptr %push_num5.i, align 4, !tbaa !5
%2 = load i32, ptr %push_num.i, align 4, !tbaa !5
%add11.i = add nsw i32 %mul.i, 2
%idxprom12.i = sext i32 %add11.i to i64
%push_num14.i = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom12.i, i32 1
%3 = load i32, ptr %push_num14.i, align 4, !tbaa !5
%add15.i = add nsw i32 %3, %2
store i32 %add15.i, ptr %push_num14.i, align 4, !tbaa !5
br label %segtree_push.exit
segtree_push.exit: ; preds = %entry, %if.then.i
%arrayidx17.i = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom.i
%push_num18.i = getelementptr inbounds [262143 x %struct.segtree_t], ptr @segtree, i64 0, i64 %idxprom.i, i32 1
%4 = load i32, ptr %push_num18.i, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx17.i, align 8, !tbaa !10
%add21.i = add nsw i32 %5, %4
store i32 %add21.i, ptr %arrayidx17.i, align 8, !tbaa !10
store i32 0, ptr %push_num18.i, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %end, %kstart
%cmp1.not = icmp sgt i32 %kend, %start
%or.cond = and i1 %cmp.not, %cmp1.not
br i1 %or.cond, label %if.end, label %common.ret38
if.end: ; preds = %segtree_push.exit
%cmp2.not = icmp sgt i32 %start, %kstart
%cmp3.not = icmp sgt i32 %kend, %end
%or.cond37 = or i1 %cmp2.not, %cmp3.not
br i1 %or.cond37, label %if.else, label %common.ret38
common.ret38: ; preds = %if.end, %segtree_push.exit, %if.else
%common.ret38.op = phi i32 [ %call.call11, %if.else ], [ 0, %segtree_push.exit ], [ %add21.i, %if.end ]
ret i32 %common.ret38.op
if.else: ; preds = %if.end
%sub = sub nsw i32 %kend, %kstart
%div = sdiv i32 %sub, 2
%add5 = add nsw i32 %div, %kstart
%call = tail call i32 @segtree_getmax_internal(i32 noundef %add.i, i32 noundef %start, i32 noundef %end, i32 noundef %kstart, i32 noundef %add5)
%add7 = add nsw i32 %mul.i, 2
%call11 = tail call i32 @segtree_getmax_internal(i32 noundef %add7, i32 noundef %start, i32 noundef %end, i32 noundef %add5, i32 noundef %kend)
%call.call11 = tail call i32 @llvm.smax.i32(i32 %call, i32 %call11)
br label %common.ret38
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @segtree_init() local_unnamed_addr #3 {
entry:
tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2097144) @segtree, i8 0, i64 2097144, i1 false)
ret void
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @segtree_add(i32 noundef %start, i32 noundef %end, i32 noundef %add) local_unnamed_addr #5 {
entry:
tail call void @segtree_add_internal(i32 noundef 0, i32 noundef %add, i32 noundef %start, i32 noundef %end, i32 noundef 0, i32 noundef 131072)
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local i32 @segtree_getmax(i32 noundef %start, i32 noundef %end) local_unnamed_addr #5 {
entry:
%call = tail call i32 @segtree_getmax_internal(i32 noundef 0, i32 noundef %start, i32 noundef %end, i32 noundef 0, i32 noundef 131072)
ret i32 %call
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #6 {
entry:
%n = alloca i32, align 4
%h = alloca i32, align 4
%m = alloca i32, align 4
%s = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #9
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !11
%cmp18 = icmp eq i32 %0, 0
br i1 %cmp18, label %while.end, label %if.end
if.end: ; preds = %entry, %for.end
%1 = phi i32 [ %9, %for.end ], [ %0, %entry ]
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2097144) @segtree, i8 0, i64 2097144, i1 false)
%cmp115 = icmp sgt i32 %1, 0
br i1 %cmp115, label %for.body, label %for.end
for.body: ; preds = %if.end, %for.body
%i.016 = phi i32 [ %inc, %for.body ], [ 0, %if.end ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h, ptr noundef nonnull %m, ptr noundef nonnull %s)
%2 = load i32, ptr %h, align 4, !tbaa !11
%mul3 = mul i32 %2, 3600
%3 = load i32, ptr %m, align 4, !tbaa !11
%mul4 = mul nsw i32 %3, 60
%add = add nsw i32 %mul4, %mul3
%4 = load i32, ptr %s, align 4, !tbaa !11
%add5 = add nsw i32 %add, %4
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %h, ptr noundef nonnull %m, ptr noundef nonnull %s)
%5 = load i32, ptr %h, align 4, !tbaa !11
%mul8 = mul i32 %5, 3600
%6 = load i32, ptr %m, align 4, !tbaa !11
%mul9 = mul nsw i32 %6, 60
%add10 = add nsw i32 %mul9, %mul8
%7 = load i32, ptr %s, align 4, !tbaa !11
%add11 = add nsw i32 %add10, %7
call void @segtree_add_internal(i32 noundef 0, i32 noundef 1, i32 noundef %add5, i32 noundef %add11, i32 noundef 0, i32 noundef 131072)
%inc = add nuw nsw i32 %i.016, 1
%8 = load i32, ptr %n, align 4, !tbaa !11
%cmp1 = icmp slt i32 %inc, %8
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body, %if.end
%call.i = call i32 @segtree_getmax_internal(i32 noundef 0, i32 noundef 0, i32 noundef 86400, i32 noundef 0, i32 noundef 131072)
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %call.i)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%9 = load i32, ptr %n, align 4, !tbaa !11
%cmp = icmp eq i32 %9, 0
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %for.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(write, 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE 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}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int N;
char board[102][102];
int main()
{
int i,j,adj,status=0;
scanf("%d",&N);
for(i=1; i<=N; i++)
{
for(j=1; j<=N; j++)
{
scanf(" %c",&board[i][j]);
}
}
for(i=1; i<=N; i++)
{
for(j=1; j<=N; j++)
{
if('o'==board[i-1][j]) adj++;
if('o'==board[i][j-1]) adj++;
if('o'==board[i][j+1]) adj++;
if('o'==board[i+1][j]) adj++;
if(!(adj%2==0))
{
status=1;
break;
}
}
if(status) break;
}
if(status) printf("NO\n");
else printf("YES\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_20907/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_20907/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@N = dso_local global i32 0, align 4
@.str.1 = private unnamed_addr constant [4 x i8] c" %c\00", align 1
@board = dso_local global [102 x [102 x i8]] 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:
%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.not102 = icmp slt i32 %0, 1
br i1 %cmp.not102, label %if.end71, label %for.cond1.preheader
for.cond1.preheader: ; preds = %entry, %for.inc7
%1 = phi i32 [ %5, %for.inc7 ], [ %0, %entry ]
%indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.inc7 ], [ 1, %entry ]
%cmp2.not100 = icmp slt i32 %1, 1
br i1 %cmp2.not100, label %for.cond1.preheader.for.inc7_crit_edge, label %for.body3
for.cond1.preheader.for.inc7_crit_edge: ; preds = %for.cond1.preheader
%.pre = sext i32 %1 to i64
br label %for.inc7
for.cond10.preheader: ; preds = %for.inc7
%cmp11.not104 = icmp slt i32 %5, 1
br i1 %cmp11.not104, label %if.end71, label %for.cond13.preheader.preheader
for.cond13.preheader.preheader: ; preds = %for.cond10.preheader
%2 = add nuw i32 %5, 1
%wide.trip.count122 = zext i32 %2 to i64
br label %for.cond13.preheader
for.body3: ; preds = %for.cond1.preheader, %for.body3
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 1, %for.cond1.preheader ]
%arrayidx5 = getelementptr inbounds [102 x [102 x i8]], ptr @board, i64 0, i64 %indvars.iv111, i64 %indvars.iv
%call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr @N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp2.not.not = icmp slt i64 %indvars.iv, %4
br i1 %cmp2.not.not, label %for.body3, label %for.inc7, !llvm.loop !9
for.inc7: ; preds = %for.body3, %for.cond1.preheader.for.inc7_crit_edge
%.pre-phi = phi i64 [ %.pre, %for.cond1.preheader.for.inc7_crit_edge ], [ %4, %for.body3 ]
%5 = phi i32 [ %1, %for.cond1.preheader.for.inc7_crit_edge ], [ %3, %for.body3 ]
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%cmp.not.not = icmp slt i64 %indvars.iv111, %.pre-phi
br i1 %cmp.not.not, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11
for.cond13.preheader: ; preds = %for.cond13.preheader.preheader, %for.inc64
%indvars.iv118 = phi i64 [ 1, %for.cond13.preheader.preheader ], [ %indvars.iv.next119, %for.inc64 ]
%adj.0106 = phi i32 [ undef, %for.cond13.preheader.preheader ], [ %adj.1, %for.inc64 ]
%6 = add nsw i64 %indvars.iv118, -1
%indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
%idxprom45 = and i64 %indvars.iv.next119, 4294967295
br label %for.cond13
for.cond13: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv114 = phi i64 [ 1, %for.cond13.preheader ], [ %indvars.iv.next115, %for.body15 ]
%adj.1 = phi i32 [ %adj.0106, %for.cond13.preheader ], [ %adj.5, %for.body15 ]
%exitcond = icmp eq i64 %indvars.iv114, %wide.trip.count122
br i1 %exitcond, label %for.inc64, label %for.body15
for.body15: ; preds = %for.cond13
%arrayidx19 = getelementptr inbounds [102 x [102 x i8]], ptr @board, i64 0, i64 %6, i64 %indvars.iv114
%7 = load i8, ptr %arrayidx19, align 1, !tbaa !13
%cmp20 = icmp eq i8 %7, 111
%inc22 = zext i1 %cmp20 to i32
%spec.select = add nsw i32 %adj.1, %inc22
%8 = add nsw i64 %indvars.iv114, -1
%arrayidx27 = getelementptr inbounds [102 x [102 x i8]], ptr @board, i64 0, i64 %indvars.iv118, i64 %8
%9 = load i8, ptr %arrayidx27, align 1, !tbaa !13
%cmp29 = icmp eq i8 %9, 111
%inc32 = zext i1 %cmp29 to i32
%adj.3 = add nsw i32 %spec.select, %inc32
%indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1
%idxprom36 = and i64 %indvars.iv.next115, 4294967295
%arrayidx37 = getelementptr inbounds [102 x [102 x i8]], ptr @board, i64 0, i64 %indvars.iv118, i64 %idxprom36
%10 = load i8, ptr %arrayidx37, align 1, !tbaa !13
%cmp39 = icmp eq i8 %10, 111
%inc42 = zext i1 %cmp39 to i32
%adj.4 = add nsw i32 %adj.3, %inc42
%arrayidx48 = getelementptr inbounds [102 x [102 x i8]], ptr @board, i64 0, i64 %idxprom45, i64 %indvars.iv114
%11 = load i8, ptr %arrayidx48, align 1, !tbaa !13
%cmp50 = icmp eq i8 %11, 111
%inc53 = zext i1 %cmp50 to i32
%adj.5 = add nsw i32 %adj.4, %inc53
%12 = and i32 %adj.5, 1
%cmp55 = icmp eq i32 %12, 0
br i1 %cmp55, label %for.cond13, label %if.end71, !llvm.loop !14
for.inc64: ; preds = %for.cond13
%exitcond123.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count122
br i1 %exitcond123.not, label %if.end71, label %for.cond13.preheader, !llvm.loop !15
if.end71: ; preds = %for.inc64, %for.body15, %for.cond10.preheader, %entry
%str.sink = phi ptr [ @str, %entry ], [ @str, %for.cond10.preheader ], [ @str.4, %for.body15 ], [ @str, %for.inc64 ]
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12}
!12 = !{!"llvm.loop.unswitch.partial.disable"}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main()
{
int h,w,a,b,c,blank,blankremain;
scanf("%d %d",&h,&w);
scanf("%d %d",&a,&b);
blank=h*w;
c=w*a+(h-a)*b;
blankremain=blank-c;
printf("%d",blankremain);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209112/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209112/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%h = alloca i32, align 4
%w = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
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 %h, ptr noundef nonnull %w)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %h, align 4, !tbaa !5
%1 = load i32, ptr %w, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%2 = load i32, ptr %a, align 4, !tbaa !5
%sub.neg = sub i32 %2, %0
%3 = load i32, ptr %b, align 4, !tbaa !5
%mul2.neg = mul i32 %2, %1
%mul3.neg.neg = mul i32 %sub.neg, %3
%reass.add.neg = sub i32 %mul3.neg.neg, %mul2.neg
%sub4 = add i32 %reass.add.neg, %mul
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 <stdint.h>
#include <inttypes.h>
int main (int argc, char const *argv[])
{
int64_t H, W, h, w;
scanf("%"PRId64"%"PRId64, &H, &W);
scanf("%"PRId64"%"PRId64, &h, &w);
printf("%"PRId64"\n", (H - h) * (W - w));
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209163/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209163/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%ld%ld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%H = alloca i64, align 8
%W = alloca i64, align 8
%h = alloca i64, align 8
%w = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %H) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %W) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %w) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i64, ptr %H, align 8, !tbaa !5
%1 = load i64, ptr %h, align 8, !tbaa !5
%sub = sub nsw i64 %0, %1
%2 = load i64, ptr %W, align 8, !tbaa !5
%3 = load i64, ptr %w, align 8, !tbaa !5
%sub2 = sub nsw i64 %2, %3
%mul = mul nsw i64 %sub2, %sub
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %mul)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %H) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int H;
int W;
int h;
int w;
scanf("%d%d",&H,&W);
scanf("%d%d",&h,&w);
int ans=(H-h)*(W-w);
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209206/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209206/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %H, align 4, !tbaa !5
%1 = load i32, ptr %h, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %W, align 4, !tbaa !5
%3 = load i32, ptr %w, align 4, !tbaa !5
%sub2 = sub nsw i32 %2, %3
%mul = mul nsw i32 %sub2, %sub
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int white_h,white_w;
int black_h,black_w;
scanf("%d %d %d %d",&white_h,&white_w,&black_h,&black_w);
printf("%d",(white_h-black_h)*(white_w-black_w));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209257/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209257/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%white_h = alloca i32, align 4
%white_w = alloca i32, align 4
%black_h = alloca i32, align 4
%black_w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %white_h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %white_w) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %black_h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %black_w) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %white_h, ptr noundef nonnull %white_w, ptr noundef nonnull %black_h, ptr noundef nonnull %black_w)
%0 = load i32, ptr %white_h, align 4, !tbaa !5
%1 = load i32, ptr %black_h, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
%2 = load i32, ptr %white_w, align 4, !tbaa !5
%3 = load i32, ptr %black_w, align 4, !tbaa !5
%sub1 = sub nsw i32 %2, %3
%mul = mul nsw i32 %sub1, %sub
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %black_w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %black_h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %white_w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %white_h) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
//テンプレート
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
int main(){
int H,W,h,w,ans=0,i,j;
scanf("%d%d%d%d",&H,&W,&h,&w);
H-=h;
W-=w;
int array[H][W];
for (i=0; i<H; i++) {
for (j=0; j<W; j++) {
ans++;
}
}
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209307/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209307/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%H = alloca i32, align 4
%W = alloca i32, align 4
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %h, align 4, !tbaa !5
%1 = load i32, ptr %H, align 4, !tbaa !5
%sub = sub nsw i32 %1, %0
store i32 %sub, ptr %H, align 4, !tbaa !5
%2 = load i32, ptr %w, align 4, !tbaa !5
%3 = load i32, ptr %W, align 4, !tbaa !5
%sub1 = sub nsw i32 %3, %2
store i32 %sub1, ptr %W, align 4, !tbaa !5
%4 = call ptr @llvm.stacksave.p0()
%5 = load i32, ptr %H, align 4, !tbaa !5
%cmp16 = icmp sgt i32 %5, 0
%6 = load i32, ptr %W, align 4
%cmp313 = icmp sgt i32 %6, 0
%7 = mul i32 %6, %5
%8 = select i1 %cmp16, i1 %cmp313, i1 false
%ans.0.lcssa = select i1 %8, i32 %7, i32 0
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa)
call void @llvm.stackrestore.p0(ptr %4)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int H,W,h,w,sum;
scanf("%d %d",&H,&W);
scanf("%d %d",&h,&w);
sum = H*W-(h*W+w*H-h*w);
printf("%d",sum);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209350/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209350/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%H = alloca i32, align 4
%W = alloca i32, align 4
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %H, align 4, !tbaa !5
%1 = load i32, ptr %W, align 4, !tbaa !5
%2 = load i32, ptr %h, align 4, !tbaa !5
%3 = load i32, ptr %w, align 4, !tbaa !5
%reass.add = sub i32 %2, %0
%reass.mul = mul i32 %reass.add, %3
%reass.add7 = sub i32 %0, %2
%reass.mul8 = mul i32 %reass.add7, %1
%sub5 = add i32 %reass.mul8, %reass.mul
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub5)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int H, W, h, w;
scanf("%d %d", &H, &W);
scanf("%d %d", &h, &w);
printf("%d\n", H * W - (H * w) - (h * W) + h * w);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209394/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209394/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%H = alloca i32, align 4
%W = alloca i32, align 4
%h = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %H) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %H, ptr noundef nonnull %W)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %h, ptr noundef nonnull %w)
%0 = load i32, ptr %H, align 4, !tbaa !5
%1 = load i32, ptr %W, align 4, !tbaa !5
%2 = load i32, ptr %w, align 4, !tbaa !5
%mul27 = sub i32 %1, %2
%sub = mul i32 %mul27, %0
%3 = load i32, ptr %h, align 4, !tbaa !5
%reass.add = sub i32 %2, %1
%reass.mul = mul i32 %reass.add, %3
%add = add i32 %reass.mul, %sub
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %add)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %H) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int i,j,e,m;
double k;
while(1){
scanf("%d",&e);
if(e==0)break;
m=1000000;
for(i=0;i<101;i++){
for(j=0;j<1001;j++){
k=e-(i*i*i+j*j);
if(i+j+k<m && k>=0){
m=i+j+k;
}
}
}
printf("%d\n",m);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209466/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209466/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%e = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %e) #3
%call43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e)
%0 = load i32, ptr %e, align 4, !tbaa !5
%cmp44 = icmp eq i32 %0, 0
br i1 %cmp44, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end23
%1 = phi i32 [ %10, %for.end23 ], [ %0, %entry ]
br label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.cond.preheader, %for.inc21
%i.042 = phi i32 [ 0, %for.cond.preheader ], [ %inc22, %for.inc21 ]
%m.041 = phi i32 [ 1000000, %for.cond.preheader ], [ %spec.select, %for.inc21 ]
%mul5 = mul i32 %i.042, %i.042
%mul5.neg = mul i32 %mul5, %i.042
br label %for.body4
for.body4: ; preds = %for.body4.1, %for.cond2.preheader
%m.140 = phi i32 [ %m.041, %for.cond2.preheader ], [ %spec.select.1, %for.body4.1 ]
%j.039 = phi i32 [ 0, %for.cond2.preheader ], [ %inc.1, %for.body4.1 ]
%mul6.neg = mul i32 %j.039, %j.039
%reass.add = add i32 %mul6.neg, %mul5.neg
%sub = sub i32 %1, %reass.add
%2 = sext i32 %sub to i64
%add7 = add nuw nsw i32 %j.039, %i.042
%3 = zext i32 %add7 to i64
%add946 = add nsw i64 %3, %2
%4 = sext i32 %m.140 to i64
%cmp1147 = icmp slt i64 %add946, %4
%cmp13 = icmp sgt i32 %sub, -1
%or.cond = and i1 %cmp13, %cmp1147
%5 = trunc i64 %add946 to i32
%spec.select = select i1 %or.cond, i32 %5, i32 %m.140
%inc = or i32 %j.039, 1
%exitcond.not = icmp eq i32 %inc, 1001
br i1 %exitcond.not, label %for.inc21, label %for.body4.1, !llvm.loop !9
for.body4.1: ; preds = %for.body4
%mul6.neg.1 = mul i32 %inc, %inc
%reass.add.1 = add i32 %mul6.neg.1, %mul5.neg
%sub.1 = sub i32 %1, %reass.add.1
%6 = sext i32 %sub.1 to i64
%add7.1 = add nuw nsw i32 %inc, %i.042
%7 = zext i32 %add7.1 to i64
%add946.1 = add nsw i64 %7, %6
%8 = sext i32 %spec.select to i64
%cmp1147.1 = icmp slt i64 %add946.1, %8
%cmp13.1 = icmp sgt i32 %sub.1, -1
%or.cond.1 = and i1 %cmp13.1, %cmp1147.1
%9 = trunc i64 %add946.1 to i32
%spec.select.1 = select i1 %or.cond.1, i32 %9, i32 %spec.select
%inc.1 = add nuw nsw i32 %j.039, 2
br label %for.body4
for.inc21: ; preds = %for.body4
%inc22 = add nuw nsw i32 %i.042, 1
%exitcond45.not = icmp eq i32 %inc22, 101
br i1 %exitcond45.not, label %for.end23, label %for.cond2.preheader, !llvm.loop !11
for.end23: ; preds = %for.inc21
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %spec.select)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %e)
%10 = load i32, ptr %e, align 4, !tbaa !5
%cmp = icmp eq i32 %10, 0
br i1 %cmp, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end23, %entry
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"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")
void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod(ll n){return n%=MOD1;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}
int main(void){
char s[200005];
ll n,ans=0;
scanf("%s",s);
n=strlen(s);
ll as=0;
rep(i,0,n-1){
if(s[i]=='A'){
as++;
}else if(s[i]=='B' && s[i+1]=='C'){
ans+=as;
i++;
}else{
as=0;
}
// printf("%lld ",ans);
}
printf("%lld\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209552/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209552/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @swap(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i64, ptr %b, align 8, !tbaa !5
%1 = load i64, ptr %a, align 8, !tbaa !5
store i64 %1, ptr %b, align 8, !tbaa !5
store i64 %0, ptr %a, align 8, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min2(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %cond
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @min3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #2 {
entry:
%cmp.not = icmp sgt i64 %a, %b
%cmp1.not = icmp sgt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smin.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @max3(i64 noundef %a, i64 noundef %b, i64 noundef %c) local_unnamed_addr #2 {
entry:
%cmp.not = icmp slt i64 %a, %b
%cmp1.not = icmp slt i64 %a, %c
%or.cond = or i1 %cmp.not, %cmp1.not
%cond = tail call i64 @llvm.smax.i64(i64 %b, i64 %c)
%cond6 = select i1 %or.cond, i64 %cond, i64 %a
ret i64 %cond6
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @minn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 1152921504606846976, i64 1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smin.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smin.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ 1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ 1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smin.i64(i64 %b.06, i64 %6)
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !13
}
; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable
define dso_local i64 @maxn(i64 noundef %n, ptr nocapture noundef readonly %a) local_unnamed_addr #3 {
entry:
%cmp5 = icmp sgt i64 %n, 0
br i1 %cmp5, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i64 %n, 4
br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %n, -4
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %2, %vector.body ]
%vec.phi8 = phi <2 x i64> [ <i64 -1152921504606846976, i64 -1152921504606846976>, %vector.ph ], [ %3, %vector.body ]
%0 = getelementptr inbounds i64, ptr %a, i64 %index
%wide.load = load <2 x i64>, ptr %0, align 8, !tbaa !5
%1 = getelementptr inbounds i64, ptr %0, i64 2
%wide.load9 = load <2 x i64>, ptr %1, align 8, !tbaa !5
%2 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi, <2 x i64> %wide.load)
%3 = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %vec.phi8, <2 x i64> %wide.load9)
%index.next = add nuw i64 %index, 4
%4 = icmp eq i64 %index.next, %n.vec
br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14
middle.block: ; preds = %vector.body
%rdx.minmax = tail call <2 x i64> @llvm.smax.v2i64(<2 x i64> %2, <2 x i64> %3)
%5 = tail call i64 @llvm.vector.reduce.smax.v2i64(<2 x i64> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %n
br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10
for.body.preheader10: ; preds = %for.body.preheader, %middle.block
%i.07.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
%b.06.ph = phi i64 [ -1152921504606846976, %for.body.preheader ], [ %5, %middle.block ]
br label %for.body
for.cond.cleanup: ; preds = %for.body, %middle.block, %entry
%b.0.lcssa = phi i64 [ -1152921504606846976, %entry ], [ %5, %middle.block ], [ %cond.i, %for.body ]
ret i64 %b.0.lcssa
for.body: ; preds = %for.body.preheader10, %for.body
%i.07 = phi i64 [ %inc, %for.body ], [ %i.07.ph, %for.body.preheader10 ]
%b.06 = phi i64 [ %cond.i, %for.body ], [ %b.06.ph, %for.body.preheader10 ]
%arrayidx = getelementptr inbounds i64, ptr %a, i64 %i.07
%6 = load i64, ptr %arrayidx, align 8, !tbaa !5
%cond.i = tail call i64 @llvm.smax.i64(i64 %b.06, i64 %6)
%inc = add nuw nsw i64 %i.07, 1
%exitcond.not = icmp eq i64 %inc, %n
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !15
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @ABS(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cond = tail call i64 @llvm.abs.i64(i64 %a, i1 true)
ret i64 %cond
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @POW(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%cmp3 = icmp sgt i64 %b, 0
br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %b, -8
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%c.04.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%c.04.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %c.04.unr, %for.cond.cleanup.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %c.04.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !16
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%c.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %c.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%c.04 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %c.04, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%tobool.not4 = icmp eq i64 %b, 0
br i1 %tobool.not4, label %cond.end, label %cond.true
cond.true: ; preds = %entry, %cond.true
%b.tr6 = phi i64 [ %rem, %cond.true ], [ %b, %entry ]
%a.tr5 = phi i64 [ %b.tr6, %cond.true ], [ %a, %entry ]
%rem = srem i64 %a.tr5, %b.tr6
%tobool.not = icmp eq i64 %rem, 0
br i1 %tobool.not, label %cond.end, label %cond.true
cond.end: ; preds = %cond.true, %entry
%a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %cond.true ]
ret i64 %a.tr.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #4 {
entry:
%tobool.not4.i = icmp eq i64 %b, 0
br i1 %tobool.not4.i, label %gcd.exit, label %cond.true.i
cond.true.i: ; preds = %entry, %cond.true.i
%b.tr6.i = phi i64 [ %rem.i, %cond.true.i ], [ %b, %entry ]
%a.tr5.i = phi i64 [ %b.tr6.i, %cond.true.i ], [ %a, %entry ]
%rem.i = srem i64 %a.tr5.i, %b.tr6.i
%tobool.not.i = icmp eq i64 %rem.i, 0
br i1 %tobool.not.i, label %gcd.exit, label %cond.true.i
gcd.exit: ; preds = %cond.true.i, %entry
%a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %cond.true.i ]
%div = sdiv i64 %a, %a.tr.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @mod(i64 noundef %n) local_unnamed_addr #5 {
entry:
%rem = srem i64 %n, 1000000007
ret i64 %rem
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @upll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #6 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = zext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 -1, i32 %cond
ret i32 %cond2
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @downll(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #6 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%cond = sext i1 %cmp1 to i32
%cond2 = select i1 %cmp, i32 1, i32 %cond
ret i32 %cond2
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #12
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #8
; Function Attrs: nofree nounwind uwtable
define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #12
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp1(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #6 {
entry:
%0 = load i64, ptr %p, align 8, !tbaa !19
%1 = load i64, ptr %q, align 8, !tbaa !19
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmp2(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #6 {
entry:
%0 = load i64, ptr %q, align 8, !tbaa !19
%1 = load i64, ptr %p, align 8, !tbaa !19
%sub = sub nsw i64 %0, %1
%conv = trunc i64 %sub to i32
ret i32 %conv
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortup(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp1) #12
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @strsortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #7 {
entry:
%conv = sext i32 %n to i64
tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 16, ptr noundef nonnull @cmp2) #12
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #7 {
entry:
%s = alloca [200005 x i8], align 16
call void @llvm.lifetime.start.p0(i64 200005, ptr nonnull %s) #12
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #13
%sub = add nsw i64 %call2, -1
%cmp27 = icmp sgt i64 %call2, 1
br i1 %cmp27, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.inc, %entry
%ans.0.lcssa = phi i64 [ 0, %entry ], [ %ans.1, %for.inc ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0.lcssa)
call void @llvm.lifetime.end.p0(i64 200005, ptr nonnull %s) #12
ret i32 0
for.body: ; preds = %entry, %for.inc
%i.030 = phi i64 [ %inc18, %for.inc ], [ 0, %entry ]
%as.029 = phi i64 [ %as.1, %for.inc ], [ 0, %entry ]
%ans.028 = phi i64 [ %ans.1, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %i.030
%0 = load i8, ptr %arrayidx, align 1, !tbaa !21
switch i8 %0, label %for.inc [
i8 65, label %if.then
i8 66, label %land.lhs.true
]
if.then: ; preds = %for.body
%inc = add nsw i64 %as.029, 1
br label %for.inc
land.lhs.true: ; preds = %for.body
%add = add nsw i64 %i.030, 1
%arrayidx9 = getelementptr inbounds [200005 x i8], ptr %s, i64 0, i64 %add
%1 = load i8, ptr %arrayidx9, align 1, !tbaa !21
%cmp11 = icmp eq i8 %1, 67
br i1 %cmp11, label %if.then13, label %for.inc
if.then13: ; preds = %land.lhs.true
%add14 = add nsw i64 %as.029, %ans.028
br label %for.inc
for.inc: ; preds = %land.lhs.true, %for.body, %if.then, %if.then13
%ans.1 = phi i64 [ %ans.028, %if.then ], [ %add14, %if.then13 ], [ %ans.028, %for.body ], [ %ans.028, %land.lhs.true ]
%as.1 = phi i64 [ %inc, %if.then ], [ %as.029, %if.then13 ], [ 0, %for.body ], [ 0, %land.lhs.true ]
%i.1 = phi i64 [ %i.030, %if.then ], [ %add, %if.then13 ], [ %i.030, %for.body ], [ %i.030, %land.lhs.true ]
%inc18 = add nsw i64 %i.1, 1
%cmp = icmp slt i64 %inc18, %sub
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !22
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #10
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smin.v2i64(<2 x i64>, <2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smin.v2i64(<2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.smax.v2i64(<2 x i64>, <2 x i64>) #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.smax.v2i64(<2 x i64>) #11
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #12 = { nounwind }
attributes #13 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !12, !11}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !10}
!19 = !{!20, !6, i64 0}
!20 = !{!"", !6, i64 0, !6, i64 8}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !10}
|
#include<stdio.h>
int main (void) {
int i,j,a,n,ans;
char s[200];
scanf("%s",s);
i=0,j=0,ans;
while(s[n]!='\0'){n++;}
for(i=2;i<n;i+=2){a=0;
for(j=0;j<(n-i)/2;j++){
if(s[j]!=s[(n-i)/2+j]){a++;}
}
if(a==0){ans=n-i;break;}
}
printf("%d\n",ans);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209596/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209596/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%s = alloca [200 x i8], align 16
call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %s) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %while.cond
while.cond: ; preds = %while.cond, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [200 x i8], ptr %s, i64 0, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
%cmp.not = icmp eq i8 %0, 0
%indvars.iv.next = add i64 %indvars.iv, 1
br i1 %cmp.not, label %for.cond.preheader, label %while.cond, !llvm.loop !8
for.cond.preheader: ; preds = %while.cond
%1 = trunc i64 %indvars.iv to i32
%2 = trunc i64 %indvars.iv to i32
%3 = add i32 %2, -2
br label %for.cond
for.cond: ; preds = %for.end, %for.cond.preheader
%indvar = phi i32 [ %indvar.next, %for.end ], [ 0, %for.cond.preheader ]
%i.0 = phi i32 [ %add26, %for.end ], [ 2, %for.cond.preheader ]
%4 = shl i32 %indvar, 1
%5 = sub i32 %3, %4
%6 = lshr i32 %5, 1
%7 = zext i32 %6 to i64
%cmp2 = icmp slt i32 %i.0, %1
call void @llvm.assume(i1 %cmp2)
%sub = sub nsw i32 %1, %i.0
%cmp543 = icmp sgt i32 %sub, 1
br i1 %cmp543, label %for.body7.preheader, label %for.end27
for.body7.preheader: ; preds = %for.cond
%div5455 = lshr i32 %sub, 1
%8 = zext i32 %div5455 to i64
%wide.trip.count = zext i32 %div5455 to i64
%min.iters.check = icmp ult i32 %5, 16
br i1 %min.iters.check, label %for.body7.preheader60, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%n.vec = and i64 %7, 2147483640
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 ], [ %18, %vector.body ]
%vec.phi56 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%9 = getelementptr inbounds [200 x i8], ptr %s, i64 0, i64 %index
%wide.load = load <4 x i8>, ptr %9, align 8, !tbaa !5
%10 = getelementptr inbounds i8, ptr %9, i64 4
%wide.load57 = load <4 x i8>, ptr %10, align 4, !tbaa !5
%11 = add nuw nsw i64 %index, %8
%12 = getelementptr inbounds [200 x i8], ptr %s, i64 0, i64 %11
%wide.load58 = load <4 x i8>, ptr %12, align 1, !tbaa !5
%13 = getelementptr inbounds i8, ptr %12, i64 4
%wide.load59 = load <4 x i8>, ptr %13, align 1, !tbaa !5
%14 = icmp ne <4 x i8> %wide.load, %wide.load58
%15 = icmp ne <4 x i8> %wide.load57, %wide.load59
%16 = zext <4 x i1> %14 to <4 x i32>
%17 = zext <4 x i1> %15 to <4 x i32>
%18 = add <4 x i32> %vec.phi, %16
%19 = add <4 x i32> %vec.phi56, %17
%index.next = add nuw i64 %index, 8
%20 = icmp eq i64 %index.next, %n.vec
br i1 %20, label %middle.block, label %vector.body, !llvm.loop !10
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %19, %18
%21 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %7
br i1 %cmp.n, label %for.end, label %for.body7.preheader60
for.body7.preheader60: ; preds = %for.body7.preheader, %middle.block
%indvars.iv47.ph = phi i64 [ 0, %for.body7.preheader ], [ %n.vec, %middle.block ]
%a.045.ph = phi i32 [ 0, %for.body7.preheader ], [ %21, %middle.block ]
br label %for.body7
for.body7: ; preds = %for.body7.preheader60, %for.body7
%indvars.iv47 = phi i64 [ %indvars.iv.next48, %for.body7 ], [ %indvars.iv47.ph, %for.body7.preheader60 ]
%a.045 = phi i32 [ %spec.select, %for.body7 ], [ %a.045.ph, %for.body7.preheader60 ]
%arrayidx9 = getelementptr inbounds [200 x i8], ptr %s, i64 0, i64 %indvars.iv47
%22 = load i8, ptr %arrayidx9, align 1, !tbaa !5
%23 = add nuw nsw i64 %indvars.iv47, %8
%arrayidx14 = getelementptr inbounds [200 x i8], ptr %s, i64 0, i64 %23
%24 = load i8, ptr %arrayidx14, align 1, !tbaa !5
%cmp16.not = icmp ne i8 %22, %24
%inc18 = zext i1 %cmp16.not to i32
%spec.select = add nuw nsw i32 %a.045, %inc18
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
%exitcond.not = icmp eq i64 %indvars.iv.next48, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body7, !llvm.loop !13
for.end: ; preds = %for.body7, %middle.block
%spec.select.lcssa = phi i32 [ %21, %middle.block ], [ %spec.select, %for.body7 ]
%cmp20 = icmp eq i32 %spec.select.lcssa, 0
%add26 = add nuw nsw i32 %i.0, 2
%indvar.next = add i32 %indvar, 1
br i1 %cmp20, label %for.end27, label %for.cond, !llvm.loop !14
for.end27: ; preds = %for.cond, %for.end
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.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 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9, !11, !12}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !9, !12, !11}
!14 = distinct !{!14, !9}
|
#include<stdio.h>
#include<string.h>
int main(){
char s[201];
int i,ans;
scanf("%s",s);
int len=strlen(s);
for(i=len-2; i>0; i-=2){
if(strncmp(s,s+i/2,i/2)==0){
ans=i;
break;
}
}
printf("%d\n",ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209653/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209653/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%s = alloca [201 x i8], align 16
call void @llvm.lifetime.start.p0(i64 201, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5
%conv = trunc i64 %call2 to i32
br label %for.cond
for.cond: ; preds = %for.body, %entry
%i.0.in = phi i32 [ %conv, %entry ], [ %i.0, %for.body ]
%i.0 = add nsw i32 %i.0.in, -2
%cmp = icmp sgt i32 %i.0.in, 2
br i1 %cmp, label %for.body, label %for.end
for.body: ; preds = %for.cond
%div17 = lshr i32 %i.0, 1
%idx.ext = zext i32 %div17 to i64
%add.ptr = getelementptr inbounds i8, ptr %s, i64 %idx.ext
%call8 = call i32 @strncmp(ptr noundef nonnull %s, ptr noundef nonnull %add.ptr, i64 noundef %idx.ext) #5
%cmp9 = icmp eq i32 %call8, 0
br i1 %cmp9, label %for.end, label %for.cond, !llvm.loop !5
for.end: ; preds = %for.body, %for.cond
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0)
call void @llvm.lifetime.end.p0(i64 201, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, 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 memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
char s[202];
int len, i, j;
scanf("%s", s);
len = strlen(s);
if(strlen(s) == 2){
printf("1\n");
return 0;
}
while(1){
len -= 2;
j = len/2;
for(i = 0; i < len/2; i++){
if(s[i] != s[j]) break;
if(i == len/2-1){
printf("%d\n", len);
return 0;
}
j++;
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209703/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209703/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [202 x i8], align 16
call void @llvm.lifetime.start.p0(i64 202, 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
%cmp = icmp eq i64 %call2, 2
br i1 %cmp, label %if.then, label %while.cond.preheader
while.cond.preheader: ; preds = %entry
%conv = trunc i64 %call2 to i32
br label %while.cond
if.then: ; preds = %entry
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %cleanup
while.cond: ; preds = %while.cond.backedge, %while.cond.preheader
%len.0 = phi i32 [ %conv, %while.cond.preheader ], [ %sub, %while.cond.backedge ]
%sub = add nsw i32 %len.0, -2
%cmp837 = icmp sgt i32 %len.0, 3
br i1 %cmp837, label %for.body.lr.ph, label %while.cond.backedge
while.cond.backedge: ; preds = %for.body, %if.end24, %while.cond
br label %while.cond
for.body.lr.ph: ; preds = %while.cond
%div4546 = lshr i32 %sub, 1
%sub19 = add nsw i32 %div4546, -1
%0 = zext i32 %div4546 to i64
%1 = zext i32 %sub19 to i64
%wide.trip.count = zext i32 %div4546 to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %if.end24
%indvars.iv40 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next41, %if.end24 ]
%indvars.iv = phi i64 [ %0, %for.body.lr.ph ], [ %indvars.iv.next, %if.end24 ]
%arrayidx = getelementptr inbounds [202 x i8], ptr %s, i64 0, i64 %indvars.iv40
%2 = load i8, ptr %arrayidx, align 1, !tbaa !5
%arrayidx12 = getelementptr inbounds [202 x i8], ptr %s, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx12, align 1, !tbaa !5
%cmp14.not = icmp eq i8 %2, %3
br i1 %cmp14.not, label %if.end17, label %while.cond.backedge
if.end17: ; preds = %for.body
%cmp20 = icmp eq i64 %indvars.iv40, %1
br i1 %cmp20, label %if.then22, label %if.end24
if.then22: ; preds = %if.end17
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %sub)
br label %cleanup
if.end24: ; preds = %if.end17
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%exitcond.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count
br i1 %exitcond.not, label %while.cond.backedge, label %for.body, !llvm.loop !8
cleanup: ; preds = %if.then22, %if.then
call void @llvm.lifetime.end.p0(i64 202, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
int main(){
char s[201];
int len;
int i,j;
scanf("%s",s);
len = strlen(s);
s[len - 1] = '\0';
for(j = len;j > 0;j--){
s[j] = '\0';
if((len = strlen(s)) % 2 != 0){
continue;
};
for(i = 0;i < (len / 2);i++){
if(s[i] == s[i + (len / 2)]){
if(i == ((len / 2) - 1)){
printf("%d\n",len);
return 0;
}
}
else{
break;
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209747/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209747/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%s = alloca [201 x i8], align 16
call void @llvm.lifetime.start.p0(i64 201, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5
%conv = trunc i64 %call2 to i32
%sub = shl i64 %call2, 32
%sext = add i64 %sub, -4294967296
%idxprom = ashr exact i64 %sext, 32
%arrayidx = getelementptr inbounds [201 x i8], ptr %s, i64 0, i64 %idxprom
store i8 0, ptr %arrayidx, align 1, !tbaa !5
%cmp51 = icmp sgt i32 %conv, 0
br i1 %cmp51, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%0 = and i64 %call2, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %for.inc33
%indvars.iv56 = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next57, %for.inc33 ]
%arrayidx5 = getelementptr inbounds [201 x i8], ptr %s, i64 0, i64 %indvars.iv56
store i8 0, ptr %arrayidx5, align 1, !tbaa !5
%call7 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5
%conv8 = trunc i64 %call7 to i32
%1 = and i32 %conv8, 1
%cmp9.not = icmp eq i32 %1, 0
%cmp1249 = icmp sgt i32 %conv8, 1
%or.cond = and i1 %cmp9.not, %cmp1249
br i1 %or.cond, label %for.body14.lr.ph, label %for.inc33
for.body14.lr.ph: ; preds = %for.body
%div5961 = lshr i32 %conv8, 1
%sub26 = add nsw i32 %div5961, -1
%2 = zext i32 %div5961 to i64
%3 = zext i32 %sub26 to i64
%4 = load i8, ptr %s, align 16, !tbaa !5
%arrayidx2063 = getelementptr inbounds [201 x i8], ptr %s, i64 0, i64 %2
%5 = load i8, ptr %arrayidx2063, align 1, !tbaa !5
%cmp2264 = icmp eq i8 %4, %5
br i1 %cmp2264, label %if.then24, label %for.inc33
for.body14: ; preds = %if.then24
%indvars.iv.next = add nuw nsw i64 %indvars.iv65, 1
%arrayidx16 = getelementptr inbounds [201 x i8], ptr %s, i64 0, i64 %indvars.iv.next
%6 = load i8, ptr %arrayidx16, align 1, !tbaa !5
%7 = add nuw nsw i64 %indvars.iv.next, %2
%arrayidx20 = getelementptr inbounds [201 x i8], ptr %s, i64 0, i64 %7
%8 = load i8, ptr %arrayidx20, align 1, !tbaa !5
%cmp22 = icmp eq i8 %6, %8
br i1 %cmp22, label %if.then24, label %for.inc33
if.then24: ; preds = %for.body14.lr.ph, %for.body14
%indvars.iv65 = phi i64 [ %indvars.iv.next, %for.body14 ], [ 0, %for.body14.lr.ph ]
%cmp27 = icmp eq i64 %indvars.iv65, %3
br i1 %cmp27, label %if.then29, label %for.body14
if.then29: ; preds = %if.then24
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv8)
br label %cleanup
for.inc33: ; preds = %for.body14, %for.body14.lr.ph, %for.body
%indvars.iv.next57 = add nsw i64 %indvars.iv56, -1
%cmp = icmp sgt i64 %indvars.iv56, 1
br i1 %cmp, label %for.body, label %cleanup, !llvm.loop !8
cleanup: ; preds = %for.inc33, %entry, %if.then29
call void @llvm.lifetime.end.p0(i64 201, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
long double triangle(long double d1[],long double d2[], long double d3[]){
long double h1,h2,h3,s,S;
h1=(long double)sqrt((double)((d3[1]-d2[1])*(d3[1]-d2[1])+(d3[0]-d2[0])*(d3[0]-d2[0])));
h2=(long double)sqrt((double)((d3[1]-d1[1])*(d3[1]-d1[1])+(d3[0]-d1[0])*(d3[0]-d1[0])));
h3=(long double)sqrt((double)((d1[1]-d2[1])*(d1[1]-d2[1])+(d1[0]-d2[0])*(d1[0]-d2[0])));
s=(h1+h2+h3)/2.0;
S=(long double)sqrt((double)(s*(s-h1)*(s-h2)*(s-h3)));
return S;
}
int main(){
long double a[5],b[5],c[5],d[4];
for(;scanf("%llf,%llf,%llf,%llf,%llf,%llf,%llf,%llf",&a[0],&a[1],&b[0],&b[1],&c[0],&c[1],&d[0],&d[1])!=EOF;){
if((triangle(a,b,d)+triangle(b,c,d))==(triangle(a,b,c)+triangle(a,c,d)))printf("YES\n");
else printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209790/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209790/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [40 x i8] c"%llf,%llf,%llf,%llf,%llf,%llf,%llf,%llf\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: mustprogress nofree nounwind willreturn memory(write, argmem: readwrite) uwtable
define dso_local x86_fp80 @triangle(ptr nocapture noundef readonly %d1, ptr nocapture noundef readonly %d2, ptr nocapture noundef readonly %d3) local_unnamed_addr #0 {
entry:
%arrayidx = getelementptr inbounds x86_fp80, ptr %d3, i64 1
%0 = load x86_fp80, ptr %arrayidx, align 16, !tbaa !5
%arrayidx1 = getelementptr inbounds x86_fp80, ptr %d2, i64 1
%1 = load x86_fp80, ptr %arrayidx1, align 16, !tbaa !5
%sub = fsub x86_fp80 %0, %1
%2 = load x86_fp80, ptr %d3, align 16, !tbaa !5
%3 = load x86_fp80, ptr %d2, align 16, !tbaa !5
%sub7 = fsub x86_fp80 %2, %3
%mul11 = fmul x86_fp80 %sub7, %sub7
%4 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub, x86_fp80 %sub, x86_fp80 %mul11)
%conv = fptrunc x86_fp80 %4 to double
%sqrt82 = tail call double @llvm.sqrt.f64(double %conv)
%conv12 = fpext double %sqrt82 to x86_fp80
%arrayidx14 = getelementptr inbounds x86_fp80, ptr %d1, i64 1
%5 = load x86_fp80, ptr %arrayidx14, align 16, !tbaa !5
%sub15 = fsub x86_fp80 %0, %5
%6 = load x86_fp80, ptr %d1, align 16, !tbaa !5
%sub21 = fsub x86_fp80 %2, %6
%mul25 = fmul x86_fp80 %sub21, %sub21
%7 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub15, x86_fp80 %sub15, x86_fp80 %mul25)
%conv26 = fptrunc x86_fp80 %7 to double
%sqrt81 = tail call double @llvm.sqrt.f64(double %conv26)
%conv28 = fpext double %sqrt81 to x86_fp80
%sub31 = fsub x86_fp80 %5, %1
%sub37 = fsub x86_fp80 %6, %3
%mul41 = fmul x86_fp80 %sub37, %sub37
%8 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub31, x86_fp80 %sub31, x86_fp80 %mul41)
%conv42 = fptrunc x86_fp80 %8 to double
%sqrt = tail call double @llvm.sqrt.f64(double %conv42)
%conv44 = fpext double %sqrt to x86_fp80
%add = fadd x86_fp80 %conv12, %conv28
%add45 = fadd x86_fp80 %add, %conv44
%div = fmul x86_fp80 %add45, 0xK3FFE8000000000000000
%sub46 = fsub x86_fp80 %div, %conv12
%mul = fmul x86_fp80 %div, %sub46
%sub47 = fsub x86_fp80 %div, %conv28
%mul48 = fmul x86_fp80 %sub47, %mul
%sub49 = fsub x86_fp80 %div, %conv44
%mul50 = fmul x86_fp80 %sub49, %mul48
%conv51 = fptrunc x86_fp80 %mul50 to double
%call52 = tail call double @sqrt(double noundef %conv51) #8
%conv53 = fpext double %call52 to x86_fp80
ret x86_fp80 %conv53
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare x86_fp80 @llvm.fmuladd.f80(x86_fp80, x86_fp80, x86_fp80) #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 uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%a = alloca [5 x x86_fp80], align 16
%b = alloca [5 x x86_fp80], align 16
%c = alloca [5 x x86_fp80], align 16
%d = alloca [4 x x86_fp80], align 16
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %a) #8
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %b) #8
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %c) #8
call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %d) #8
%arrayidx1 = getelementptr inbounds [5 x x86_fp80], ptr %a, i64 0, i64 1
%arrayidx3 = getelementptr inbounds [5 x x86_fp80], ptr %b, i64 0, i64 1
%arrayidx5 = getelementptr inbounds [5 x x86_fp80], ptr %c, i64 0, i64 1
%arrayidx7 = getelementptr inbounds [4 x x86_fp80], ptr %d, i64 0, i64 1
%call127 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %c, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %d, ptr noundef nonnull %arrayidx7)
%cmp.not128 = icmp eq i32 %call127, -1
br i1 %cmp.not128, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%0 = load x86_fp80, ptr %arrayidx7, align 16, !tbaa !5
%1 = load x86_fp80, ptr %arrayidx3, align 16, !tbaa !5
%sub.i = fsub x86_fp80 %0, %1
%2 = load x86_fp80, ptr %d, align 16, !tbaa !5
%3 = load x86_fp80, ptr %b, align 16, !tbaa !5
%sub7.i = fsub x86_fp80 %2, %3
%mul11.i = fmul x86_fp80 %sub7.i, %sub7.i
%4 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub.i, x86_fp80 %sub.i, x86_fp80 %mul11.i)
%conv.i = fptrunc x86_fp80 %4 to double
%sqrt82.i = call double @llvm.sqrt.f64(double %conv.i)
%conv12.i = fpext double %sqrt82.i to x86_fp80
%5 = load x86_fp80, ptr %arrayidx1, align 16, !tbaa !5
%sub15.i = fsub x86_fp80 %0, %5
%6 = load x86_fp80, ptr %a, align 16, !tbaa !5
%sub21.i = fsub x86_fp80 %2, %6
%mul25.i = fmul x86_fp80 %sub21.i, %sub21.i
%7 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub15.i, x86_fp80 %sub15.i, x86_fp80 %mul25.i)
%conv26.i = fptrunc x86_fp80 %7 to double
%sqrt81.i = call double @llvm.sqrt.f64(double %conv26.i)
%conv28.i = fpext double %sqrt81.i to x86_fp80
%sub31.i = fsub x86_fp80 %5, %1
%sub37.i = fsub x86_fp80 %6, %3
%mul41.i = fmul x86_fp80 %sub37.i, %sub37.i
%8 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub31.i, x86_fp80 %sub31.i, x86_fp80 %mul41.i)
%conv42.i = fptrunc x86_fp80 %8 to double
%sqrt.i = call double @llvm.sqrt.f64(double %conv42.i)
%conv44.i = fpext double %sqrt.i to x86_fp80
%add.i = fadd x86_fp80 %conv12.i, %conv28.i
%add45.i = fadd x86_fp80 %add.i, %conv44.i
%div.i = fmul x86_fp80 %add45.i, 0xK3FFE8000000000000000
%sub46.i = fsub x86_fp80 %div.i, %conv12.i
%mul.i = fmul x86_fp80 %div.i, %sub46.i
%sub47.i = fsub x86_fp80 %div.i, %conv28.i
%mul48.i = fmul x86_fp80 %sub47.i, %mul.i
%sub49.i = fsub x86_fp80 %div.i, %conv44.i
%mul50.i = fmul x86_fp80 %sub49.i, %mul48.i
%conv51.i = fptrunc x86_fp80 %mul50.i to double
%call52.i = call double @sqrt(double noundef %conv51.i) #8
%conv53.i = fpext double %call52.i to x86_fp80
%9 = load x86_fp80, ptr %arrayidx7, align 16, !tbaa !5
%10 = load x86_fp80, ptr %arrayidx5, align 16, !tbaa !5
%sub.i30 = fsub x86_fp80 %9, %10
%11 = load x86_fp80, ptr %d, align 16, !tbaa !5
%12 = load x86_fp80, ptr %c, align 16, !tbaa !5
%sub7.i31 = fsub x86_fp80 %11, %12
%mul11.i32 = fmul x86_fp80 %sub7.i31, %sub7.i31
%13 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub.i30, x86_fp80 %sub.i30, x86_fp80 %mul11.i32)
%conv.i33 = fptrunc x86_fp80 %13 to double
%sqrt82.i34 = call double @llvm.sqrt.f64(double %conv.i33)
%conv12.i35 = fpext double %sqrt82.i34 to x86_fp80
%14 = load x86_fp80, ptr %arrayidx3, align 16, !tbaa !5
%sub15.i37 = fsub x86_fp80 %9, %14
%15 = load x86_fp80, ptr %b, align 16, !tbaa !5
%sub21.i38 = fsub x86_fp80 %11, %15
%mul25.i39 = fmul x86_fp80 %sub21.i38, %sub21.i38
%16 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub15.i37, x86_fp80 %sub15.i37, x86_fp80 %mul25.i39)
%conv26.i40 = fptrunc x86_fp80 %16 to double
%sqrt81.i41 = call double @llvm.sqrt.f64(double %conv26.i40)
%conv28.i42 = fpext double %sqrt81.i41 to x86_fp80
%sub31.i43 = fsub x86_fp80 %14, %10
%sub37.i44 = fsub x86_fp80 %15, %12
%mul41.i45 = fmul x86_fp80 %sub37.i44, %sub37.i44
%17 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub31.i43, x86_fp80 %sub31.i43, x86_fp80 %mul41.i45)
%conv42.i46 = fptrunc x86_fp80 %17 to double
%sqrt.i47 = call double @llvm.sqrt.f64(double %conv42.i46)
%conv44.i48 = fpext double %sqrt.i47 to x86_fp80
%add.i49 = fadd x86_fp80 %conv12.i35, %conv28.i42
%add45.i50 = fadd x86_fp80 %add.i49, %conv44.i48
%div.i51 = fmul x86_fp80 %add45.i50, 0xK3FFE8000000000000000
%sub46.i52 = fsub x86_fp80 %div.i51, %conv12.i35
%mul.i53 = fmul x86_fp80 %div.i51, %sub46.i52
%sub47.i54 = fsub x86_fp80 %div.i51, %conv28.i42
%mul48.i55 = fmul x86_fp80 %sub47.i54, %mul.i53
%sub49.i56 = fsub x86_fp80 %div.i51, %conv44.i48
%mul50.i57 = fmul x86_fp80 %sub49.i56, %mul48.i55
%conv51.i58 = fptrunc x86_fp80 %mul50.i57 to double
%call52.i59 = call double @sqrt(double noundef %conv51.i58) #8
%conv53.i60 = fpext double %call52.i59 to x86_fp80
%add = fadd x86_fp80 %conv53.i, %conv53.i60
%18 = load x86_fp80, ptr %arrayidx5, align 16, !tbaa !5
%19 = load x86_fp80, ptr %arrayidx3, align 16, !tbaa !5
%sub.i63 = fsub x86_fp80 %18, %19
%20 = load x86_fp80, ptr %c, align 16, !tbaa !5
%21 = load x86_fp80, ptr %b, align 16, !tbaa !5
%sub7.i64 = fsub x86_fp80 %20, %21
%mul11.i65 = fmul x86_fp80 %sub7.i64, %sub7.i64
%22 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub.i63, x86_fp80 %sub.i63, x86_fp80 %mul11.i65)
%conv.i66 = fptrunc x86_fp80 %22 to double
%sqrt82.i67 = call double @llvm.sqrt.f64(double %conv.i66)
%conv12.i68 = fpext double %sqrt82.i67 to x86_fp80
%23 = load x86_fp80, ptr %arrayidx1, align 16, !tbaa !5
%sub15.i70 = fsub x86_fp80 %18, %23
%24 = load x86_fp80, ptr %a, align 16, !tbaa !5
%sub21.i71 = fsub x86_fp80 %20, %24
%mul25.i72 = fmul x86_fp80 %sub21.i71, %sub21.i71
%25 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub15.i70, x86_fp80 %sub15.i70, x86_fp80 %mul25.i72)
%conv26.i73 = fptrunc x86_fp80 %25 to double
%sqrt81.i74 = call double @llvm.sqrt.f64(double %conv26.i73)
%conv28.i75 = fpext double %sqrt81.i74 to x86_fp80
%sub31.i76 = fsub x86_fp80 %23, %19
%sub37.i77 = fsub x86_fp80 %24, %21
%mul41.i78 = fmul x86_fp80 %sub37.i77, %sub37.i77
%26 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub31.i76, x86_fp80 %sub31.i76, x86_fp80 %mul41.i78)
%conv42.i79 = fptrunc x86_fp80 %26 to double
%sqrt.i80 = call double @llvm.sqrt.f64(double %conv42.i79)
%conv44.i81 = fpext double %sqrt.i80 to x86_fp80
%add.i82 = fadd x86_fp80 %conv12.i68, %conv28.i75
%add45.i83 = fadd x86_fp80 %add.i82, %conv44.i81
%div.i84 = fmul x86_fp80 %add45.i83, 0xK3FFE8000000000000000
%sub46.i85 = fsub x86_fp80 %div.i84, %conv12.i68
%mul.i86 = fmul x86_fp80 %div.i84, %sub46.i85
%sub47.i87 = fsub x86_fp80 %div.i84, %conv28.i75
%mul48.i88 = fmul x86_fp80 %sub47.i87, %mul.i86
%sub49.i89 = fsub x86_fp80 %div.i84, %conv44.i81
%mul50.i90 = fmul x86_fp80 %sub49.i89, %mul48.i88
%conv51.i91 = fptrunc x86_fp80 %mul50.i90 to double
%call52.i92 = call double @sqrt(double noundef %conv51.i91) #8
%conv53.i93 = fpext double %call52.i92 to x86_fp80
%27 = load x86_fp80, ptr %arrayidx7, align 16, !tbaa !5
%28 = load x86_fp80, ptr %arrayidx5, align 16, !tbaa !5
%sub.i96 = fsub x86_fp80 %27, %28
%29 = load x86_fp80, ptr %d, align 16, !tbaa !5
%30 = load x86_fp80, ptr %c, align 16, !tbaa !5
%sub7.i97 = fsub x86_fp80 %29, %30
%mul11.i98 = fmul x86_fp80 %sub7.i97, %sub7.i97
%31 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub.i96, x86_fp80 %sub.i96, x86_fp80 %mul11.i98)
%conv.i99 = fptrunc x86_fp80 %31 to double
%sqrt82.i100 = call double @llvm.sqrt.f64(double %conv.i99)
%conv12.i101 = fpext double %sqrt82.i100 to x86_fp80
%32 = load x86_fp80, ptr %arrayidx1, align 16, !tbaa !5
%sub15.i103 = fsub x86_fp80 %27, %32
%33 = load x86_fp80, ptr %a, align 16, !tbaa !5
%sub21.i104 = fsub x86_fp80 %29, %33
%mul25.i105 = fmul x86_fp80 %sub21.i104, %sub21.i104
%34 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub15.i103, x86_fp80 %sub15.i103, x86_fp80 %mul25.i105)
%conv26.i106 = fptrunc x86_fp80 %34 to double
%sqrt81.i107 = call double @llvm.sqrt.f64(double %conv26.i106)
%conv28.i108 = fpext double %sqrt81.i107 to x86_fp80
%sub31.i109 = fsub x86_fp80 %32, %28
%sub37.i110 = fsub x86_fp80 %33, %30
%mul41.i111 = fmul x86_fp80 %sub37.i110, %sub37.i110
%35 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %sub31.i109, x86_fp80 %sub31.i109, x86_fp80 %mul41.i111)
%conv42.i112 = fptrunc x86_fp80 %35 to double
%sqrt.i113 = call double @llvm.sqrt.f64(double %conv42.i112)
%conv44.i114 = fpext double %sqrt.i113 to x86_fp80
%add.i115 = fadd x86_fp80 %conv12.i101, %conv28.i108
%add45.i116 = fadd x86_fp80 %add.i115, %conv44.i114
%div.i117 = fmul x86_fp80 %add45.i116, 0xK3FFE8000000000000000
%sub46.i118 = fsub x86_fp80 %div.i117, %conv12.i101
%mul.i119 = fmul x86_fp80 %div.i117, %sub46.i118
%sub47.i120 = fsub x86_fp80 %div.i117, %conv28.i108
%mul48.i121 = fmul x86_fp80 %sub47.i120, %mul.i119
%sub49.i122 = fsub x86_fp80 %div.i117, %conv44.i114
%mul50.i123 = fmul x86_fp80 %sub49.i122, %mul48.i121
%conv51.i124 = fptrunc x86_fp80 %mul50.i123 to double
%call52.i125 = call double @sqrt(double noundef %conv51.i124) #8
%conv53.i126 = fpext double %call52.i125 to x86_fp80
%add23 = fadd x86_fp80 %conv53.i93, %conv53.i126
%cmp24 = fcmp oeq x86_fp80 %add, %add23
%str.3.str = select i1 %cmp24, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %b, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %c, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %d, ptr noundef nonnull %arrayidx7)
%cmp.not = icmp eq i32 %call, -1
br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %d) #8
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %c) #8
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %b) #8
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %a) #8
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.sqrt.f64(double) #7
attributes #0 = { mustprogress nofree nounwind willreturn memory(write, argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{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 double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define mod 1e9+7
#define ll long long int
#define epsilon 1e-7
int compare_int(const void *a, const void *b){
int *A = (int *)a;
int *B = (int *)b;
return *A - *B;
}
int main(void){
int n;
scanf("%d", &n);
int a[n];
for(int i = 0;i < n;i++)scanf("%d", &a[i]);
qsort(a, n, sizeof(int), compare_int);
int small = a[0];
int big = a[n-1];
if(big - small > 1)printf("No\n");
else if(big - small == 0){
if(small == n-1 || n/2 >= small)printf("Yes\n");
else printf("No\n");
}else{
int count = 0;
while(1){
count++;
if(a[count] != small){
break;
}
}
if(count > small || (n-count)/2 + count < big)printf("No\n");
else printf("Yes\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209862/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209862/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.5 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.6 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @compare_int(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp62 = icmp sgt i32 %3, 0
br i1 %cmp62, label %for.body, label %entry.for.cond.cleanup_crit_edge
entry.for.cond.cleanup_crit_edge: ; preds = %entry
%.pre = sext i32 %3 to i64
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge
%conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %8, %for.body ]
call void @qsort(ptr noundef nonnull %vla, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @compare_int) #7
%4 = load i32, ptr %vla, align 16, !tbaa !5
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%idxprom3 = sext i32 %sub to i64
%arrayidx4 = getelementptr inbounds i32, ptr %vla, i64 %idxprom3
%6 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%sub5 = sub nsw i32 %6, %4
%cmp6 = icmp sgt i32 %sub5, 1
br i1 %cmp6, label %if.end43, label %if.else
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
if.else: ; preds = %for.cond.cleanup
%cmp10 = icmp eq i32 %6, %4
br i1 %cmp10, label %if.then12, label %while.cond
if.then12: ; preds = %if.else
%cmp14 = icmp ne i32 %4, %sub
%div = sdiv i32 %5, 2
%cmp16.not = icmp slt i32 %div, %4
%or.cond = and i1 %cmp14, %cmp16.not
%str.4.str.5 = select i1 %or.cond, ptr @str.6, ptr @str.5
br label %if.end43
while.cond: ; preds = %if.else, %while.cond
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %while.cond ], [ 0, %if.else ]
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%arrayidx25 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next67
%9 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%cmp26.not = icmp eq i32 %9, %4
br i1 %cmp26.not, label %while.cond, label %while.end
while.end: ; preds = %while.cond
%10 = trunc i64 %indvars.iv66 to i32
%cmp30.not = icmp sgt i32 %4, %10
br i1 %cmp30.not, label %lor.lhs.false32, label %if.end43
lor.lhs.false32: ; preds = %while.end
%11 = trunc i64 %indvars.iv.next67 to i32
%sub33 = sub nsw i32 %5, %11
%div34 = sdiv i32 %sub33, 2
%add = add nsw i32 %div34, %11
%cmp35 = icmp slt i32 %add, %6
%spec.select = select i1 %cmp35, ptr @str.6, ptr @str.5
br label %if.end43
if.end43: ; preds = %lor.lhs.false32, %while.end, %if.then12, %for.cond.cleanup
%str.3.sink = phi ptr [ @str.6, %for.cond.cleanup ], [ %str.4.str.5, %if.then12 ], [ @str.6, %while.end ], [ %spec.select, %lor.lhs.false32 ]
%puts58 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; 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: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!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"}
|
//set many funcs template
//Ver.20181228
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<time.h>
#define inf 1072114514
#define llinf 4154118101919364364
#define mod 1000000007
#define pi 3.1415926535897932384
int max(int a,int b){if(a>b){return a;}return b;}
int min(int a,int b){if(a<b){return a;}return b;}
int zt(int a,int b){return max(a,b)-min(a,b);}
int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;}
int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;}
int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;}
int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
int nHr(int a,int b){return nCr(a+b-1,b);}
int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
int dsum(int x){int r=0;while(x){r+=(x%10);x/=10;}return r;}
int dsumb(int x,int b){int r=0;while(x){r+=(x%b);x/=b;}return r;}
int sankaku(int x){return ((1+x)*x)/2;}
long long llmax(long long a,long long b){if(a>b){return a;}return b;}
long long llmin(long long a,long long b){if(a<b){return a;}return b;}
long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);}
long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;}
long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;}
long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;}
long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;}
long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
long long llnHr(long long a,long long b){return llnCr(a+b-1,b);}
long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;}
long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;}
long long lldsum(long long x){long long r=0;while(x){r+=(x%10);x/=10;}return r;}
long long lldsumb(long long x,long long b){long long r=0;while(x){r+=(x%b);x/=b;}return r;}
long long llsankaku(long long x){return ((1+x)*x)/2;}
double dbmax(double a,double b){if(a>b){return a;}return b;}
double dbmin(double a,double b){if(a<b){return a;}return b;}
double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);}
int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;}
int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;}
int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;}
int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);}
int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);}
int chsortfncsj(const void *a,const void *b){if(*(char *)a>*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
int chsortfnckj(const void *a,const void *b){if(*(char *)a<*(char *)b){return 1;}if(*(char *)a==*(char *)b){return 0;}return -1;}
void shuffledget(int x[],int n){
srand(time(0));
int i,b[524288],p,c;
for(i=0;i<n;i++){
b[i]=i;
}
for(i=n;i>=1;i--){
p=rand()%i;
c=b[i-1];b[i-1]=b[p];b[p]=c;
}
for(i=0;i<n;i++){
scanf("%d",&x[b[i]]);
}
}
int dx4[4]={1,-1,0,0};
int dy4[4]={0,0,1,-1};
int dx8[8]={-1,-1,-1,0,0,1,1,1};
int dy8[8]={-1,0,1,-1,1,-1,0,1};
int search(int x,int a[],int n){
int st=0,fi=n-1,te;
while(st<=fi){
te=(st+fi)/2;
if(a[te]<x){st=te+1;}else{fi=te-1;}
}
return st;
}
void prarr(int arr[],int n){
int i;
for(i=0;i<n;i++){
if(i){printf(" ");}
printf("%d",arr[i]);
}
printf("\n");
return;
}
typedef struct{
int val;
int node;
}sd;
int sdsortfnc(const void *a,const void *b){
if(((sd*)a)->val < ((sd*)b)->val){return -1;}
if(((sd*)a)->val > ((sd*)b)->val){return 1;}
return 0;
}
int main(void){
int i,j,n,m,k,a,b,c,h,w,r=0,l,t;
char s[524288];
scanf("%d%d%s",&l,&k,s);
i=0;t=1;
while(1){
if(s[i]=='A'&&t==1){
s[i]='B';
}
else if(s[i]=='B'&&t==-1){
s[i]='A';
}
else{
i++;
t*=-1;
}
k--;
if(i==l){
if(l%2==1){
if(k%2==1){printf("B");}
else{printf("A");}
}
for(i=0;i<(l/2);i++){
printf("BA");
}
printf("\n");
return 0;
}
if(k==0){break;}
}
c=i;
while(i<l){
if(t==1){printf("%c",s[i]);}
else if(s[i]=='A'){printf("B");}
else{printf("A");}
i++;
}
while(c>0){
if(c%2==1){printf("A");}
else{printf("B");}
c--;
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209905/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209905/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@dx4 = dso_local local_unnamed_addr global [4 x i32] [i32 1, i32 -1, i32 0, i32 0], align 16
@dy4 = dso_local local_unnamed_addr global [4 x i32] [i32 0, i32 0, i32 1, i32 -1], align 16
@dx8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 -1, i32 -1, i32 0, i32 0, i32 1, i32 1, i32 1], align 16
@dy8 = dso_local local_unnamed_addr global [8 x i32] [i32 -1, i32 0, i32 1, i32 -1, i32 1, i32 -1, i32 0, i32 1], align 16
@.str.3 = private unnamed_addr constant [7 x i8] c"%d%d%s\00", align 1
@.str.6 = private unnamed_addr constant [3 x i8] c"BA\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
ret i32 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i32 %a, %b
%sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true)
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%mul = shl nsw i32 %rem, 1
%cmp.not = icmp sge i32 %mul, %b
%div1 = sdiv i32 %a, %b
%add = zext i1 %cmp.not to i32
%retval.0 = add nsw i32 %div1, %add
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i32 %a, %b
%cmp = icmp ne i32 %rem, 0
%div = sdiv i32 %a, %b
%add = zext i1 %cmp to i32
%retval.0 = add nsw i32 %div, %add
ret i32 %retval.0
}
; 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:
%cmp.not4 = icmp eq i32 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i32 %a.addr.06, %b.addr.05
%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.05, %while.body ]
ret i32 %a.addr.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i32 %b, 0
br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i32 %a.addr.06.i, %b.addr.05.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, %entry
%a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i32 %a, %a.addr.0.lcssa.i
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i32 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i32 %a, 1
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, 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 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i32 %add, %i.07
%mul = mul nsw i32 %r.08, %sub
%div = sdiv i32 %mul, %i.07
%inc = add nuw i32 %i.07, 1
%sub.1 = sub i32 %add, %inc
%mul.1 = mul nsw i32 %div, %sub.1
%div.1 = sdiv i32 %mul.1, %inc
%inc.1 = add nuw i32 %i.07, 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 !7
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.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
%sub.epil = sub i32 %add, %i.07.unr
%mul.epil = mul nsw i32 %r.08.unr, %sub.epil
%div.epil = sdiv i32 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i32 %b, %a
%cmp.not6.i = icmp slt i32 %b, 1
br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i32 %b, 1
%0 = icmp eq i32 %b, 1
br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i32 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i32 %add, %i.07.i
%mul.i = mul nsw i32 %sub.i, %r.08.i
%div.i = sdiv i32 %mul.i, %i.07.i
%inc.i = add nuw i32 %i.07.i, 1
%sub.i.1 = sub i32 %add, %inc.i
%mul.i.1 = mul nsw i32 %sub.i.1, %div.i
%div.i.1 = sdiv i32 %mul.i.1, %inc.i
%inc.i.1 = add nuw i32 %i.07.i, 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 %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7
nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i32 %add, %i.07.i.unr
%mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr
br label %nCr.exit
nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i32 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i32 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %a, 8
br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %a, -8
%ind.end = or i32 %n.vec, 1
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> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = mul <4 x i32> %vec.phi, %vec.ind
%1 = mul <4 x i32> %vec.phi7, %step.add
%index.next = add nuw i32 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %a
br i1 %cmp.n, label %for.end, label %for.body.preheader9
for.body.preheader9: ; preds = %for.body.preheader, %middle.block
%r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader9, %for.body
%r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ]
%i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ]
%mul = mul nsw i32 %r.06, %i.05
%inc = add nuw i32 %i.05, 1
%exitcond.not = icmp eq i32 %i.05, %a
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i32 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%min.iters.check = icmp ult i32 %b, 8
br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i32 %b, -8
%ind.end = or i32 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ]
%vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ]
%0 = mul <4 x i32> %vec.phi, %broadcast.splat
%1 = mul <4 x i32> %vec.phi6, %broadcast.splat
%index.next = add nuw i32 %index, 8
%2 = icmp eq i32 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = mul <4 x i32> %1, %0
%3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i32 %n.vec, %b
br i1 %cmp.n, label %for.end, label %for.body.preheader7
for.body.preheader7: ; preds = %for.body.preheader, %middle.block
%r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ]
%i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.body: ; preds = %for.body.preheader7, %for.body
%r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ]
%i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ]
%mul = mul nsw i32 %r.05, %a
%inc = add nuw i32 %i.04, 1
%exitcond.not = icmp eq i32 %i.04, %b
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13
for.end: ; preds = %for.body, %middle.block, %entry
%r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsum(i32 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i32 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.05, 10
%add = add nsw i32 %r.06, %rem
%div = sdiv i32 %x.addr.05, 10
%x.addr.05.off = add i32 %x.addr.05, 9
%tobool.not = icmp ult i32 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @dsumb(i32 noundef %x, i32 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i32 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i32 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i32 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i32 %x.addr.06, %b
%add = add nsw i32 %rem, %r.07
%div = sdiv i32 %x.addr.06, %b
%tobool.not = icmp eq i32 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !15
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
ret i32 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @sankaku(i32 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i32 %x, 1
%mul = mul nsw i32 %add, %x
%div = sdiv i32 %mul, 2
ret i32 %div
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
ret i64 %a.b
}
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 {
entry:
%sub5 = sub nsw i64 %a, %b
%sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true)
ret i64 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%mul = shl nsw i64 %rem, 1
%cmp.not = icmp sge i64 %mul, %b
%div1 = sdiv i64 %a, %b
%add = zext i1 %cmp.not to i64
%retval.0 = add nsw i64 %div1, %add
ret i64 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 {
entry:
%rem = srem i64 %a, %b
%cmp = icmp ne i64 %rem, 0
%div = sdiv i64 %a, %b
%add = zext i1 %cmp to i64
%retval.0 = add nsw i64 %div, %add
ret i64 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp eq i64 %b, 0
br i1 %cmp.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ]
%b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ]
%rem = srem i64 %a.addr.06, %b.addr.05
%cmp.not = icmp eq i64 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !16
while.end: ; preds = %while.body, %entry
%a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ]
ret i64 %a.addr.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not4.i = icmp eq i64 %b, 0
br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ]
%b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ]
%rem.i = srem i64 %a.addr.06.i, %b.addr.05.i
%cmp.not.i = icmp eq i64 %rem.i, 0
br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !16
llgcd.exit: ; preds = %while.body.i, %entry
%a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ]
%div = sdiv i64 %a, %a.addr.0.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not6 = icmp slt i64 %b, 1
br i1 %cmp.not6, label %for.end, label %for.body.lr.ph
for.body.lr.ph: ; preds = %entry
%add = add nsw i64 %a, 1
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i64 %b, -2
br label %for.body
for.body: ; preds = %for.body, %for.body.lr.ph.new
%r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ]
%i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%sub = sub i64 %add, %i.07
%mul = mul nsw i64 %r.08, %sub
%div = sdiv i64 %mul, %i.07
%inc = add nuw i64 %i.07, 1
%sub.1 = sub i64 %add, %inc
%mul.1 = mul nsw i64 %div, %sub.1
%div.1 = sdiv i64 %mul.1, %inc
%inc.1 = add nuw i64 %i.07, 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 !17
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ]
%r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ]
%i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.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
%sub.epil = sub i64 %add, %i.07.unr
%mul.epil = mul nsw i64 %r.08.unr, %sub.epil
%div.epil = sdiv i64 %mul.epil, %i.07.unr
br label %for.end
for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%add = add nsw i64 %b, %a
%cmp.not6.i = icmp slt i64 %b, 1
br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader
for.body.i.preheader: ; preds = %entry
%xtraiter = and i64 %b, 1
%0 = icmp eq i64 %b, 1
br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i64 %b, -2
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ]
%i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ]
%niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ]
%sub.i = sub i64 %add, %i.07.i
%mul.i = mul nsw i64 %sub.i, %r.08.i
%div.i = sdiv i64 %mul.i, %i.07.i
%inc.i = add nuw i64 %i.07.i, 1
%sub.i.1 = sub i64 %add, %inc.i
%mul.i.1 = mul nsw i64 %sub.i.1, %div.i
%div.i.1 = sdiv i64 %mul.i.1, %inc.i
%inc.i.1 = add nuw i64 %i.07.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 %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !17
llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ]
%i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa
%sub.i.epil = sub i64 %add, %i.07.i.unr
%mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr
%div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr
br label %llnCr.exit
llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry
%r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ]
ret i64 %r.0.lcssa.i
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 {
entry:
%cmp.not4 = icmp slt i64 %a, 1
br i1 %cmp.not4, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %a, 7
%0 = icmp ult i64 %a, 8
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 %a, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.06, %i.05
%inc = add nuw nsw i64 %i.05, 1
%mul.1 = mul nsw i64 %mul, %inc
%inc.1 = add nuw nsw i64 %i.05, 2
%mul.2 = mul nsw i64 %mul.1, %inc.1
%inc.2 = add nuw nsw i64 %i.05, 3
%mul.3 = mul nsw i64 %mul.2, %inc.2
%inc.3 = add nuw nsw i64 %i.05, 4
%mul.4 = mul nsw i64 %mul.3, %inc.3
%inc.4 = add nuw nsw i64 %i.05, 5
%mul.5 = mul nsw i64 %mul.4, %inc.4
%inc.5 = add nuw nsw i64 %i.05, 6
%mul.6 = mul nsw i64 %mul.5, %inc.5
%inc.6 = add nuw i64 %i.05, 7
%mul.7 = mul nsw i64 %mul.6, %inc.6
%inc.7 = add nuw i64 %i.05, 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.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !18
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %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
%r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ]
%i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.06.epil, %i.05.epil
%inc.epil = add nuw i64 %i.05.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 !19
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 {
entry:
%cmp.not3 = icmp slt i64 %b, 1
br i1 %cmp.not3, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %b, 7
%0 = icmp ult i64 %b, 8
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 %b, -8
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = mul nsw i64 %r.05, %a
%mul.1 = mul nsw i64 %mul, %a
%mul.2 = mul nsw i64 %mul.1, %a
%mul.3 = mul nsw i64 %mul.2, %a
%mul.4 = mul nsw i64 %mul.3, %a
%mul.5 = mul nsw i64 %mul.4, %a
%mul.6 = mul nsw i64 %mul.5, %a
%mul.7 = mul nsw i64 %mul.6, %a
%niter.next.7 = add i64 %niter, 8
%niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !21
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ]
%r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%mul.epil = mul nsw i64 %r.05.epil, %a
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !22
for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry
%r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsum(i64 noundef %x) local_unnamed_addr #2 {
entry:
%tobool.not4 = icmp eq i64 %x, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.06 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.05 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.05, 10
%add = add nsw i64 %r.06, %rem
%div = sdiv i64 %x.addr.05, 10
%x.addr.05.off = add i64 %x.addr.05, 9
%tobool.not = icmp ult i64 %x.addr.05.off, 19
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !23
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @lldsumb(i64 noundef %x, i64 noundef %b) local_unnamed_addr #2 {
entry:
%tobool.not5 = icmp eq i64 %x, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.07 = phi i64 [ %add, %while.body ], [ 0, %entry ]
%x.addr.06 = phi i64 [ %div, %while.body ], [ %x, %entry ]
%rem = srem i64 %x.addr.06, %b
%add = add nsw i64 %rem, %r.07
%div = sdiv i64 %x.addr.06, %b
%tobool.not = icmp eq i64 %div, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !24
while.end: ; preds = %while.body, %entry
%r.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ]
ret i64 %r.0.lcssa
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i64 @llsankaku(i64 noundef %x) local_unnamed_addr #1 {
entry:
%add = add nsw i64 %x, 1
%mul = mul nsw i64 %add, %x
%div = sdiv i64 %mul, 2
ret i64 %div
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp ogt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp = fcmp olt double %a, %b
%a.b = select i1 %cmp, double %a, double %b
ret double %a.b
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 {
entry:
%cmp.i = fcmp ogt double %a, %b
%a.b.i = select i1 %cmp.i, double %a, double %b
%cmp.i4 = fcmp olt double %a, %b
%a.b.i5 = select i1 %cmp.i4, double %a, double %b
%sub = fsub double %a.b.i, %a.b.i5
ret double %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !25
%1 = load i32, ptr %b, align 4, !tbaa !25
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !25
%1 = load i32, ptr %b, align 4, !tbaa !25
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !29
%1 = load i64, ptr %b, align 8, !tbaa !29
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp ne i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp ogt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load double, ptr %a, align 8, !tbaa !31
%1 = load double, ptr %b, align 8, !tbaa !31
%cmp = fcmp olt double %0, %1
%cmp1 = fcmp une double %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #14
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #14
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp sgt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @chsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i8, ptr %a, align 1, !tbaa !33
%1 = load i8, ptr %b, align 1, !tbaa !33
%cmp = icmp slt i8 %0, %1
%cmp5 = icmp ne i8 %0, %1
%. = sext i1 %cmp5 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nounwind uwtable
define dso_local void @shuffledget(ptr noundef %x, i32 noundef %n) local_unnamed_addr #7 {
entry:
%b = alloca [524288 x i32], align 16
%call = tail call i64 @time(ptr noundef null) #15
%conv = trunc i64 %call to i32
tail call void @srand(i32 noundef %conv) #15
call void @llvm.lifetime.start.p0(i64 2097152, ptr nonnull %b) #15
%cmp44 = icmp sgt i32 %n, 0
br i1 %cmp44, label %for.body.preheader, label %for.end29
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%min.iters.check = icmp ult i32 %n, 8
br i1 %min.iters.check, label %for.body.preheader61, 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.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
%step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
%0 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %index
store <4 x i32> %vec.ind, ptr %0, align 16, !tbaa !25
%1 = getelementptr inbounds i32, ptr %0, i64 4
store <4 x i32> %step.add, ptr %1, align 16, !tbaa !25
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%2 = icmp eq i64 %index.next, %n.vec
br i1 %2, label %middle.block, label %vector.body, !llvm.loop !34
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond2.preheader, label %for.body.preheader61
for.body.preheader61: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ]
br label %for.body
for.cond2.preheader: ; preds = %for.body, %middle.block
br i1 %cmp44, label %for.body5.preheader, label %for.end29
for.body5.preheader: ; preds = %for.cond2.preheader
%3 = zext i32 %n to i64
br label %for.body5
for.body: ; preds = %for.body.preheader61, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader61 ]
%arrayidx = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv
%4 = trunc i64 %indvars.iv to i32
store i32 %4, ptr %arrayidx, align 4, !tbaa !25
%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.cond2.preheader, label %for.body, !llvm.loop !35
for.cond18.preheader: ; preds = %for.body5
br i1 %cmp44, label %for.body21.preheader, label %for.end29
for.body21.preheader: ; preds = %for.cond18.preheader
%wide.trip.count58 = zext i32 %n to i64
br label %for.body21
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv51 = phi i64 [ %3, %for.body5.preheader ], [ %indvars.iv.next52, %for.body5 ]
%call6 = tail call i32 @rand() #15
%5 = trunc i64 %indvars.iv51 to i32
%rem = srem i32 %call6, %5
%indvars.iv.next52 = add nsw i64 %indvars.iv51, -1
%idxprom7 = and i64 %indvars.iv.next52, 4294967295
%arrayidx8 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom7
%6 = load i32, ptr %arrayidx8, align 4, !tbaa !25
%idxprom9 = sext i32 %rem to i64
%arrayidx10 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %idxprom9
%7 = load i32, ptr %arrayidx10, align 4, !tbaa !25
store i32 %7, ptr %arrayidx8, align 4, !tbaa !25
store i32 %6, ptr %arrayidx10, align 4, !tbaa !25
%cmp3 = icmp ugt i64 %indvars.iv51, 1
br i1 %cmp3, label %for.body5, label %for.cond18.preheader, !llvm.loop !36
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv54 = phi i64 [ 0, %for.body21.preheader ], [ %indvars.iv.next55, %for.body21 ]
%arrayidx23 = getelementptr inbounds [524288 x i32], ptr %b, i64 0, i64 %indvars.iv54
%8 = load i32, ptr %arrayidx23, align 4, !tbaa !25
%idxprom24 = sext i32 %8 to i64
%arrayidx25 = getelementptr inbounds i32, ptr %x, i64 %idxprom24
%call26 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx25)
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond59.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count58
br i1 %exitcond59.not, label %for.end29, label %for.body21, !llvm.loop !37
for.end29: ; preds = %for.body21, %entry, %for.cond2.preheader, %for.cond18.preheader
call void @llvm.lifetime.end.p0(i64 2097152, ptr nonnull %b) #15
ret void
}
; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #8
; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #8
; Function Attrs: nounwind
declare i32 @rand() local_unnamed_addr #8
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @search(i32 noundef %x, ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #10 {
entry:
%cmp.not9 = icmp slt i32 %n, 1
br i1 %cmp.not9, label %while.end, label %while.body.preheader
while.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
br label %while.body
while.body: ; preds = %while.body.preheader, %while.body
%st.011 = phi i32 [ %st.1, %while.body ], [ 0, %while.body.preheader ]
%fi.010 = phi i32 [ %fi.1, %while.body ], [ %sub, %while.body.preheader ]
%add = add nsw i32 %st.011, %fi.010
%div = sdiv i32 %add, 2
%idxprom = sext i32 %div to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !25
%cmp1 = icmp slt i32 %0, %x
%add2 = add nsw i32 %div, 1
%sub3 = add nsw i32 %div, -1
%fi.1 = select i1 %cmp1, i32 %fi.010, i32 %sub3
%st.1 = select i1 %cmp1, i32 %add2, i32 %st.011
%cmp.not = icmp sgt i32 %st.1, %fi.1
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !38
while.end: ; preds = %while.body, %entry
%st.0.lcssa = phi i32 [ 0, %entry ], [ %st.1, %while.body ]
ret i32 %st.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @prarr(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #11 {
entry:
%cmp7 = icmp sgt i32 %n, 0
br i1 %cmp7, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%.pre = load i32, ptr %arr, align 4, !tbaa !25
%call1.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %n, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar6 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !25
%call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !39
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #9
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @sdsortfnc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !41
%1 = load i32, ptr %b, align 4, !tbaa !41
%cmp = icmp slt i32 %0, %1
%cmp4 = icmp sgt i32 %0, %1
%. = zext i1 %cmp4 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #11 {
entry:
%k = alloca i32, align 4
%l = alloca i32, align 4
%s = alloca [524288 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #15
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #15
call void @llvm.lifetime.start.p0(i64 524288, ptr nonnull %s) #15
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %l, ptr noundef nonnull %k, ptr noundef nonnull %s)
%0 = load i32, ptr %l, align 4, !tbaa !25
%k.promoted = load i32, ptr %k, align 4, !tbaa !25
br label %while.cond
while.cond: ; preds = %if.end39, %entry
%dec127 = phi i32 [ %k.promoted, %entry ], [ %dec, %if.end39 ]
%i.0 = phi i32 [ 0, %entry ], [ %i.1, %if.end39 ]
%t.0 = phi i32 [ 1, %entry ], [ %t.1, %if.end39 ]
%idxprom = sext i32 %i.0 to i64
%arrayidx = getelementptr inbounds [524288 x i8], ptr %s, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 1, !tbaa !33
%cmp = icmp eq i8 %1, 65
%cmp2 = icmp eq i32 %t.0, 1
%or.cond = select i1 %cmp, i1 %cmp2, i1 false
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %while.cond
store i8 66, ptr %arrayidx, align 1, !tbaa !33
br label %if.end18
if.else: ; preds = %while.cond
%cmp9 = icmp eq i8 %1, 66
%cmp12 = icmp eq i32 %t.0, -1
%or.cond97 = select i1 %cmp9, i1 %cmp12, i1 false
br i1 %or.cond97, label %if.then14, label %if.else17
if.then14: ; preds = %if.else
store i8 65, ptr %arrayidx, align 1, !tbaa !33
br label %if.end18
if.else17: ; preds = %if.else
%inc = add nsw i32 %i.0, 1
%mul = sub nsw i32 0, %t.0
br label %if.end18
if.end18: ; preds = %if.then14, %if.else17, %if.then
%i.1 = phi i32 [ %i.0, %if.then ], [ %i.0, %if.then14 ], [ %inc, %if.else17 ]
%t.1 = phi i32 [ 1, %if.then ], [ -1, %if.then14 ], [ %mul, %if.else17 ]
%dec = add nsw i32 %dec127, -1
%cmp19 = icmp eq i32 %i.1, %0
br i1 %cmp19, label %if.then21, label %if.end39
if.then21: ; preds = %if.end18
store i32 %dec, ptr %k, align 4, !tbaa !25
%2 = and i32 %0, -2147483647
%cmp22 = icmp eq i32 %2, 1
br i1 %cmp22, label %if.then24, label %if.end33
if.then24: ; preds = %if.then21
%3 = and i32 %dec, -2147483647
%cmp26 = icmp eq i32 %3, 1
%. = select i1 %cmp26, i32 66, i32 65
%putchar121 = call i32 @putchar(i32 %.)
br label %if.end33
if.end33: ; preds = %if.then24, %if.then21
%4 = load i32, ptr %l, align 4, !tbaa !25
%cmp34135 = icmp sgt i32 %4, 1
br i1 %cmp34135, label %for.body, label %cleanup
for.body: ; preds = %if.end33, %for.body
%i.2136 = phi i32 [ %inc37, %for.body ], [ 0, %if.end33 ]
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
%inc37 = add nuw nsw i32 %i.2136, 1
%5 = load i32, ptr %l, align 4, !tbaa !25
%div = sdiv i32 %5, 2
%cmp34 = icmp slt i32 %inc37, %div
br i1 %cmp34, label %for.body, label %cleanup, !llvm.loop !43
if.end39: ; preds = %if.end18
%cmp40 = icmp eq i32 %dec, 0
br i1 %cmp40, label %while.cond44.preheader, label %while.cond
while.cond44.preheader: ; preds = %if.end39
store i32 0, ptr %k, align 4, !tbaa !25
%cmp45130 = icmp slt i32 %i.1, %0
br i1 %cmp45130, label %while.body47.lr.ph, label %while.cond69.preheader
while.body47.lr.ph: ; preds = %while.cond44.preheader
%cmp48 = icmp eq i32 %t.1, 1
%6 = sext i32 %i.1 to i64
br i1 %cmp48, label %while.body47.us, label %while.body47
while.body47.us: ; preds = %while.body47.lr.ph, %while.body47.us
%indvars.iv142 = phi i64 [ %indvars.iv.next143, %while.body47.us ], [ %6, %while.body47.lr.ph ]
%arrayidx52.us = getelementptr inbounds [524288 x i8], ptr %s, i64 0, i64 %indvars.iv142
%7 = load i8, ptr %arrayidx52.us, align 1, !tbaa !33
%conv53.us = sext i8 %7 to i32
%putchar119.us = call i32 @putchar(i32 %conv53.us)
%indvars.iv.next143 = add nsw i64 %indvars.iv142, 1
%8 = load i32, ptr %l, align 4, !tbaa !25
%9 = sext i32 %8 to i64
%cmp45.us = icmp slt i64 %indvars.iv.next143, %9
br i1 %cmp45.us, label %while.body47.us, label %while.cond69.preheader, !llvm.loop !44
while.cond69.preheader: ; preds = %while.body47, %while.body47.us, %while.cond44.preheader
%cmp70132 = icmp sgt i32 %i.1, 0
br i1 %cmp70132, label %while.body72, label %cleanup
while.body47: ; preds = %while.body47.lr.ph, %while.body47
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body47 ], [ %6, %while.body47.lr.ph ]
%arrayidx57 = getelementptr inbounds [524288 x i8], ptr %s, i64 0, i64 %indvars.iv
%10 = load i8, ptr %arrayidx57, align 1, !tbaa !33
%cmp59 = icmp eq i8 %10, 65
%.151 = select i1 %cmp59, i32 66, i32 65
%putchar118 = call i32 @putchar(i32 %.151)
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%11 = load i32, ptr %l, align 4, !tbaa !25
%12 = sext i32 %11 to i64
%cmp45 = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp45, label %while.body47, label %while.cond69.preheader, !llvm.loop !44
while.body72: ; preds = %while.cond69.preheader, %while.body72
%c.0133 = phi i32 [ %dec81, %while.body72 ], [ %i.1, %while.cond69.preheader ]
%rem73 = and i32 %c.0133, 1
%cmp74.not = icmp eq i32 %rem73, 0
%.152 = select i1 %cmp74.not, i32 66, i32 65
%putchar115 = call i32 @putchar(i32 %.152)
%dec81 = add nsw i32 %c.0133, -1
%cmp70 = icmp sgt i32 %c.0133, 1
br i1 %cmp70, label %while.body72, label %cleanup, !llvm.loop !45
cleanup: ; preds = %while.body72, %for.body, %while.cond69.preheader, %if.end33
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 524288, ptr nonnull %s) #15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #15
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #15
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.abs.i64(i64, i1 immarg) #13
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #13
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { 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 #11 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { nofree nounwind }
attributes #13 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #14 = { nounwind willreturn memory(read) }
attributes #15 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = distinct !{!8, !6, !9, !10}
!9 = !{!"llvm.loop.isvectorized", i32 1}
!10 = !{!"llvm.loop.unroll.runtime.disable"}
!11 = distinct !{!11, !6, !10, !9}
!12 = distinct !{!12, !6, !9, !10}
!13 = distinct !{!13, !6, !10, !9}
!14 = distinct !{!14, !6}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}
!18 = distinct !{!18, !6}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.unroll.disable"}
!21 = distinct !{!21, !6}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !6}
!24 = distinct !{!24, !6}
!25 = !{!26, !26, i64 0}
!26 = !{!"int", !27, i64 0}
!27 = !{!"omnipotent char", !28, i64 0}
!28 = !{!"Simple C/C++ TBAA"}
!29 = !{!30, !30, i64 0}
!30 = !{!"long long", !27, i64 0}
!31 = !{!32, !32, i64 0}
!32 = !{!"double", !27, i64 0}
!33 = !{!27, !27, i64 0}
!34 = distinct !{!34, !6, !9, !10}
!35 = distinct !{!35, !6, !10, !9}
!36 = distinct !{!36, !6}
!37 = distinct !{!37, !6}
!38 = distinct !{!38, !6}
!39 = distinct !{!39, !6, !40}
!40 = !{!"llvm.loop.peeled.count", i32 1}
!41 = !{!42, !26, i64 0}
!42 = !{!"", !26, i64 0, !26, i64 4}
!43 = distinct !{!43, !6}
!44 = distinct !{!44, !6}
!45 = distinct !{!45, !6}
|
#include <stdio.h>
#define MAX 100
int main()
{
int a, b;
char s[MAX];
scanf("%d %d",&a,&b);
scanf("%s",s);
s[b-1]+='a'-'A';
printf("%s\n",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_209956/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_209956/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\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
%s = alloca [100 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %b, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [100 x i8], ptr %s, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%add = add i8 %1, 32
store i8 %add, ptr %arrayidx, align 1, !tbaa !9
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %s)
call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include <stdio.h>
#include <math.h>
int isPrime(int number);
int main() {
int setTotal;
scanf("%d", &setTotal);
int text[100];
for (int setIndex = 0; setIndex < setTotal; setIndex++) {
int n;
scanf("%d", &n);
scanf("%d", &text[0]);
int compositeSum = text[0];
int min = (text[0] % 2) ? text[0] : 0;
int length = 1;
int minIndex = min ? 0 : -1;
for (int i = 1; i < n; i++) {
scanf("%d", &text[i]);
compositeSum += text[i];
if (!min && (text[i] % 2)) {
min = text[i];
minIndex = i;
}
length++;
}
if (isPrime(compositeSum)) {
printf("%d\n", length - 1);
for (int i = 0; i < length; i++) {
if (i != minIndex) {
printf("%d ", i + 1);
}
}
printf("\n");
} else {
printf("%d\n", length);
for (int i = 0; i < length; i++) {
printf("%d ", i + 1);
}
printf("\n");
}
}
return 0;
}
int isPrime(int number) {
int edge = sqrt(number);
for (int i = 2; i <= sqrt(number); i++) {
if (number % i == 0) {
return 0;
}
}
return 1;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_21/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_21/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%setTotal = alloca i32, align 4
%text = alloca [100 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %setTotal) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %setTotal)
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %text) #6
%0 = load i32, ptr %setTotal, align 4, !tbaa !5
%cmp90 = icmp sgt i32 %0, 0
br i1 %cmp90, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.end54, %entry
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %text) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %setTotal) #6
ret i32 0
for.body: ; preds = %entry, %if.end54
%setIndex.091 = phi i32 [ %inc56, %if.end54 ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %text)
%1 = load i32, ptr %text, align 16
%2 = and i32 %1, 1
%tobool.not = icmp eq i32 %2, 0
%cond = select i1 %tobool.not, i32 0, i32 %1
%tobool6.not = icmp eq i32 %cond, 0
%cond7 = sext i1 %tobool6.not to i32
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp980 = icmp sgt i32 %3, 1
br i1 %cmp980, label %for.body11, label %for.cond.cleanup10
for.cond.cleanup10.loopexit: ; preds = %for.body11
%indvars93 = trunc i64 %indvars.iv.next to i32
br label %for.cond.cleanup10
for.cond.cleanup10: ; preds = %for.cond.cleanup10.loopexit, %for.body
%compositeSum.0.lcssa = phi i32 [ %1, %for.body ], [ %add, %for.cond.cleanup10.loopexit ]
%length.0.lcssa = phi i32 [ 1, %for.body ], [ %indvars93, %for.cond.cleanup10.loopexit ]
%minIndex.0.lcssa = phi i32 [ %cond7, %for.body ], [ %minIndex.1, %for.cond.cleanup10.loopexit ]
%conv.i = sitofp i32 %compositeSum.0.lcssa to double
%4 = icmp slt i32 %compositeSum.0.lcssa, 0
br i1 %4, label %cdce.call, label %cdce.end.i, !prof !9
cdce.call: ; preds = %for.cond.cleanup10
%call.i = call double @sqrt(double noundef %conv.i) #6
br label %cdce.end.i
cdce.end.i: ; preds = %cdce.call, %for.cond.cleanup10
%call413.i = call double @sqrt(double noundef %conv.i) #6
%cmp14.i = fcmp ult double %call413.i, 2.000000e+00
br i1 %cmp14.i, label %if.then26, label %for.body.i
for.cond.i: ; preds = %for.body.i
%inc.i = add nuw nsw i32 %i.015.i, 1
%conv2.i = sitofp i32 %inc.i to double
%call4.i = call double @sqrt(double noundef %conv.i) #6
%cmp.i = fcmp ult double %call4.i, %conv2.i
br i1 %cmp.i, label %if.then26, label %for.body.i, !llvm.loop !10
for.body.i: ; preds = %cdce.end.i, %for.cond.i
%i.015.i = phi i32 [ %inc.i, %for.cond.i ], [ 2, %cdce.end.i ]
%rem.i = srem i32 %compositeSum.0.lcssa, %i.015.i
%cmp6.i = icmp eq i32 %rem.i, 0
br i1 %cmp6.i, label %if.else, label %for.cond.i
for.body11: ; preds = %for.body, %for.body11
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body11 ], [ 1, %for.body ]
%minIndex.084 = phi i32 [ %minIndex.1, %for.body11 ], [ %cond7, %for.body ]
%min.082 = phi i32 [ %min.1, %for.body11 ], [ %cond, %for.body ]
%compositeSum.081 = phi i32 [ %add, %for.body11 ], [ %1, %for.body ]
%arrayidx12 = getelementptr inbounds [100 x i32], ptr %text, i64 0, i64 %indvars.iv
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx12)
%5 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%add = add nsw i32 %5, %compositeSum.081
%tobool16.not = icmp eq i32 %min.082, 0
%6 = and i32 %5, 1
%tobool20.not = icmp eq i32 %6, 0
%spec.select = select i1 %tobool20.not, i32 0, i32 %5
%7 = trunc i64 %indvars.iv to i32
%spec.select77 = select i1 %tobool20.not, i32 %minIndex.084, i32 %7
%min.1 = select i1 %tobool16.not, i32 %spec.select, i32 %min.082
%minIndex.1 = select i1 %tobool16.not, i32 %spec.select77, i32 %minIndex.084
%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
%cmp9 = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp9, label %for.body11, label %for.cond.cleanup10.loopexit, !llvm.loop !12
if.then26: ; preds = %for.cond.i, %cdce.end.i
%sub = add nsw i32 %length.0.lcssa, -1
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
br label %for.body32
for.body32: ; preds = %if.then26, %for.inc38
%i28.089 = phi i32 [ 0, %if.then26 ], [ %.pre, %for.inc38 ]
%cmp33.not = icmp eq i32 %i28.089, %minIndex.0.lcssa
%.pre = add nuw nsw i32 %i28.089, 1
br i1 %cmp33.not, label %for.inc38, label %if.then34
if.then34: ; preds = %for.body32
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.pre)
br label %for.inc38
for.inc38: ; preds = %for.body32, %if.then34
%exitcond95.not = icmp eq i32 %.pre, %length.0.lcssa
br i1 %exitcond95.not, label %if.end54, label %for.body32, !llvm.loop !13
if.else: ; preds = %for.body.i
%call42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %length.0.lcssa)
br label %for.body47
for.body47: ; preds = %if.else, %for.body47
%i43.088 = phi i32 [ 0, %if.else ], [ %add48, %for.body47 ]
%add48 = add nuw nsw i32 %i43.088, 1
%call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add48)
%exitcond.not = icmp eq i32 %add48, %length.0.lcssa
br i1 %exitcond.not, label %if.end54, label %for.body47, !llvm.loop !14
if.end54: ; preds = %for.body47, %for.inc38
%putchar = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
%inc56 = add nuw nsw i32 %setIndex.091, 1
%10 = load i32, ptr %setTotal, align 4, !tbaa !5
%cmp = icmp slt i32 %inc56, %10
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind memory(write) uwtable
define dso_local i32 @isPrime(i32 noundef %number) local_unnamed_addr #3 {
entry:
%conv = sitofp i32 %number to double
%0 = icmp slt i32 %number, 0
br i1 %0, label %cdce.call, label %cdce.end, !prof !9
cdce.call: ; preds = %entry
%call = tail call double @sqrt(double noundef %conv) #6
br label %cdce.end
cdce.end: ; preds = %entry, %cdce.call
%call413 = tail call double @sqrt(double noundef %conv) #6
%cmp14 = fcmp ult double %call413, 2.000000e+00
br i1 %cmp14, label %cleanup8, label %for.body
for.cond: ; preds = %for.body
%inc = add nuw nsw i32 %i.015, 1
%conv2 = sitofp i32 %inc to double
%call4 = tail call double @sqrt(double noundef %conv) #6
%cmp = fcmp ult double %call4, %conv2
br i1 %cmp, label %cleanup8, label %for.body, !llvm.loop !10
for.body: ; preds = %cdce.end, %for.cond
%i.015 = phi i32 [ %inc, %for.cond ], [ 2, %cdce.end ]
%rem = srem i32 %number, %i.015
%cmp6 = icmp eq i32 %rem, 0
br i1 %cmp6, label %cleanup8, label %for.cond
cleanup8: ; preds = %for.body, %for.cond, %cdce.end
%retval.1 = phi i32 [ 1, %cdce.end ], [ 1, %for.cond ], [ 0, %for.body ]
ret i32 %retval.1
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #4
; 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 = { nofree nounwind memory(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 #4 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"branch_weights", i32 1, i32 2000}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !11}
!15 = distinct !{!15, !11}
|
#include<stdio.h>
#include<string.h>
int main()
{
int a,b,i;
char n[50];
scanf("%d%d%s",&a,&b,&n);
n[b-1]+=32;
printf("%s",n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210055/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210055/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%n = alloca [50 x i8], align 16
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 50, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %n)
%0 = load i32, ptr %b, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [50 x i8], ptr %n, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%add = add i8 %1, 32
store i8 %add, ptr %arrayidx, align 1, !tbaa !9
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %n)
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %n) #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 = !{!7, !7, i64 0}
|
#include<stdio.h>
#include<ctype.h>
int main(void)
{
int n,k,c;
char s[55];
scanf("%d%d%s",&n,&k,s);
c=tolower(s[k-1]);
s[k-1]=c;
printf("%s",s);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210099/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210099/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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%s\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
%s = alloca [55 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.start.p0(i64 55, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %s)
%call1 = tail call ptr @__ctype_tolower_loc() #5
%0 = load ptr, ptr %call1, align 8, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !9
%sub = add nsw i32 %1, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [55 x i8], ptr %s, i64 0, i64 %idxprom
%2 = load i8, ptr %arrayidx, align 1, !tbaa !11
%idxprom2 = sext i8 %2 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %0, i64 %idxprom2
%3 = load i32, ptr %arrayidx3, align 4, !tbaa !9
%conv4 = trunc i32 %3 to i8
store i8 %conv4, ptr %arrayidx, align 1, !tbaa !11
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 55, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_tolower_loc() local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
|
#include<stdio.h>
int main(){
int n,k;
char s[50];
scanf("%d %d",&n,&k);
scanf("%s",s);
s[k-1] += 32;
printf("%s",s);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210141/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210141/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\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
%s = alloca [50 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %s) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s)
%0 = load i32, ptr %k, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [50 x i8], ptr %s, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%add = add i8 %1, 32
store i8 %add, ptr %arrayidx, align 1, !tbaa !9
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %s)
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %s) #3
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"}
!9 = !{!7, !7, i64 0}
|
#include<stdio.h>
int main(){
char str[51];
int N,i;
scanf("%d %d",&N,&i);
scanf("%s",str);
str[i-1] += 'a'-'A';
printf("%s\n",str);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210185/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210185/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [51 x i8], align 16
%N = alloca i32, align 4
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 51, ptr nonnull %str) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %i)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %str)
%0 = load i32, ptr %i, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [51 x i8], ptr %str, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%add = add i8 %1, 32
store i8 %add, ptr %arrayidx, align 1, !tbaa !9
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 51, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include <stdio.h>
#include <ctype.h>
void change_character(int N, int K) {
char S[N+1];
scanf("%s",S);
S[K-1] = tolower(S[K-1]);
printf("%s",S);
}
int main(void) {
int N, K;
scanf("%d%d",&N,&K);
change_character(N,K);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210228/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210228/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @change_character(i32 noundef %N, i32 noundef %K) local_unnamed_addr #0 {
entry:
%add = add nsw i32 %N, 1
%0 = zext i32 %add to i64
%vla = alloca i8, i64 %0, align 16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %vla)
%call1 = tail call ptr @__ctype_tolower_loc() #4
%1 = load ptr, ptr %call1, align 8, !tbaa !5
%sub = add nsw i32 %K, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %idxprom
%2 = load i8, ptr %arrayidx, align 1, !tbaa !9
%idxprom2 = sext i8 %2 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %1, i64 %idxprom2
%3 = load i32, ptr %arrayidx3, align 4, !tbaa !10
%conv4 = trunc i32 %3 to i8
store i8 %conv4, ptr %arrayidx, align 1, !tbaa !9
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %vla)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; 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 nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_tolower_loc() local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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.1, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !10
%1 = load i32, ptr %K, align 4, !tbaa !10
call void @change_character(i32 noundef %0, i32 noundef %1)
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
}
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
|
#include <stdio.h>
int main(int argc, const char * argv[]) {
int N = 0;
int K = 0;
char S[50] = {0};
scanf("%d",&N);
scanf("%d",&K);
scanf("%s",S);
for (int i = 0; i < K; i++) {
if (i+1 == K) {
if (S[i] == 'A') {
S[i] = 'a';
}else if(S[i] == 'B'){
S[i] = 'b';
}else{
S[i] = 'c';
}
}
}
printf("%s",S);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210279/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210279/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
%S = alloca [50 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
store i32 0, ptr %N, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
store i32 0, ptr %K, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %S) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(50) %S, i8 0, i64 50, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S)
%0 = load i32, ptr %K, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%1 = zext i32 %0 to i64
%xtraiter = and i64 %1, 1
%2 = icmp eq i32 %0, 1
br i1 %2, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %1, 4294967294
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.inc.1, %for.body.preheader
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.1, %for.inc.1 ]
%lcmp.mod.not = icmp ne i64 %xtraiter, 0
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.unr, 1
%cmp3.epil = icmp eq i64 %indvars.iv.next.epil, %1
%or.cond = select i1 %lcmp.mod.not, i1 %cmp3.epil, i1 false
br i1 %or.cond, label %if.then.epil, label %for.cond.cleanup
if.then.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa
%arrayidx.epil = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %indvars.iv.unr
%3 = load i8, ptr %arrayidx.epil, align 1, !tbaa !9
%switch.selectcmp.epil = icmp eq i8 %3, 66
%switch.select.epil = select i1 %switch.selectcmp.epil, i8 98, i8 99
%switch.selectcmp34.epil = icmp eq i8 %3, 65
%switch.select35.epil = select i1 %switch.selectcmp34.epil, i8 97, i8 %switch.select.epil
store i8 %switch.select35.epil, ptr %arrayidx.epil, align 1, !tbaa !9
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %if.then.epil, %entry
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %S)
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
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 ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.inc.1 ]
%indvars.iv.next = or i64 %indvars.iv, 1
%cmp3 = icmp eq i64 %indvars.iv.next, %1
br i1 %cmp3, label %if.then, label %for.inc
if.then: ; preds = %for.body
%arrayidx = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %indvars.iv
%4 = load i8, ptr %arrayidx, align 2, !tbaa !9
%switch.selectcmp = icmp eq i8 %4, 66
%switch.select = select i1 %switch.selectcmp, i8 98, i8 99
%switch.selectcmp34 = icmp eq i8 %4, 65
%switch.select35 = select i1 %switch.selectcmp34, i8 97, i8 %switch.select
store i8 %switch.select35, ptr %arrayidx, align 2, !tbaa !9
br label %for.inc
for.inc: ; preds = %if.then, %for.body
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%cmp3.1 = icmp eq i64 %indvars.iv.next.1, %1
br i1 %cmp3.1, label %if.then.1, label %for.inc.1
if.then.1: ; preds = %for.inc
%arrayidx.1 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %indvars.iv.next
%5 = load i8, ptr %arrayidx.1, align 1, !tbaa !9
%switch.selectcmp.1 = icmp eq i8 %5, 66
%switch.select.1 = select i1 %switch.selectcmp.1, i8 98, i8 99
%switch.selectcmp34.1 = icmp eq i8 %5, 65
%switch.select35.1 = select i1 %switch.selectcmp34.1, i8 97, i8 %switch.select.1
store i8 %switch.select35.1, ptr %arrayidx.1, align 1, !tbaa !9
br label %for.inc.1
for.inc.1: ; preds = %if.then.1, %for.inc
%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 !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 K,N;
char S[50];
scanf("%d %d",&N,&K);
scanf("%s",S);
S[K-1]+=0x20;
printf("%s\n",S);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210321/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210321/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%K = alloca i32, align 4
%N = alloca i32, align 4
%S = alloca [50 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %S) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S)
%0 = load i32, ptr %K, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%add = add i8 %1, 32
store i8 %add, ptr %arrayidx, align 1, !tbaa !9
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %S)
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %S) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
|
#include <stdio.h>
int main(){
int N=0,K=0;
char S[50]={};
scanf("%d",&N);
scanf("%d",&K);
scanf("%s",&S);
S[K-1]=S[K-1]-'A'+'a';
for(int i=0;i<N;i++){
printf("%c",S[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210365/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210365/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%K = alloca i32, align 4
%S = alloca [50 x i8], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
store i32 0, ptr %N, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #5
store i32 0, ptr %K, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %S) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(50) %S, i8 0, i64 50, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %K)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S)
%0 = load i32, ptr %K, align 4, !tbaa !5
%sub = add nsw i32 %0, -1
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %idxprom
%1 = load i8, ptr %arrayidx, align 1, !tbaa !9
%add = add i8 %1, 32
store i8 %add, ptr %arrayidx, align 1, !tbaa !9
%2 = load i32, ptr %N, align 4, !tbaa !5
%cmp15 = icmp sgt i32 %2, 0
br i1 %cmp15, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %S) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx10 = getelementptr inbounds [50 x i8], ptr %S, i64 0, i64 %indvars.iv
%3 = load i8, ptr %arrayidx10, align 1, !tbaa !9
%conv11 = sext i8 %3 to i32
%putchar = call i32 @putchar(i32 %conv11)
%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.cond.cleanup, !llvm.loop !10
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <ctype.h>
int main()
{
char str[55];
char ch;
int n, k;
scanf("%d %d", &n, &k);
k--;
for (int i = 0; i < n; i++) {
scanf(" %c", &ch);
if (i == k) {
ch = tolower(ch);
}
putchar(ch);
}
putchar('\n');
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210408/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210408/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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" %c\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:
%ch = alloca i8, align 1
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #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 %k, align 4, !tbaa !5
%dec = add nsw i32 %0, -1
store i32 %dec, ptr %k, align 4, !tbaa !5
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %1, 0
br i1 %cmp11, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.end, %entry
%2 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i = call i32 @putc(i32 noundef 10, ptr noundef %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4
ret i32 0
for.body: ; preds = %entry, %if.end
%i.012 = phi i32 [ %inc, %if.end ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %ch)
%3 = load i32, ptr %k, align 4, !tbaa !5
%cmp2 = icmp eq i32 %i.012, %3
%.pre = load i8, ptr %ch, align 1, !tbaa !11
br i1 %cmp2, label %if.then, label %if.end
if.then: ; preds = %for.body
%call3 = tail call ptr @__ctype_tolower_loc() #5
%4 = load ptr, ptr %call3, align 8, !tbaa !9
%idxprom = sext i8 %.pre to i64
%arrayidx = getelementptr inbounds i32, ptr %4, i64 %idxprom
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv4 = trunc i32 %5 to i8
store i8 %conv4, ptr %ch, align 1, !tbaa !11
br label %if.end
if.end: ; preds = %if.then, %for.body
%6 = phi i8 [ %conv4, %if.then ], [ %.pre, %for.body ]
%conv5 = sext i8 %6 to i32
%7 = load ptr, ptr @stdout, align 8, !tbaa !9
%call.i10 = call i32 @putc(i32 noundef %conv5, ptr noundef %7)
%inc = add nuw nsw i32 %i.012, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %8
br i1 %cmp, label %for.body, label %for.cond.cleanup, !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 nofree nosync nounwind willreturn memory(none)
declare ptr @__ctype_tolower_loc() local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(none) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
|
#include <ctype.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
//char rbuf[]; int rbufl;
//#define getchar() rbuf[rbufl++]
#define getchar getchar_unlocked
#define putchar putchar_unlocked
int32_t nextint(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); bool s=false; if(c=='-'){s=true;c=getchar();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); int s=0; if(c=='-'){s=1;c=getchar();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }
void printint(int32_t x){ if(x<0){x=-x; putchar('-');}else if(x==0){putchar('0');} int d=0; char s[10]; while(x){ s[d]='0'+x%10; x/=10; d++; } for (int i=d-1; i>=0; i--) putchar(s[i]); putchar('\n'); }
void rsorta_d32(void *base, const int count, const int size, const int index){
typedef int32_t rsort_t;
rsort_t (*a)[size] = (rsort_t(*)[size])base;
rsort_t (*b)[size] = (rsort_t(*)[size])malloc(count*size*sizeof(rsort_t));
int c[0x100];
for(int k=0; k<4; k++){
memset(c, 0, sizeof(c)); for(int i=0; i<count; i++){ c[(a[i][index]>>(k<<3))&0xFF]++; } for(int i=1; i<0x100; i++) c[i]+=c[i-1]; for(int i=count-1; i>=0; i--){ int to=--c[(a[i][index]>>(k<<3))&0xFF]; for(int j=0; j<size; j++){ b[to][j]=a[i][j]; } }{rsort_t(*t)[size]=a; a=b; b=t;}
}
free(b);
}
long a[2001];
int main(void){
int n=nextint();
a[0]=1;
for(int i=3; i<=n; i++){
for(int j=0; j<=i-3; j++){
a[i]+=a[j];
}
a[i]%=1000000007;
}
printf("%d\n", a[n]);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210451/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210451/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
%struct._IO_FILE = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i16, i8, [1 x i8], ptr, i64, ptr, ptr, ptr, ptr, i64, i32, [20 x i8] }
@a = dso_local local_unnamed_addr global [2001 x i64] zeroinitializer, align 16
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @nextint() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #8
br label %getchar_unlocked.exit
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%sext72 = shl i32 %cond.i, 24
%cmp.not73 = icmp ne i32 %sext72, 754974720
%4 = add i32 %sext72, -956301313
%5 = icmp ult i32 %4, -150994945
%or.cond74 = and i1 %cmp.not73, %5
br i1 %or.cond74, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %getchar_unlocked.exit
%.pre81 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.preheader, %getchar_unlocked.exit51
%6 = phi ptr [ %.pre81, %while.body.preheader ], [ %10, %getchar_unlocked.exit51 ]
%_IO_read_ptr.i42 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 1
%7 = load ptr, ptr %_IO_read_ptr.i42, align 8, !tbaa !9
%_IO_read_end.i43 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 2
%8 = load ptr, ptr %_IO_read_end.i43, align 8, !tbaa !14
%cmp.not.i44 = icmp ult ptr %7, %8
br i1 %cmp.not.i44, label %cond.false.i48, label %cond.true.i45, !prof !15
cond.true.i45: ; preds = %while.body
%call.i46 = tail call i32 @__uflow(ptr noundef nonnull %6) #8
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit51
cond.false.i48: ; preds = %while.body
%incdec.ptr.i49 = getelementptr inbounds i8, ptr %7, i64 1
store ptr %incdec.ptr.i49, ptr %_IO_read_ptr.i42, align 8, !tbaa !9
%9 = load i8, ptr %7, align 1, !tbaa !16
%conv3.i50 = zext i8 %9 to i32
br label %getchar_unlocked.exit51
getchar_unlocked.exit51: ; preds = %cond.true.i45, %cond.false.i48
%10 = phi ptr [ %.pre, %cond.true.i45 ], [ %6, %cond.false.i48 ]
%cond.i47 = phi i32 [ %call.i46, %cond.true.i45 ], [ %conv3.i50, %cond.false.i48 ]
%sext = shl i32 %cond.i47, 24
%cmp.not = icmp ne i32 %sext, 754974720
%11 = add i32 %sext, -956301313
%12 = icmp ult i32 %11, -150994945
%or.cond = and i1 %cmp.not, %12
br i1 %or.cond, label %while.body, label %while.end, !llvm.loop !17
while.end: ; preds = %getchar_unlocked.exit51, %getchar_unlocked.exit
%c.0.in.lcssa = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %cond.i47, %getchar_unlocked.exit51 ]
%sext.lcssa = phi i32 [ %sext72, %getchar_unlocked.exit ], [ %sext, %getchar_unlocked.exit51 ]
%cmp12 = icmp eq i32 %sext.lcssa, 754974720
br i1 %cmp12, label %if.then, label %if.end
if.then: ; preds = %while.end
%13 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i52 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1
%14 = load ptr, ptr %_IO_read_ptr.i52, align 8, !tbaa !9
%_IO_read_end.i53 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2
%15 = load ptr, ptr %_IO_read_end.i53, align 8, !tbaa !14
%cmp.not.i54 = icmp ult ptr %14, %15
br i1 %cmp.not.i54, label %cond.false.i58, label %cond.true.i55, !prof !15
cond.true.i55: ; preds = %if.then
%call.i56 = tail call i32 @__uflow(ptr noundef nonnull %13) #8
br label %if.end
cond.false.i58: ; preds = %if.then
%incdec.ptr.i59 = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i59, ptr %_IO_read_ptr.i52, align 8, !tbaa !9
%16 = load i8, ptr %14, align 1, !tbaa !16
%conv3.i60 = zext i8 %16 to i32
br label %if.end
if.end: ; preds = %cond.false.i58, %cond.true.i55, %while.end
%c.1.in = phi i32 [ %c.0.in.lcssa, %while.end ], [ %call.i56, %cond.true.i55 ], [ %conv3.i60, %cond.false.i58 ]
%sext4076 = shl i32 %c.1.in, 24
%17 = add i32 %sext4076, -788529153
%18 = icmp ult i32 %17, 184549375
br i1 %18, label %while.body25.preheader, label %while.end29
while.body25.preheader: ; preds = %if.end
%.pre83 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body25
while.body25: ; preds = %while.body25.preheader, %getchar_unlocked.exit71
%19 = phi ptr [ %23, %getchar_unlocked.exit71 ], [ %.pre83, %while.body25.preheader ]
%x.078 = phi i32 [ %sub, %getchar_unlocked.exit71 ], [ 0, %while.body25.preheader ]
%c.2.in77 = phi i32 [ %cond.i67, %getchar_unlocked.exit71 ], [ %c.1.in, %while.body25.preheader ]
%conv17 = and i32 %c.2.in77, 255
%mul = mul i32 %x.078, 10
%add = add nsw i32 %conv17, -48
%sub = add i32 %add, %mul
%_IO_read_ptr.i62 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 1
%20 = load ptr, ptr %_IO_read_ptr.i62, align 8, !tbaa !9
%_IO_read_end.i63 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 2
%21 = load ptr, ptr %_IO_read_end.i63, align 8, !tbaa !14
%cmp.not.i64 = icmp ult ptr %20, %21
br i1 %cmp.not.i64, label %cond.false.i68, label %cond.true.i65, !prof !15
cond.true.i65: ; preds = %while.body25
%call.i66 = tail call i32 @__uflow(ptr noundef nonnull %19) #8
%.pre82 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit71
cond.false.i68: ; preds = %while.body25
%incdec.ptr.i69 = getelementptr inbounds i8, ptr %20, i64 1
store ptr %incdec.ptr.i69, ptr %_IO_read_ptr.i62, align 8, !tbaa !9
%22 = load i8, ptr %20, align 1, !tbaa !16
%conv3.i70 = zext i8 %22 to i32
br label %getchar_unlocked.exit71
getchar_unlocked.exit71: ; preds = %cond.true.i65, %cond.false.i68
%23 = phi ptr [ %.pre82, %cond.true.i65 ], [ %19, %cond.false.i68 ]
%cond.i67 = phi i32 [ %call.i66, %cond.true.i65 ], [ %conv3.i70, %cond.false.i68 ]
%sext40 = shl i32 %cond.i67, 24
%24 = add i32 %sext40, -788529153
%25 = icmp ult i32 %24, 184549375
br i1 %25, label %while.body25, label %while.end29, !llvm.loop !19
while.end29: ; preds = %getchar_unlocked.exit71, %if.end
%x.0.lcssa = phi i32 [ 0, %if.end ], [ %sub, %getchar_unlocked.exit71 ]
%sub31 = sub i32 0, %x.0.lcssa
%cond = select i1 %cmp12, i32 %sub31, i32 %x.0.lcssa
ret i32 %cond
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local i64 @nextlong() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #8
br label %getchar_unlocked.exit
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%sext72 = shl i32 %cond.i, 24
%cmp.not73 = icmp ne i32 %sext72, 754974720
%4 = add i32 %sext72, -956301313
%5 = icmp ult i32 %4, -150994945
%or.cond74 = and i1 %cmp.not73, %5
br i1 %or.cond74, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %getchar_unlocked.exit
%.pre81 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.preheader, %getchar_unlocked.exit51
%6 = phi ptr [ %.pre81, %while.body.preheader ], [ %10, %getchar_unlocked.exit51 ]
%_IO_read_ptr.i42 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 1
%7 = load ptr, ptr %_IO_read_ptr.i42, align 8, !tbaa !9
%_IO_read_end.i43 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 2
%8 = load ptr, ptr %_IO_read_end.i43, align 8, !tbaa !14
%cmp.not.i44 = icmp ult ptr %7, %8
br i1 %cmp.not.i44, label %cond.false.i48, label %cond.true.i45, !prof !15
cond.true.i45: ; preds = %while.body
%call.i46 = tail call i32 @__uflow(ptr noundef nonnull %6) #8
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit51
cond.false.i48: ; preds = %while.body
%incdec.ptr.i49 = getelementptr inbounds i8, ptr %7, i64 1
store ptr %incdec.ptr.i49, ptr %_IO_read_ptr.i42, align 8, !tbaa !9
%9 = load i8, ptr %7, align 1, !tbaa !16
%conv3.i50 = zext i8 %9 to i32
br label %getchar_unlocked.exit51
getchar_unlocked.exit51: ; preds = %cond.true.i45, %cond.false.i48
%10 = phi ptr [ %.pre, %cond.true.i45 ], [ %6, %cond.false.i48 ]
%cond.i47 = phi i32 [ %call.i46, %cond.true.i45 ], [ %conv3.i50, %cond.false.i48 ]
%sext = shl i32 %cond.i47, 24
%cmp.not = icmp ne i32 %sext, 754974720
%11 = add i32 %sext, -956301313
%12 = icmp ult i32 %11, -150994945
%or.cond = and i1 %cmp.not, %12
br i1 %or.cond, label %while.body, label %while.end, !llvm.loop !20
while.end: ; preds = %getchar_unlocked.exit51, %getchar_unlocked.exit
%c.0.in.lcssa = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %cond.i47, %getchar_unlocked.exit51 ]
%sext.lcssa = phi i32 [ %sext72, %getchar_unlocked.exit ], [ %sext, %getchar_unlocked.exit51 ]
%cmp12.not = icmp eq i32 %sext.lcssa, 754974720
br i1 %cmp12.not, label %if.then, label %if.end
if.then: ; preds = %while.end
%13 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i52 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1
%14 = load ptr, ptr %_IO_read_ptr.i52, align 8, !tbaa !9
%_IO_read_end.i53 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2
%15 = load ptr, ptr %_IO_read_end.i53, align 8, !tbaa !14
%cmp.not.i54 = icmp ult ptr %14, %15
br i1 %cmp.not.i54, label %cond.false.i58, label %cond.true.i55, !prof !15
cond.true.i55: ; preds = %if.then
%call.i56 = tail call i32 @__uflow(ptr noundef nonnull %13) #8
br label %if.end
cond.false.i58: ; preds = %if.then
%incdec.ptr.i59 = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i59, ptr %_IO_read_ptr.i52, align 8, !tbaa !9
%16 = load i8, ptr %14, align 1, !tbaa !16
%conv3.i60 = zext i8 %16 to i32
br label %if.end
if.end: ; preds = %cond.false.i58, %cond.true.i55, %while.end
%c.1.in = phi i32 [ %c.0.in.lcssa, %while.end ], [ %call.i56, %cond.true.i55 ], [ %conv3.i60, %cond.false.i58 ]
%sext3976 = shl i32 %c.1.in, 24
%17 = add i32 %sext3976, -788529153
%18 = icmp ult i32 %17, 184549375
br i1 %18, label %while.body25.preheader, label %while.end29
while.body25.preheader: ; preds = %if.end
%.pre83 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body25
while.body25: ; preds = %while.body25.preheader, %getchar_unlocked.exit71
%19 = phi ptr [ %23, %getchar_unlocked.exit71 ], [ %.pre83, %while.body25.preheader ]
%x.078 = phi i64 [ %sub, %getchar_unlocked.exit71 ], [ 0, %while.body25.preheader ]
%c.2.in77 = phi i32 [ %cond.i67, %getchar_unlocked.exit71 ], [ %c.1.in, %while.body25.preheader ]
%c.2 = zext i32 %c.2.in77 to i64
%mul = mul i64 %x.078, 10
%sext40 = shl i64 %c.2, 56
%conv26 = ashr exact i64 %sext40, 56
%add = add i64 %mul, -48
%sub = add i64 %add, %conv26
%_IO_read_ptr.i62 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 1
%20 = load ptr, ptr %_IO_read_ptr.i62, align 8, !tbaa !9
%_IO_read_end.i63 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 2
%21 = load ptr, ptr %_IO_read_end.i63, align 8, !tbaa !14
%cmp.not.i64 = icmp ult ptr %20, %21
br i1 %cmp.not.i64, label %cond.false.i68, label %cond.true.i65, !prof !15
cond.true.i65: ; preds = %while.body25
%call.i66 = tail call i32 @__uflow(ptr noundef nonnull %19) #8
%.pre82 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit71
cond.false.i68: ; preds = %while.body25
%incdec.ptr.i69 = getelementptr inbounds i8, ptr %20, i64 1
store ptr %incdec.ptr.i69, ptr %_IO_read_ptr.i62, align 8, !tbaa !9
%22 = load i8, ptr %20, align 1, !tbaa !16
%conv3.i70 = zext i8 %22 to i32
br label %getchar_unlocked.exit71
getchar_unlocked.exit71: ; preds = %cond.true.i65, %cond.false.i68
%23 = phi ptr [ %.pre82, %cond.true.i65 ], [ %19, %cond.false.i68 ]
%cond.i67 = phi i32 [ %call.i66, %cond.true.i65 ], [ %conv3.i70, %cond.false.i68 ]
%sext39 = shl i32 %cond.i67, 24
%24 = add i32 %sext39, -788529153
%25 = icmp ult i32 %24, 184549375
br i1 %25, label %while.body25, label %while.end29, !llvm.loop !21
while.end29: ; preds = %getchar_unlocked.exit71, %if.end
%x.0.lcssa = phi i64 [ 0, %if.end ], [ %sub, %getchar_unlocked.exit71 ]
%sub30 = sub i64 0, %x.0.lcssa
%cond = select i1 %cmp12.not, i64 %sub30, i64 %x.0.lcssa
ret i64 %cond
}
; Function Attrs: nounwind uwtable
define dso_local i32 @nextstr(ptr nocapture noundef writeonly %s) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #8
br label %while.cond.preheader
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %while.cond.preheader
while.cond.preheader: ; preds = %cond.true.i, %cond.false.i
%c.0.in.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ]
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %while.cond.preheader
%c.0.in = phi i32 [ %c.0.in.ph, %while.cond.preheader ], [ %c.0.in.be, %while.cond.backedge ]
%sext = shl i32 %c.0.in, 24
switch i32 %sext, label %while.cond8 [
i32 536870912, label %while.body
i32 167772160, label %while.body
]
while.body: ; preds = %while.cond, %while.cond
%4 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i26 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i26, align 8, !tbaa !9
%_IO_read_end.i27 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i27, align 8, !tbaa !14
%cmp.not.i28 = icmp ult ptr %5, %6
br i1 %cmp.not.i28, label %cond.false.i32, label %cond.true.i29, !prof !15
cond.true.i29: ; preds = %while.body
%call.i30 = tail call i32 @__uflow(ptr noundef nonnull %4) #8
br label %while.cond.backedge
while.cond.backedge: ; preds = %cond.true.i29, %cond.false.i32
%c.0.in.be = phi i32 [ %call.i30, %cond.true.i29 ], [ %conv3.i34, %cond.false.i32 ]
br label %while.cond, !llvm.loop !22
cond.false.i32: ; preds = %while.body
%incdec.ptr.i33 = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i33, ptr %_IO_read_ptr.i26, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i34 = zext i8 %7 to i32
br label %while.cond.backedge
while.cond8: ; preds = %while.cond, %while.cond8.backedge
%s.addr.0 = phi ptr [ %incdec.ptr, %while.cond8.backedge ], [ %s, %while.cond ]
%c.1.in = phi i32 [ %c.1.in.be, %while.cond8.backedge ], [ %c.0.in, %while.cond ]
%len.0 = phi i32 [ %inc, %while.cond8.backedge ], [ 0, %while.cond ]
%sext25 = shl i32 %c.1.in, 24
switch i32 %sext25, label %while.body15 [
i32 536870912, label %while.end18
i32 167772160, label %while.end18
]
while.body15: ; preds = %while.cond8
%c.1 = trunc i32 %c.1.in to i8
%incdec.ptr = getelementptr inbounds i8, ptr %s.addr.0, i64 1
store i8 %c.1, ptr %s.addr.0, align 1, !tbaa !16
%inc = add i32 %len.0, 1
%8 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i36 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 1
%9 = load ptr, ptr %_IO_read_ptr.i36, align 8, !tbaa !9
%_IO_read_end.i37 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 2
%10 = load ptr, ptr %_IO_read_end.i37, align 8, !tbaa !14
%cmp.not.i38 = icmp ult ptr %9, %10
br i1 %cmp.not.i38, label %cond.false.i42, label %cond.true.i39, !prof !15
cond.true.i39: ; preds = %while.body15
%call.i40 = tail call i32 @__uflow(ptr noundef nonnull %8) #8
br label %while.cond8.backedge
while.cond8.backedge: ; preds = %cond.true.i39, %cond.false.i42
%c.1.in.be = phi i32 [ %call.i40, %cond.true.i39 ], [ %conv3.i44, %cond.false.i42 ]
br label %while.cond8, !llvm.loop !23
cond.false.i42: ; preds = %while.body15
%incdec.ptr.i43 = getelementptr inbounds i8, ptr %9, i64 1
store ptr %incdec.ptr.i43, ptr %_IO_read_ptr.i36, align 8, !tbaa !9
%11 = load i8, ptr %9, align 1, !tbaa !16
%conv3.i44 = zext i8 %11 to i32
br label %while.cond8.backedge
while.end18: ; preds = %while.cond8, %while.cond8
store i8 0, ptr %s.addr.0, align 1, !tbaa !16
ret i32 %len.0
}
; Function Attrs: nounwind uwtable
define dso_local void @printint(i32 noundef %x) local_unnamed_addr #0 {
entry:
%s = alloca [10 x i8], align 1
%cmp = icmp slt i32 %x, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%sub = sub nsw i32 0, %x
%0 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 5
%1 = load ptr, ptr %_IO_write_ptr.i, align 8, !tbaa !24
%_IO_write_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 6
%2 = load ptr, ptr %_IO_write_end.i, align 8, !tbaa !25
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %if.then
%call.i = tail call i32 @__overflow(ptr noundef nonnull %0, i32 noundef 45) #8
br label %while.body.preheader
cond.false.i: ; preds = %if.then
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_write_ptr.i, align 8, !tbaa !24
store i8 45, ptr %1, align 1, !tbaa !16
br label %while.body.preheader
if.else: ; preds = %entry
%cmp1 = icmp eq i32 %x, 0
br i1 %cmp1, label %if.then2, label %while.body.preheader
if.then2: ; preds = %if.else
%3 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i22 = getelementptr inbounds %struct._IO_FILE, ptr %3, i64 0, i32 5
%4 = load ptr, ptr %_IO_write_ptr.i22, align 8, !tbaa !24
%_IO_write_end.i23 = getelementptr inbounds %struct._IO_FILE, ptr %3, i64 0, i32 6
%5 = load ptr, ptr %_IO_write_end.i23, align 8, !tbaa !25
%cmp.not.i24 = icmp ult ptr %4, %5
br i1 %cmp.not.i24, label %cond.false.i28, label %cond.true.i25, !prof !15
cond.true.i25: ; preds = %if.then2
%call.i26 = tail call i32 @__overflow(ptr noundef nonnull %3, i32 noundef 48) #8
br label %for.cond.preheader.thread
cond.false.i28: ; preds = %if.then2
%incdec.ptr.i29 = getelementptr inbounds i8, ptr %4, i64 1
store ptr %incdec.ptr.i29, ptr %_IO_write_ptr.i22, align 8, !tbaa !24
store i8 48, ptr %4, align 1, !tbaa !16
br label %for.cond.preheader.thread
for.cond.preheader.thread: ; preds = %cond.true.i25, %cond.false.i28
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #8
br label %for.cond.cleanup
while.body.preheader: ; preds = %if.else, %cond.true.i, %cond.false.i
%x.addr.0.ph = phi i32 [ %sub, %cond.false.i ], [ %sub, %cond.true.i ], [ %x, %if.else ]
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #8
br label %while.body
for.cond.preheader: ; preds = %while.body
%6 = trunc i64 %indvars.iv.next to i32
%cmp652 = icmp sgt i32 %6, 0
br i1 %cmp652, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %for.cond.preheader
%7 = and i64 %indvars.iv.next, 4294967295
br label %for.body
while.body: ; preds = %while.body.preheader, %while.body
%indvars.iv = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next, %while.body ]
%x.addr.150 = phi i32 [ %x.addr.0.ph, %while.body.preheader ], [ %div, %while.body ]
%rem = srem i32 %x.addr.150, 10
%8 = trunc i32 %rem to i8
%conv = add nsw i8 %8, 48
%arrayidx = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv
store i8 %conv, ptr %arrayidx, align 1, !tbaa !16
%div = sdiv i32 %x.addr.150, 10
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%x.addr.150.off = add i32 %x.addr.150, 9
%tobool.not = icmp ult i32 %x.addr.150.off, 19
br i1 %tobool.not, label %for.cond.preheader, label %while.body, !llvm.loop !26
for.cond.cleanup: ; preds = %putchar_unlocked.exit48, %for.cond.preheader.thread, %for.cond.preheader
%9 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i31 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 5
%10 = load ptr, ptr %_IO_write_ptr.i31, align 8, !tbaa !24
%_IO_write_end.i32 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 6
%11 = load ptr, ptr %_IO_write_end.i32, align 8, !tbaa !25
%cmp.not.i33 = icmp ult ptr %10, %11
br i1 %cmp.not.i33, label %cond.false.i37, label %cond.true.i34, !prof !15
cond.true.i34: ; preds = %for.cond.cleanup
%call.i35 = tail call i32 @__overflow(ptr noundef nonnull %9, i32 noundef 10) #8
br label %putchar_unlocked.exit39
cond.false.i37: ; preds = %for.cond.cleanup
%incdec.ptr.i38 = getelementptr inbounds i8, ptr %10, i64 1
store ptr %incdec.ptr.i38, ptr %_IO_write_ptr.i31, align 8, !tbaa !24
store i8 10, ptr %10, align 1, !tbaa !16
br label %putchar_unlocked.exit39
putchar_unlocked.exit39: ; preds = %cond.true.i34, %cond.false.i37
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #8
ret void
for.body: ; preds = %for.body.preheader, %putchar_unlocked.exit48
%indvars.iv55 = phi i64 [ %7, %for.body.preheader ], [ %indvars.iv.next56, %putchar_unlocked.exit48 ]
%indvars.iv.next56 = add nsw i64 %indvars.iv55, -1
%idxprom8 = and i64 %indvars.iv.next56, 4294967295
%arrayidx9 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %idxprom8
%12 = load i8, ptr %arrayidx9, align 1, !tbaa !16
%13 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i40 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 5
%14 = load ptr, ptr %_IO_write_ptr.i40, align 8, !tbaa !24
%_IO_write_end.i41 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 6
%15 = load ptr, ptr %_IO_write_end.i41, align 8, !tbaa !25
%cmp.not.i42 = icmp ult ptr %14, %15
br i1 %cmp.not.i42, label %cond.false.i46, label %cond.true.i43, !prof !15
cond.true.i43: ; preds = %for.body
%conv10 = zext i8 %12 to i32
%call.i44 = tail call i32 @__overflow(ptr noundef nonnull %13, i32 noundef %conv10) #8
br label %putchar_unlocked.exit48
cond.false.i46: ; preds = %for.body
%incdec.ptr.i47 = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i47, ptr %_IO_write_ptr.i40, align 8, !tbaa !24
store i8 %12, ptr %14, align 1, !tbaa !16
br label %putchar_unlocked.exit48
putchar_unlocked.exit48: ; preds = %cond.true.i43, %cond.false.i46
%cmp6 = icmp ugt i64 %indvars.iv55, 1
br i1 %cmp6, label %for.body, label %for.cond.cleanup, !llvm.loop !27
}
; Function Attrs: nounwind uwtable
define dso_local void @rsorta_d32(ptr nocapture noundef %base, i32 noundef %count, i32 noundef %size, i32 noundef %index) local_unnamed_addr #0 {
entry:
%c = alloca [256 x i32], align 16
%0 = zext i32 %size to i64
%mul = mul nsw i32 %size, %count
%conv = sext i32 %mul to i64
%mul1 = shl nsw i64 %conv, 2
%call = tail call noalias ptr @malloc(i64 noundef %mul1) #9
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %c) #8
%cmp492 = icmp sgt i32 %count, 0
%idxprom8 = sext i32 %index to i64
br i1 %cmp492, label %entry.split.us, label %for.body.preheader
for.body.preheader: ; preds = %entry
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
br label %for.body18
entry.split.us: ; preds = %entry
%i26.097 = add i32 %count, -1
%cmp4395 = icmp sgt i32 %size, 0
%1 = zext i32 %i26.097 to i64
br i1 %cmp4395, label %for.body7.lr.ph.us.us, label %for.body7.lr.ph.us
for.body18.us.us: ; preds = %for.body18.us.us, %for.cond14.preheader.us.us
%2 = phi i32 [ %.pre193.pre, %for.cond14.preheader.us.us ], [ %add.us.us.4, %for.body18.us.us ]
%indvars.iv176 = phi i64 [ 1, %for.cond14.preheader.us.us ], [ %indvars.iv.next177.4, %for.body18.us.us ]
%arrayidx22.us.us = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv176
%3 = load i32, ptr %arrayidx22.us.us, align 4, !tbaa !28
%add.us.us = add nsw i32 %3, %2
store i32 %add.us.us, ptr %arrayidx22.us.us, align 4, !tbaa !28
%indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
%arrayidx22.us.us.1297 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177
%4 = load i32, ptr %arrayidx22.us.us.1297, align 4, !tbaa !28
%add.us.us.1298 = add nsw i32 %4, %add.us.us
store i32 %add.us.us.1298, ptr %arrayidx22.us.us.1297, align 4, !tbaa !28
%indvars.iv.next177.1299 = add nuw nsw i64 %indvars.iv176, 2
%arrayidx22.us.us.2302 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.1299
%5 = load i32, ptr %arrayidx22.us.us.2302, align 4, !tbaa !28
%add.us.us.2303 = add nsw i32 %5, %add.us.us.1298
store i32 %add.us.us.2303, ptr %arrayidx22.us.us.2302, align 4, !tbaa !28
%indvars.iv.next177.2304 = add nuw nsw i64 %indvars.iv176, 3
%arrayidx22.us.us.3307 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.2304
%6 = load i32, ptr %arrayidx22.us.us.3307, align 4, !tbaa !28
%add.us.us.3308 = add nsw i32 %6, %add.us.us.2303
store i32 %add.us.us.3308, ptr %arrayidx22.us.us.3307, align 4, !tbaa !28
%indvars.iv.next177.3309 = add nuw nsw i64 %indvars.iv176, 4
%arrayidx22.us.us.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.3309
%7 = load i32, ptr %arrayidx22.us.us.4, align 4, !tbaa !28
%add.us.us.4 = add nsw i32 %7, %add.us.us.3308
store i32 %add.us.us.4, ptr %arrayidx22.us.us.4, align 4, !tbaa !28
%indvars.iv.next177.4 = add nuw nsw i64 %indvars.iv176, 5
%exitcond180.not.4 = icmp eq i64 %indvars.iv.next177.4, 256
br i1 %exitcond180.not.4, label %for.cond28.preheader.us.us, label %for.body18.us.us, !llvm.loop !29
for.body7.us.us: ; preds = %for.body7.us.us, %for.body7.lr.ph.us.us.new
%indvars.iv171 = phi i64 [ 0, %for.body7.lr.ph.us.us.new ], [ %indvars.iv.next172.1294, %for.body7.us.us ]
%niter287 = phi i64 [ 0, %for.body7.lr.ph.us.us.new ], [ %niter287.next.1, %for.body7.us.us ]
%8 = mul nuw nsw i64 %indvars.iv171, %0
%gep.us.us = getelementptr i32, ptr %invariant.gep.us.us, i64 %8
%9 = load i32, ptr %gep.us.us, align 4, !tbaa !28
%and.us.us = and i32 %9, 255
%idxprom10.us.us = zext i32 %and.us.us to i64
%arrayidx11.us.us = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us
%10 = load i32, ptr %arrayidx11.us.us, align 4, !tbaa !28
%inc.us.us = add nsw i32 %10, 1
store i32 %inc.us.us, ptr %arrayidx11.us.us, align 4, !tbaa !28
%indvars.iv.next172 = or i64 %indvars.iv171, 1
%11 = mul nuw nsw i64 %indvars.iv.next172, %0
%gep.us.us.1289 = getelementptr i32, ptr %invariant.gep.us.us, i64 %11
%12 = load i32, ptr %gep.us.us.1289, align 4, !tbaa !28
%and.us.us.1290 = and i32 %12, 255
%idxprom10.us.us.1291 = zext i32 %and.us.us.1290 to i64
%arrayidx11.us.us.1292 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.1291
%13 = load i32, ptr %arrayidx11.us.us.1292, align 4, !tbaa !28
%inc.us.us.1293 = add nsw i32 %13, 1
store i32 %inc.us.us.1293, ptr %arrayidx11.us.us.1292, align 4, !tbaa !28
%indvars.iv.next172.1294 = add nuw nsw i64 %indvars.iv171, 2
%niter287.next.1 = add i64 %niter287, 2
%niter287.ncmp.1 = icmp eq i64 %niter287.next.1, %unroll_iter286
br i1 %niter287.ncmp.1, label %for.cond14.preheader.us.us.unr-lcssa, label %for.body7.us.us, !llvm.loop !30
for.cond28.preheader.us.us: ; preds = %for.body18.us.us
%wide.trip.count187 = zext i32 %count to i64
%14 = getelementptr i8, ptr %base, i64 %19
%invariant.gep = getelementptr i32, ptr %base, i64 %idxprom8
br label %for.body32.us.us.us
for.cond14.preheader.us.us.unr-lcssa: ; preds = %for.body7.us.us, %for.body7.lr.ph.us.us
%indvars.iv171.unr = phi i64 [ 0, %for.body7.lr.ph.us.us ], [ %indvars.iv.next172.1294, %for.body7.us.us ]
%lcmp.mod285.not = icmp eq i64 %xtraiter284, 0
br i1 %lcmp.mod285.not, label %for.cond14.preheader.us.us, label %for.body7.us.us.epil
for.body7.us.us.epil: ; preds = %for.cond14.preheader.us.us.unr-lcssa
%15 = mul nuw nsw i64 %indvars.iv171.unr, %0
%gep.us.us.epil = getelementptr i32, ptr %invariant.gep.us.us, i64 %15
%16 = load i32, ptr %gep.us.us.epil, align 4, !tbaa !28
%and.us.us.epil = and i32 %16, 255
%idxprom10.us.us.epil = zext i32 %and.us.us.epil to i64
%arrayidx11.us.us.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.epil
%17 = load i32, ptr %arrayidx11.us.us.epil, align 4, !tbaa !28
%inc.us.us.epil = add nsw i32 %17, 1
store i32 %inc.us.us.epil, ptr %arrayidx11.us.us.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.us
for.cond14.preheader.us.us: ; preds = %for.cond14.preheader.us.us.unr-lcssa, %for.body7.us.us.epil
%.pre193.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.us
for.body7.lr.ph.us.us: ; preds = %entry.split.us
%18 = mul nuw nsw i64 %0, %1
%19 = shl i64 %18, 2
%20 = mul nsw i64 %0, -4
%21 = shl nuw nsw i64 %0, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us.us = getelementptr i32, ptr %base, i64 %idxprom8
%wide.trip.count174 = zext i32 %count to i64
%22 = add nsw i64 %wide.trip.count174, -1
%xtraiter284 = and i64 %wide.trip.count174, 1
%23 = icmp eq i64 %22, 0
br i1 %23, label %for.cond14.preheader.us.us.unr-lcssa, label %for.body7.lr.ph.us.us.new
for.body7.lr.ph.us.us.new: ; preds = %for.body7.lr.ph.us.us
%unroll_iter286 = and i64 %wide.trip.count174, 4294967294
br label %for.body7.us.us
for.body32.us.us.us: ; preds = %for.body32.us.us.us, %for.cond28.preheader.us.us
%indvars.iv184 = phi i64 [ %indvars.iv.next185, %for.body32.us.us.us ], [ %1, %for.cond28.preheader.us.us ]
%indvar = phi i64 [ %indvar.next, %for.body32.us.us.us ], [ 0, %for.cond28.preheader.us.us ]
%24 = mul i64 %20, %indvar
%scevgep = getelementptr i8, ptr %14, i64 %24
%25 = mul nuw nsw i64 %indvars.iv184, %0
%gep = getelementptr i32, ptr %invariant.gep, i64 %25
%26 = load i32, ptr %gep, align 4, !tbaa !28
%and39.us.us.us = and i32 %26, 255
%idxprom40.us.us.us = zext i32 %and39.us.us.us to i64
%arrayidx41.us.us.us = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us.us.us
%27 = load i32, ptr %arrayidx41.us.us.us, align 4, !tbaa !28
%dec.us.us.us = add nsw i32 %27, -1
store i32 %dec.us.us.us, ptr %arrayidx41.us.us.us, align 4, !tbaa !28
%idxprom51.us.us.us = sext i32 %dec.us.us.us to i64
%28 = mul nsw i64 %idxprom51.us.us.us, %0
%arrayidx52.us.us.us = getelementptr inbounds i32, ptr %call, i64 %28
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arrayidx52.us.us.us, ptr align 4 %scevgep, i64 %21, i1 false), !tbaa !28
%indvars.iv.next185 = add nsw i64 %indvars.iv184, -1
%indvar.next = add nuw nsw i64 %indvar, 1
%exitcond188.not = icmp eq i64 %indvar.next, %wide.trip.count187
br i1 %exitcond188.not, label %for.body7.lr.ph.us.us.1, label %for.body32.us.us.us, !llvm.loop !31
for.body7.lr.ph.us.us.1: ; preds = %for.body32.us.us.us
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us.us.1 = getelementptr i32, ptr %call, i64 %idxprom8
%xtraiter311 = and i64 %wide.trip.count174, 1
%29 = icmp eq i64 %22, 0
br i1 %29, label %for.cond14.preheader.us.us.1.unr-lcssa, label %for.body7.lr.ph.us.us.1.new
for.body7.lr.ph.us.us.1.new: ; preds = %for.body7.lr.ph.us.us.1
%unroll_iter313 = and i64 %wide.trip.count174, 4294967294
br label %for.body7.us.us.1
for.body7.us.us.1: ; preds = %for.body7.us.us.1, %for.body7.lr.ph.us.us.1.new
%indvars.iv171.1 = phi i64 [ 0, %for.body7.lr.ph.us.us.1.new ], [ %indvars.iv.next172.1.1, %for.body7.us.us.1 ]
%niter314 = phi i64 [ 0, %for.body7.lr.ph.us.us.1.new ], [ %niter314.next.1, %for.body7.us.us.1 ]
%30 = mul nuw nsw i64 %indvars.iv171.1, %0
%gep.us.us.1 = getelementptr i32, ptr %invariant.gep.us.us.1, i64 %30
%31 = load i32, ptr %gep.us.us.1, align 4, !tbaa !28
%shr.us.us.1 = lshr i32 %31, 8
%and.us.us.1 = and i32 %shr.us.us.1, 255
%idxprom10.us.us.1 = zext i32 %and.us.us.1 to i64
%arrayidx11.us.us.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.1
%32 = load i32, ptr %arrayidx11.us.us.1, align 4, !tbaa !28
%inc.us.us.1 = add nsw i32 %32, 1
store i32 %inc.us.us.1, ptr %arrayidx11.us.us.1, align 4, !tbaa !28
%indvars.iv.next172.1 = or i64 %indvars.iv171.1, 1
%33 = mul nuw nsw i64 %indvars.iv.next172.1, %0
%gep.us.us.1.1 = getelementptr i32, ptr %invariant.gep.us.us.1, i64 %33
%34 = load i32, ptr %gep.us.us.1.1, align 4, !tbaa !28
%shr.us.us.1.1 = lshr i32 %34, 8
%and.us.us.1.1 = and i32 %shr.us.us.1.1, 255
%idxprom10.us.us.1.1 = zext i32 %and.us.us.1.1 to i64
%arrayidx11.us.us.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.1.1
%35 = load i32, ptr %arrayidx11.us.us.1.1, align 4, !tbaa !28
%inc.us.us.1.1 = add nsw i32 %35, 1
store i32 %inc.us.us.1.1, ptr %arrayidx11.us.us.1.1, align 4, !tbaa !28
%indvars.iv.next172.1.1 = add nuw nsw i64 %indvars.iv171.1, 2
%niter314.next.1 = add i64 %niter314, 2
%niter314.ncmp.1 = icmp eq i64 %niter314.next.1, %unroll_iter313
br i1 %niter314.ncmp.1, label %for.cond14.preheader.us.us.1.unr-lcssa, label %for.body7.us.us.1, !llvm.loop !30
for.cond14.preheader.us.us.1.unr-lcssa: ; preds = %for.body7.us.us.1, %for.body7.lr.ph.us.us.1
%indvars.iv171.1.unr = phi i64 [ 0, %for.body7.lr.ph.us.us.1 ], [ %indvars.iv.next172.1.1, %for.body7.us.us.1 ]
%lcmp.mod312.not = icmp eq i64 %xtraiter311, 0
br i1 %lcmp.mod312.not, label %for.cond14.preheader.us.us.1, label %for.body7.us.us.1.epil
for.body7.us.us.1.epil: ; preds = %for.cond14.preheader.us.us.1.unr-lcssa
%36 = mul nuw nsw i64 %indvars.iv171.1.unr, %0
%gep.us.us.1.epil = getelementptr i32, ptr %invariant.gep.us.us.1, i64 %36
%37 = load i32, ptr %gep.us.us.1.epil, align 4, !tbaa !28
%shr.us.us.1.epil = lshr i32 %37, 8
%and.us.us.1.epil = and i32 %shr.us.us.1.epil, 255
%idxprom10.us.us.1.epil = zext i32 %and.us.us.1.epil to i64
%arrayidx11.us.us.1.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.1.epil
%38 = load i32, ptr %arrayidx11.us.us.1.epil, align 4, !tbaa !28
%inc.us.us.1.epil = add nsw i32 %38, 1
store i32 %inc.us.us.1.epil, ptr %arrayidx11.us.us.1.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.us.1
for.cond14.preheader.us.us.1: ; preds = %for.cond14.preheader.us.us.1.unr-lcssa, %for.body7.us.us.1.epil
%.pre194.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.us.1
for.body18.us.us.1: ; preds = %for.body18.us.us.1, %for.cond14.preheader.us.us.1
%39 = phi i32 [ %.pre194.pre, %for.cond14.preheader.us.us.1 ], [ %add.us.us.1.4, %for.body18.us.us.1 ]
%indvars.iv176.1 = phi i64 [ 1, %for.cond14.preheader.us.us.1 ], [ %indvars.iv.next177.1.4, %for.body18.us.us.1 ]
%arrayidx22.us.us.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv176.1
%40 = load i32, ptr %arrayidx22.us.us.1, align 4, !tbaa !28
%add.us.us.1 = add nsw i32 %40, %39
store i32 %add.us.us.1, ptr %arrayidx22.us.us.1, align 4, !tbaa !28
%indvars.iv.next177.1 = add nuw nsw i64 %indvars.iv176.1, 1
%arrayidx22.us.us.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.1
%41 = load i32, ptr %arrayidx22.us.us.1.1, align 4, !tbaa !28
%add.us.us.1.1 = add nsw i32 %41, %add.us.us.1
store i32 %add.us.us.1.1, ptr %arrayidx22.us.us.1.1, align 4, !tbaa !28
%indvars.iv.next177.1.1 = add nuw nsw i64 %indvars.iv176.1, 2
%arrayidx22.us.us.1.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.1.1
%42 = load i32, ptr %arrayidx22.us.us.1.2, align 4, !tbaa !28
%add.us.us.1.2 = add nsw i32 %42, %add.us.us.1.1
store i32 %add.us.us.1.2, ptr %arrayidx22.us.us.1.2, align 4, !tbaa !28
%indvars.iv.next177.1.2 = add nuw nsw i64 %indvars.iv176.1, 3
%arrayidx22.us.us.1.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.1.2
%43 = load i32, ptr %arrayidx22.us.us.1.3, align 4, !tbaa !28
%add.us.us.1.3 = add nsw i32 %43, %add.us.us.1.2
store i32 %add.us.us.1.3, ptr %arrayidx22.us.us.1.3, align 4, !tbaa !28
%indvars.iv.next177.1.3 = add nuw nsw i64 %indvars.iv176.1, 4
%arrayidx22.us.us.1.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.1.3
%44 = load i32, ptr %arrayidx22.us.us.1.4, align 4, !tbaa !28
%add.us.us.1.4 = add nsw i32 %44, %add.us.us.1.3
store i32 %add.us.us.1.4, ptr %arrayidx22.us.us.1.4, align 4, !tbaa !28
%indvars.iv.next177.1.4 = add nuw nsw i64 %indvars.iv176.1, 5
%exitcond180.1.not.4 = icmp eq i64 %indvars.iv.next177.1.4, 256
br i1 %exitcond180.1.not.4, label %for.cond28.preheader.us.us.1, label %for.body18.us.us.1, !llvm.loop !29
for.cond28.preheader.us.us.1: ; preds = %for.body18.us.us.1
%45 = getelementptr i8, ptr %call, i64 %19
%invariant.gep207 = getelementptr i32, ptr %call, i64 %idxprom8
br label %for.body32.us.us.us.1
for.body32.us.us.us.1: ; preds = %for.body32.us.us.us.1, %for.cond28.preheader.us.us.1
%indvars.iv184.1 = phi i64 [ %indvars.iv.next185.1, %for.body32.us.us.us.1 ], [ %1, %for.cond28.preheader.us.us.1 ]
%indvar.1 = phi i64 [ %indvar.next.1, %for.body32.us.us.us.1 ], [ 0, %for.cond28.preheader.us.us.1 ]
%46 = mul i64 %20, %indvar.1
%scevgep.1 = getelementptr i8, ptr %45, i64 %46
%47 = mul nuw nsw i64 %indvars.iv184.1, %0
%gep208 = getelementptr i32, ptr %invariant.gep207, i64 %47
%48 = load i32, ptr %gep208, align 4, !tbaa !28
%shr38.us.us.us.1 = lshr i32 %48, 8
%and39.us.us.us.1 = and i32 %shr38.us.us.us.1, 255
%idxprom40.us.us.us.1 = zext i32 %and39.us.us.us.1 to i64
%arrayidx41.us.us.us.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us.us.us.1
%49 = load i32, ptr %arrayidx41.us.us.us.1, align 4, !tbaa !28
%dec.us.us.us.1 = add nsw i32 %49, -1
store i32 %dec.us.us.us.1, ptr %arrayidx41.us.us.us.1, align 4, !tbaa !28
%idxprom51.us.us.us.1 = sext i32 %dec.us.us.us.1 to i64
%50 = mul nsw i64 %idxprom51.us.us.us.1, %0
%arrayidx52.us.us.us.1 = getelementptr inbounds i32, ptr %base, i64 %50
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arrayidx52.us.us.us.1, ptr align 4 %scevgep.1, i64 %21, i1 false), !tbaa !28
%indvars.iv.next185.1 = add nsw i64 %indvars.iv184.1, -1
%indvar.next.1 = add nuw nsw i64 %indvar.1, 1
%exitcond188.1.not = icmp eq i64 %indvar.next.1, %wide.trip.count187
br i1 %exitcond188.1.not, label %for.body7.lr.ph.us.us.2, label %for.body32.us.us.us.1, !llvm.loop !31
for.body7.lr.ph.us.us.2: ; preds = %for.body32.us.us.us.1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us.us.2 = getelementptr i32, ptr %base, i64 %idxprom8
%xtraiter315 = and i64 %wide.trip.count174, 1
%51 = icmp eq i64 %22, 0
br i1 %51, label %for.cond14.preheader.us.us.2.unr-lcssa, label %for.body7.lr.ph.us.us.2.new
for.body7.lr.ph.us.us.2.new: ; preds = %for.body7.lr.ph.us.us.2
%unroll_iter317 = and i64 %wide.trip.count174, 4294967294
br label %for.body7.us.us.2
for.body7.us.us.2: ; preds = %for.body7.us.us.2, %for.body7.lr.ph.us.us.2.new
%indvars.iv171.2 = phi i64 [ 0, %for.body7.lr.ph.us.us.2.new ], [ %indvars.iv.next172.2.1, %for.body7.us.us.2 ]
%niter318 = phi i64 [ 0, %for.body7.lr.ph.us.us.2.new ], [ %niter318.next.1, %for.body7.us.us.2 ]
%52 = mul nuw nsw i64 %indvars.iv171.2, %0
%gep.us.us.2 = getelementptr i32, ptr %invariant.gep.us.us.2, i64 %52
%53 = load i32, ptr %gep.us.us.2, align 4, !tbaa !28
%shr.us.us.2 = lshr i32 %53, 16
%and.us.us.2 = and i32 %shr.us.us.2, 255
%idxprom10.us.us.2 = zext i32 %and.us.us.2 to i64
%arrayidx11.us.us.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.2
%54 = load i32, ptr %arrayidx11.us.us.2, align 4, !tbaa !28
%inc.us.us.2 = add nsw i32 %54, 1
store i32 %inc.us.us.2, ptr %arrayidx11.us.us.2, align 4, !tbaa !28
%indvars.iv.next172.2 = or i64 %indvars.iv171.2, 1
%55 = mul nuw nsw i64 %indvars.iv.next172.2, %0
%gep.us.us.2.1 = getelementptr i32, ptr %invariant.gep.us.us.2, i64 %55
%56 = load i32, ptr %gep.us.us.2.1, align 4, !tbaa !28
%shr.us.us.2.1 = lshr i32 %56, 16
%and.us.us.2.1 = and i32 %shr.us.us.2.1, 255
%idxprom10.us.us.2.1 = zext i32 %and.us.us.2.1 to i64
%arrayidx11.us.us.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.2.1
%57 = load i32, ptr %arrayidx11.us.us.2.1, align 4, !tbaa !28
%inc.us.us.2.1 = add nsw i32 %57, 1
store i32 %inc.us.us.2.1, ptr %arrayidx11.us.us.2.1, align 4, !tbaa !28
%indvars.iv.next172.2.1 = add nuw nsw i64 %indvars.iv171.2, 2
%niter318.next.1 = add i64 %niter318, 2
%niter318.ncmp.1 = icmp eq i64 %niter318.next.1, %unroll_iter317
br i1 %niter318.ncmp.1, label %for.cond14.preheader.us.us.2.unr-lcssa, label %for.body7.us.us.2, !llvm.loop !30
for.cond14.preheader.us.us.2.unr-lcssa: ; preds = %for.body7.us.us.2, %for.body7.lr.ph.us.us.2
%indvars.iv171.2.unr = phi i64 [ 0, %for.body7.lr.ph.us.us.2 ], [ %indvars.iv.next172.2.1, %for.body7.us.us.2 ]
%lcmp.mod316.not = icmp eq i64 %xtraiter315, 0
br i1 %lcmp.mod316.not, label %for.cond14.preheader.us.us.2, label %for.body7.us.us.2.epil
for.body7.us.us.2.epil: ; preds = %for.cond14.preheader.us.us.2.unr-lcssa
%58 = mul nuw nsw i64 %indvars.iv171.2.unr, %0
%gep.us.us.2.epil = getelementptr i32, ptr %invariant.gep.us.us.2, i64 %58
%59 = load i32, ptr %gep.us.us.2.epil, align 4, !tbaa !28
%shr.us.us.2.epil = lshr i32 %59, 16
%and.us.us.2.epil = and i32 %shr.us.us.2.epil, 255
%idxprom10.us.us.2.epil = zext i32 %and.us.us.2.epil to i64
%arrayidx11.us.us.2.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.2.epil
%60 = load i32, ptr %arrayidx11.us.us.2.epil, align 4, !tbaa !28
%inc.us.us.2.epil = add nsw i32 %60, 1
store i32 %inc.us.us.2.epil, ptr %arrayidx11.us.us.2.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.us.2
for.cond14.preheader.us.us.2: ; preds = %for.cond14.preheader.us.us.2.unr-lcssa, %for.body7.us.us.2.epil
%.pre195.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.us.2
for.body18.us.us.2: ; preds = %for.body18.us.us.2, %for.cond14.preheader.us.us.2
%61 = phi i32 [ %.pre195.pre, %for.cond14.preheader.us.us.2 ], [ %add.us.us.2.4, %for.body18.us.us.2 ]
%indvars.iv176.2 = phi i64 [ 1, %for.cond14.preheader.us.us.2 ], [ %indvars.iv.next177.2.4, %for.body18.us.us.2 ]
%arrayidx22.us.us.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv176.2
%62 = load i32, ptr %arrayidx22.us.us.2, align 4, !tbaa !28
%add.us.us.2 = add nsw i32 %62, %61
store i32 %add.us.us.2, ptr %arrayidx22.us.us.2, align 4, !tbaa !28
%indvars.iv.next177.2 = add nuw nsw i64 %indvars.iv176.2, 1
%arrayidx22.us.us.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.2
%63 = load i32, ptr %arrayidx22.us.us.2.1, align 4, !tbaa !28
%add.us.us.2.1 = add nsw i32 %63, %add.us.us.2
store i32 %add.us.us.2.1, ptr %arrayidx22.us.us.2.1, align 4, !tbaa !28
%indvars.iv.next177.2.1 = add nuw nsw i64 %indvars.iv176.2, 2
%arrayidx22.us.us.2.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.2.1
%64 = load i32, ptr %arrayidx22.us.us.2.2, align 4, !tbaa !28
%add.us.us.2.2 = add nsw i32 %64, %add.us.us.2.1
store i32 %add.us.us.2.2, ptr %arrayidx22.us.us.2.2, align 4, !tbaa !28
%indvars.iv.next177.2.2 = add nuw nsw i64 %indvars.iv176.2, 3
%arrayidx22.us.us.2.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.2.2
%65 = load i32, ptr %arrayidx22.us.us.2.3, align 4, !tbaa !28
%add.us.us.2.3 = add nsw i32 %65, %add.us.us.2.2
store i32 %add.us.us.2.3, ptr %arrayidx22.us.us.2.3, align 4, !tbaa !28
%indvars.iv.next177.2.3 = add nuw nsw i64 %indvars.iv176.2, 4
%arrayidx22.us.us.2.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.2.3
%66 = load i32, ptr %arrayidx22.us.us.2.4, align 4, !tbaa !28
%add.us.us.2.4 = add nsw i32 %66, %add.us.us.2.3
store i32 %add.us.us.2.4, ptr %arrayidx22.us.us.2.4, align 4, !tbaa !28
%indvars.iv.next177.2.4 = add nuw nsw i64 %indvars.iv176.2, 5
%exitcond180.2.not.4 = icmp eq i64 %indvars.iv.next177.2.4, 256
br i1 %exitcond180.2.not.4, label %for.cond28.preheader.us.us.2, label %for.body18.us.us.2, !llvm.loop !29
for.cond28.preheader.us.us.2: ; preds = %for.body18.us.us.2
%67 = getelementptr i8, ptr %base, i64 %19
%invariant.gep209 = getelementptr i32, ptr %base, i64 %idxprom8
br label %for.body32.us.us.us.2
for.body32.us.us.us.2: ; preds = %for.body32.us.us.us.2, %for.cond28.preheader.us.us.2
%indvars.iv184.2 = phi i64 [ %indvars.iv.next185.2, %for.body32.us.us.us.2 ], [ %1, %for.cond28.preheader.us.us.2 ]
%indvar.2 = phi i64 [ %indvar.next.2, %for.body32.us.us.us.2 ], [ 0, %for.cond28.preheader.us.us.2 ]
%68 = mul i64 %20, %indvar.2
%scevgep.2 = getelementptr i8, ptr %67, i64 %68
%69 = mul nuw nsw i64 %indvars.iv184.2, %0
%gep210 = getelementptr i32, ptr %invariant.gep209, i64 %69
%70 = load i32, ptr %gep210, align 4, !tbaa !28
%shr38.us.us.us.2 = lshr i32 %70, 16
%and39.us.us.us.2 = and i32 %shr38.us.us.us.2, 255
%idxprom40.us.us.us.2 = zext i32 %and39.us.us.us.2 to i64
%arrayidx41.us.us.us.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us.us.us.2
%71 = load i32, ptr %arrayidx41.us.us.us.2, align 4, !tbaa !28
%dec.us.us.us.2 = add nsw i32 %71, -1
store i32 %dec.us.us.us.2, ptr %arrayidx41.us.us.us.2, align 4, !tbaa !28
%idxprom51.us.us.us.2 = sext i32 %dec.us.us.us.2 to i64
%72 = mul nsw i64 %idxprom51.us.us.us.2, %0
%arrayidx52.us.us.us.2 = getelementptr inbounds i32, ptr %call, i64 %72
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arrayidx52.us.us.us.2, ptr align 4 %scevgep.2, i64 %21, i1 false), !tbaa !28
%indvars.iv.next185.2 = add nsw i64 %indvars.iv184.2, -1
%indvar.next.2 = add nuw nsw i64 %indvar.2, 1
%exitcond188.2.not = icmp eq i64 %indvar.next.2, %wide.trip.count187
br i1 %exitcond188.2.not, label %for.body7.lr.ph.us.us.3, label %for.body32.us.us.us.2, !llvm.loop !31
for.body7.lr.ph.us.us.3: ; preds = %for.body32.us.us.us.2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us.us.3 = getelementptr i32, ptr %call, i64 %idxprom8
%xtraiter319 = and i64 %wide.trip.count174, 1
%73 = icmp eq i64 %22, 0
br i1 %73, label %for.cond14.preheader.us.us.3.unr-lcssa, label %for.body7.lr.ph.us.us.3.new
for.body7.lr.ph.us.us.3.new: ; preds = %for.body7.lr.ph.us.us.3
%unroll_iter321 = and i64 %wide.trip.count174, 4294967294
br label %for.body7.us.us.3
for.body7.us.us.3: ; preds = %for.body7.us.us.3, %for.body7.lr.ph.us.us.3.new
%indvars.iv171.3 = phi i64 [ 0, %for.body7.lr.ph.us.us.3.new ], [ %indvars.iv.next172.3.1, %for.body7.us.us.3 ]
%niter322 = phi i64 [ 0, %for.body7.lr.ph.us.us.3.new ], [ %niter322.next.1, %for.body7.us.us.3 ]
%74 = mul nuw nsw i64 %indvars.iv171.3, %0
%gep.us.us.3 = getelementptr i32, ptr %invariant.gep.us.us.3, i64 %74
%75 = load i32, ptr %gep.us.us.3, align 4, !tbaa !28
%shr.us.us.3 = lshr i32 %75, 24
%idxprom10.us.us.3 = zext i32 %shr.us.us.3 to i64
%arrayidx11.us.us.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.3
%76 = load i32, ptr %arrayidx11.us.us.3, align 4, !tbaa !28
%inc.us.us.3 = add nsw i32 %76, 1
store i32 %inc.us.us.3, ptr %arrayidx11.us.us.3, align 4, !tbaa !28
%indvars.iv.next172.3 = or i64 %indvars.iv171.3, 1
%77 = mul nuw nsw i64 %indvars.iv.next172.3, %0
%gep.us.us.3.1 = getelementptr i32, ptr %invariant.gep.us.us.3, i64 %77
%78 = load i32, ptr %gep.us.us.3.1, align 4, !tbaa !28
%shr.us.us.3.1 = lshr i32 %78, 24
%idxprom10.us.us.3.1 = zext i32 %shr.us.us.3.1 to i64
%arrayidx11.us.us.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.3.1
%79 = load i32, ptr %arrayidx11.us.us.3.1, align 4, !tbaa !28
%inc.us.us.3.1 = add nsw i32 %79, 1
store i32 %inc.us.us.3.1, ptr %arrayidx11.us.us.3.1, align 4, !tbaa !28
%indvars.iv.next172.3.1 = add nuw nsw i64 %indvars.iv171.3, 2
%niter322.next.1 = add i64 %niter322, 2
%niter322.ncmp.1 = icmp eq i64 %niter322.next.1, %unroll_iter321
br i1 %niter322.ncmp.1, label %for.cond14.preheader.us.us.3.unr-lcssa, label %for.body7.us.us.3, !llvm.loop !30
for.cond14.preheader.us.us.3.unr-lcssa: ; preds = %for.body7.us.us.3, %for.body7.lr.ph.us.us.3
%indvars.iv171.3.unr = phi i64 [ 0, %for.body7.lr.ph.us.us.3 ], [ %indvars.iv.next172.3.1, %for.body7.us.us.3 ]
%lcmp.mod320.not = icmp eq i64 %xtraiter319, 0
br i1 %lcmp.mod320.not, label %for.cond14.preheader.us.us.3, label %for.body7.us.us.3.epil
for.body7.us.us.3.epil: ; preds = %for.cond14.preheader.us.us.3.unr-lcssa
%80 = mul nuw nsw i64 %indvars.iv171.3.unr, %0
%gep.us.us.3.epil = getelementptr i32, ptr %invariant.gep.us.us.3, i64 %80
%81 = load i32, ptr %gep.us.us.3.epil, align 4, !tbaa !28
%shr.us.us.3.epil = lshr i32 %81, 24
%idxprom10.us.us.3.epil = zext i32 %shr.us.us.3.epil to i64
%arrayidx11.us.us.3.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.3.epil
%82 = load i32, ptr %arrayidx11.us.us.3.epil, align 4, !tbaa !28
%inc.us.us.3.epil = add nsw i32 %82, 1
store i32 %inc.us.us.3.epil, ptr %arrayidx11.us.us.3.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.us.3
for.cond14.preheader.us.us.3: ; preds = %for.cond14.preheader.us.us.3.unr-lcssa, %for.body7.us.us.3.epil
%.pre196.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.us.3
for.body18.us.us.3: ; preds = %for.body18.us.us.3, %for.cond14.preheader.us.us.3
%83 = phi i32 [ %.pre196.pre, %for.cond14.preheader.us.us.3 ], [ %add.us.us.3.4, %for.body18.us.us.3 ]
%indvars.iv176.3 = phi i64 [ 1, %for.cond14.preheader.us.us.3 ], [ %indvars.iv.next177.3.4, %for.body18.us.us.3 ]
%arrayidx22.us.us.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv176.3
%84 = load i32, ptr %arrayidx22.us.us.3, align 4, !tbaa !28
%add.us.us.3 = add nsw i32 %84, %83
store i32 %add.us.us.3, ptr %arrayidx22.us.us.3, align 4, !tbaa !28
%indvars.iv.next177.3 = add nuw nsw i64 %indvars.iv176.3, 1
%arrayidx22.us.us.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.3
%85 = load i32, ptr %arrayidx22.us.us.3.1, align 4, !tbaa !28
%add.us.us.3.1 = add nsw i32 %85, %add.us.us.3
store i32 %add.us.us.3.1, ptr %arrayidx22.us.us.3.1, align 4, !tbaa !28
%indvars.iv.next177.3.1 = add nuw nsw i64 %indvars.iv176.3, 2
%arrayidx22.us.us.3.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.3.1
%86 = load i32, ptr %arrayidx22.us.us.3.2, align 4, !tbaa !28
%add.us.us.3.2 = add nsw i32 %86, %add.us.us.3.1
store i32 %add.us.us.3.2, ptr %arrayidx22.us.us.3.2, align 4, !tbaa !28
%indvars.iv.next177.3.2 = add nuw nsw i64 %indvars.iv176.3, 3
%arrayidx22.us.us.3.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.3.2
%87 = load i32, ptr %arrayidx22.us.us.3.3, align 4, !tbaa !28
%add.us.us.3.3 = add nsw i32 %87, %add.us.us.3.2
store i32 %add.us.us.3.3, ptr %arrayidx22.us.us.3.3, align 4, !tbaa !28
%indvars.iv.next177.3.3 = add nuw nsw i64 %indvars.iv176.3, 4
%arrayidx22.us.us.3.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.3.3
%88 = load i32, ptr %arrayidx22.us.us.3.4, align 4, !tbaa !28
%add.us.us.3.4 = add nsw i32 %88, %add.us.us.3.3
store i32 %add.us.us.3.4, ptr %arrayidx22.us.us.3.4, align 4, !tbaa !28
%indvars.iv.next177.3.4 = add nuw nsw i64 %indvars.iv176.3, 5
%exitcond180.3.not.4 = icmp eq i64 %indvars.iv.next177.3.4, 256
br i1 %exitcond180.3.not.4, label %for.cond28.preheader.us.us.3, label %for.body18.us.us.3, !llvm.loop !29
for.cond28.preheader.us.us.3: ; preds = %for.body18.us.us.3
%89 = getelementptr i8, ptr %call, i64 %19
%invariant.gep211 = getelementptr i32, ptr %call, i64 %idxprom8
br label %for.body32.us.us.us.3
for.body32.us.us.us.3: ; preds = %for.body32.us.us.us.3, %for.cond28.preheader.us.us.3
%indvars.iv184.3 = phi i64 [ %indvars.iv.next185.3, %for.body32.us.us.us.3 ], [ %1, %for.cond28.preheader.us.us.3 ]
%indvar.3 = phi i64 [ %indvar.next.3, %for.body32.us.us.us.3 ], [ 0, %for.cond28.preheader.us.us.3 ]
%90 = mul i64 %20, %indvar.3
%scevgep.3 = getelementptr i8, ptr %89, i64 %90
%91 = mul nuw nsw i64 %indvars.iv184.3, %0
%gep212 = getelementptr i32, ptr %invariant.gep211, i64 %91
%92 = load i32, ptr %gep212, align 4, !tbaa !28
%shr38.us.us.us.3 = lshr i32 %92, 24
%idxprom40.us.us.us.3 = zext i32 %shr38.us.us.us.3 to i64
%arrayidx41.us.us.us.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us.us.us.3
%93 = load i32, ptr %arrayidx41.us.us.us.3, align 4, !tbaa !28
%dec.us.us.us.3 = add nsw i32 %93, -1
store i32 %dec.us.us.us.3, ptr %arrayidx41.us.us.us.3, align 4, !tbaa !28
%idxprom51.us.us.us.3 = sext i32 %dec.us.us.us.3 to i64
%94 = mul nsw i64 %idxprom51.us.us.us.3, %0
%arrayidx52.us.us.us.3 = getelementptr inbounds i32, ptr %base, i64 %94
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arrayidx52.us.us.us.3, ptr align 4 %scevgep.3, i64 %21, i1 false), !tbaa !28
%indvars.iv.next185.3 = add nsw i64 %indvars.iv184.3, -1
%indvar.next.3 = add nuw nsw i64 %indvar.3, 1
%exitcond188.3.not = icmp eq i64 %indvar.next.3, %wide.trip.count187
br i1 %exitcond188.3.not, label %for.cond.cleanup, label %for.body32.us.us.us.3, !llvm.loop !31
for.body32.us105: ; preds = %for.body32.us105.prol.loopexit, %for.body32.us105
%indvars.iv167 = phi i64 [ %indvars.iv.next168.1263, %for.body32.us105 ], [ %indvars.iv167.unr, %for.body32.us105.prol.loopexit ]
%95 = mul nuw nsw i64 %indvars.iv167, %0
%gep101.us = getelementptr i32, ptr %invariant.gep100.us, i64 %95
%96 = load i32, ptr %gep101.us, align 4, !tbaa !28
%and39.us109 = and i32 %96, 255
%idxprom40.us110 = zext i32 %and39.us109 to i64
%arrayidx41.us111 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110
%97 = load i32, ptr %arrayidx41.us111, align 4, !tbaa !28
%dec.us112 = add nsw i32 %97, -1
store i32 %dec.us112, ptr %arrayidx41.us111, align 4, !tbaa !28
%indvars.iv.next168 = add nsw i64 %indvars.iv167, -1
%98 = mul nuw nsw i64 %indvars.iv.next168, %0
%gep101.us.1258 = getelementptr i32, ptr %invariant.gep100.us, i64 %98
%99 = load i32, ptr %gep101.us.1258, align 4, !tbaa !28
%and39.us109.1259 = and i32 %99, 255
%idxprom40.us110.1260 = zext i32 %and39.us109.1259 to i64
%arrayidx41.us111.1261 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.1260
%100 = load i32, ptr %arrayidx41.us111.1261, align 4, !tbaa !28
%dec.us112.1262 = add nsw i32 %100, -1
store i32 %dec.us112.1262, ptr %arrayidx41.us111.1261, align 4, !tbaa !28
%indvars.iv.next168.1263 = add nsw i64 %indvars.iv167, -2
%cmp29.us114.1264 = icmp sgt i64 %indvars.iv167, 1
br i1 %cmp29.us114.1264, label %for.body32.us105, label %for.body7.lr.ph.us.1, !llvm.loop !31
for.body18.us: ; preds = %for.body18.us, %for.cond14.preheader.us
%101 = phi i32 [ %.pre.pre, %for.cond14.preheader.us ], [ %add.us.4, %for.body18.us ]
%indvars.iv162 = phi i64 [ 1, %for.cond14.preheader.us ], [ %indvars.iv.next163.4, %for.body18.us ]
%arrayidx22.us = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv162
%102 = load i32, ptr %arrayidx22.us, align 4, !tbaa !28
%add.us = add nsw i32 %102, %101
store i32 %add.us, ptr %arrayidx22.us, align 4, !tbaa !28
%indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
%arrayidx22.us.1241 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163
%103 = load i32, ptr %arrayidx22.us.1241, align 4, !tbaa !28
%add.us.1242 = add nsw i32 %103, %add.us
store i32 %add.us.1242, ptr %arrayidx22.us.1241, align 4, !tbaa !28
%indvars.iv.next163.1243 = add nuw nsw i64 %indvars.iv162, 2
%arrayidx22.us.2246 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.1243
%104 = load i32, ptr %arrayidx22.us.2246, align 4, !tbaa !28
%add.us.2247 = add nsw i32 %104, %add.us.1242
store i32 %add.us.2247, ptr %arrayidx22.us.2246, align 4, !tbaa !28
%indvars.iv.next163.2248 = add nuw nsw i64 %indvars.iv162, 3
%arrayidx22.us.3251 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.2248
%105 = load i32, ptr %arrayidx22.us.3251, align 4, !tbaa !28
%add.us.3252 = add nsw i32 %105, %add.us.2247
store i32 %add.us.3252, ptr %arrayidx22.us.3251, align 4, !tbaa !28
%indvars.iv.next163.3253 = add nuw nsw i64 %indvars.iv162, 4
%arrayidx22.us.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.3253
%106 = load i32, ptr %arrayidx22.us.4, align 4, !tbaa !28
%add.us.4 = add nsw i32 %106, %add.us.3252
store i32 %add.us.4, ptr %arrayidx22.us.4, align 4, !tbaa !28
%indvars.iv.next163.4 = add nuw nsw i64 %indvars.iv162, 5
%exitcond166.not.4 = icmp eq i64 %indvars.iv.next163.4, 256
br i1 %exitcond166.not.4, label %for.cond28.preheader.us, label %for.body18.us, !llvm.loop !29
for.body7.us: ; preds = %for.body7.us, %for.body7.lr.ph.us.new
%indvars.iv158 = phi i64 [ 0, %for.body7.lr.ph.us.new ], [ %indvars.iv.next159.1238, %for.body7.us ]
%niter = phi i64 [ 0, %for.body7.lr.ph.us.new ], [ %niter.next.1, %for.body7.us ]
%107 = mul nuw nsw i64 %indvars.iv158, %0
%gep.us = getelementptr i32, ptr %invariant.gep.us, i64 %107
%108 = load i32, ptr %gep.us, align 4, !tbaa !28
%and.us = and i32 %108, 255
%idxprom10.us = zext i32 %and.us to i64
%arrayidx11.us = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us
%109 = load i32, ptr %arrayidx11.us, align 4, !tbaa !28
%inc.us = add nsw i32 %109, 1
store i32 %inc.us, ptr %arrayidx11.us, align 4, !tbaa !28
%indvars.iv.next159 = or i64 %indvars.iv158, 1
%110 = mul nuw nsw i64 %indvars.iv.next159, %0
%gep.us.1233 = getelementptr i32, ptr %invariant.gep.us, i64 %110
%111 = load i32, ptr %gep.us.1233, align 4, !tbaa !28
%and.us.1234 = and i32 %111, 255
%idxprom10.us.1235 = zext i32 %and.us.1234 to i64
%arrayidx11.us.1236 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.1235
%112 = load i32, ptr %arrayidx11.us.1236, align 4, !tbaa !28
%inc.us.1237 = add nsw i32 %112, 1
store i32 %inc.us.1237, ptr %arrayidx11.us.1236, align 4, !tbaa !28
%indvars.iv.next159.1238 = add nuw nsw i64 %indvars.iv158, 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.cond14.preheader.us.unr-lcssa, label %for.body7.us, !llvm.loop !30
for.cond28.preheader.us: ; preds = %for.body18.us
%invariant.gep100.us = getelementptr i32, ptr %base, i64 %idxprom8
%113 = zext i32 %count to i64
%xtraiter255 = and i64 %113, 1
%lcmp.mod256.not = icmp eq i64 %xtraiter255, 0
br i1 %lcmp.mod256.not, label %for.body32.us105.prol.loopexit, label %for.body32.us105.prol
for.body32.us105.prol: ; preds = %for.cond28.preheader.us
%114 = mul nuw nsw i64 %1, %0
%gep101.us.prol = getelementptr i32, ptr %invariant.gep100.us, i64 %114
%115 = load i32, ptr %gep101.us.prol, align 4, !tbaa !28
%and39.us109.prol = and i32 %115, 255
%idxprom40.us110.prol = zext i32 %and39.us109.prol to i64
%arrayidx41.us111.prol = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.prol
%116 = load i32, ptr %arrayidx41.us111.prol, align 4, !tbaa !28
%dec.us112.prol = add nsw i32 %116, -1
store i32 %dec.us112.prol, ptr %arrayidx41.us111.prol, align 4, !tbaa !28
%indvars.iv.next168.prol = add nsw i64 %1, -1
br label %for.body32.us105.prol.loopexit
for.body32.us105.prol.loopexit: ; preds = %for.body32.us105.prol, %for.cond28.preheader.us
%indvars.iv167.unr = phi i64 [ %1, %for.cond28.preheader.us ], [ %indvars.iv.next168.prol, %for.body32.us105.prol ]
%117 = icmp eq i32 %i26.097, 0
br i1 %117, label %for.body7.lr.ph.us.1, label %for.body32.us105
for.cond14.preheader.us.unr-lcssa: ; preds = %for.body7.us, %for.body7.lr.ph.us
%indvars.iv158.unr = phi i64 [ 0, %for.body7.lr.ph.us ], [ %indvars.iv.next159.1238, %for.body7.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond14.preheader.us, label %for.body7.us.epil
for.body7.us.epil: ; preds = %for.cond14.preheader.us.unr-lcssa
%118 = mul nuw nsw i64 %indvars.iv158.unr, %0
%gep.us.epil = getelementptr i32, ptr %invariant.gep.us, i64 %118
%119 = load i32, ptr %gep.us.epil, align 4, !tbaa !28
%and.us.epil = and i32 %119, 255
%idxprom10.us.epil = zext i32 %and.us.epil to i64
%arrayidx11.us.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.epil
%120 = load i32, ptr %arrayidx11.us.epil, align 4, !tbaa !28
%inc.us.epil = add nsw i32 %120, 1
store i32 %inc.us.epil, ptr %arrayidx11.us.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us
for.cond14.preheader.us: ; preds = %for.cond14.preheader.us.unr-lcssa, %for.body7.us.epil
%.pre.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us
for.body7.lr.ph.us: ; preds = %entry.split.us
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us = getelementptr i32, ptr %base, i64 %idxprom8
%wide.trip.count = zext i32 %count to i64
%121 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 1
%122 = icmp eq i64 %121, 0
br i1 %122, label %for.cond14.preheader.us.unr-lcssa, label %for.body7.lr.ph.us.new
for.body7.lr.ph.us.new: ; preds = %for.body7.lr.ph.us
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body7.us
for.body7.lr.ph.us.1: ; preds = %for.body32.us105, %for.body32.us105.prol.loopexit
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us.1 = getelementptr i32, ptr %call, i64 %idxprom8
%xtraiter266 = and i64 %wide.trip.count, 1
%123 = icmp eq i64 %121, 0
br i1 %123, label %for.cond14.preheader.us.1.unr-lcssa, label %for.body7.lr.ph.us.1.new
for.body7.lr.ph.us.1.new: ; preds = %for.body7.lr.ph.us.1
%unroll_iter268 = and i64 %wide.trip.count, 4294967294
br label %for.body7.us.1
for.body7.us.1: ; preds = %for.body7.us.1, %for.body7.lr.ph.us.1.new
%indvars.iv158.1 = phi i64 [ 0, %for.body7.lr.ph.us.1.new ], [ %indvars.iv.next159.1.1, %for.body7.us.1 ]
%niter269 = phi i64 [ 0, %for.body7.lr.ph.us.1.new ], [ %niter269.next.1, %for.body7.us.1 ]
%124 = mul nuw nsw i64 %indvars.iv158.1, %0
%gep.us.1 = getelementptr i32, ptr %invariant.gep.us.1, i64 %124
%125 = load i32, ptr %gep.us.1, align 4, !tbaa !28
%shr.us.1 = lshr i32 %125, 8
%and.us.1 = and i32 %shr.us.1, 255
%idxprom10.us.1 = zext i32 %and.us.1 to i64
%arrayidx11.us.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.1
%126 = load i32, ptr %arrayidx11.us.1, align 4, !tbaa !28
%inc.us.1 = add nsw i32 %126, 1
store i32 %inc.us.1, ptr %arrayidx11.us.1, align 4, !tbaa !28
%indvars.iv.next159.1 = or i64 %indvars.iv158.1, 1
%127 = mul nuw nsw i64 %indvars.iv.next159.1, %0
%gep.us.1.1 = getelementptr i32, ptr %invariant.gep.us.1, i64 %127
%128 = load i32, ptr %gep.us.1.1, align 4, !tbaa !28
%shr.us.1.1 = lshr i32 %128, 8
%and.us.1.1 = and i32 %shr.us.1.1, 255
%idxprom10.us.1.1 = zext i32 %and.us.1.1 to i64
%arrayidx11.us.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.1.1
%129 = load i32, ptr %arrayidx11.us.1.1, align 4, !tbaa !28
%inc.us.1.1 = add nsw i32 %129, 1
store i32 %inc.us.1.1, ptr %arrayidx11.us.1.1, align 4, !tbaa !28
%indvars.iv.next159.1.1 = add nuw nsw i64 %indvars.iv158.1, 2
%niter269.next.1 = add i64 %niter269, 2
%niter269.ncmp.1 = icmp eq i64 %niter269.next.1, %unroll_iter268
br i1 %niter269.ncmp.1, label %for.cond14.preheader.us.1.unr-lcssa, label %for.body7.us.1, !llvm.loop !30
for.cond14.preheader.us.1.unr-lcssa: ; preds = %for.body7.us.1, %for.body7.lr.ph.us.1
%indvars.iv158.1.unr = phi i64 [ 0, %for.body7.lr.ph.us.1 ], [ %indvars.iv.next159.1.1, %for.body7.us.1 ]
%lcmp.mod267.not = icmp eq i64 %xtraiter266, 0
br i1 %lcmp.mod267.not, label %for.cond14.preheader.us.1, label %for.body7.us.1.epil
for.body7.us.1.epil: ; preds = %for.cond14.preheader.us.1.unr-lcssa
%130 = mul nuw nsw i64 %indvars.iv158.1.unr, %0
%gep.us.1.epil = getelementptr i32, ptr %invariant.gep.us.1, i64 %130
%131 = load i32, ptr %gep.us.1.epil, align 4, !tbaa !28
%shr.us.1.epil = lshr i32 %131, 8
%and.us.1.epil = and i32 %shr.us.1.epil, 255
%idxprom10.us.1.epil = zext i32 %and.us.1.epil to i64
%arrayidx11.us.1.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.1.epil
%132 = load i32, ptr %arrayidx11.us.1.epil, align 4, !tbaa !28
%inc.us.1.epil = add nsw i32 %132, 1
store i32 %inc.us.1.epil, ptr %arrayidx11.us.1.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.1
for.cond14.preheader.us.1: ; preds = %for.cond14.preheader.us.1.unr-lcssa, %for.body7.us.1.epil
%.pre190.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.1
for.body18.us.1: ; preds = %for.body18.us.1, %for.cond14.preheader.us.1
%133 = phi i32 [ %.pre190.pre, %for.cond14.preheader.us.1 ], [ %add.us.1.4, %for.body18.us.1 ]
%indvars.iv162.1 = phi i64 [ 1, %for.cond14.preheader.us.1 ], [ %indvars.iv.next163.1.4, %for.body18.us.1 ]
%arrayidx22.us.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv162.1
%134 = load i32, ptr %arrayidx22.us.1, align 4, !tbaa !28
%add.us.1 = add nsw i32 %134, %133
store i32 %add.us.1, ptr %arrayidx22.us.1, align 4, !tbaa !28
%indvars.iv.next163.1 = add nuw nsw i64 %indvars.iv162.1, 1
%arrayidx22.us.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.1
%135 = load i32, ptr %arrayidx22.us.1.1, align 4, !tbaa !28
%add.us.1.1 = add nsw i32 %135, %add.us.1
store i32 %add.us.1.1, ptr %arrayidx22.us.1.1, align 4, !tbaa !28
%indvars.iv.next163.1.1 = add nuw nsw i64 %indvars.iv162.1, 2
%arrayidx22.us.1.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.1.1
%136 = load i32, ptr %arrayidx22.us.1.2, align 4, !tbaa !28
%add.us.1.2 = add nsw i32 %136, %add.us.1.1
store i32 %add.us.1.2, ptr %arrayidx22.us.1.2, align 4, !tbaa !28
%indvars.iv.next163.1.2 = add nuw nsw i64 %indvars.iv162.1, 3
%arrayidx22.us.1.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.1.2
%137 = load i32, ptr %arrayidx22.us.1.3, align 4, !tbaa !28
%add.us.1.3 = add nsw i32 %137, %add.us.1.2
store i32 %add.us.1.3, ptr %arrayidx22.us.1.3, align 4, !tbaa !28
%indvars.iv.next163.1.3 = add nuw nsw i64 %indvars.iv162.1, 4
%arrayidx22.us.1.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.1.3
%138 = load i32, ptr %arrayidx22.us.1.4, align 4, !tbaa !28
%add.us.1.4 = add nsw i32 %138, %add.us.1.3
store i32 %add.us.1.4, ptr %arrayidx22.us.1.4, align 4, !tbaa !28
%indvars.iv.next163.1.4 = add nuw nsw i64 %indvars.iv162.1, 5
%exitcond166.1.not.4 = icmp eq i64 %indvars.iv.next163.1.4, 256
br i1 %exitcond166.1.not.4, label %for.cond28.preheader.us.1, label %for.body18.us.1, !llvm.loop !29
for.cond28.preheader.us.1: ; preds = %for.body18.us.1
%invariant.gep100.us.1 = getelementptr i32, ptr %call, i64 %idxprom8
%xtraiter270 = and i64 %113, 1
%lcmp.mod271.not = icmp eq i64 %xtraiter270, 0
br i1 %lcmp.mod271.not, label %for.body32.us105.1.prol.loopexit, label %for.body32.us105.1.prol
for.body32.us105.1.prol: ; preds = %for.cond28.preheader.us.1
%139 = mul nuw nsw i64 %1, %0
%gep101.us.1.prol = getelementptr i32, ptr %invariant.gep100.us.1, i64 %139
%140 = load i32, ptr %gep101.us.1.prol, align 4, !tbaa !28
%shr38.us108.1.prol = lshr i32 %140, 8
%and39.us109.1.prol = and i32 %shr38.us108.1.prol, 255
%idxprom40.us110.1.prol = zext i32 %and39.us109.1.prol to i64
%arrayidx41.us111.1.prol = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.1.prol
%141 = load i32, ptr %arrayidx41.us111.1.prol, align 4, !tbaa !28
%dec.us112.1.prol = add nsw i32 %141, -1
store i32 %dec.us112.1.prol, ptr %arrayidx41.us111.1.prol, align 4, !tbaa !28
%indvars.iv.next168.1.prol = add nsw i64 %1, -1
br label %for.body32.us105.1.prol.loopexit
for.body32.us105.1.prol.loopexit: ; preds = %for.body32.us105.1.prol, %for.cond28.preheader.us.1
%indvars.iv167.1.unr = phi i64 [ %1, %for.cond28.preheader.us.1 ], [ %indvars.iv.next168.1.prol, %for.body32.us105.1.prol ]
%142 = icmp eq i32 %i26.097, 0
br i1 %142, label %for.body7.lr.ph.us.2, label %for.body32.us105.1
for.body32.us105.1: ; preds = %for.body32.us105.1.prol.loopexit, %for.body32.us105.1
%indvars.iv167.1 = phi i64 [ %indvars.iv.next168.1.1, %for.body32.us105.1 ], [ %indvars.iv167.1.unr, %for.body32.us105.1.prol.loopexit ]
%143 = mul nuw nsw i64 %indvars.iv167.1, %0
%gep101.us.1 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %143
%144 = load i32, ptr %gep101.us.1, align 4, !tbaa !28
%shr38.us108.1 = lshr i32 %144, 8
%and39.us109.1 = and i32 %shr38.us108.1, 255
%idxprom40.us110.1 = zext i32 %and39.us109.1 to i64
%arrayidx41.us111.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.1
%145 = load i32, ptr %arrayidx41.us111.1, align 4, !tbaa !28
%dec.us112.1 = add nsw i32 %145, -1
store i32 %dec.us112.1, ptr %arrayidx41.us111.1, align 4, !tbaa !28
%indvars.iv.next168.1 = add nsw i64 %indvars.iv167.1, -1
%146 = mul nuw nsw i64 %indvars.iv.next168.1, %0
%gep101.us.1.1 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %146
%147 = load i32, ptr %gep101.us.1.1, align 4, !tbaa !28
%shr38.us108.1.1 = lshr i32 %147, 8
%and39.us109.1.1 = and i32 %shr38.us108.1.1, 255
%idxprom40.us110.1.1 = zext i32 %and39.us109.1.1 to i64
%arrayidx41.us111.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.1.1
%148 = load i32, ptr %arrayidx41.us111.1.1, align 4, !tbaa !28
%dec.us112.1.1 = add nsw i32 %148, -1
store i32 %dec.us112.1.1, ptr %arrayidx41.us111.1.1, align 4, !tbaa !28
%indvars.iv.next168.1.1 = add nsw i64 %indvars.iv167.1, -2
%cmp29.us114.1.1 = icmp sgt i64 %indvars.iv167.1, 1
br i1 %cmp29.us114.1.1, label %for.body32.us105.1, label %for.body7.lr.ph.us.2, !llvm.loop !31
for.body7.lr.ph.us.2: ; preds = %for.body32.us105.1, %for.body32.us105.1.prol.loopexit
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%xtraiter272 = and i64 %wide.trip.count, 1
%149 = icmp eq i64 %121, 0
br i1 %149, label %for.cond14.preheader.us.2.unr-lcssa, label %for.body7.lr.ph.us.2.new
for.body7.lr.ph.us.2.new: ; preds = %for.body7.lr.ph.us.2
%unroll_iter274 = and i64 %wide.trip.count, 4294967294
br label %for.body7.us.2
for.body7.us.2: ; preds = %for.body7.us.2, %for.body7.lr.ph.us.2.new
%indvars.iv158.2 = phi i64 [ 0, %for.body7.lr.ph.us.2.new ], [ %indvars.iv.next159.2.1, %for.body7.us.2 ]
%niter275 = phi i64 [ 0, %for.body7.lr.ph.us.2.new ], [ %niter275.next.1, %for.body7.us.2 ]
%150 = mul nuw nsw i64 %indvars.iv158.2, %0
%gep.us.2 = getelementptr i32, ptr %invariant.gep100.us, i64 %150
%151 = load i32, ptr %gep.us.2, align 4, !tbaa !28
%shr.us.2 = lshr i32 %151, 16
%and.us.2 = and i32 %shr.us.2, 255
%idxprom10.us.2 = zext i32 %and.us.2 to i64
%arrayidx11.us.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.2
%152 = load i32, ptr %arrayidx11.us.2, align 4, !tbaa !28
%inc.us.2 = add nsw i32 %152, 1
store i32 %inc.us.2, ptr %arrayidx11.us.2, align 4, !tbaa !28
%indvars.iv.next159.2 = or i64 %indvars.iv158.2, 1
%153 = mul nuw nsw i64 %indvars.iv.next159.2, %0
%gep.us.2.1 = getelementptr i32, ptr %invariant.gep100.us, i64 %153
%154 = load i32, ptr %gep.us.2.1, align 4, !tbaa !28
%shr.us.2.1 = lshr i32 %154, 16
%and.us.2.1 = and i32 %shr.us.2.1, 255
%idxprom10.us.2.1 = zext i32 %and.us.2.1 to i64
%arrayidx11.us.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.2.1
%155 = load i32, ptr %arrayidx11.us.2.1, align 4, !tbaa !28
%inc.us.2.1 = add nsw i32 %155, 1
store i32 %inc.us.2.1, ptr %arrayidx11.us.2.1, align 4, !tbaa !28
%indvars.iv.next159.2.1 = add nuw nsw i64 %indvars.iv158.2, 2
%niter275.next.1 = add i64 %niter275, 2
%niter275.ncmp.1 = icmp eq i64 %niter275.next.1, %unroll_iter274
br i1 %niter275.ncmp.1, label %for.cond14.preheader.us.2.unr-lcssa, label %for.body7.us.2, !llvm.loop !30
for.cond14.preheader.us.2.unr-lcssa: ; preds = %for.body7.us.2, %for.body7.lr.ph.us.2
%indvars.iv158.2.unr = phi i64 [ 0, %for.body7.lr.ph.us.2 ], [ %indvars.iv.next159.2.1, %for.body7.us.2 ]
%lcmp.mod273.not = icmp eq i64 %xtraiter272, 0
br i1 %lcmp.mod273.not, label %for.cond14.preheader.us.2, label %for.body7.us.2.epil
for.body7.us.2.epil: ; preds = %for.cond14.preheader.us.2.unr-lcssa
%156 = mul nuw nsw i64 %indvars.iv158.2.unr, %0
%gep.us.2.epil = getelementptr i32, ptr %invariant.gep100.us, i64 %156
%157 = load i32, ptr %gep.us.2.epil, align 4, !tbaa !28
%shr.us.2.epil = lshr i32 %157, 16
%and.us.2.epil = and i32 %shr.us.2.epil, 255
%idxprom10.us.2.epil = zext i32 %and.us.2.epil to i64
%arrayidx11.us.2.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.2.epil
%158 = load i32, ptr %arrayidx11.us.2.epil, align 4, !tbaa !28
%inc.us.2.epil = add nsw i32 %158, 1
store i32 %inc.us.2.epil, ptr %arrayidx11.us.2.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.2
for.cond14.preheader.us.2: ; preds = %for.cond14.preheader.us.2.unr-lcssa, %for.body7.us.2.epil
%.pre191.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.2
for.body18.us.2: ; preds = %for.body18.us.2, %for.cond14.preheader.us.2
%159 = phi i32 [ %.pre191.pre, %for.cond14.preheader.us.2 ], [ %add.us.2.4, %for.body18.us.2 ]
%indvars.iv162.2 = phi i64 [ 1, %for.cond14.preheader.us.2 ], [ %indvars.iv.next163.2.4, %for.body18.us.2 ]
%arrayidx22.us.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv162.2
%160 = load i32, ptr %arrayidx22.us.2, align 4, !tbaa !28
%add.us.2 = add nsw i32 %160, %159
store i32 %add.us.2, ptr %arrayidx22.us.2, align 4, !tbaa !28
%indvars.iv.next163.2 = add nuw nsw i64 %indvars.iv162.2, 1
%arrayidx22.us.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.2
%161 = load i32, ptr %arrayidx22.us.2.1, align 4, !tbaa !28
%add.us.2.1 = add nsw i32 %161, %add.us.2
store i32 %add.us.2.1, ptr %arrayidx22.us.2.1, align 4, !tbaa !28
%indvars.iv.next163.2.1 = add nuw nsw i64 %indvars.iv162.2, 2
%arrayidx22.us.2.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.2.1
%162 = load i32, ptr %arrayidx22.us.2.2, align 4, !tbaa !28
%add.us.2.2 = add nsw i32 %162, %add.us.2.1
store i32 %add.us.2.2, ptr %arrayidx22.us.2.2, align 4, !tbaa !28
%indvars.iv.next163.2.2 = add nuw nsw i64 %indvars.iv162.2, 3
%arrayidx22.us.2.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.2.2
%163 = load i32, ptr %arrayidx22.us.2.3, align 4, !tbaa !28
%add.us.2.3 = add nsw i32 %163, %add.us.2.2
store i32 %add.us.2.3, ptr %arrayidx22.us.2.3, align 4, !tbaa !28
%indvars.iv.next163.2.3 = add nuw nsw i64 %indvars.iv162.2, 4
%arrayidx22.us.2.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.2.3
%164 = load i32, ptr %arrayidx22.us.2.4, align 4, !tbaa !28
%add.us.2.4 = add nsw i32 %164, %add.us.2.3
store i32 %add.us.2.4, ptr %arrayidx22.us.2.4, align 4, !tbaa !28
%indvars.iv.next163.2.4 = add nuw nsw i64 %indvars.iv162.2, 5
%exitcond166.2.not.4 = icmp eq i64 %indvars.iv.next163.2.4, 256
br i1 %exitcond166.2.not.4, label %for.body32.us105.2.preheader, label %for.body18.us.2, !llvm.loop !29
for.body32.us105.2.preheader: ; preds = %for.body18.us.2
%xtraiter276 = and i64 %113, 1
%lcmp.mod277.not = icmp eq i64 %xtraiter276, 0
br i1 %lcmp.mod277.not, label %for.body32.us105.2.prol.loopexit, label %for.body32.us105.2.prol
for.body32.us105.2.prol: ; preds = %for.body32.us105.2.preheader
%165 = mul nuw nsw i64 %1, %0
%gep101.us.2.prol = getelementptr i32, ptr %invariant.gep100.us, i64 %165
%166 = load i32, ptr %gep101.us.2.prol, align 4, !tbaa !28
%shr38.us108.2.prol = lshr i32 %166, 16
%and39.us109.2.prol = and i32 %shr38.us108.2.prol, 255
%idxprom40.us110.2.prol = zext i32 %and39.us109.2.prol to i64
%arrayidx41.us111.2.prol = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.2.prol
%167 = load i32, ptr %arrayidx41.us111.2.prol, align 4, !tbaa !28
%dec.us112.2.prol = add nsw i32 %167, -1
store i32 %dec.us112.2.prol, ptr %arrayidx41.us111.2.prol, align 4, !tbaa !28
%indvars.iv.next168.2.prol = add nsw i64 %1, -1
br label %for.body32.us105.2.prol.loopexit
for.body32.us105.2.prol.loopexit: ; preds = %for.body32.us105.2.prol, %for.body32.us105.2.preheader
%indvars.iv167.2.unr = phi i64 [ %1, %for.body32.us105.2.preheader ], [ %indvars.iv.next168.2.prol, %for.body32.us105.2.prol ]
%168 = icmp eq i32 %i26.097, 0
br i1 %168, label %for.body7.lr.ph.us.3, label %for.body32.us105.2
for.body32.us105.2: ; preds = %for.body32.us105.2.prol.loopexit, %for.body32.us105.2
%indvars.iv167.2 = phi i64 [ %indvars.iv.next168.2.1, %for.body32.us105.2 ], [ %indvars.iv167.2.unr, %for.body32.us105.2.prol.loopexit ]
%169 = mul nuw nsw i64 %indvars.iv167.2, %0
%gep101.us.2 = getelementptr i32, ptr %invariant.gep100.us, i64 %169
%170 = load i32, ptr %gep101.us.2, align 4, !tbaa !28
%shr38.us108.2 = lshr i32 %170, 16
%and39.us109.2 = and i32 %shr38.us108.2, 255
%idxprom40.us110.2 = zext i32 %and39.us109.2 to i64
%arrayidx41.us111.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.2
%171 = load i32, ptr %arrayidx41.us111.2, align 4, !tbaa !28
%dec.us112.2 = add nsw i32 %171, -1
store i32 %dec.us112.2, ptr %arrayidx41.us111.2, align 4, !tbaa !28
%indvars.iv.next168.2 = add nsw i64 %indvars.iv167.2, -1
%172 = mul nuw nsw i64 %indvars.iv.next168.2, %0
%gep101.us.2.1 = getelementptr i32, ptr %invariant.gep100.us, i64 %172
%173 = load i32, ptr %gep101.us.2.1, align 4, !tbaa !28
%shr38.us108.2.1 = lshr i32 %173, 16
%and39.us109.2.1 = and i32 %shr38.us108.2.1, 255
%idxprom40.us110.2.1 = zext i32 %and39.us109.2.1 to i64
%arrayidx41.us111.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.2.1
%174 = load i32, ptr %arrayidx41.us111.2.1, align 4, !tbaa !28
%dec.us112.2.1 = add nsw i32 %174, -1
store i32 %dec.us112.2.1, ptr %arrayidx41.us111.2.1, align 4, !tbaa !28
%indvars.iv.next168.2.1 = add nsw i64 %indvars.iv167.2, -2
%cmp29.us114.2.1 = icmp sgt i64 %indvars.iv167.2, 1
br i1 %cmp29.us114.2.1, label %for.body32.us105.2, label %for.body7.lr.ph.us.3, !llvm.loop !31
for.body7.lr.ph.us.3: ; preds = %for.body32.us105.2, %for.body32.us105.2.prol.loopexit
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%xtraiter278 = and i64 %wide.trip.count, 1
%175 = icmp eq i64 %121, 0
br i1 %175, label %for.cond14.preheader.us.3.unr-lcssa, label %for.body7.lr.ph.us.3.new
for.body7.lr.ph.us.3.new: ; preds = %for.body7.lr.ph.us.3
%unroll_iter280 = and i64 %wide.trip.count, 4294967294
br label %for.body7.us.3
for.body7.us.3: ; preds = %for.body7.us.3, %for.body7.lr.ph.us.3.new
%indvars.iv158.3 = phi i64 [ 0, %for.body7.lr.ph.us.3.new ], [ %indvars.iv.next159.3.1, %for.body7.us.3 ]
%niter281 = phi i64 [ 0, %for.body7.lr.ph.us.3.new ], [ %niter281.next.1, %for.body7.us.3 ]
%176 = mul nuw nsw i64 %indvars.iv158.3, %0
%gep.us.3 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %176
%177 = load i32, ptr %gep.us.3, align 4, !tbaa !28
%shr.us.3 = lshr i32 %177, 24
%idxprom10.us.3 = zext i32 %shr.us.3 to i64
%arrayidx11.us.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.3
%178 = load i32, ptr %arrayidx11.us.3, align 4, !tbaa !28
%inc.us.3 = add nsw i32 %178, 1
store i32 %inc.us.3, ptr %arrayidx11.us.3, align 4, !tbaa !28
%indvars.iv.next159.3 = or i64 %indvars.iv158.3, 1
%179 = mul nuw nsw i64 %indvars.iv.next159.3, %0
%gep.us.3.1 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %179
%180 = load i32, ptr %gep.us.3.1, align 4, !tbaa !28
%shr.us.3.1 = lshr i32 %180, 24
%idxprom10.us.3.1 = zext i32 %shr.us.3.1 to i64
%arrayidx11.us.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.3.1
%181 = load i32, ptr %arrayidx11.us.3.1, align 4, !tbaa !28
%inc.us.3.1 = add nsw i32 %181, 1
store i32 %inc.us.3.1, ptr %arrayidx11.us.3.1, align 4, !tbaa !28
%indvars.iv.next159.3.1 = add nuw nsw i64 %indvars.iv158.3, 2
%niter281.next.1 = add i64 %niter281, 2
%niter281.ncmp.1 = icmp eq i64 %niter281.next.1, %unroll_iter280
br i1 %niter281.ncmp.1, label %for.cond14.preheader.us.3.unr-lcssa, label %for.body7.us.3, !llvm.loop !30
for.cond14.preheader.us.3.unr-lcssa: ; preds = %for.body7.us.3, %for.body7.lr.ph.us.3
%indvars.iv158.3.unr = phi i64 [ 0, %for.body7.lr.ph.us.3 ], [ %indvars.iv.next159.3.1, %for.body7.us.3 ]
%lcmp.mod279.not = icmp eq i64 %xtraiter278, 0
br i1 %lcmp.mod279.not, label %for.cond14.preheader.us.3, label %for.body7.us.3.epil
for.body7.us.3.epil: ; preds = %for.cond14.preheader.us.3.unr-lcssa
%182 = mul nuw nsw i64 %indvars.iv158.3.unr, %0
%gep.us.3.epil = getelementptr i32, ptr %invariant.gep100.us.1, i64 %182
%183 = load i32, ptr %gep.us.3.epil, align 4, !tbaa !28
%shr.us.3.epil = lshr i32 %183, 24
%idxprom10.us.3.epil = zext i32 %shr.us.3.epil to i64
%arrayidx11.us.3.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.3.epil
%184 = load i32, ptr %arrayidx11.us.3.epil, align 4, !tbaa !28
%inc.us.3.epil = add nsw i32 %184, 1
store i32 %inc.us.3.epil, ptr %arrayidx11.us.3.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.3
for.cond14.preheader.us.3: ; preds = %for.cond14.preheader.us.3.unr-lcssa, %for.body7.us.3.epil
%.pre192.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.3
for.body18.us.3: ; preds = %for.body18.us.3, %for.cond14.preheader.us.3
%185 = phi i32 [ %.pre192.pre, %for.cond14.preheader.us.3 ], [ %add.us.3.4, %for.body18.us.3 ]
%indvars.iv162.3 = phi i64 [ 1, %for.cond14.preheader.us.3 ], [ %indvars.iv.next163.3.4, %for.body18.us.3 ]
%arrayidx22.us.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv162.3
%186 = load i32, ptr %arrayidx22.us.3, align 4, !tbaa !28
%add.us.3 = add nsw i32 %186, %185
store i32 %add.us.3, ptr %arrayidx22.us.3, align 4, !tbaa !28
%indvars.iv.next163.3 = add nuw nsw i64 %indvars.iv162.3, 1
%arrayidx22.us.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.3
%187 = load i32, ptr %arrayidx22.us.3.1, align 4, !tbaa !28
%add.us.3.1 = add nsw i32 %187, %add.us.3
store i32 %add.us.3.1, ptr %arrayidx22.us.3.1, align 4, !tbaa !28
%indvars.iv.next163.3.1 = add nuw nsw i64 %indvars.iv162.3, 2
%arrayidx22.us.3.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.3.1
%188 = load i32, ptr %arrayidx22.us.3.2, align 4, !tbaa !28
%add.us.3.2 = add nsw i32 %188, %add.us.3.1
store i32 %add.us.3.2, ptr %arrayidx22.us.3.2, align 4, !tbaa !28
%indvars.iv.next163.3.2 = add nuw nsw i64 %indvars.iv162.3, 3
%arrayidx22.us.3.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.3.2
%189 = load i32, ptr %arrayidx22.us.3.3, align 4, !tbaa !28
%add.us.3.3 = add nsw i32 %189, %add.us.3.2
store i32 %add.us.3.3, ptr %arrayidx22.us.3.3, align 4, !tbaa !28
%indvars.iv.next163.3.3 = add nuw nsw i64 %indvars.iv162.3, 4
%arrayidx22.us.3.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.3.3
%190 = load i32, ptr %arrayidx22.us.3.4, align 4, !tbaa !28
%add.us.3.4 = add nsw i32 %190, %add.us.3.3
store i32 %add.us.3.4, ptr %arrayidx22.us.3.4, align 4, !tbaa !28
%indvars.iv.next163.3.4 = add nuw nsw i64 %indvars.iv162.3, 5
%exitcond166.3.not.4 = icmp eq i64 %indvars.iv.next163.3.4, 256
br i1 %exitcond166.3.not.4, label %for.body32.us105.3.preheader, label %for.body18.us.3, !llvm.loop !29
for.body32.us105.3.preheader: ; preds = %for.body18.us.3
%xtraiter282 = and i64 %113, 1
%lcmp.mod283.not = icmp eq i64 %xtraiter282, 0
br i1 %lcmp.mod283.not, label %for.body32.us105.3.prol.loopexit, label %for.body32.us105.3.prol
for.body32.us105.3.prol: ; preds = %for.body32.us105.3.preheader
%191 = mul nuw nsw i64 %1, %0
%gep101.us.3.prol = getelementptr i32, ptr %invariant.gep100.us.1, i64 %191
%192 = load i32, ptr %gep101.us.3.prol, align 4, !tbaa !28
%shr38.us108.3.prol = lshr i32 %192, 24
%idxprom40.us110.3.prol = zext i32 %shr38.us108.3.prol to i64
%arrayidx41.us111.3.prol = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.3.prol
%193 = load i32, ptr %arrayidx41.us111.3.prol, align 4, !tbaa !28
%dec.us112.3.prol = add nsw i32 %193, -1
store i32 %dec.us112.3.prol, ptr %arrayidx41.us111.3.prol, align 4, !tbaa !28
%indvars.iv.next168.3.prol = add nsw i64 %1, -1
br label %for.body32.us105.3.prol.loopexit
for.body32.us105.3.prol.loopexit: ; preds = %for.body32.us105.3.prol, %for.body32.us105.3.preheader
%indvars.iv167.3.unr = phi i64 [ %1, %for.body32.us105.3.preheader ], [ %indvars.iv.next168.3.prol, %for.body32.us105.3.prol ]
%194 = icmp eq i32 %i26.097, 0
br i1 %194, label %for.cond.cleanup, label %for.body32.us105.3
for.body32.us105.3: ; preds = %for.body32.us105.3.prol.loopexit, %for.body32.us105.3
%indvars.iv167.3 = phi i64 [ %indvars.iv.next168.3.1, %for.body32.us105.3 ], [ %indvars.iv167.3.unr, %for.body32.us105.3.prol.loopexit ]
%195 = mul nuw nsw i64 %indvars.iv167.3, %0
%gep101.us.3 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %195
%196 = load i32, ptr %gep101.us.3, align 4, !tbaa !28
%shr38.us108.3 = lshr i32 %196, 24
%idxprom40.us110.3 = zext i32 %shr38.us108.3 to i64
%arrayidx41.us111.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.3
%197 = load i32, ptr %arrayidx41.us111.3, align 4, !tbaa !28
%dec.us112.3 = add nsw i32 %197, -1
store i32 %dec.us112.3, ptr %arrayidx41.us111.3, align 4, !tbaa !28
%indvars.iv.next168.3 = add nsw i64 %indvars.iv167.3, -1
%198 = mul nuw nsw i64 %indvars.iv.next168.3, %0
%gep101.us.3.1 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %198
%199 = load i32, ptr %gep101.us.3.1, align 4, !tbaa !28
%shr38.us108.3.1 = lshr i32 %199, 24
%idxprom40.us110.3.1 = zext i32 %shr38.us108.3.1 to i64
%arrayidx41.us111.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.3.1
%200 = load i32, ptr %arrayidx41.us111.3.1, align 4, !tbaa !28
%dec.us112.3.1 = add nsw i32 %200, -1
store i32 %dec.us112.3.1, ptr %arrayidx41.us111.3.1, align 4, !tbaa !28
%indvars.iv.next168.3.1 = add nsw i64 %indvars.iv167.3, -2
%cmp29.us114.3.1 = icmp sgt i64 %indvars.iv167.3, 1
br i1 %cmp29.us114.3.1, label %for.body32.us105.3, label %for.cond.cleanup, !llvm.loop !31
for.cond.cleanup: ; preds = %for.body18.3, %for.body32.us105.3.prol.loopexit, %for.body32.us105.3, %for.body32.us.us.us.3
tail call void @free(ptr noundef %call) #8
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %c) #8
ret void
for.cond28.preheader: ; preds = %for.body18
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
br label %for.body18.1
for.body18.1: ; preds = %for.body18.1, %for.cond28.preheader
%201 = phi i32 [ 0, %for.cond28.preheader ], [ %add.1.4, %for.body18.1 ]
%indvars.iv.1 = phi i64 [ 1, %for.cond28.preheader ], [ %indvars.iv.next.1.4, %for.body18.1 ]
%arrayidx22.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.1
%202 = load i32, ptr %arrayidx22.1, align 4, !tbaa !28
%add.1 = add nsw i32 %202, %201
store i32 %add.1, ptr %arrayidx22.1, align 4, !tbaa !28
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
%arrayidx22.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.1
%203 = load i32, ptr %arrayidx22.1.1, align 4, !tbaa !28
%add.1.1 = add nsw i32 %203, %add.1
store i32 %add.1.1, ptr %arrayidx22.1.1, align 4, !tbaa !28
%indvars.iv.next.1.1 = add nuw nsw i64 %indvars.iv.1, 2
%arrayidx22.1.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.1.1
%204 = load i32, ptr %arrayidx22.1.2, align 4, !tbaa !28
%add.1.2 = add nsw i32 %204, %add.1.1
store i32 %add.1.2, ptr %arrayidx22.1.2, align 4, !tbaa !28
%indvars.iv.next.1.2 = add nuw nsw i64 %indvars.iv.1, 3
%arrayidx22.1.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.1.2
%205 = load i32, ptr %arrayidx22.1.3, align 4, !tbaa !28
%add.1.3 = add nsw i32 %205, %add.1.2
store i32 %add.1.3, ptr %arrayidx22.1.3, align 4, !tbaa !28
%indvars.iv.next.1.3 = add nuw nsw i64 %indvars.iv.1, 4
%arrayidx22.1.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.1.3
%206 = load i32, ptr %arrayidx22.1.4, align 4, !tbaa !28
%add.1.4 = add nsw i32 %206, %add.1.3
store i32 %add.1.4, ptr %arrayidx22.1.4, align 4, !tbaa !28
%indvars.iv.next.1.4 = add nuw nsw i64 %indvars.iv.1, 5
%exitcond.1.not.4 = icmp eq i64 %indvars.iv.next.1.4, 256
br i1 %exitcond.1.not.4, label %for.cond28.preheader.1, label %for.body18.1, !llvm.loop !29
for.cond28.preheader.1: ; preds = %for.body18.1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
br label %for.body18.2
for.body18.2: ; preds = %for.body18.2, %for.cond28.preheader.1
%207 = phi i32 [ 0, %for.cond28.preheader.1 ], [ %add.2.4, %for.body18.2 ]
%indvars.iv.2 = phi i64 [ 1, %for.cond28.preheader.1 ], [ %indvars.iv.next.2.4, %for.body18.2 ]
%arrayidx22.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.2
%208 = load i32, ptr %arrayidx22.2, align 4, !tbaa !28
%add.2 = add nsw i32 %208, %207
store i32 %add.2, ptr %arrayidx22.2, align 4, !tbaa !28
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
%arrayidx22.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.2
%209 = load i32, ptr %arrayidx22.2.1, align 4, !tbaa !28
%add.2.1 = add nsw i32 %209, %add.2
store i32 %add.2.1, ptr %arrayidx22.2.1, align 4, !tbaa !28
%indvars.iv.next.2.1 = add nuw nsw i64 %indvars.iv.2, 2
%arrayidx22.2.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.2.1
%210 = load i32, ptr %arrayidx22.2.2, align 4, !tbaa !28
%add.2.2 = add nsw i32 %210, %add.2.1
store i32 %add.2.2, ptr %arrayidx22.2.2, align 4, !tbaa !28
%indvars.iv.next.2.2 = add nuw nsw i64 %indvars.iv.2, 3
%arrayidx22.2.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.2.2
%211 = load i32, ptr %arrayidx22.2.3, align 4, !tbaa !28
%add.2.3 = add nsw i32 %211, %add.2.2
store i32 %add.2.3, ptr %arrayidx22.2.3, align 4, !tbaa !28
%indvars.iv.next.2.3 = add nuw nsw i64 %indvars.iv.2, 4
%arrayidx22.2.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.2.3
%212 = load i32, ptr %arrayidx22.2.4, align 4, !tbaa !28
%add.2.4 = add nsw i32 %212, %add.2.3
store i32 %add.2.4, ptr %arrayidx22.2.4, align 4, !tbaa !28
%indvars.iv.next.2.4 = add nuw nsw i64 %indvars.iv.2, 5
%exitcond.2.not.4 = icmp eq i64 %indvars.iv.next.2.4, 256
br i1 %exitcond.2.not.4, label %for.cond28.preheader.2, label %for.body18.2, !llvm.loop !29
for.cond28.preheader.2: ; preds = %for.body18.2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
br label %for.body18.3
for.body18.3: ; preds = %for.body18.3, %for.cond28.preheader.2
%213 = phi i32 [ 0, %for.cond28.preheader.2 ], [ %add.3.4, %for.body18.3 ]
%indvars.iv.3 = phi i64 [ 1, %for.cond28.preheader.2 ], [ %indvars.iv.next.3.4, %for.body18.3 ]
%arrayidx22.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.3
%214 = load i32, ptr %arrayidx22.3, align 4, !tbaa !28
%add.3 = add nsw i32 %214, %213
store i32 %add.3, ptr %arrayidx22.3, align 4, !tbaa !28
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
%arrayidx22.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.3
%215 = load i32, ptr %arrayidx22.3.1, align 4, !tbaa !28
%add.3.1 = add nsw i32 %215, %add.3
store i32 %add.3.1, ptr %arrayidx22.3.1, align 4, !tbaa !28
%indvars.iv.next.3.1 = add nuw nsw i64 %indvars.iv.3, 2
%arrayidx22.3.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.3.1
%216 = load i32, ptr %arrayidx22.3.2, align 4, !tbaa !28
%add.3.2 = add nsw i32 %216, %add.3.1
store i32 %add.3.2, ptr %arrayidx22.3.2, align 4, !tbaa !28
%indvars.iv.next.3.2 = add nuw nsw i64 %indvars.iv.3, 3
%arrayidx22.3.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.3.2
%217 = load i32, ptr %arrayidx22.3.3, align 4, !tbaa !28
%add.3.3 = add nsw i32 %217, %add.3.2
store i32 %add.3.3, ptr %arrayidx22.3.3, align 4, !tbaa !28
%indvars.iv.next.3.3 = add nuw nsw i64 %indvars.iv.3, 4
%arrayidx22.3.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.3.3
%218 = load i32, ptr %arrayidx22.3.4, align 4, !tbaa !28
%add.3.4 = add nsw i32 %218, %add.3.3
store i32 %add.3.4, ptr %arrayidx22.3.4, align 4, !tbaa !28
%indvars.iv.next.3.4 = add nuw nsw i64 %indvars.iv.3, 5
%exitcond.3.not.4 = icmp eq i64 %indvars.iv.next.3.4, 256
br i1 %exitcond.3.not.4, label %for.cond.cleanup, label %for.body18.3, !llvm.loop !29
for.body18: ; preds = %for.body18, %for.body.preheader
%219 = phi i32 [ 0, %for.body.preheader ], [ %add.4, %for.body18 ]
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.4, %for.body18 ]
%arrayidx22 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv
%220 = load i32, ptr %arrayidx22, align 4, !tbaa !28
%add = add nsw i32 %220, %219
store i32 %add, ptr %arrayidx22, align 4, !tbaa !28
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx22.1218 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next
%221 = load i32, ptr %arrayidx22.1218, align 4, !tbaa !28
%add.1219 = add nsw i32 %221, %add
store i32 %add.1219, ptr %arrayidx22.1218, align 4, !tbaa !28
%indvars.iv.next.1220 = add nuw nsw i64 %indvars.iv, 2
%arrayidx22.2223 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.1220
%222 = load i32, ptr %arrayidx22.2223, align 4, !tbaa !28
%add.2224 = add nsw i32 %222, %add.1219
store i32 %add.2224, ptr %arrayidx22.2223, align 4, !tbaa !28
%indvars.iv.next.2225 = add nuw nsw i64 %indvars.iv, 3
%arrayidx22.3228 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.2225
%223 = load i32, ptr %arrayidx22.3228, align 4, !tbaa !28
%add.3229 = add nsw i32 %223, %add.2224
store i32 %add.3229, ptr %arrayidx22.3228, align 4, !tbaa !28
%indvars.iv.next.3230 = add nuw nsw i64 %indvars.iv, 4
%arrayidx22.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.3230
%224 = load i32, ptr %arrayidx22.4, align 4, !tbaa !28
%add.4 = add nsw i32 %224, %add.3229
store i32 %add.4, ptr %arrayidx22.4, align 4, !tbaa !28
%indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5
%exitcond.not.4 = icmp eq i64 %indvars.iv.next.4, 256
br i1 %exitcond.not.4, label %for.cond28.preheader, label %for.body18, !llvm.loop !29
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; 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: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 @nextint()
store i64 1, ptr @a, align 16, !tbaa !32
%cmp.not25 = icmp slt i32 %call, 3
br i1 %cmp.not25, label %for.cond.cleanup, label %for.cond1.preheader.preheader
for.cond1.preheader.preheader: ; preds = %entry
%0 = add nuw i32 %call, 1
%wide.trip.count37 = zext i32 %0 to i64
br label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %for.cond.cleanup3, %for.cond1.preheader.preheader
%indvar = phi i64 [ %indvar.next, %for.cond.cleanup3 ], [ 0, %for.cond1.preheader.preheader ]
%indvars.iv32 = phi i64 [ %indvars.iv.next33, %for.cond.cleanup3 ], [ 3, %for.cond1.preheader.preheader ]
%indvars.iv30 = phi i64 [ %indvars.iv.next31, %for.cond.cleanup3 ], [ 1, %for.cond1.preheader.preheader ]
%arrayidx6 = getelementptr inbounds [2001 x i64], ptr @a, i64 0, i64 %indvars.iv32
%arrayidx6.promoted = load i64, ptr %arrayidx6, align 8, !tbaa !32
%xtraiter = and i64 %indvars.iv30, 3
%1 = icmp ult i64 %indvar, 3
br i1 %1, label %for.cond.cleanup3.unr-lcssa, label %for.body4.lr.ph.new
for.body4.lr.ph.new: ; preds = %for.body4.lr.ph
%unroll_iter = and i64 %indvars.iv30, 9223372036854775804
br label %for.body4
for.cond.cleanup: ; preds = %for.cond.cleanup3, %entry
%idxprom12 = sext i32 %call to i64
%arrayidx13 = getelementptr inbounds [2001 x i64], ptr @a, i64 0, i64 %idxprom12
%2 = load i64, ptr %arrayidx13, align 8, !tbaa !32
%call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %2)
ret i32 0
for.cond.cleanup3.unr-lcssa: ; preds = %for.body4, %for.body4.lr.ph
%add.lcssa.ph = phi i64 [ undef, %for.body4.lr.ph ], [ %add.3, %for.body4 ]
%indvars.iv.unr = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next.3, %for.body4 ]
%add24.unr = phi i64 [ %arrayidx6.promoted, %for.body4.lr.ph ], [ %add.3, %for.body4 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup3, label %for.body4.epil
for.body4.epil: ; preds = %for.cond.cleanup3.unr-lcssa, %for.body4.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body4.epil ], [ %indvars.iv.unr, %for.cond.cleanup3.unr-lcssa ]
%add24.epil = phi i64 [ %add.epil, %for.body4.epil ], [ %add24.unr, %for.cond.cleanup3.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body4.epil ], [ 0, %for.cond.cleanup3.unr-lcssa ]
%arrayidx.epil = getelementptr inbounds [2001 x i64], ptr @a, i64 0, i64 %indvars.iv.epil
%3 = load i64, ptr %arrayidx.epil, align 8, !tbaa !32
%add.epil = add nsw i64 %add24.epil, %3
store i64 %add.epil, ptr %arrayidx6, align 8, !tbaa !32
%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.cond.cleanup3, label %for.body4.epil, !llvm.loop !33
for.cond.cleanup3: ; preds = %for.body4.epil, %for.cond.cleanup3.unr-lcssa
%add.lcssa = phi i64 [ %add.lcssa.ph, %for.cond.cleanup3.unr-lcssa ], [ %add.epil, %for.body4.epil ]
%arrayidx8 = getelementptr inbounds [2001 x i64], ptr @a, i64 0, i64 %indvars.iv32
%rem = srem i64 %add.lcssa, 1000000007
store i64 %rem, ptr %arrayidx8, align 8, !tbaa !32
%indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
%indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
%exitcond38.not = icmp eq i64 %indvars.iv.next33, %wide.trip.count37
%indvar.next = add i64 %indvar, 1
br i1 %exitcond38.not, label %for.cond.cleanup, label %for.body4.lr.ph, !llvm.loop !35
for.body4: ; preds = %for.body4, %for.body4.lr.ph.new
%indvars.iv = phi i64 [ 0, %for.body4.lr.ph.new ], [ %indvars.iv.next.3, %for.body4 ]
%add24 = phi i64 [ %arrayidx6.promoted, %for.body4.lr.ph.new ], [ %add.3, %for.body4 ]
%niter = phi i64 [ 0, %for.body4.lr.ph.new ], [ %niter.next.3, %for.body4 ]
%arrayidx = getelementptr inbounds [2001 x i64], ptr @a, i64 0, i64 %indvars.iv
%4 = load i64, ptr %arrayidx, align 16, !tbaa !32
%add = add nsw i64 %add24, %4
store i64 %add, ptr %arrayidx6, align 8, !tbaa !32
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [2001 x i64], ptr @a, i64 0, i64 %indvars.iv.next
%5 = load i64, ptr %arrayidx.1, align 8, !tbaa !32
%add.1 = add nsw i64 %add, %5
store i64 %add.1, ptr %arrayidx6, align 8, !tbaa !32
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [2001 x i64], ptr @a, i64 0, i64 %indvars.iv.next.1
%6 = load i64, ptr %arrayidx.2, align 16, !tbaa !32
%add.2 = add nsw i64 %add.1, %6
store i64 %add.2, ptr %arrayidx6, align 8, !tbaa !32
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [2001 x i64], ptr @a, i64 0, i64 %indvars.iv.next.2
%7 = load i64, ptr %arrayidx.3, align 8, !tbaa !32
%add.3 = add nsw i64 %add.2, %7
store i64 %add.3, ptr %arrayidx6, align 8, !tbaa !32
%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.cond.cleanup3.unr-lcssa, label %for.body4, !llvm.loop !36
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
declare i32 @__uflow(ptr noundef) local_unnamed_addr #6
declare i32 @__overflow(ptr noundef, i32 noundef) local_unnamed_addr #6
; 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) #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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !18}
!24 = !{!10, !6, i64 40}
!25 = !{!10, !6, i64 48}
!26 = distinct !{!26, !18}
!27 = distinct !{!27, !18}
!28 = !{!11, !11, i64 0}
!29 = distinct !{!29, !18}
!30 = distinct !{!30, !18}
!31 = distinct !{!31, !18}
!32 = !{!12, !12, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.unroll.disable"}
!35 = distinct !{!35, !18}
!36 = distinct !{!36, !18}
|
#include <stdio.h>
#include <string.h>
int main(void)
{
int n, m;
double g[100][100];
double baby[100], baby_next[100];
int i, j, k;
double max;
while (1){
scanf("%d%d", &n, &m);
if (n == 0 && m == 0){
break;
}
for (i = 0; i < n; i++){
for (j = 0; j < n; j++){
scanf("%lf", &g[i][j]);
}
}
for (i = 0; i < n; i++){
baby_next[i] = 1.0;
}
for (k = 0; k < m - 1; k++){
memcpy(baby, baby_next, sizeof(baby));
for (i = 0; i < n; i++){
max = 0.0;
for (j = 0; j < n; j++){
if (max < baby[j] * g[j][i]){
max = baby[j] * g[j][i];
//printf("<%d->%d %.2lf>", j+1, i+1,max);
}
}
//printf("|");
baby_next[i] = max;
}
//printf("\n");
}
memcpy(baby, baby_next, sizeof(baby));
max = 0.0;
for (i = 0; i < n; i++){
if (max < baby[i]){
max = baby[i];
}
}
printf("%.2lf\n", max);
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210495/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210495/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%.2lf\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%g = alloca [100 x [100 x double]], align 16
%baby = alloca [100 x double], align 16
%baby_next = alloca [100 x double], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %g) #4
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %baby) #4
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %baby_next) #4
%call117 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp118 = icmp eq i32 %0, 0
%1 = load i32, ptr %m, align 4
%cmp1119 = icmp eq i32 %1, 0
%or.cond120 = select i1 %cmp118, i1 %cmp1119, i1 false
br i1 %or.cond120, label %while.end, label %for.cond.preheader
for.cond.preheader: ; preds = %entry, %for.end71
%2 = phi i32 [ %27, %for.end71 ], [ %0, %entry ]
%cmp2101 = icmp sgt i32 %2, 0
br i1 %cmp2101, label %for.cond3.preheader, label %for.cond20.preheader.thread
for.cond12.preheader: ; preds = %for.inc9
%cmp13103 = icmp sgt i32 %9, 0
br i1 %cmp13103, label %for.body14.preheader, label %for.cond20.preheader
for.body14.preheader: ; preds = %for.cond12.preheader
%wide.trip.count = zext i32 %9 to i64
%min.iters.check = icmp ult i32 %9, 4
br i1 %min.iters.check, label %for.body14.preheader175, label %vector.ph
vector.ph: ; preds = %for.body14.preheader
%n.vec = and i64 %wide.trip.count, 4294967292
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%3 = getelementptr inbounds [100 x double], ptr %baby_next, i64 0, i64 %index
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %3, align 16, !tbaa !9
%4 = getelementptr inbounds double, ptr %3, i64 2
store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %4, align 16, !tbaa !9
%index.next = add nuw i64 %index, 4
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond20.preheader, label %for.body14.preheader175
for.body14.preheader175: ; preds = %for.body14.preheader, %middle.block
%indvars.iv128.ph = phi i64 [ 0, %for.body14.preheader ], [ %n.vec, %middle.block ]
br label %for.body14
for.cond3.preheader: ; preds = %for.cond.preheader, %for.inc9
%6 = phi i32 [ %9, %for.inc9 ], [ %2, %for.cond.preheader ]
%indvars.iv125 = phi i64 [ %indvars.iv.next126, %for.inc9 ], [ 0, %for.cond.preheader ]
%cmp499 = icmp sgt i32 %6, 0
br i1 %cmp499, label %for.body5, label %for.cond3.preheader.for.inc9_crit_edge
for.cond3.preheader.for.inc9_crit_edge: ; preds = %for.cond3.preheader
%.pre = sext i32 %6 to i64
br 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 [100 x [100 x double]], ptr %g, i64 0, i64 %indvars.iv125, 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
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp4 = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp4, label %for.body5, label %for.inc9, !llvm.loop !15
for.inc9: ; preds = %for.body5, %for.cond3.preheader.for.inc9_crit_edge
%.pre-phi = phi i64 [ %.pre, %for.cond3.preheader.for.inc9_crit_edge ], [ %8, %for.body5 ]
%9 = phi i32 [ %6, %for.cond3.preheader.for.inc9_crit_edge ], [ %7, %for.body5 ]
%indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1
%cmp2 = icmp slt i64 %indvars.iv.next126, %.pre-phi
br i1 %cmp2, label %for.cond3.preheader, label %for.cond12.preheader, !llvm.loop !16
for.cond20.preheader: ; preds = %for.body14, %middle.block, %for.cond12.preheader
%10 = load i32, ptr %m, align 4, !tbaa !5
%cmp21111 = icmp slt i32 %10, 2
%cmp13103.not = xor i1 %cmp13103, true
%brmerge = or i1 %cmp21111, %cmp13103.not
%cmp13103.mux = and i1 %cmp21111, %cmp13103
br i1 %brmerge, label %for.end56, label %for.body22.us.preheader
for.cond20.preheader.thread: ; preds = %for.cond.preheader
%11 = load i32, ptr %m, align 4, !tbaa !5
%cmp21111155 = icmp sgt i32 %11, 1
br i1 %cmp21111155, label %for.end56, label %for.end71
for.body22.us.preheader: ; preds = %for.cond20.preheader
%wide.trip.count140 = zext i32 %9 to i64
%xtraiter = and i64 %wide.trip.count140, 1
%12 = icmp eq i32 %9, 1
%unroll_iter = and i64 %wide.trip.count140, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
%13 = add i32 %10, -2
br label %for.body22.us
for.body22.us: ; preds = %for.body22.us.preheader, %for.cond24.for.inc54_crit_edge.split.us.us
%k.0112.us = phi i32 [ %inc55.us, %for.cond24.for.inc54_crit_edge.split.us.us ], [ 0, %for.body22.us.preheader ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) %baby, ptr noundef nonnull align 16 dereferenceable(800) %baby_next, i64 800, i1 false)
br label %for.cond27.preheader.us.us
for.cond27.preheader.us.us: ; preds = %for.cond27.for.end48_crit_edge.us.us, %for.body22.us
%indvars.iv137 = phi i64 [ %indvars.iv.next138, %for.cond27.for.end48_crit_edge.us.us ], [ 0, %for.body22.us ]
br i1 %12, label %for.cond27.for.end48_crit_edge.us.us.unr-lcssa, label %for.body29.us.us
for.body29.us.us: ; preds = %for.cond27.preheader.us.us, %for.body29.us.us
%indvars.iv132 = phi i64 [ %indvars.iv.next133.1, %for.body29.us.us ], [ 0, %for.cond27.preheader.us.us ]
%max.0107.us.us = phi double [ %max.1.us.us.1, %for.body29.us.us ], [ 0.000000e+00, %for.cond27.preheader.us.us ]
%niter = phi i64 [ %niter.next.1, %for.body29.us.us ], [ 0, %for.cond27.preheader.us.us ]
%arrayidx31.us.us = getelementptr inbounds [100 x double], ptr %baby, i64 0, i64 %indvars.iv132
%14 = load double, ptr %arrayidx31.us.us, align 16, !tbaa !9
%arrayidx35.us.us = getelementptr inbounds [100 x [100 x double]], ptr %g, i64 0, i64 %indvars.iv132, i64 %indvars.iv137
%15 = load double, ptr %arrayidx35.us.us, align 8, !tbaa !9
%mul.us.us = fmul double %14, %15
%cmp36.us.us = fcmp olt double %max.0107.us.us, %mul.us.us
%max.1.us.us = select i1 %cmp36.us.us, double %mul.us.us, double %max.0107.us.us
%indvars.iv.next133 = or i64 %indvars.iv132, 1
%arrayidx31.us.us.1 = getelementptr inbounds [100 x double], ptr %baby, i64 0, i64 %indvars.iv.next133
%16 = load double, ptr %arrayidx31.us.us.1, align 8, !tbaa !9
%arrayidx35.us.us.1 = getelementptr inbounds [100 x [100 x double]], ptr %g, i64 0, i64 %indvars.iv.next133, i64 %indvars.iv137
%17 = load double, ptr %arrayidx35.us.us.1, align 8, !tbaa !9
%mul.us.us.1 = fmul double %16, %17
%cmp36.us.us.1 = fcmp olt double %max.1.us.us, %mul.us.us.1
%max.1.us.us.1 = select i1 %cmp36.us.us.1, double %mul.us.us.1, double %max.1.us.us
%indvars.iv.next133.1 = add nuw nsw i64 %indvars.iv132, 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.cond27.for.end48_crit_edge.us.us.unr-lcssa, label %for.body29.us.us, !llvm.loop !18
for.cond27.for.end48_crit_edge.us.us.unr-lcssa: ; preds = %for.body29.us.us, %for.cond27.preheader.us.us
%max.1.us.us.lcssa.ph = phi double [ undef, %for.cond27.preheader.us.us ], [ %max.1.us.us.1, %for.body29.us.us ]
%indvars.iv132.unr = phi i64 [ 0, %for.cond27.preheader.us.us ], [ %indvars.iv.next133.1, %for.body29.us.us ]
%max.0107.us.us.unr = phi double [ 0.000000e+00, %for.cond27.preheader.us.us ], [ %max.1.us.us.1, %for.body29.us.us ]
br i1 %lcmp.mod.not, label %for.cond27.for.end48_crit_edge.us.us, label %for.body29.us.us.epil
for.body29.us.us.epil: ; preds = %for.cond27.for.end48_crit_edge.us.us.unr-lcssa
%arrayidx31.us.us.epil = getelementptr inbounds [100 x double], ptr %baby, i64 0, i64 %indvars.iv132.unr
%18 = load double, ptr %arrayidx31.us.us.epil, align 8, !tbaa !9
%arrayidx35.us.us.epil = getelementptr inbounds [100 x [100 x double]], ptr %g, i64 0, i64 %indvars.iv132.unr, i64 %indvars.iv137
%19 = load double, ptr %arrayidx35.us.us.epil, align 8, !tbaa !9
%mul.us.us.epil = fmul double %18, %19
%cmp36.us.us.epil = fcmp olt double %max.0107.us.us.unr, %mul.us.us.epil
%max.1.us.us.epil = select i1 %cmp36.us.us.epil, double %mul.us.us.epil, double %max.0107.us.us.unr
br label %for.cond27.for.end48_crit_edge.us.us
for.cond27.for.end48_crit_edge.us.us: ; preds = %for.cond27.for.end48_crit_edge.us.us.unr-lcssa, %for.body29.us.us.epil
%max.1.us.us.lcssa = phi double [ %max.1.us.us.lcssa.ph, %for.cond27.for.end48_crit_edge.us.us.unr-lcssa ], [ %max.1.us.us.epil, %for.body29.us.us.epil ]
%arrayidx50.us.us = getelementptr inbounds [100 x double], ptr %baby_next, i64 0, i64 %indvars.iv137
store double %max.1.us.us.lcssa, ptr %arrayidx50.us.us, align 8, !tbaa !9
%indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
%exitcond141.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count140
br i1 %exitcond141.not, label %for.cond24.for.inc54_crit_edge.split.us.us, label %for.cond27.preheader.us.us, !llvm.loop !19
for.cond24.for.inc54_crit_edge.split.us.us: ; preds = %for.cond27.for.end48_crit_edge.us.us
%inc55.us = add nuw nsw i32 %k.0112.us, 1
%exitcond142.not = icmp eq i32 %k.0112.us, %13
br i1 %exitcond142.not, label %for.end56, label %for.body22.us, !llvm.loop !20
for.body14: ; preds = %for.body14.preheader175, %for.body14
%indvars.iv128 = phi i64 [ %indvars.iv.next129, %for.body14 ], [ %indvars.iv128.ph, %for.body14.preheader175 ]
%arrayidx16 = getelementptr inbounds [100 x double], ptr %baby_next, i64 0, i64 %indvars.iv128
store double 1.000000e+00, ptr %arrayidx16, align 8, !tbaa !9
%indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
%exitcond.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count
br i1 %exitcond.not, label %for.cond20.preheader, label %for.body14, !llvm.loop !21
for.end56: ; preds = %for.cond24.for.inc54_crit_edge.split.us.us, %for.cond20.preheader, %for.cond20.preheader.thread
%.lcssa150159 = phi i32 [ %9, %for.cond20.preheader ], [ %2, %for.cond20.preheader.thread ], [ %9, %for.cond24.for.inc54_crit_edge.split.us.us ]
%cmp13103151157 = phi i1 [ %cmp13103.mux, %for.cond20.preheader ], [ false, %for.cond20.preheader.thread ], [ %cmp13103, %for.cond24.for.inc54_crit_edge.split.us.us ]
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(800) %baby, ptr noundef nonnull align 16 dereferenceable(800) %baby_next, i64 800, i1 false)
br i1 %cmp13103151157, label %for.body61.preheader, label %for.end71
for.body61.preheader: ; preds = %for.end56
%wide.trip.count146 = zext i32 %.lcssa150159 to i64
%20 = add nsw i64 %wide.trip.count146, -1
%xtraiter179 = and i64 %wide.trip.count146, 3
%21 = icmp ult i64 %20, 3
br i1 %21, label %for.end71.loopexit.unr-lcssa, label %for.body61.preheader.new
for.body61.preheader.new: ; preds = %for.body61.preheader
%unroll_iter182 = and i64 %wide.trip.count146, 4294967292
br label %for.body61
for.body61: ; preds = %for.body61, %for.body61.preheader.new
%indvars.iv143 = phi i64 [ 0, %for.body61.preheader.new ], [ %indvars.iv.next144.3, %for.body61 ]
%max.2115 = phi double [ 0.000000e+00, %for.body61.preheader.new ], [ %max.3.3, %for.body61 ]
%niter183 = phi i64 [ 0, %for.body61.preheader.new ], [ %niter183.next.3, %for.body61 ]
%arrayidx63 = getelementptr inbounds [100 x double], ptr %baby, i64 0, i64 %indvars.iv143
%22 = load double, ptr %arrayidx63, align 16, !tbaa !9
%cmp64 = fcmp olt double %max.2115, %22
%max.3 = select i1 %cmp64, double %22, double %max.2115
%indvars.iv.next144 = or i64 %indvars.iv143, 1
%arrayidx63.1 = getelementptr inbounds [100 x double], ptr %baby, i64 0, i64 %indvars.iv.next144
%23 = load double, ptr %arrayidx63.1, align 8, !tbaa !9
%cmp64.1 = fcmp olt double %max.3, %23
%max.3.1 = select i1 %cmp64.1, double %23, double %max.3
%indvars.iv.next144.1 = or i64 %indvars.iv143, 2
%arrayidx63.2 = getelementptr inbounds [100 x double], ptr %baby, i64 0, i64 %indvars.iv.next144.1
%24 = load double, ptr %arrayidx63.2, align 16, !tbaa !9
%cmp64.2 = fcmp olt double %max.3.1, %24
%max.3.2 = select i1 %cmp64.2, double %24, double %max.3.1
%indvars.iv.next144.2 = or i64 %indvars.iv143, 3
%arrayidx63.3 = getelementptr inbounds [100 x double], ptr %baby, i64 0, i64 %indvars.iv.next144.2
%25 = load double, ptr %arrayidx63.3, align 8, !tbaa !9
%cmp64.3 = fcmp olt double %max.3.2, %25
%max.3.3 = select i1 %cmp64.3, double %25, double %max.3.2
%indvars.iv.next144.3 = add nuw nsw i64 %indvars.iv143, 4
%niter183.next.3 = add i64 %niter183, 4
%niter183.ncmp.3 = icmp eq i64 %niter183.next.3, %unroll_iter182
br i1 %niter183.ncmp.3, label %for.end71.loopexit.unr-lcssa, label %for.body61, !llvm.loop !22
for.end71.loopexit.unr-lcssa: ; preds = %for.body61, %for.body61.preheader
%max.3.lcssa.ph = phi double [ undef, %for.body61.preheader ], [ %max.3.3, %for.body61 ]
%indvars.iv143.unr = phi i64 [ 0, %for.body61.preheader ], [ %indvars.iv.next144.3, %for.body61 ]
%max.2115.unr = phi double [ 0.000000e+00, %for.body61.preheader ], [ %max.3.3, %for.body61 ]
%lcmp.mod180.not = icmp eq i64 %xtraiter179, 0
br i1 %lcmp.mod180.not, label %for.end71, label %for.body61.epil
for.body61.epil: ; preds = %for.end71.loopexit.unr-lcssa, %for.body61.epil
%indvars.iv143.epil = phi i64 [ %indvars.iv.next144.epil, %for.body61.epil ], [ %indvars.iv143.unr, %for.end71.loopexit.unr-lcssa ]
%max.2115.epil = phi double [ %max.3.epil, %for.body61.epil ], [ %max.2115.unr, %for.end71.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body61.epil ], [ 0, %for.end71.loopexit.unr-lcssa ]
%arrayidx63.epil = getelementptr inbounds [100 x double], ptr %baby, i64 0, i64 %indvars.iv143.epil
%26 = load double, ptr %arrayidx63.epil, align 8, !tbaa !9
%cmp64.epil = fcmp olt double %max.2115.epil, %26
%max.3.epil = select i1 %cmp64.epil, double %26, double %max.2115.epil
%indvars.iv.next144.epil = add nuw nsw i64 %indvars.iv143.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter179
br i1 %epil.iter.cmp.not, label %for.end71, label %for.body61.epil, !llvm.loop !23
for.end71: ; preds = %for.end71.loopexit.unr-lcssa, %for.body61.epil, %for.cond20.preheader.thread, %for.end56
%max.2.lcssa = phi double [ 0.000000e+00, %for.end56 ], [ 0.000000e+00, %for.cond20.preheader.thread ], [ %max.3.lcssa.ph, %for.end71.loopexit.unr-lcssa ], [ %max.3.epil, %for.body61.epil ]
%call72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %max.2.lcssa)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%27 = load i32, ptr %n, align 4, !tbaa !5
%cmp = icmp eq i32 %27, 0
%28 = load i32, ptr %m, align 4
%cmp1 = icmp eq i32 %28, 0
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
br i1 %or.cond, label %while.end, label %for.cond.preheader
while.end: ; preds = %for.end71, %entry
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %baby_next) #4
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %baby) #4
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %g) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !17}
!17 = !{!"llvm.loop.unswitch.partial.disable"}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12, !14, !13}
!22 = distinct !{!22, !12}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
#include<string.h>
int main ()
{
int l,x;
scanf("%d %d ",&l,&x);
int a=0;
int i;
char buff[6]={0};
for(i = 0; i < l*x; ++i){
buff[0]=getchar();
buff[1]=getchar();
buff[2]=getchar();
buff[3]=getchar();
buff[4]=getchar();
if(strcmp(buff, "snuke")==0){
a=1;
break;
}
getchar();
}
if(a==1){
printf("%c%d",i%x+'A',i/x+1);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210545/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210545/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"snuke\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"%c%d\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:
%l = alloca i32, align 4
%x = alloca i32, align 4
%buff = alloca [6 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l, ptr noundef nonnull %x)
call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %buff) #4
%0 = getelementptr inbounds i8, ptr %buff, i64 5
store i8 0, ptr %0, align 1
%1 = load i32, ptr %l, align 4, !tbaa !5
%2 = load i32, ptr %x, align 4, !tbaa !5
%mul33 = mul nsw i32 %2, %1
%cmp34 = icmp sgt i32 %mul33, 0
br i1 %cmp34, label %for.body.lr.ph, label %if.end23
for.body.lr.ph: ; preds = %entry
%arrayidx4 = getelementptr inbounds [6 x i8], ptr %buff, i64 0, i64 1
%arrayidx7 = getelementptr inbounds [6 x i8], ptr %buff, i64 0, i64 2
%arrayidx10 = getelementptr inbounds [6 x i8], ptr %buff, i64 0, i64 3
%arrayidx13 = getelementptr inbounds [6 x i8], ptr %buff, i64 0, i64 4
br label %for.body
for.body: ; preds = %for.body.lr.ph, %if.end
%i.035 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %if.end ]
%3 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i = call i32 @getc(ptr noundef %3)
%conv = trunc i32 %call.i to i8
store i8 %conv, ptr %buff, align 1, !tbaa !11
%4 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i27 = call i32 @getc(ptr noundef %4)
%conv3 = trunc i32 %call.i27 to i8
store i8 %conv3, ptr %arrayidx4, align 1, !tbaa !11
%5 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i28 = call i32 @getc(ptr noundef %5)
%conv6 = trunc i32 %call.i28 to i8
store i8 %conv6, ptr %arrayidx7, align 1, !tbaa !11
%6 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i29 = call i32 @getc(ptr noundef %6)
%conv9 = trunc i32 %call.i29 to i8
store i8 %conv9, ptr %arrayidx10, align 1, !tbaa !11
%7 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i30 = call i32 @getc(ptr noundef %7)
%conv12 = trunc i32 %call.i30 to i8
store i8 %conv12, ptr %arrayidx13, align 1, !tbaa !11
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(6) %buff, ptr noundef nonnull dereferenceable(6) @.str.1, i64 6)
%cmp15 = icmp eq i32 %bcmp, 0
br i1 %cmp15, label %if.then20, label %if.end
if.end: ; preds = %for.body
%8 = load ptr, ptr @stdin, align 8, !tbaa !9
%call.i31 = call i32 @getc(ptr noundef %8)
%inc = add nuw nsw i32 %i.035, 1
%9 = load i32, ptr %l, align 4, !tbaa !5
%10 = load i32, ptr %x, align 4, !tbaa !5
%mul = mul nsw i32 %10, %9
%cmp = icmp slt i32 %inc, %mul
br i1 %cmp, label %for.body, label %if.end23, !llvm.loop !12
if.then20: ; preds = %for.body
%11 = load i32, ptr %x, align 4, !tbaa !5
%rem = srem i32 %i.035, %11
%add = add nuw nsw i32 %rem, 65
%div = sdiv i32 %i.035, %11
%add21 = add nsw i32 %div, 1
%call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add, i32 noundef %add21)
br label %if.end23
if.end23: ; preds = %if.end, %entry, %if.then20
call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %buff) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #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: nofree nounwind
declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) 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 willreturn memory(argmem: read) }
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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
|
/* ex3_5
hangan2020*/
#include <stdio.h>
#include <string.h>
int main(void){
char str[11], *p;
int len, max;
//文字列入力
scanf("%s", &str[0]);
//文字列先頭のアドレス
p = str;
len = 0;
max = 0;
//null文字ではない間に
while(*p){
//長さリセット
len = 0;
//ACGT列を見つけたら長さをカウントする。
//カウントが終わるとポインタは最後の文字の次の文字にある
while(*p == 'A'||*p == 'C'||*p == 'G'||*p == 'T'){
len++;
p++;
}
//もしカウントしている文字列が前の文字列より長かったらmaxにする
if(len > max){
max = len;
}
//次の文字へ
p++;
}
printf("%d", max);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210596/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210596/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%0 = load i8, ptr %str, align 1, !tbaa !5
%tobool.not28 = icmp eq i8 %0, 0
br i1 %tobool.not28, label %while.end17, label %while.cond1.preheader
while.cond1.preheader: ; preds = %entry, %while.end
%1 = phi i8 [ %3, %while.end ], [ %0, %entry ]
%max.030 = phi i32 [ %spec.select, %while.end ], [ 0, %entry ]
%p.029 = phi ptr [ %incdec.ptr16, %while.end ], [ %str, %entry ]
br label %while.cond1
while.cond1: ; preds = %while.cond1.preheader, %while.body13
%2 = phi i8 [ %.pr, %while.body13 ], [ %1, %while.cond1.preheader ]
%p.1 = phi ptr [ %incdec.ptr, %while.body13 ], [ %p.029, %while.cond1.preheader ]
%len.0 = phi i32 [ %inc, %while.body13 ], [ 0, %while.cond1.preheader ]
switch i8 %2, label %while.end [
i8 65, label %while.body13
i8 67, label %while.body13
i8 71, label %while.body13
i8 84, label %while.body13
]
while.body13: ; preds = %while.cond1, %while.cond1, %while.cond1, %while.cond1
%inc = add nuw nsw i32 %len.0, 1
%incdec.ptr = getelementptr inbounds i8, ptr %p.1, i64 1
%.pr = load i8, ptr %incdec.ptr, align 1, !tbaa !5
br label %while.cond1, !llvm.loop !8
while.end: ; preds = %while.cond1
%spec.select = call i32 @llvm.smax.i32(i32 %len.0, i32 %max.030)
%incdec.ptr16 = getelementptr inbounds i8, ptr %p.1, i64 1
%3 = load i8, ptr %incdec.ptr16, align 1, !tbaa !5
%tobool.not = icmp eq i8 %3, 0
br i1 %tobool.not, label %while.end17, label %while.cond1.preheader, !llvm.loop !10
while.end17: ; preds = %while.end, %entry
%max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %while.end ]
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.0.lcssa)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
/* ex 5_4
Tarara */
#include <stdio.h>
// 文字列長は10よりも大きくする
#define MAX_LEN 15
// a, bの内大きい値を返す
int max(int a, int b)
{
return a > b ? a : b;
}
int main(void)
{
//ptr: strの各要素へのポインタ
char str[MAX_LEN], *ptr;
int max_len, tmp_len;
max_len = 0;
tmp_len = 0;
// 入力
scanf("%s", str);
// 文字列先頭から1文字づつ見る
ptr = str;
while (*ptr)
{
if (*ptr == 'A' || *ptr == 'C' || *ptr == 'G' || *ptr == 'T')
tmp_len++;
// 文字列にACGT以外が現れたらACGT文字列でなくなるため,文字列長のカウントを中断する
// 過去のACGT文字列とその長さを比較し,ACGT文字列の最大長を更新する
else
{
max_len = max(max_len, tmp_len);
tmp_len = 0;
}
ptr++;
}
// 最後の文字がACGT文字列に含まれる場合,ループの外でACGT文字列の最大長を更新する必要がある
max_len = max(max_len, tmp_len);
// 出力
printf("%d\n", max_len);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210639/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210639/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%str = alloca [15 x i8], align 1
call void @llvm.lifetime.start.p0(i64 15, ptr nonnull %str) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
br label %while.cond
while.cond: ; preds = %if.end, %entry
%ptr.0 = phi ptr [ %str, %entry ], [ %incdec.ptr, %if.end ]
%max_len.0 = phi i32 [ 0, %entry ], [ %max_len.1, %if.end ]
%tmp_len.0 = phi i32 [ 0, %entry ], [ %tmp_len.1, %if.end ]
%0 = load i8, ptr %ptr.0, align 1, !tbaa !5
switch i8 %0, label %if.else [
i8 0, label %while.end
i8 65, label %if.then
i8 67, label %if.then
i8 71, label %if.then
i8 84, label %if.then
]
if.then: ; preds = %while.cond, %while.cond, %while.cond, %while.cond
%inc = add nsw i32 %tmp_len.0, 1
br label %if.end
if.else: ; preds = %while.cond
%cond.i = call i32 @llvm.smax.i32(i32 %max_len.0, i32 %tmp_len.0)
br label %if.end
if.end: ; preds = %if.else, %if.then
%max_len.1 = phi i32 [ %max_len.0, %if.then ], [ %cond.i, %if.else ]
%tmp_len.1 = phi i32 [ %inc, %if.then ], [ 0, %if.else ]
%incdec.ptr = getelementptr inbounds i8, ptr %ptr.0, i64 1
br label %while.cond, !llvm.loop !8
while.end: ; preds = %while.cond
%cond.i26 = call i32 @llvm.smax.i32(i32 %max_len.0, i32 %tmp_len.0)
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond.i26)
call void @llvm.lifetime.end.p0(i64 15, ptr nonnull %str) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #4
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
/* ex5-4
toshiwaka */
#include <stdio.h>
#include <string.h>
//最長部分文字列の長さを取得
int get_max_len(char *ptr);
int main(void) {
//入力は10文字以内なのでstrの最大要素数は\0を含めて11
char str[11];
//入力
scanf("%s", str);
//結果を出力
printf("%d\n", get_max_len(str));
return 0;
}
//最長部分文字列の長さを取得
int get_max_len(char *ptr){
int len = 0, max_len = 0;
while(*ptr){
switch(*ptr){
//要素が'A''G''C''T'の時
case 'A':
case 'G':
case 'C':
case 'T':
//lenの値を更新
//lenがmax_lenより大きければlen_maxの値を更新
len++;
if(len > max_len) max_len = len;
break;
//それ以外の時
default:
//lenの値を初期化
len = 0;
break;
}
ptr++;
}
//最長部分文字列の長さを返す
return max_len;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210682/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210682/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%str = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %str) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str)
%0 = load i8, ptr %str, align 1, !tbaa !5
%tobool.not7.i = icmp eq i8 %0, 0
br i1 %tobool.not7.i, label %get_max_len.exit, label %while.body.i
while.body.i: ; preds = %entry, %sw.epilog.i
%1 = phi i8 [ %2, %sw.epilog.i ], [ %0, %entry ]
%max_len.010.i = phi i32 [ %max_len.1.i, %sw.epilog.i ], [ 0, %entry ]
%len.09.i = phi i32 [ %len.1.i, %sw.epilog.i ], [ 0, %entry ]
%ptr.addr.08.i = phi ptr [ %incdec.ptr.i, %sw.epilog.i ], [ %str, %entry ]
%conv.i = sext i8 %1 to i32
switch i32 %conv.i, label %sw.epilog.i [
i32 65, label %sw.bb.i
i32 71, label %sw.bb.i
i32 67, label %sw.bb.i
i32 84, label %sw.bb.i
]
sw.bb.i: ; preds = %while.body.i, %while.body.i, %while.body.i, %while.body.i
%inc.i = add nsw i32 %len.09.i, 1
%cmp.not.i = icmp slt i32 %len.09.i, %max_len.010.i
%spec.select.i = select i1 %cmp.not.i, i32 %max_len.010.i, i32 %inc.i
br label %sw.epilog.i
sw.epilog.i: ; preds = %sw.bb.i, %while.body.i
%len.1.i = phi i32 [ %inc.i, %sw.bb.i ], [ 0, %while.body.i ]
%max_len.1.i = phi i32 [ %spec.select.i, %sw.bb.i ], [ %max_len.010.i, %while.body.i ]
%incdec.ptr.i = getelementptr inbounds i8, ptr %ptr.addr.08.i, i64 1
%2 = load i8, ptr %incdec.ptr.i, align 1, !tbaa !5
%tobool.not.i = icmp eq i8 %2, 0
br i1 %tobool.not.i, label %get_max_len.exit, label %while.body.i, !llvm.loop !8
get_max_len.exit: ; preds = %sw.epilog.i, %entry
%max_len.0.lcssa.i = phi i32 [ 0, %entry ], [ %max_len.1.i, %sw.epilog.i ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max_len.0.lcssa.i)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %str) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable
define dso_local i32 @get_max_len(ptr nocapture noundef readonly %ptr) local_unnamed_addr #3 {
entry:
%0 = load i8, ptr %ptr, align 1, !tbaa !5
%tobool.not7 = icmp eq i8 %0, 0
br i1 %tobool.not7, label %while.end, label %while.body
while.body: ; preds = %entry, %sw.epilog
%1 = phi i8 [ %2, %sw.epilog ], [ %0, %entry ]
%max_len.010 = phi i32 [ %max_len.1, %sw.epilog ], [ 0, %entry ]
%len.09 = phi i32 [ %len.1, %sw.epilog ], [ 0, %entry ]
%ptr.addr.08 = phi ptr [ %incdec.ptr, %sw.epilog ], [ %ptr, %entry ]
%conv = sext i8 %1 to i32
switch i32 %conv, label %sw.epilog [
i32 65, label %sw.bb
i32 71, label %sw.bb
i32 67, label %sw.bb
i32 84, label %sw.bb
]
sw.bb: ; preds = %while.body, %while.body, %while.body, %while.body
%inc = add nsw i32 %len.09, 1
%cmp.not = icmp slt i32 %len.09, %max_len.010
%spec.select = select i1 %cmp.not, i32 %max_len.010, i32 %inc
br label %sw.epilog
sw.epilog: ; preds = %sw.bb, %while.body
%len.1 = phi i32 [ %inc, %sw.bb ], [ 0, %while.body ]
%max_len.1 = phi i32 [ %spec.select, %sw.bb ], [ %max_len.010, %while.body ]
%incdec.ptr = getelementptr inbounds i8, ptr %ptr.addr.08, i64 1
%2 = load i8, ptr %incdec.ptr, align 1, !tbaa !5
%tobool.not = icmp eq i8 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !8
while.end: ; preds = %sw.epilog, %entry
%max_len.0.lcssa = phi i32 [ 0, %entry ], [ %max_len.1, %sw.epilog ]
ret i32 %max_len.0.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(read, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
char s[11];
scanf("%s", s);
int i = 0;
int j;
int ans = 0;
while (s[i] != '\0')
{
if (s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')
{
j = 0;
while ((s[i + j] == 'A' || s[i + j] == 'C' || s[i + j] == 'G' || s[i + j] == 'T') && s[i + j] != '\0')
{
j++;
}
if (ans < j)
{
ans = j;
}
}
i++;
}
printf("%d", ans);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_210725/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_210725/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [11 x i8], align 1
call void @llvm.lifetime.start.p0(i64 11, ptr nonnull %s) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
br label %while.cond
while.cond: ; preds = %if.end61, %entry
%indvars.iv85 = phi i64 [ %indvars.iv.next86, %if.end61 ], [ 0, %entry ]
%ans.0 = phi i32 [ %ans.1, %if.end61 ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %indvars.iv85
%0 = load i8, ptr %arrayidx, align 1, !tbaa !5
switch i8 %0, label %if.end61 [
i8 0, label %while.end63
i8 65, label %while.cond24.preheader
i8 67, label %while.cond24.preheader
i8 71, label %while.cond24.preheader
i8 84, label %while.cond24.preheader
]
while.cond24.preheader: ; preds = %while.cond, %while.cond, %while.cond, %while.cond
br label %while.cond24
while.cond24: ; preds = %while.cond24.preheader, %while.body57
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body57 ], [ 0, %while.cond24.preheader ]
%1 = add nuw nsw i64 %indvars.iv, %indvars.iv85
%arrayidx26 = getelementptr inbounds [11 x i8], ptr %s, i64 0, i64 %1
%2 = load i8, ptr %arrayidx26, align 1, !tbaa !5
switch i8 %2, label %while.end [
i8 65, label %while.body57
i8 67, label %while.body57
i8 71, label %while.body57
i8 84, label %while.body57
]
while.body57: ; preds = %while.cond24, %while.cond24, %while.cond24, %while.cond24
%indvars.iv.next = add nuw i64 %indvars.iv, 1
br label %while.cond24, !llvm.loop !8
while.end: ; preds = %while.cond24
%3 = trunc i64 %indvars.iv to i32
%spec.select = call i32 @llvm.smax.i32(i32 %ans.0, i32 %3)
br label %if.end61
if.end61: ; preds = %while.end, %while.cond
%ans.1 = phi i32 [ %ans.0, %while.cond ], [ %spec.select, %while.end ]
%indvars.iv.next86 = add nuw i64 %indvars.iv85, 1
br label %while.cond, !llvm.loop !10
while.end63: ; preds = %while.cond
%call64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0)
call void @llvm.lifetime.end.p0(i64 11, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.