Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
/* A0410.c Akabeko 20 2019/11/08 rte */ #include <stdio.h> #include <string.h> #define max(x,y) (((x)>(y))?(x):(y)) int m,n,n2,q[41],p[20]; int from[8000]; char to[8000]; int cntr; //割り切れる順列の数 int primes[]={2,3,5,7,11,13,17,19,23,29,31,37}; char gt_[20][12]; //20個(まで)の引数をゲーデル表記に変換 int gcd(int a, int b) { int c; while (b > 0) { c = a % b; a = b; b = c; } return a; } void dump(int mask,int m2) { int i,j; for(i=0,j=1;i<n;i++,j<<=1) { if(j & mask) printf("%d,",p[i]); } printf(":%d\n",p[m2]); } int check(int x) { int i,f,t,mask; for(i=0;i<cntr;i++) { mask=from[i]; t =to[i]; //dump(mask,t); if((x & mask)==mask && (x & (1<<t))==0) { return(0); } } return(1); } int solve() { int i,ret; for(i=1,ret=0;i<(1<<n);i++) { if(check(i)) ret++; } return(ret); } void dump_fact(char gt[]) { int i; for(i=0;i<12;i++) if(gt[i]>0) printf("%d[%d]:",primes[i],gt[i]); printf("\n------\n"); } void factorize(int num,char gt[]) { int i; memset(gt,0,12); while(num>1) { for(i=0;i<12;i++) if((num % primes[i])==0) { gt[i]++; num /= primes[i]; } } //dump_fact(gt); } int lcm(char outgt[],char gt[],char gt2[]) { int i; //dump_fact(gt); //dump_fact(gt2); for(i=0;i<13;i++) { outgt[i]=max(gt[i],gt2[i]); //if(outgt[i]>0) //printf("%d[%d]%d\n",i,primes[i],gt[i]); } } int divisor(char gt[],char gt2[]) { int i,ret; //dump_fact(gt); //dump_fact(gt2); for(i=0;i<12;i++) if(gt[i]>gt2[i]) return(0); //printf("*!*"); return(1); } void make_gt() { int i; for(i=0;i<20;i++) factorize(p[i],&gt_[i][0]); } void prepare() { int i,j,k,l,mask; char gt[13],gt2[13],gt3[13]; cntr=0; for(i=0;i<n;i++) { memcpy(gt,&(gt_[i][0]),sizeof(gt)); for(j=i;j<n;j++) { lcm(gt2,gt,&(gt_[j][0])); { for(k=j;k<n;k++) { lcm(gt3,gt2,&(gt_[k][0])); for(l=0;l<n;l++) { if(l!=i && l!=j && l!=k && divisor(&gt_[l][0],gt3)) { from[cntr]=mask=(1<<i)|(1<<j)|(1<<k); to [cntr]=l; cntr++; //dump(mask,l); } } } } } } } void dump_gt() { int i; for(i=0;i<n;i++) { dump_fact(&gt_[i][0]); } } void dump1() { int i; printf("n=%d\n",n); for(i=0;i<n;i++) printf("%d ",p[i]); printf("\n",n); } int main() { int i,j,k,ret,c; scanf("%d",&n2); n=0; for(i=0;i<n2;i++) { scanf("%d",&c); q[c]++; } for(i=2,n=0;i<=40;i++) { if(q[i]>0) { p[n]=i; n++; } } //dump1(); make_gt(); //dump_gt(); if(n<=1) { if(q[1]==n2 || q[1]==0) // 1種類だけのとき ret=1; else // 1と他1種だけのとき ret=2; } else { prepare(); //printf(":cntr=%d\n",cntr); ret=solve(); if(q[1]>0) ret++; } printf("%d\n",ret); return(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118904/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118904/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @primes = dso_local local_unnamed_addr global [12 x i32] [i32 2, i32 3, i32 5, i32 7, i32 11, i32 13, i32 17, i32 19, i32 23, i32 29, i32 31, i32 37], align 16 @n = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [4 x i8] c"%d,\00", align 1 @p = dso_local local_unnamed_addr global [20 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [5 x i8] c":%d\0A\00", align 1 @cntr = dso_local local_unnamed_addr global i32 0, align 4 @from = dso_local local_unnamed_addr global [8000 x i32] zeroinitializer, align 16 @to = dso_local local_unnamed_addr global [8000 x i8] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [8 x i8] c"%d[%d]:\00", align 1 @gt_ = dso_local global [20 x [12 x i8]] zeroinitializer, align 16 @.str.4 = private unnamed_addr constant [6 x i8] c"n=%d\0A\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.7 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @n2 = dso_local global i32 0, align 4 @q = dso_local local_unnamed_addr global [41 x i32] zeroinitializer, align 16 @.str.8 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @m = dso_local local_unnamed_addr global i32 0, align 4 @str = private unnamed_addr constant [8 x i8] c"\0A------\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %cmp4 = icmp sgt i32 %b, 0 br i1 %cmp4, label %while.body, label %while.end 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 = icmp sgt i32 %rem, 0 br i1 %cmp, label %while.body, label %while.end, !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) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @dump(i32 noundef %mask, i32 noundef %m2) local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !7 %cmp7 = icmp sgt i32 %0, 0 br i1 %cmp7, label %for.body, label %for.end for.body: ; preds = %entry, %for.inc %1 = phi i32 [ %3, %for.inc ], [ %0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ] %j.09 = phi i32 [ %shl, %for.inc ], [ 1, %entry ] %and = and i32 %j.09, %mask %tobool.not = icmp eq i32 %and, 0 br i1 %tobool.not, label %for.inc, label %if.then if.then: ; preds = %for.body %arrayidx = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !7 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2) %.pre = load i32, ptr @n, align 4, !tbaa !7 br label %for.inc for.inc: ; preds = %for.body, %if.then %3 = phi i32 [ %1, %for.body ], [ %.pre, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %shl = shl i32 %j.09, 1 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.inc, %entry %idxprom1 = sext i32 %m2 to i64 %arrayidx2 = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %idxprom1 %5 = load i32, ptr %arrayidx2, align 4, !tbaa !7 %call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @check(i32 noundef %x) local_unnamed_addr #4 { entry: %0 = load i32, ptr @cntr, align 4, !tbaa !7 %cmp17 = icmp sgt i32 %0, 0 br i1 %cmp17, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %arrayidx = getelementptr inbounds [8000 x i32], ptr @from, i64 0, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !7 %and = and i32 %1, %x %cmp3 = icmp eq i32 %and, %1 br i1 %cmp3, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %for.body %arrayidx2 = getelementptr inbounds [8000 x i8], ptr @to, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx2, align 1, !tbaa !12 %conv16 = zext i8 %2 to i32 %shl = shl nuw i32 1, %conv16 %and5 = and i32 %shl, %x %cmp6 = icmp eq i32 %and5, 0 br i1 %cmp6, label %cleanup, label %for.inc for.inc: ; preds = %for.body, %land.lhs.true %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !13 cleanup: ; preds = %land.lhs.true, %for.inc, %entry %retval.0 = phi i32 [ 1, %entry ], [ 1, %for.inc ], [ 0, %land.lhs.true ] ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @solve() local_unnamed_addr #4 { entry: %0 = load i32, ptr @n, align 4, !tbaa !7 %shl = shl nuw i32 1, %0 %cmp8 = icmp sgt i32 %shl, 1 br i1 %cmp8, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %1 = load i32, ptr @cntr, align 4, !tbaa !7 %cmp17.i = icmp sgt i32 %1, 0 %wide.trip.count.i = zext i32 %1 to i64 br i1 %cmp17.i, label %for.body.us, label %for.body.preheader for.body.preheader: ; preds = %for.body.lr.ph %2 = add nsw i32 %shl, -1 br label %for.end for.body.us: ; preds = %for.body.lr.ph, %for.cond.us %ret.011.us = phi i32 [ %5, %for.cond.us ], [ 0, %for.body.lr.ph ] %i.09.us = phi i32 [ %inc1.us, %for.cond.us ], [ 1, %for.body.lr.ph ] br label %for.body.i.us for.body.i.us: ; preds = %for.inc.i.us, %for.body.us %indvars.iv.i.us = phi i64 [ 0, %for.body.us ], [ %indvars.iv.next.i.us, %for.inc.i.us ] %arrayidx.i.us = getelementptr inbounds [8000 x i32], ptr @from, i64 0, i64 %indvars.iv.i.us %3 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !7 %and.i.us = and i32 %3, %i.09.us %cmp3.i.us = icmp eq i32 %and.i.us, %3 br i1 %cmp3.i.us, label %land.lhs.true.i.us, label %for.inc.i.us land.lhs.true.i.us: ; preds = %for.body.i.us %arrayidx2.i.us = getelementptr inbounds [8000 x i8], ptr @to, i64 0, i64 %indvars.iv.i.us %4 = load i8, ptr %arrayidx2.i.us, align 1, !tbaa !12 %conv16.i.us = zext i8 %4 to i32 %shl.i.us = shl nuw i32 1, %conv16.i.us %and5.i.us = and i32 %shl.i.us, %i.09.us %cmp6.i.us = icmp eq i32 %and5.i.us, 0 br i1 %cmp6.i.us, label %for.cond.us, label %for.inc.i.us for.inc.i.us: ; preds = %land.lhs.true.i.us, %for.body.i.us %indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i br i1 %exitcond.not.i.us, label %check.exit.thread.loopexit.us, label %for.body.i.us, !llvm.loop !13 for.cond.us: ; preds = %land.lhs.true.i.us, %check.exit.thread.loopexit.us %5 = phi i32 [ %inc7.us, %check.exit.thread.loopexit.us ], [ %ret.011.us, %land.lhs.true.i.us ] %inc1.us = add nuw nsw i32 %i.09.us, 1 %exitcond.not = icmp eq i32 %inc1.us, %shl br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !14 check.exit.thread.loopexit.us: ; preds = %for.inc.i.us %inc7.us = add nsw i32 %ret.011.us, 1 br label %for.cond.us for.end: ; preds = %for.cond.us, %for.body.preheader, %entry %ret.0.lcssa = phi i32 [ 0, %entry ], [ %2, %for.body.preheader ], [ %5, %for.cond.us ] ret i32 %ret.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local void @dump_fact(ptr nocapture noundef readonly %gt) local_unnamed_addr #2 { entry: %0 = load i8, ptr %gt, align 1, !tbaa !12 %cmp1 = icmp sgt i8 %0, 0 br i1 %cmp1, label %if.then, label %for.inc if.then: ; preds = %entry %conv = zext i8 %0 to i32 %1 = load i32, ptr @primes, align 16, !tbaa !7 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1, i32 noundef %conv) br label %for.inc for.inc: ; preds = %entry, %if.then %arrayidx.1 = getelementptr inbounds i8, ptr %gt, i64 1 %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !12 %cmp1.1 = icmp sgt i8 %2, 0 br i1 %cmp1.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %conv.1 = zext i8 %2 to i32 %3 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 1), align 4, !tbaa !7 %call.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %3, i32 noundef %conv.1) br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %arrayidx.2 = getelementptr inbounds i8, ptr %gt, i64 2 %4 = load i8, ptr %arrayidx.2, align 1, !tbaa !12 %cmp1.2 = icmp sgt i8 %4, 0 br i1 %cmp1.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 %conv.2 = zext i8 %4 to i32 %5 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 2), align 8, !tbaa !7 %call.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5, i32 noundef %conv.2) br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %arrayidx.3 = getelementptr inbounds i8, ptr %gt, i64 3 %6 = load i8, ptr %arrayidx.3, align 1, !tbaa !12 %cmp1.3 = icmp sgt i8 %6, 0 br i1 %cmp1.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.inc.2 %conv.3 = zext i8 %6 to i32 %7 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 3), align 4, !tbaa !7 %call.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7, i32 noundef %conv.3) br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.inc.2 %arrayidx.4 = getelementptr inbounds i8, ptr %gt, i64 4 %8 = load i8, ptr %arrayidx.4, align 1, !tbaa !12 %cmp1.4 = icmp sgt i8 %8, 0 br i1 %cmp1.4, label %if.then.4, label %for.inc.4 if.then.4: ; preds = %for.inc.3 %conv.4 = zext i8 %8 to i32 %9 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 4), align 16, !tbaa !7 %call.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9, i32 noundef %conv.4) br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.inc.3 %arrayidx.5 = getelementptr inbounds i8, ptr %gt, i64 5 %10 = load i8, ptr %arrayidx.5, align 1, !tbaa !12 %cmp1.5 = icmp sgt i8 %10, 0 br i1 %cmp1.5, label %if.then.5, label %for.inc.5 if.then.5: ; preds = %for.inc.4 %conv.5 = zext i8 %10 to i32 %11 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 5), align 4, !tbaa !7 %call.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11, i32 noundef %conv.5) br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.inc.4 %arrayidx.6 = getelementptr inbounds i8, ptr %gt, i64 6 %12 = load i8, ptr %arrayidx.6, align 1, !tbaa !12 %cmp1.6 = icmp sgt i8 %12, 0 br i1 %cmp1.6, label %if.then.6, label %for.inc.6 if.then.6: ; preds = %for.inc.5 %conv.6 = zext i8 %12 to i32 %13 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 6), align 8, !tbaa !7 %call.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13, i32 noundef %conv.6) br label %for.inc.6 for.inc.6: ; preds = %if.then.6, %for.inc.5 %arrayidx.7 = getelementptr inbounds i8, ptr %gt, i64 7 %14 = load i8, ptr %arrayidx.7, align 1, !tbaa !12 %cmp1.7 = icmp sgt i8 %14, 0 br i1 %cmp1.7, label %if.then.7, label %for.inc.7 if.then.7: ; preds = %for.inc.6 %conv.7 = zext i8 %14 to i32 %15 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 7), align 4, !tbaa !7 %call.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15, i32 noundef %conv.7) br label %for.inc.7 for.inc.7: ; preds = %if.then.7, %for.inc.6 %arrayidx.8 = getelementptr inbounds i8, ptr %gt, i64 8 %16 = load i8, ptr %arrayidx.8, align 1, !tbaa !12 %cmp1.8 = icmp sgt i8 %16, 0 br i1 %cmp1.8, label %if.then.8, label %for.inc.8 if.then.8: ; preds = %for.inc.7 %conv.8 = zext i8 %16 to i32 %17 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 8), align 16, !tbaa !7 %call.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17, i32 noundef %conv.8) br label %for.inc.8 for.inc.8: ; preds = %if.then.8, %for.inc.7 %arrayidx.9 = getelementptr inbounds i8, ptr %gt, i64 9 %18 = load i8, ptr %arrayidx.9, align 1, !tbaa !12 %cmp1.9 = icmp sgt i8 %18, 0 br i1 %cmp1.9, label %if.then.9, label %for.inc.9 if.then.9: ; preds = %for.inc.8 %conv.9 = zext i8 %18 to i32 %19 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 9), align 4, !tbaa !7 %call.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19, i32 noundef %conv.9) br label %for.inc.9 for.inc.9: ; preds = %if.then.9, %for.inc.8 %arrayidx.10 = getelementptr inbounds i8, ptr %gt, i64 10 %20 = load i8, ptr %arrayidx.10, align 1, !tbaa !12 %cmp1.10 = icmp sgt i8 %20, 0 br i1 %cmp1.10, label %if.then.10, label %for.inc.10 if.then.10: ; preds = %for.inc.9 %conv.10 = zext i8 %20 to i32 %21 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 10), align 8, !tbaa !7 %call.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21, i32 noundef %conv.10) br label %for.inc.10 for.inc.10: ; preds = %if.then.10, %for.inc.9 %arrayidx.11 = getelementptr inbounds i8, ptr %gt, i64 11 %22 = load i8, ptr %arrayidx.11, align 1, !tbaa !12 %cmp1.11 = icmp sgt i8 %22, 0 br i1 %cmp1.11, label %if.then.11, label %for.inc.11 if.then.11: ; preds = %for.inc.10 %conv.11 = zext i8 %22 to i32 %23 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 11), align 4, !tbaa !7 %call.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23, i32 noundef %conv.11) br label %for.inc.11 for.inc.11: ; preds = %if.then.11, %for.inc.10 %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) @str) ret void } ; Function Attrs: nofree nosync nounwind memory(read, argmem: write, inaccessiblemem: none) uwtable define dso_local void @factorize(i32 noundef %num, ptr nocapture noundef writeonly %gt) local_unnamed_addr #5 { entry: tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(12) %gt, i8 0, i64 12, i1 false) %cmp17 = icmp sgt i32 %num, 1 br i1 %cmp17, label %for.cond.preheader.preheader, label %while.end for.cond.preheader.preheader: ; preds = %entry %arrayidx4.1 = getelementptr inbounds i8, ptr %gt, i64 1 %arrayidx4.2 = getelementptr inbounds i8, ptr %gt, i64 2 %arrayidx4.3 = getelementptr inbounds i8, ptr %gt, i64 3 %arrayidx4.4 = getelementptr inbounds i8, ptr %gt, i64 4 %arrayidx4.5 = getelementptr inbounds i8, ptr %gt, i64 5 %arrayidx4.6 = getelementptr inbounds i8, ptr %gt, i64 6 %arrayidx4.7 = getelementptr inbounds i8, ptr %gt, i64 7 %arrayidx4.8 = getelementptr inbounds i8, ptr %gt, i64 8 %arrayidx4.9 = getelementptr inbounds i8, ptr %gt, i64 9 %arrayidx4.10 = getelementptr inbounds i8, ptr %gt, i64 10 %arrayidx4.11 = getelementptr inbounds i8, ptr %gt, i64 11 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.preheader, %for.inc.11 %0 = phi i8 [ %47, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %1 = phi i8 [ %44, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %2 = phi i8 [ %41, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %3 = phi i8 [ %38, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %4 = phi i8 [ %35, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %5 = phi i8 [ %32, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %6 = phi i8 [ %29, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %7 = phi i8 [ %26, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %8 = phi i8 [ %23, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %9 = phi i8 [ %20, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %10 = phi i8 [ %17, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %11 = phi i8 [ %14, %for.inc.11 ], [ 0, %for.cond.preheader.preheader ] %num.addr.018 = phi i32 [ %num.addr.2.11, %for.inc.11 ], [ %num, %for.cond.preheader.preheader ] %12 = load i32, ptr @primes, align 16, !tbaa !7 %rem = srem i32 %num.addr.018, %12 %cmp2 = icmp eq i32 %rem, 0 br i1 %cmp2, label %if.then, label %for.inc if.then: ; preds = %for.cond.preheader %inc = add i8 %11, 1 store i8 %inc, ptr %gt, align 1, !tbaa !12 %13 = load i32, ptr @primes, align 16, !tbaa !7 %div = sdiv i32 %num.addr.018, %13 br label %for.inc for.inc: ; preds = %for.cond.preheader, %if.then %14 = phi i8 [ %inc, %if.then ], [ %11, %for.cond.preheader ] %num.addr.2 = phi i32 [ %div, %if.then ], [ %num.addr.018, %for.cond.preheader ] %15 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 1), align 4, !tbaa !7 %rem.1 = srem i32 %num.addr.2, %15 %cmp2.1 = icmp eq i32 %rem.1, 0 br i1 %cmp2.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %inc.1 = add i8 %10, 1 store i8 %inc.1, ptr %arrayidx4.1, align 1, !tbaa !12 %16 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 1), align 4, !tbaa !7 %div.1 = sdiv i32 %num.addr.2, %16 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %17 = phi i8 [ %inc.1, %if.then.1 ], [ %10, %for.inc ] %num.addr.2.1 = phi i32 [ %div.1, %if.then.1 ], [ %num.addr.2, %for.inc ] %18 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 2), align 8, !tbaa !7 %rem.2 = srem i32 %num.addr.2.1, %18 %cmp2.2 = icmp eq i32 %rem.2, 0 br i1 %cmp2.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 %inc.2 = add i8 %9, 1 store i8 %inc.2, ptr %arrayidx4.2, align 1, !tbaa !12 %19 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 2), align 8, !tbaa !7 %div.2 = sdiv i32 %num.addr.2.1, %19 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %20 = phi i8 [ %inc.2, %if.then.2 ], [ %9, %for.inc.1 ] %num.addr.2.2 = phi i32 [ %div.2, %if.then.2 ], [ %num.addr.2.1, %for.inc.1 ] %21 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 3), align 4, !tbaa !7 %rem.3 = srem i32 %num.addr.2.2, %21 %cmp2.3 = icmp eq i32 %rem.3, 0 br i1 %cmp2.3, label %if.then.3, label %for.inc.3 if.then.3: ; preds = %for.inc.2 %inc.3 = add i8 %8, 1 store i8 %inc.3, ptr %arrayidx4.3, align 1, !tbaa !12 %22 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 3), align 4, !tbaa !7 %div.3 = sdiv i32 %num.addr.2.2, %22 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.inc.2 %23 = phi i8 [ %inc.3, %if.then.3 ], [ %8, %for.inc.2 ] %num.addr.2.3 = phi i32 [ %div.3, %if.then.3 ], [ %num.addr.2.2, %for.inc.2 ] %24 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 4), align 16, !tbaa !7 %rem.4 = srem i32 %num.addr.2.3, %24 %cmp2.4 = icmp eq i32 %rem.4, 0 br i1 %cmp2.4, label %if.then.4, label %for.inc.4 if.then.4: ; preds = %for.inc.3 %inc.4 = add i8 %7, 1 store i8 %inc.4, ptr %arrayidx4.4, align 1, !tbaa !12 %25 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 4), align 16, !tbaa !7 %div.4 = sdiv i32 %num.addr.2.3, %25 br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.inc.3 %26 = phi i8 [ %inc.4, %if.then.4 ], [ %7, %for.inc.3 ] %num.addr.2.4 = phi i32 [ %div.4, %if.then.4 ], [ %num.addr.2.3, %for.inc.3 ] %27 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 5), align 4, !tbaa !7 %rem.5 = srem i32 %num.addr.2.4, %27 %cmp2.5 = icmp eq i32 %rem.5, 0 br i1 %cmp2.5, label %if.then.5, label %for.inc.5 if.then.5: ; preds = %for.inc.4 %inc.5 = add i8 %6, 1 store i8 %inc.5, ptr %arrayidx4.5, align 1, !tbaa !12 %28 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 5), align 4, !tbaa !7 %div.5 = sdiv i32 %num.addr.2.4, %28 br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.inc.4 %29 = phi i8 [ %inc.5, %if.then.5 ], [ %6, %for.inc.4 ] %num.addr.2.5 = phi i32 [ %div.5, %if.then.5 ], [ %num.addr.2.4, %for.inc.4 ] %30 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 6), align 8, !tbaa !7 %rem.6 = srem i32 %num.addr.2.5, %30 %cmp2.6 = icmp eq i32 %rem.6, 0 br i1 %cmp2.6, label %if.then.6, label %for.inc.6 if.then.6: ; preds = %for.inc.5 %inc.6 = add i8 %5, 1 store i8 %inc.6, ptr %arrayidx4.6, align 1, !tbaa !12 %31 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 6), align 8, !tbaa !7 %div.6 = sdiv i32 %num.addr.2.5, %31 br label %for.inc.6 for.inc.6: ; preds = %if.then.6, %for.inc.5 %32 = phi i8 [ %inc.6, %if.then.6 ], [ %5, %for.inc.5 ] %num.addr.2.6 = phi i32 [ %div.6, %if.then.6 ], [ %num.addr.2.5, %for.inc.5 ] %33 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 7), align 4, !tbaa !7 %rem.7 = srem i32 %num.addr.2.6, %33 %cmp2.7 = icmp eq i32 %rem.7, 0 br i1 %cmp2.7, label %if.then.7, label %for.inc.7 if.then.7: ; preds = %for.inc.6 %inc.7 = add i8 %4, 1 store i8 %inc.7, ptr %arrayidx4.7, align 1, !tbaa !12 %34 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 7), align 4, !tbaa !7 %div.7 = sdiv i32 %num.addr.2.6, %34 br label %for.inc.7 for.inc.7: ; preds = %if.then.7, %for.inc.6 %35 = phi i8 [ %inc.7, %if.then.7 ], [ %4, %for.inc.6 ] %num.addr.2.7 = phi i32 [ %div.7, %if.then.7 ], [ %num.addr.2.6, %for.inc.6 ] %36 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 8), align 16, !tbaa !7 %rem.8 = srem i32 %num.addr.2.7, %36 %cmp2.8 = icmp eq i32 %rem.8, 0 br i1 %cmp2.8, label %if.then.8, label %for.inc.8 if.then.8: ; preds = %for.inc.7 %inc.8 = add i8 %3, 1 store i8 %inc.8, ptr %arrayidx4.8, align 1, !tbaa !12 %37 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 8), align 16, !tbaa !7 %div.8 = sdiv i32 %num.addr.2.7, %37 br label %for.inc.8 for.inc.8: ; preds = %if.then.8, %for.inc.7 %38 = phi i8 [ %inc.8, %if.then.8 ], [ %3, %for.inc.7 ] %num.addr.2.8 = phi i32 [ %div.8, %if.then.8 ], [ %num.addr.2.7, %for.inc.7 ] %39 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 9), align 4, !tbaa !7 %rem.9 = srem i32 %num.addr.2.8, %39 %cmp2.9 = icmp eq i32 %rem.9, 0 br i1 %cmp2.9, label %if.then.9, label %for.inc.9 if.then.9: ; preds = %for.inc.8 %inc.9 = add i8 %2, 1 store i8 %inc.9, ptr %arrayidx4.9, align 1, !tbaa !12 %40 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 9), align 4, !tbaa !7 %div.9 = sdiv i32 %num.addr.2.8, %40 br label %for.inc.9 for.inc.9: ; preds = %if.then.9, %for.inc.8 %41 = phi i8 [ %inc.9, %if.then.9 ], [ %2, %for.inc.8 ] %num.addr.2.9 = phi i32 [ %div.9, %if.then.9 ], [ %num.addr.2.8, %for.inc.8 ] %42 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 10), align 8, !tbaa !7 %rem.10 = srem i32 %num.addr.2.9, %42 %cmp2.10 = icmp eq i32 %rem.10, 0 br i1 %cmp2.10, label %if.then.10, label %for.inc.10 if.then.10: ; preds = %for.inc.9 %inc.10 = add i8 %1, 1 store i8 %inc.10, ptr %arrayidx4.10, align 1, !tbaa !12 %43 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 10), align 8, !tbaa !7 %div.10 = sdiv i32 %num.addr.2.9, %43 br label %for.inc.10 for.inc.10: ; preds = %if.then.10, %for.inc.9 %44 = phi i8 [ %inc.10, %if.then.10 ], [ %1, %for.inc.9 ] %num.addr.2.10 = phi i32 [ %div.10, %if.then.10 ], [ %num.addr.2.9, %for.inc.9 ] %45 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 11), align 4, !tbaa !7 %rem.11 = srem i32 %num.addr.2.10, %45 %cmp2.11 = icmp eq i32 %rem.11, 0 br i1 %cmp2.11, label %if.then.11, label %for.inc.11 if.then.11: ; preds = %for.inc.10 %inc.11 = add i8 %0, 1 store i8 %inc.11, ptr %arrayidx4.11, align 1, !tbaa !12 %46 = load i32, ptr getelementptr inbounds ([12 x i32], ptr @primes, i64 0, i64 11), align 4, !tbaa !7 %div.11 = sdiv i32 %num.addr.2.10, %46 br label %for.inc.11 for.inc.11: ; preds = %if.then.11, %for.inc.10 %47 = phi i8 [ %inc.11, %if.then.11 ], [ %0, %for.inc.10 ] %num.addr.2.11 = phi i32 [ %div.11, %if.then.11 ], [ %num.addr.2.10, %for.inc.10 ] %cmp = icmp sgt i32 %num.addr.2.11, 1 br i1 %cmp, label %for.cond.preheader, label %while.end, !llvm.loop !15 while.end: ; preds = %for.inc.11, %entry 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) #6 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @lcm(ptr nocapture noundef writeonly %outgt, ptr nocapture noundef readonly %gt, ptr nocapture noundef readonly %gt2) local_unnamed_addr #7 { entry: %0 = load i8, ptr %gt, align 1, !tbaa !12 %1 = load i8, ptr %gt2, align 1, !tbaa !12 %. = tail call i8 @llvm.smax.i8(i8 %0, i8 %1) store i8 %., ptr %outgt, align 1, !tbaa !12 %arrayidx.1 = getelementptr inbounds i8, ptr %gt, i64 1 %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !12 %arrayidx2.1 = getelementptr inbounds i8, ptr %gt2, i64 1 %3 = load i8, ptr %arrayidx2.1, align 1, !tbaa !12 %..1 = tail call i8 @llvm.smax.i8(i8 %2, i8 %3) %arrayidx14.1 = getelementptr inbounds i8, ptr %outgt, i64 1 store i8 %..1, ptr %arrayidx14.1, align 1, !tbaa !12 %arrayidx.2 = getelementptr inbounds i8, ptr %gt, i64 2 %4 = load i8, ptr %arrayidx.2, align 1, !tbaa !12 %arrayidx2.2 = getelementptr inbounds i8, ptr %gt2, i64 2 %5 = load i8, ptr %arrayidx2.2, align 1, !tbaa !12 %..2 = tail call i8 @llvm.smax.i8(i8 %4, i8 %5) %arrayidx14.2 = getelementptr inbounds i8, ptr %outgt, i64 2 store i8 %..2, ptr %arrayidx14.2, align 1, !tbaa !12 %arrayidx.3 = getelementptr inbounds i8, ptr %gt, i64 3 %6 = load i8, ptr %arrayidx.3, align 1, !tbaa !12 %arrayidx2.3 = getelementptr inbounds i8, ptr %gt2, i64 3 %7 = load i8, ptr %arrayidx2.3, align 1, !tbaa !12 %..3 = tail call i8 @llvm.smax.i8(i8 %6, i8 %7) %arrayidx14.3 = getelementptr inbounds i8, ptr %outgt, i64 3 store i8 %..3, ptr %arrayidx14.3, align 1, !tbaa !12 %arrayidx.4 = getelementptr inbounds i8, ptr %gt, i64 4 %8 = load i8, ptr %arrayidx.4, align 1, !tbaa !12 %arrayidx2.4 = getelementptr inbounds i8, ptr %gt2, i64 4 %9 = load i8, ptr %arrayidx2.4, align 1, !tbaa !12 %..4 = tail call i8 @llvm.smax.i8(i8 %8, i8 %9) %arrayidx14.4 = getelementptr inbounds i8, ptr %outgt, i64 4 store i8 %..4, ptr %arrayidx14.4, align 1, !tbaa !12 %arrayidx.5 = getelementptr inbounds i8, ptr %gt, i64 5 %10 = load i8, ptr %arrayidx.5, align 1, !tbaa !12 %arrayidx2.5 = getelementptr inbounds i8, ptr %gt2, i64 5 %11 = load i8, ptr %arrayidx2.5, align 1, !tbaa !12 %..5 = tail call i8 @llvm.smax.i8(i8 %10, i8 %11) %arrayidx14.5 = getelementptr inbounds i8, ptr %outgt, i64 5 store i8 %..5, ptr %arrayidx14.5, align 1, !tbaa !12 %arrayidx.6 = getelementptr inbounds i8, ptr %gt, i64 6 %12 = load i8, ptr %arrayidx.6, align 1, !tbaa !12 %arrayidx2.6 = getelementptr inbounds i8, ptr %gt2, i64 6 %13 = load i8, ptr %arrayidx2.6, align 1, !tbaa !12 %..6 = tail call i8 @llvm.smax.i8(i8 %12, i8 %13) %arrayidx14.6 = getelementptr inbounds i8, ptr %outgt, i64 6 store i8 %..6, ptr %arrayidx14.6, align 1, !tbaa !12 %arrayidx.7 = getelementptr inbounds i8, ptr %gt, i64 7 %14 = load i8, ptr %arrayidx.7, align 1, !tbaa !12 %arrayidx2.7 = getelementptr inbounds i8, ptr %gt2, i64 7 %15 = load i8, ptr %arrayidx2.7, align 1, !tbaa !12 %..7 = tail call i8 @llvm.smax.i8(i8 %14, i8 %15) %arrayidx14.7 = getelementptr inbounds i8, ptr %outgt, i64 7 store i8 %..7, ptr %arrayidx14.7, align 1, !tbaa !12 %arrayidx.8 = getelementptr inbounds i8, ptr %gt, i64 8 %16 = load i8, ptr %arrayidx.8, align 1, !tbaa !12 %arrayidx2.8 = getelementptr inbounds i8, ptr %gt2, i64 8 %17 = load i8, ptr %arrayidx2.8, align 1, !tbaa !12 %..8 = tail call i8 @llvm.smax.i8(i8 %16, i8 %17) %arrayidx14.8 = getelementptr inbounds i8, ptr %outgt, i64 8 store i8 %..8, ptr %arrayidx14.8, align 1, !tbaa !12 %arrayidx.9 = getelementptr inbounds i8, ptr %gt, i64 9 %18 = load i8, ptr %arrayidx.9, align 1, !tbaa !12 %arrayidx2.9 = getelementptr inbounds i8, ptr %gt2, i64 9 %19 = load i8, ptr %arrayidx2.9, align 1, !tbaa !12 %..9 = tail call i8 @llvm.smax.i8(i8 %18, i8 %19) %arrayidx14.9 = getelementptr inbounds i8, ptr %outgt, i64 9 store i8 %..9, ptr %arrayidx14.9, align 1, !tbaa !12 %arrayidx.10 = getelementptr inbounds i8, ptr %gt, i64 10 %20 = load i8, ptr %arrayidx.10, align 1, !tbaa !12 %arrayidx2.10 = getelementptr inbounds i8, ptr %gt2, i64 10 %21 = load i8, ptr %arrayidx2.10, align 1, !tbaa !12 %..10 = tail call i8 @llvm.smax.i8(i8 %20, i8 %21) %arrayidx14.10 = getelementptr inbounds i8, ptr %outgt, i64 10 store i8 %..10, ptr %arrayidx14.10, align 1, !tbaa !12 %arrayidx.11 = getelementptr inbounds i8, ptr %gt, i64 11 %22 = load i8, ptr %arrayidx.11, align 1, !tbaa !12 %arrayidx2.11 = getelementptr inbounds i8, ptr %gt2, i64 11 %23 = load i8, ptr %arrayidx2.11, align 1, !tbaa !12 %..11 = tail call i8 @llvm.smax.i8(i8 %22, i8 %23) %arrayidx14.11 = getelementptr inbounds i8, ptr %outgt, i64 11 store i8 %..11, ptr %arrayidx14.11, align 1, !tbaa !12 %arrayidx.12 = getelementptr inbounds i8, ptr %gt, i64 12 %24 = load i8, ptr %arrayidx.12, align 1, !tbaa !12 %arrayidx2.12 = getelementptr inbounds i8, ptr %gt2, i64 12 %25 = load i8, ptr %arrayidx2.12, align 1, !tbaa !12 %..12 = tail call i8 @llvm.smax.i8(i8 %24, i8 %25) %arrayidx14.12 = getelementptr inbounds i8, ptr %outgt, i64 12 store i8 %..12, ptr %arrayidx14.12, align 1, !tbaa !12 ret i32 undef } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @divisor(ptr nocapture noundef readonly %gt, ptr nocapture noundef readonly %gt2) local_unnamed_addr #8 { entry: %0 = load i8, ptr %gt, align 1, !tbaa !12 %1 = load i8, ptr %gt2, align 1, !tbaa !12 %cmp4 = icmp sgt i8 %0, %1 br i1 %cmp4, label %cleanup, label %for.cond for.cond: ; preds = %entry %arrayidx.1 = getelementptr inbounds i8, ptr %gt, i64 1 %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !12 %arrayidx2.1 = getelementptr inbounds i8, ptr %gt2, i64 1 %3 = load i8, ptr %arrayidx2.1, align 1, !tbaa !12 %cmp4.1 = icmp sgt i8 %2, %3 br i1 %cmp4.1, label %cleanup, label %for.cond.1 for.cond.1: ; preds = %for.cond %arrayidx.2 = getelementptr inbounds i8, ptr %gt, i64 2 %4 = load i8, ptr %arrayidx.2, align 1, !tbaa !12 %arrayidx2.2 = getelementptr inbounds i8, ptr %gt2, i64 2 %5 = load i8, ptr %arrayidx2.2, align 1, !tbaa !12 %cmp4.2 = icmp sgt i8 %4, %5 br i1 %cmp4.2, label %cleanup, label %for.cond.2 for.cond.2: ; preds = %for.cond.1 %arrayidx.3 = getelementptr inbounds i8, ptr %gt, i64 3 %6 = load i8, ptr %arrayidx.3, align 1, !tbaa !12 %arrayidx2.3 = getelementptr inbounds i8, ptr %gt2, i64 3 %7 = load i8, ptr %arrayidx2.3, align 1, !tbaa !12 %cmp4.3 = icmp sgt i8 %6, %7 br i1 %cmp4.3, label %cleanup, label %for.cond.3 for.cond.3: ; preds = %for.cond.2 %arrayidx.4 = getelementptr inbounds i8, ptr %gt, i64 4 %8 = load i8, ptr %arrayidx.4, align 1, !tbaa !12 %arrayidx2.4 = getelementptr inbounds i8, ptr %gt2, i64 4 %9 = load i8, ptr %arrayidx2.4, align 1, !tbaa !12 %cmp4.4 = icmp sgt i8 %8, %9 br i1 %cmp4.4, label %cleanup, label %for.cond.4 for.cond.4: ; preds = %for.cond.3 %arrayidx.5 = getelementptr inbounds i8, ptr %gt, i64 5 %10 = load i8, ptr %arrayidx.5, align 1, !tbaa !12 %arrayidx2.5 = getelementptr inbounds i8, ptr %gt2, i64 5 %11 = load i8, ptr %arrayidx2.5, align 1, !tbaa !12 %cmp4.5 = icmp sgt i8 %10, %11 br i1 %cmp4.5, label %cleanup, label %for.cond.5 for.cond.5: ; preds = %for.cond.4 %arrayidx.6 = getelementptr inbounds i8, ptr %gt, i64 6 %12 = load i8, ptr %arrayidx.6, align 1, !tbaa !12 %arrayidx2.6 = getelementptr inbounds i8, ptr %gt2, i64 6 %13 = load i8, ptr %arrayidx2.6, align 1, !tbaa !12 %cmp4.6 = icmp sgt i8 %12, %13 br i1 %cmp4.6, label %cleanup, label %for.cond.6 for.cond.6: ; preds = %for.cond.5 %arrayidx.7 = getelementptr inbounds i8, ptr %gt, i64 7 %14 = load i8, ptr %arrayidx.7, align 1, !tbaa !12 %arrayidx2.7 = getelementptr inbounds i8, ptr %gt2, i64 7 %15 = load i8, ptr %arrayidx2.7, align 1, !tbaa !12 %cmp4.7 = icmp sgt i8 %14, %15 br i1 %cmp4.7, label %cleanup, label %for.cond.7 for.cond.7: ; preds = %for.cond.6 %arrayidx.8 = getelementptr inbounds i8, ptr %gt, i64 8 %16 = load i8, ptr %arrayidx.8, align 1, !tbaa !12 %arrayidx2.8 = getelementptr inbounds i8, ptr %gt2, i64 8 %17 = load i8, ptr %arrayidx2.8, align 1, !tbaa !12 %cmp4.8 = icmp sgt i8 %16, %17 br i1 %cmp4.8, label %cleanup, label %for.cond.8 for.cond.8: ; preds = %for.cond.7 %arrayidx.9 = getelementptr inbounds i8, ptr %gt, i64 9 %18 = load i8, ptr %arrayidx.9, align 1, !tbaa !12 %arrayidx2.9 = getelementptr inbounds i8, ptr %gt2, i64 9 %19 = load i8, ptr %arrayidx2.9, align 1, !tbaa !12 %cmp4.9 = icmp sgt i8 %18, %19 br i1 %cmp4.9, label %cleanup, label %for.cond.9 for.cond.9: ; preds = %for.cond.8 %arrayidx.10 = getelementptr inbounds i8, ptr %gt, i64 10 %20 = load i8, ptr %arrayidx.10, align 1, !tbaa !12 %arrayidx2.10 = getelementptr inbounds i8, ptr %gt2, i64 10 %21 = load i8, ptr %arrayidx2.10, align 1, !tbaa !12 %cmp4.10 = icmp sgt i8 %20, %21 br i1 %cmp4.10, label %cleanup, label %for.cond.10 for.cond.10: ; preds = %for.cond.9 %arrayidx.11 = getelementptr inbounds i8, ptr %gt, i64 11 %22 = load i8, ptr %arrayidx.11, align 1, !tbaa !12 %arrayidx2.11 = getelementptr inbounds i8, ptr %gt2, i64 11 %23 = load i8, ptr %arrayidx2.11, align 1, !tbaa !12 %cmp4.11 = icmp sle i8 %22, %23 %spec.select = zext i1 %cmp4.11 to i32 br label %cleanup cleanup: ; preds = %for.cond.10, %for.cond.9, %for.cond.8, %for.cond.7, %for.cond.6, %for.cond.5, %for.cond.4, %for.cond.3, %for.cond.2, %for.cond.1, %for.cond, %entry %retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 0, %for.cond.1 ], [ 0, %for.cond.2 ], [ 0, %for.cond.3 ], [ 0, %for.cond.4 ], [ 0, %for.cond.5 ], [ 0, %for.cond.6 ], [ 0, %for.cond.7 ], [ 0, %for.cond.8 ], [ 0, %for.cond.9 ], [ %spec.select, %for.cond.10 ] ret i32 %retval.0 } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: read, inaccessiblemem: none) uwtable define dso_local void @make_gt() local_unnamed_addr #9 { entry: %0 = load i32, ptr @p, align 16, !tbaa !7 tail call void @factorize(i32 noundef %0, ptr noundef nonnull @gt_) %1 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 1), align 4, !tbaa !7 tail call void @factorize(i32 noundef %1, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 1)) %2 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 2), align 8, !tbaa !7 tail call void @factorize(i32 noundef %2, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 2)) %3 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 3), align 4, !tbaa !7 tail call void @factorize(i32 noundef %3, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 3)) %4 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 4), align 16, !tbaa !7 tail call void @factorize(i32 noundef %4, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 4)) %5 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 5), align 4, !tbaa !7 tail call void @factorize(i32 noundef %5, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 5)) %6 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 6), align 8, !tbaa !7 tail call void @factorize(i32 noundef %6, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 6)) %7 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 7), align 4, !tbaa !7 tail call void @factorize(i32 noundef %7, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 7)) %8 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 8), align 16, !tbaa !7 tail call void @factorize(i32 noundef %8, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 8)) %9 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 9), align 4, !tbaa !7 tail call void @factorize(i32 noundef %9, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 9)) %10 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 10), align 8, !tbaa !7 tail call void @factorize(i32 noundef %10, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 10)) %11 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 11), align 4, !tbaa !7 tail call void @factorize(i32 noundef %11, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 11)) %12 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 12), align 16, !tbaa !7 tail call void @factorize(i32 noundef %12, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 12)) %13 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 13), align 4, !tbaa !7 tail call void @factorize(i32 noundef %13, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 13)) %14 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 14), align 8, !tbaa !7 tail call void @factorize(i32 noundef %14, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 14)) %15 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 15), align 4, !tbaa !7 tail call void @factorize(i32 noundef %15, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 15)) %16 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 16), align 16, !tbaa !7 tail call void @factorize(i32 noundef %16, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 16)) %17 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 17), align 4, !tbaa !7 tail call void @factorize(i32 noundef %17, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 17)) %18 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 18), align 8, !tbaa !7 tail call void @factorize(i32 noundef %18, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 18)) %19 = load i32, ptr getelementptr inbounds ([20 x i32], ptr @p, i64 0, i64 19), align 4, !tbaa !7 tail call void @factorize(i32 noundef %19, ptr noundef nonnull getelementptr inbounds ([20 x [12 x i8]], ptr @gt_, i64 0, i64 19)) ret void } ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @prepare() local_unnamed_addr #10 { entry: store i32 0, ptr @cntr, align 4, !tbaa !7 %0 = load i32, ptr @n, align 4, !tbaa !7 %cmp169 = icmp sgt i32 %0, 0 br i1 %cmp169, label %for.body.lr.ph, label %for.end48 for.body.lr.ph: ; preds = %entry %1 = zext i32 %0 to i64 %wide.trip.count182 = zext i32 %0 to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc46 %indvars.iv173 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next174, %for.inc46 ] %cntr.promoted168170 = phi i32 [ 0, %for.body.lr.ph ], [ %cntr.promoted164, %for.inc46 ] %arrayidx = getelementptr inbounds [20 x [12 x i8]], ptr @gt_, i64 0, i64 %indvars.iv173 %gt.sroa.0.0.copyload = load i8, ptr %arrayidx, align 4 %gt.sroa.4.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 1 %gt.sroa.4.0.copyload = load i8, ptr %gt.sroa.4.0.arrayidx.sroa_idx, align 1 %gt.sroa.5.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 2 %gt.sroa.5.0.copyload = load i8, ptr %gt.sroa.5.0.arrayidx.sroa_idx, align 2 %gt.sroa.6.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 3 %gt.sroa.6.0.copyload = load i8, ptr %gt.sroa.6.0.arrayidx.sroa_idx, align 1 %gt.sroa.7.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 4 %gt.sroa.7.0.copyload = load i8, ptr %gt.sroa.7.0.arrayidx.sroa_idx, align 4 %gt.sroa.8.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 5 %gt.sroa.8.0.copyload = load i8, ptr %gt.sroa.8.0.arrayidx.sroa_idx, align 1 %gt.sroa.9.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 6 %gt.sroa.9.0.copyload = load i8, ptr %gt.sroa.9.0.arrayidx.sroa_idx, align 2 %gt.sroa.10.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 7 %gt.sroa.10.0.copyload = load i8, ptr %gt.sroa.10.0.arrayidx.sroa_idx, align 1 %gt.sroa.11.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 8 %gt.sroa.11.0.copyload = load i8, ptr %gt.sroa.11.0.arrayidx.sroa_idx, align 4 %gt.sroa.12.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 9 %gt.sroa.12.0.copyload = load i8, ptr %gt.sroa.12.0.arrayidx.sroa_idx, align 1 %gt.sroa.13.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 10 %gt.sroa.13.0.copyload = load i8, ptr %gt.sroa.13.0.arrayidx.sroa_idx, align 2 %gt.sroa.14.0.arrayidx.sroa_idx = getelementptr inbounds i8, ptr %arrayidx, i64 11 %gt.sroa.14.0.copyload = load i8, ptr %gt.sroa.14.0.arrayidx.sroa_idx, align 1 %2 = trunc i64 %indvars.iv173 to i32 %shl = shl nuw i32 1, %2 br label %for.body4 for.body4: ; preds = %for.body, %for.inc43 %indvars.iv175 = phi i64 [ %indvars.iv173, %for.body ], [ %indvars.iv.next176, %for.inc43 ] %cntr.promoted167 = phi i32 [ %cntr.promoted168170, %for.body ], [ %cntr.promoted164, %for.inc43 ] %cntr.promoted148159160 = phi i32 [ %cntr.promoted168170, %for.body ], [ %cntr.promoted148156, %for.inc43 ] %arrayidx8 = getelementptr inbounds [20 x [12 x i8]], ptr @gt_, i64 0, i64 %indvars.iv175 %3 = load i8, ptr %arrayidx8, align 4, !tbaa !12 %..i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.0.0.copyload, i8 %3) %arrayidx2.1.i = getelementptr inbounds i8, ptr %arrayidx8, i64 1 %4 = load i8, ptr %arrayidx2.1.i, align 1, !tbaa !12 %..1.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.4.0.copyload, i8 %4) %arrayidx2.2.i = getelementptr inbounds i8, ptr %arrayidx8, i64 2 %5 = load i8, ptr %arrayidx2.2.i, align 2, !tbaa !12 %..2.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.5.0.copyload, i8 %5) %arrayidx2.3.i = getelementptr inbounds i8, ptr %arrayidx8, i64 3 %6 = load i8, ptr %arrayidx2.3.i, align 1, !tbaa !12 %..3.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.6.0.copyload, i8 %6) %arrayidx2.4.i = getelementptr inbounds i8, ptr %arrayidx8, i64 4 %7 = load i8, ptr %arrayidx2.4.i, align 4, !tbaa !12 %..4.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.7.0.copyload, i8 %7) %arrayidx2.5.i = getelementptr inbounds i8, ptr %arrayidx8, i64 5 %8 = load i8, ptr %arrayidx2.5.i, align 1, !tbaa !12 %..5.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.8.0.copyload, i8 %8) %arrayidx2.6.i = getelementptr inbounds i8, ptr %arrayidx8, i64 6 %9 = load i8, ptr %arrayidx2.6.i, align 2, !tbaa !12 %..6.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.9.0.copyload, i8 %9) %arrayidx2.7.i = getelementptr inbounds i8, ptr %arrayidx8, i64 7 %10 = load i8, ptr %arrayidx2.7.i, align 1, !tbaa !12 %..7.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.10.0.copyload, i8 %10) %arrayidx2.8.i = getelementptr inbounds i8, ptr %arrayidx8, i64 8 %11 = load i8, ptr %arrayidx2.8.i, align 4, !tbaa !12 %..8.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.11.0.copyload, i8 %11) %arrayidx2.9.i = getelementptr inbounds i8, ptr %arrayidx8, i64 9 %12 = load i8, ptr %arrayidx2.9.i, align 1, !tbaa !12 %..9.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.12.0.copyload, i8 %12) %arrayidx2.10.i = getelementptr inbounds i8, ptr %arrayidx8, i64 10 %13 = load i8, ptr %arrayidx2.10.i, align 2, !tbaa !12 %..10.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.13.0.copyload, i8 %13) %arrayidx2.11.i = getelementptr inbounds i8, ptr %arrayidx8, i64 11 %14 = load i8, ptr %arrayidx2.11.i, align 1, !tbaa !12 %..11.i = tail call i8 @llvm.smax.i8(i8 %gt.sroa.14.0.copyload, i8 %14) %15 = trunc i64 %indvars.iv175 to i32 %shl32 = shl nuw i32 1, %15 %or = or i32 %shl32, %shl br label %for.body21.lr.ph for.body21.lr.ph: ; preds = %for.inc40, %for.body4 %indvars.iv177 = phi i64 [ %indvars.iv175, %for.body4 ], [ %indvars.iv.next178, %for.inc40 ] %cntr.promoted166 = phi i32 [ %cntr.promoted167, %for.body4 ], [ %cntr.promoted164, %for.inc40 ] %cntr.promoted148158 = phi i32 [ %cntr.promoted148159160, %for.body4 ], [ %cntr.promoted148156, %for.inc40 ] %cntr.promoted152153 = phi i32 [ %cntr.promoted148159160, %for.body4 ], [ %cntr.promoted150, %for.inc40 ] %arrayidx16 = getelementptr inbounds [20 x [12 x i8]], ptr @gt_, i64 0, i64 %indvars.iv177 %16 = load i8, ptr %arrayidx16, align 4, !tbaa !12 %..i70 = tail call i8 @llvm.smax.i8(i8 %..i, i8 %16) %arrayidx2.1.i72 = getelementptr inbounds i8, ptr %arrayidx16, i64 1 %17 = load i8, ptr %arrayidx2.1.i72, align 1, !tbaa !12 %..1.i73 = tail call i8 @llvm.smax.i8(i8 %..1.i, i8 %17) %arrayidx2.2.i76 = getelementptr inbounds i8, ptr %arrayidx16, i64 2 %18 = load i8, ptr %arrayidx2.2.i76, align 2, !tbaa !12 %..2.i77 = tail call i8 @llvm.smax.i8(i8 %..2.i, i8 %18) %arrayidx2.3.i80 = getelementptr inbounds i8, ptr %arrayidx16, i64 3 %19 = load i8, ptr %arrayidx2.3.i80, align 1, !tbaa !12 %..3.i81 = tail call i8 @llvm.smax.i8(i8 %..3.i, i8 %19) %arrayidx2.4.i84 = getelementptr inbounds i8, ptr %arrayidx16, i64 4 %20 = load i8, ptr %arrayidx2.4.i84, align 4, !tbaa !12 %..4.i85 = tail call i8 @llvm.smax.i8(i8 %..4.i, i8 %20) %arrayidx2.5.i88 = getelementptr inbounds i8, ptr %arrayidx16, i64 5 %21 = load i8, ptr %arrayidx2.5.i88, align 1, !tbaa !12 %..5.i89 = tail call i8 @llvm.smax.i8(i8 %..5.i, i8 %21) %arrayidx2.6.i92 = getelementptr inbounds i8, ptr %arrayidx16, i64 6 %22 = load i8, ptr %arrayidx2.6.i92, align 2, !tbaa !12 %..6.i93 = tail call i8 @llvm.smax.i8(i8 %..6.i, i8 %22) %arrayidx2.7.i96 = getelementptr inbounds i8, ptr %arrayidx16, i64 7 %23 = load i8, ptr %arrayidx2.7.i96, align 1, !tbaa !12 %..7.i97 = tail call i8 @llvm.smax.i8(i8 %..7.i, i8 %23) %arrayidx2.8.i100 = getelementptr inbounds i8, ptr %arrayidx16, i64 8 %24 = load i8, ptr %arrayidx2.8.i100, align 4, !tbaa !12 %..8.i101 = tail call i8 @llvm.smax.i8(i8 %..8.i, i8 %24) %arrayidx2.9.i104 = getelementptr inbounds i8, ptr %arrayidx16, i64 9 %25 = load i8, ptr %arrayidx2.9.i104, align 1, !tbaa !12 %..9.i105 = tail call i8 @llvm.smax.i8(i8 %..9.i, i8 %25) %arrayidx2.10.i108 = getelementptr inbounds i8, ptr %arrayidx16, i64 10 %26 = load i8, ptr %arrayidx2.10.i108, align 2, !tbaa !12 %..10.i109 = tail call i8 @llvm.smax.i8(i8 %..10.i, i8 %26) %arrayidx2.11.i112 = getelementptr inbounds i8, ptr %arrayidx16, i64 11 %27 = load i8, ptr %arrayidx2.11.i112, align 1, !tbaa !12 %..11.i113 = tail call i8 @llvm.smax.i8(i8 %..11.i, i8 %27) %28 = trunc i64 %indvars.iv177 to i32 %shl33 = shl nuw i32 1, %28 %or34 = or i32 %or, %shl33 br label %for.body21 for.body21: ; preds = %for.body21.lr.ph, %for.inc %indvars.iv = phi i64 [ 0, %for.body21.lr.ph ], [ %indvars.iv.next, %for.inc ] %cntr.promoted165 = phi i32 [ %cntr.promoted166, %for.body21.lr.ph ], [ %cntr.promoted164, %for.inc ] %cntr.promoted148157 = phi i32 [ %cntr.promoted148158, %for.body21.lr.ph ], [ %cntr.promoted148156, %for.inc ] %cntr.promoted151 = phi i32 [ %cntr.promoted152153, %for.body21.lr.ph ], [ %cntr.promoted150, %for.inc ] %inc144146 = phi i32 [ %cntr.promoted152153, %for.body21.lr.ph ], [ %inc143, %for.inc ] %cmp22.not = icmp eq i64 %indvars.iv, %indvars.iv173 %cmp23.not = icmp eq i64 %indvars.iv, %indvars.iv175 %or.cond = or i1 %cmp22.not, %cmp23.not %cmp25.not = icmp eq i64 %indvars.iv, %indvars.iv177 %or.cond69 = or i1 %cmp25.not, %or.cond br i1 %or.cond69, label %for.inc, label %land.lhs.true26 land.lhs.true26: ; preds = %for.body21 %arrayidx28 = getelementptr inbounds [20 x [12 x i8]], ptr @gt_, i64 0, i64 %indvars.iv %29 = load i8, ptr %arrayidx28, align 4, !tbaa !12 %cmp4.i = icmp sgt i8 %29, %..i70 br i1 %cmp4.i, label %for.inc, label %for.cond.i for.cond.i: ; preds = %land.lhs.true26 %arrayidx.1.i119 = getelementptr inbounds i8, ptr %arrayidx28, i64 1 %30 = load i8, ptr %arrayidx.1.i119, align 1, !tbaa !12 %cmp4.1.i = icmp sgt i8 %30, %..1.i73 br i1 %cmp4.1.i, label %for.inc, label %for.cond.1.i for.cond.1.i: ; preds = %for.cond.i %arrayidx.2.i121 = getelementptr inbounds i8, ptr %arrayidx28, i64 2 %31 = load i8, ptr %arrayidx.2.i121, align 2, !tbaa !12 %cmp4.2.i = icmp sgt i8 %31, %..2.i77 br i1 %cmp4.2.i, label %for.inc, label %for.cond.2.i for.cond.2.i: ; preds = %for.cond.1.i %arrayidx.3.i123 = getelementptr inbounds i8, ptr %arrayidx28, i64 3 %32 = load i8, ptr %arrayidx.3.i123, align 1, !tbaa !12 %cmp4.3.i = icmp sgt i8 %32, %..3.i81 br i1 %cmp4.3.i, label %for.inc, label %for.cond.3.i for.cond.3.i: ; preds = %for.cond.2.i %arrayidx.4.i125 = getelementptr inbounds i8, ptr %arrayidx28, i64 4 %33 = load i8, ptr %arrayidx.4.i125, align 4, !tbaa !12 %cmp4.4.i = icmp sgt i8 %33, %..4.i85 br i1 %cmp4.4.i, label %for.inc, label %for.cond.4.i for.cond.4.i: ; preds = %for.cond.3.i %arrayidx.5.i127 = getelementptr inbounds i8, ptr %arrayidx28, i64 5 %34 = load i8, ptr %arrayidx.5.i127, align 1, !tbaa !12 %cmp4.5.i = icmp sgt i8 %34, %..5.i89 br i1 %cmp4.5.i, label %for.inc, label %for.cond.5.i for.cond.5.i: ; preds = %for.cond.4.i %arrayidx.6.i129 = getelementptr inbounds i8, ptr %arrayidx28, i64 6 %35 = load i8, ptr %arrayidx.6.i129, align 2, !tbaa !12 %cmp4.6.i = icmp sgt i8 %35, %..6.i93 br i1 %cmp4.6.i, label %for.inc, label %for.cond.6.i for.cond.6.i: ; preds = %for.cond.5.i %arrayidx.7.i131 = getelementptr inbounds i8, ptr %arrayidx28, i64 7 %36 = load i8, ptr %arrayidx.7.i131, align 1, !tbaa !12 %cmp4.7.i = icmp sgt i8 %36, %..7.i97 br i1 %cmp4.7.i, label %for.inc, label %for.cond.7.i for.cond.7.i: ; preds = %for.cond.6.i %arrayidx.8.i133 = getelementptr inbounds i8, ptr %arrayidx28, i64 8 %37 = load i8, ptr %arrayidx.8.i133, align 4, !tbaa !12 %cmp4.8.i = icmp sgt i8 %37, %..8.i101 br i1 %cmp4.8.i, label %for.inc, label %for.cond.8.i for.cond.8.i: ; preds = %for.cond.7.i %arrayidx.9.i135 = getelementptr inbounds i8, ptr %arrayidx28, i64 9 %38 = load i8, ptr %arrayidx.9.i135, align 1, !tbaa !12 %cmp4.9.i = icmp sgt i8 %38, %..9.i105 br i1 %cmp4.9.i, label %for.inc, label %for.cond.9.i for.cond.9.i: ; preds = %for.cond.8.i %arrayidx.10.i137 = getelementptr inbounds i8, ptr %arrayidx28, i64 10 %39 = load i8, ptr %arrayidx.10.i137, align 2, !tbaa !12 %cmp4.10.i = icmp sgt i8 %39, %..10.i109 br i1 %cmp4.10.i, label %for.inc, label %divisor.exit divisor.exit: ; preds = %for.cond.9.i %arrayidx.11.i139 = getelementptr inbounds i8, ptr %arrayidx28, i64 11 %40 = load i8, ptr %arrayidx.11.i139, align 1, !tbaa !12 %cmp4.11.i.not = icmp sgt i8 %40, %..11.i113 br i1 %cmp4.11.i.not, label %for.inc, label %if.then if.then: ; preds = %divisor.exit %idxprom35 = sext i32 %inc144146 to i64 %arrayidx36 = getelementptr inbounds [8000 x i32], ptr @from, i64 0, i64 %idxprom35 store i32 %or34, ptr %arrayidx36, align 4, !tbaa !7 %conv = trunc i64 %indvars.iv to i8 %arrayidx38 = getelementptr inbounds [8000 x i8], ptr @to, i64 0, i64 %idxprom35 store i8 %conv, ptr %arrayidx38, align 1, !tbaa !12 %inc = add nsw i32 %inc144146, 1 store i32 %inc, ptr @cntr, align 4, !tbaa !7 br label %for.inc for.inc: ; preds = %for.cond.9.i, %for.cond.8.i, %for.cond.7.i, %for.cond.6.i, %for.cond.5.i, %for.cond.4.i, %for.cond.3.i, %for.cond.2.i, %for.cond.1.i, %for.cond.i, %land.lhs.true26, %for.body21, %divisor.exit, %if.then %cntr.promoted164 = phi i32 [ %cntr.promoted165, %for.cond.9.i ], [ %cntr.promoted165, %for.cond.8.i ], [ %cntr.promoted165, %for.cond.7.i ], [ %cntr.promoted165, %for.cond.6.i ], [ %cntr.promoted165, %for.cond.5.i ], [ %cntr.promoted165, %for.cond.4.i ], [ %cntr.promoted165, %for.cond.3.i ], [ %cntr.promoted165, %for.cond.2.i ], [ %cntr.promoted165, %for.cond.1.i ], [ %cntr.promoted165, %for.cond.i ], [ %cntr.promoted165, %land.lhs.true26 ], [ %cntr.promoted165, %for.body21 ], [ %cntr.promoted165, %divisor.exit ], [ %inc, %if.then ] %cntr.promoted148156 = phi i32 [ %cntr.promoted148157, %for.cond.9.i ], [ %cntr.promoted148157, %for.cond.8.i ], [ %cntr.promoted148157, %for.cond.7.i ], [ %cntr.promoted148157, %for.cond.6.i ], [ %cntr.promoted148157, %for.cond.5.i ], [ %cntr.promoted148157, %for.cond.4.i ], [ %cntr.promoted148157, %for.cond.3.i ], [ %cntr.promoted148157, %for.cond.2.i ], [ %cntr.promoted148157, %for.cond.1.i ], [ %cntr.promoted148157, %for.cond.i ], [ %cntr.promoted148157, %land.lhs.true26 ], [ %cntr.promoted148157, %for.body21 ], [ %cntr.promoted148157, %divisor.exit ], [ %inc, %if.then ] %cntr.promoted150 = phi i32 [ %cntr.promoted151, %for.cond.9.i ], [ %cntr.promoted151, %for.cond.8.i ], [ %cntr.promoted151, %for.cond.7.i ], [ %cntr.promoted151, %for.cond.6.i ], [ %cntr.promoted151, %for.cond.5.i ], [ %cntr.promoted151, %for.cond.4.i ], [ %cntr.promoted151, %for.cond.3.i ], [ %cntr.promoted151, %for.cond.2.i ], [ %cntr.promoted151, %for.cond.1.i ], [ %cntr.promoted151, %for.cond.i ], [ %cntr.promoted151, %land.lhs.true26 ], [ %cntr.promoted151, %for.body21 ], [ %cntr.promoted151, %divisor.exit ], [ %inc, %if.then ] %inc143 = phi i32 [ %inc144146, %for.cond.9.i ], [ %inc144146, %for.cond.8.i ], [ %inc144146, %for.cond.7.i ], [ %inc144146, %for.cond.6.i ], [ %inc144146, %for.cond.5.i ], [ %inc144146, %for.cond.4.i ], [ %inc144146, %for.cond.3.i ], [ %inc144146, %for.cond.2.i ], [ %inc144146, %for.cond.1.i ], [ %inc144146, %for.cond.i ], [ %inc144146, %land.lhs.true26 ], [ %inc144146, %for.body21 ], [ %inc144146, %divisor.exit ], [ %inc, %if.then ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count182 br i1 %exitcond.not, label %for.inc40, label %for.body21, !llvm.loop !16 for.inc40: ; preds = %for.inc %indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1 %cmp11 = icmp ult i64 %indvars.iv.next178, %1 br i1 %cmp11, label %for.body21.lr.ph, label %for.inc43, !llvm.loop !17 for.inc43: ; preds = %for.inc40 %indvars.iv.next176 = add nuw nsw i64 %indvars.iv175, 1 %cmp3 = icmp ult i64 %indvars.iv.next176, %1 br i1 %cmp3, label %for.body4, label %for.inc46, !llvm.loop !18 for.inc46: ; preds = %for.inc43 %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1 %exitcond183.not = icmp eq i64 %indvars.iv.next174, %wide.trip.count182 br i1 %exitcond183.not, label %for.end48, label %for.body, !llvm.loop !19 for.end48: ; preds = %for.inc46, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @dump_gt() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !7 %cmp4 = icmp sgt i32 %0, 0 br i1 %cmp4, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x [12 x i8]], ptr @gt_, i64 0, i64 %indvars.iv tail call void @dump_fact(ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr @n, align 4, !tbaa !7 %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 !20 for.end: ; preds = %for.body, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @dump1() local_unnamed_addr #2 { entry: %0 = load i32, ptr @n, align 4, !tbaa !7 %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %0) %1 = load i32, ptr @n, align 4, !tbaa !7 %cmp5 = icmp sgt i32 %1, 0 br i1 %cmp5, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %indvars.iv %2 = load i32, ptr %arrayidx, align 4, !tbaa !7 %call1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %2) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !7 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !21 for.end: ; preds = %for.body, %entry %putchar = tail call i32 @putchar(i32 10) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #13 %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull @n2) store i32 0, ptr @n, align 4, !tbaa !7 %0 = load i32, ptr @n2, align 4, !tbaa !7 %cmp35 = icmp sgt i32 %0, 0 br i1 %cmp35, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.036 = phi i32 [ %inc2, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %c) %1 = load i32, ptr %c, align 4, !tbaa !7 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [41 x i32], ptr @q, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !7 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !7 %inc2 = add nuw nsw i32 %i.036, 1 %3 = load i32, ptr @n2, align 4, !tbaa !7 %cmp = icmp slt i32 %inc2, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !22 for.end: ; preds = %for.body, %entry store i32 0, ptr @n, align 4, !tbaa !7 br label %for.body5 for.body5: ; preds = %for.inc12.1, %for.end %indvars.iv = phi i64 [ 2, %for.end ], [ %indvars.iv.next.1, %for.inc12.1 ] %inc113839 = phi i32 [ 0, %for.end ], [ %inc1137.1, %for.inc12.1 ] %arrayidx7 = getelementptr inbounds [41 x i32], ptr @q, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx7, align 8, !tbaa !7 %cmp8 = icmp sgt i32 %4, 0 br i1 %cmp8, label %if.then, label %for.inc12 if.then: ; preds = %for.body5 %idxprom9 = sext i32 %inc113839 to i64 %arrayidx10 = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %idxprom9 %5 = trunc i64 %indvars.iv to i32 store i32 %5, ptr %arrayidx10, align 4, !tbaa !7 %inc11 = add nsw i32 %inc113839, 1 store i32 %inc11, ptr @n, align 4, !tbaa !7 br label %for.inc12 for.inc12: ; preds = %for.body5, %if.then %inc1137 = phi i32 [ %inc113839, %for.body5 ], [ %inc11, %if.then ] %indvars.iv.next = or i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 41 br i1 %exitcond.not, label %for.end14, label %for.body5.1, !llvm.loop !23 for.body5.1: ; preds = %for.inc12 %arrayidx7.1 = getelementptr inbounds [41 x i32], ptr @q, i64 0, i64 %indvars.iv.next %6 = load i32, ptr %arrayidx7.1, align 4, !tbaa !7 %cmp8.1 = icmp sgt i32 %6, 0 br i1 %cmp8.1, label %if.then.1, label %for.inc12.1 if.then.1: ; preds = %for.body5.1 %idxprom9.1 = sext i32 %inc1137 to i64 %arrayidx10.1 = getelementptr inbounds [20 x i32], ptr @p, i64 0, i64 %idxprom9.1 %7 = trunc i64 %indvars.iv.next to i32 store i32 %7, ptr %arrayidx10.1, align 4, !tbaa !7 %inc11.1 = add nsw i32 %inc1137, 1 store i32 %inc11.1, ptr @n, align 4, !tbaa !7 br label %for.inc12.1 for.inc12.1: ; preds = %if.then.1, %for.body5.1 %inc1137.1 = phi i32 [ %inc1137, %for.body5.1 ], [ %inc11.1, %if.then.1 ] %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 br label %for.body5 for.end14: ; preds = %for.inc12 call void @make_gt() %8 = load i32, ptr @n, align 4, !tbaa !7 %cmp15 = icmp slt i32 %8, 2 br i1 %cmp15, label %if.then16, label %if.else21 if.then16: ; preds = %for.end14 %9 = load i32, ptr getelementptr inbounds ([41 x i32], ptr @q, i64 0, i64 1), align 4 %10 = load i32, ptr @n2, align 4, !tbaa !7 %cmp17 = icmp eq i32 %9, %10 %cmp18 = icmp eq i32 %9, 0 %or.cond = or i1 %cmp18, %cmp17 %. = select i1 %or.cond, i32 1, i32 2 br label %if.end27 if.else21: ; preds = %for.end14 call void @prepare() %11 = load i32, ptr @n, align 4, !tbaa !7 %shl.i = shl nuw i32 1, %11 %cmp8.i = icmp sgt i32 %shl.i, 1 br i1 %cmp8.i, label %for.body.lr.ph.i, label %solve.exit for.body.lr.ph.i: ; preds = %if.else21 %12 = load i32, ptr @cntr, align 4, !tbaa !7 %cmp17.i.i = icmp sgt i32 %12, 0 %wide.trip.count.i.i = zext i32 %12 to i64 br i1 %cmp17.i.i, label %for.body.us.i, label %for.body.preheader.i for.body.preheader.i: ; preds = %for.body.lr.ph.i %13 = add nsw i32 %shl.i, -1 br label %solve.exit for.body.us.i: ; preds = %for.body.lr.ph.i, %for.cond.us.i %ret.011.us.i = phi i32 [ %16, %for.cond.us.i ], [ 0, %for.body.lr.ph.i ] %i.09.us.i = phi i32 [ %inc1.us.i, %for.cond.us.i ], [ 1, %for.body.lr.ph.i ] br label %for.body.i.us.i for.body.i.us.i: ; preds = %for.inc.i.us.i, %for.body.us.i %indvars.iv.i.us.i = phi i64 [ 0, %for.body.us.i ], [ %indvars.iv.next.i.us.i, %for.inc.i.us.i ] %arrayidx.i.us.i = getelementptr inbounds [8000 x i32], ptr @from, i64 0, i64 %indvars.iv.i.us.i %14 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !7 %and.i.us.i = and i32 %14, %i.09.us.i %cmp3.i.us.i = icmp eq i32 %and.i.us.i, %14 br i1 %cmp3.i.us.i, label %land.lhs.true.i.us.i, label %for.inc.i.us.i land.lhs.true.i.us.i: ; preds = %for.body.i.us.i %arrayidx2.i.us.i = getelementptr inbounds [8000 x i8], ptr @to, i64 0, i64 %indvars.iv.i.us.i %15 = load i8, ptr %arrayidx2.i.us.i, align 1, !tbaa !12 %conv16.i.us.i = zext i8 %15 to i32 %shl.i.us.i = shl nuw i32 1, %conv16.i.us.i %and5.i.us.i = and i32 %shl.i.us.i, %i.09.us.i %cmp6.i.us.i = icmp eq i32 %and5.i.us.i, 0 br i1 %cmp6.i.us.i, label %for.cond.us.i, label %for.inc.i.us.i for.inc.i.us.i: ; preds = %land.lhs.true.i.us.i, %for.body.i.us.i %indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1 %exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i br i1 %exitcond.not.i.us.i, label %check.exit.thread.loopexit.us.i, label %for.body.i.us.i, !llvm.loop !13 for.cond.us.i: ; preds = %land.lhs.true.i.us.i, %check.exit.thread.loopexit.us.i %16 = phi i32 [ %inc7.us.i, %check.exit.thread.loopexit.us.i ], [ %ret.011.us.i, %land.lhs.true.i.us.i ] %inc1.us.i = add nuw nsw i32 %i.09.us.i, 1 %exitcond.not.i = icmp eq i32 %inc1.us.i, %shl.i br i1 %exitcond.not.i, label %solve.exit, label %for.body.us.i, !llvm.loop !14 check.exit.thread.loopexit.us.i: ; preds = %for.inc.i.us.i %inc7.us.i = add nsw i32 %ret.011.us.i, 1 br label %for.cond.us.i solve.exit: ; preds = %for.cond.us.i, %if.else21, %for.body.preheader.i %ret.0.lcssa.i = phi i32 [ 0, %if.else21 ], [ %13, %for.body.preheader.i ], [ %16, %for.cond.us.i ] %17 = load i32, ptr getelementptr inbounds ([41 x i32], ptr @q, i64 0, i64 1), align 4, !tbaa !7 %cmp23 = icmp sgt i32 %17, 0 %inc25 = zext i1 %cmp23 to i32 %spec.select = add nsw i32 %ret.0.lcssa.i, %inc25 br label %if.end27 if.end27: ; preds = %solve.exit, %if.then16 %ret.0 = phi i32 [ %., %if.then16 ], [ %spec.select, %solve.exit ] %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i32 noundef %ret.0) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #13 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 #11 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #11 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.smax.i8(i8, i8) #12 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nosync nounwind memory(read, argmem: write, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #7 = { mustprogress nofree 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 #8 = { 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 #9 = { 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 #10 = { 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 #11 = { nofree nounwind } attributes #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #13 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = !{!9, !9, i64 0} !13 = distinct !{!13, !6} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !6} !18 = distinct !{!18, !6} !19 = distinct !{!19, !6} !20 = distinct !{!20, !6} !21 = distinct !{!21, !6} !22 = distinct !{!22, !6} !23 = distinct !{!23, !6}
#include<stdio.h> #include<stdlib.h> int a[20004], b[20004]; int asc1(const void* x, const void* y) { if (a[*(int*)x] > a[*(int*)y])return 1; if (a[*(int*)x] < a[*(int*)y])return -1; if (b[*(int*)x] > b[*(int*)y])return 1; if (b[*(int*)x] < b[*(int*)y])return -1; return 0; } int asc2(const void* x, const void* y) { if (*(long long int*)x > * (long long int*)y)return 1; if (*(long long int*)x < *(long long int*)y)return -1; return 0; } int main() { int n; scanf("%d", &n); int i; for (i = 0; i < n - 1; i++) { scanf("%d %d", &a[2 * i], &b[2 * i]); a[2 * i]--; b[2 * i]--; b[2 * i + 1] = a[2 * i]; a[2 * i + 1] = b[2 * i]; } long long int c[10004]; for (i = 0; i < n; i++) scanf("%lld", &c[i]); int d[20004]; for (i = 0; i < 2 * n; i++) d[i] = i; qsort(d, 2 * n - 2, sizeof(int), asc1); qsort(c, n, sizeof(long long int), asc2); int count[10004]; for (i = 0; i < n; i++) count[i] = 0; for (i = 0; i < n - 1; i++) { count[a[2 * i]]++; count[b[2 * i]]++; } long long int v[10004]; for (i = 0; i < n; i++) v[i] = -1; int min; int j; long long int ans = 0; int p, q, r; for (j = 0; j < n; j++) { min = -1; for (i = 0; i < n; i++) { if (min < 0 && v[i] < 0) min = i; else if (v[i] < 0 && count[i] < count[min]) min = i; } v[min] = c[j]; ans += v[min] * count[min]; p = 0; q = 2 * n - 2; while (q - p > 1) { r = (p + q) / 2; if (a[d[r]] < min) p = r; else q = r; } if (a[d[p]] < min) p++; if (p < 2 * n) { while (a[d[p]] == min) { if (v[b[d[p]]] < 0) count[b[d[p]]]--; p++; if (p == 2 * n) break; } } } printf("%lld\n", ans); for (i = 0; i < n - 1; i++) printf("%lld ", v[i]); printf("%lld\n", v[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118948/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118948/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @a = dso_local global [20004 x i32] zeroinitializer, align 16 @b = dso_local global [20004 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.4 = private unnamed_addr constant [6 x i8] c"%lld \00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @asc1(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #0 { entry: %0 = load i32, ptr %x, align 4, !tbaa !5 %idxprom = sext i32 %0 to i64 %arrayidx = getelementptr inbounds [20004 x i32], ptr @a, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = load i32, ptr %y, align 4, !tbaa !5 %idxprom1 = sext i32 %2 to i64 %arrayidx2 = getelementptr inbounds [20004 x i32], ptr @a, i64 0, i64 %idxprom1 %3 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp = icmp sgt i32 %1, %3 br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %cmp7 = icmp slt i32 %1, %3 br i1 %cmp7, label %return, label %if.end9 if.end9: ; preds = %if.end %arrayidx11 = getelementptr inbounds [20004 x i32], ptr @b, i64 0, i64 %idxprom %4 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %arrayidx13 = getelementptr inbounds [20004 x i32], ptr @b, i64 0, i64 %idxprom1 %5 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp sgt i32 %4, %5 br i1 %cmp14, label %return, label %if.end16 if.end16: ; preds = %if.end9 %cmp21 = icmp slt i32 %4, %5 %. = sext i1 %cmp21 to i32 br label %return return: ; preds = %if.end16, %if.end9, %if.end, %entry %retval.0 = phi i32 [ 1, %entry ], [ -1, %if.end ], [ 1, %if.end9 ], [ %., %if.end16 ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @asc2(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y) #1 { entry: %0 = load i64, ptr %x, align 8, !tbaa !9 %1 = load i64, ptr %y, align 8, !tbaa !9 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp slt i64 %0, %1 %. = sext i1 %cmp1 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 #2 { entry: %n = alloca i32, align 4 %c = alloca [10004 x i64], align 16 %d = alloca [20004 x i32], align 16 %count = alloca [10004 x i32], align 16 %v = alloca [10004 x i64], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp267 = icmp sgt i32 %0, 1 br i1 %cmp267, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %1 = shl nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [20004 x i32], ptr @a, i64 0, i64 %1 %arrayidx3 = getelementptr inbounds [20004 x i32], ptr @b, i64 0, i64 %1 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx3) %2 = load i32, ptr %arrayidx, align 8, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %arrayidx, align 8, !tbaa !5 %3 = load i32, ptr %arrayidx3, align 8, !tbaa !5 %dec11 = add nsw i32 %3, -1 store i32 %dec11, ptr %arrayidx3, align 8, !tbaa !5 %4 = or i64 %1, 1 %arrayidx17 = getelementptr inbounds [20004 x i32], ptr @b, i64 0, i64 %4 store i32 %dec, ptr %arrayidx17, align 4, !tbaa !5 %arrayidx24 = getelementptr inbounds [20004 x i32], ptr @a, i64 0, i64 %4 store i32 %dec11, ptr %arrayidx24, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %5, -1 %6 = sext i32 %sub to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %7 = phi i32 [ %0, %entry ], [ %5, %for.body ] call void @llvm.lifetime.start.p0(i64 80032, ptr nonnull %c) #8 %cmp26269 = icmp sgt i32 %7, 0 br i1 %cmp26269, label %for.body27, label %for.end33.thread for.end33.thread: ; preds = %for.end call void @llvm.lifetime.start.p0(i64 80016, ptr nonnull %d) #8 %mul35335 = shl i32 %7, 1 br label %for.end42 for.body27: ; preds = %for.end, %for.body27 %indvars.iv300 = phi i64 [ %indvars.iv.next301, %for.body27 ], [ 0, %for.end ] %arrayidx29 = getelementptr inbounds [10004 x i64], ptr %c, i64 0, i64 %indvars.iv300 %call30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx29) %indvars.iv.next301 = add nuw nsw i64 %indvars.iv300, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp26 = icmp slt i64 %indvars.iv.next301, %9 br i1 %cmp26, label %for.body27, label %for.end33, !llvm.loop !13 for.end33: ; preds = %for.body27 call void @llvm.lifetime.start.p0(i64 80016, ptr nonnull %d) #8 %mul35 = shl i32 %8, 1 %cmp36271 = icmp sgt i32 %8, 0 br i1 %cmp36271, label %for.body37.preheader, label %for.end42 for.body37.preheader: ; preds = %for.end33 %smax = call i32 @llvm.smax.i32(i32 %mul35, i32 1) %wide.trip.count = zext i32 %smax to i64 %min.iters.check = icmp ult i32 %smax, 8 br i1 %min.iters.check, label %for.body37.preheader345, label %vector.ph vector.ph: ; preds = %for.body37.preheader %n.vec = and i64 %wide.trip.count, 2147483640 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> %10 = getelementptr inbounds [20004 x i32], ptr %d, i64 0, i64 %index store <4 x i32> %vec.ind, ptr %10, align 16, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 store <4 x i32> %step.add, ptr %11, align 16, !tbaa !5 %index.next = add nuw i64 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end42, label %for.body37.preheader345 for.body37.preheader345: ; preds = %for.body37.preheader, %middle.block %indvars.iv303.ph = phi i64 [ 0, %for.body37.preheader ], [ %n.vec, %middle.block ] br label %for.body37 for.body37: ; preds = %for.body37.preheader345, %for.body37 %indvars.iv303 = phi i64 [ %indvars.iv.next304, %for.body37 ], [ %indvars.iv303.ph, %for.body37.preheader345 ] %arrayidx39 = getelementptr inbounds [20004 x i32], ptr %d, i64 0, i64 %indvars.iv303 %13 = trunc i64 %indvars.iv303 to i32 store i32 %13, ptr %arrayidx39, align 4, !tbaa !5 %indvars.iv.next304 = add nuw nsw i64 %indvars.iv303, 1 %exitcond.not = icmp eq i64 %indvars.iv.next304, %wide.trip.count br i1 %exitcond.not, label %for.end42, label %for.body37, !llvm.loop !17 for.end42: ; preds = %for.body37, %middle.block, %for.end33.thread, %for.end33 %mul35337 = phi i32 [ %mul35335, %for.end33.thread ], [ %mul35, %for.end33 ], [ %mul35, %middle.block ], [ %mul35, %for.body37 ] %sub44 = add nsw i32 %mul35337, -2 %conv = sext i32 %sub44 to i64 call void @qsort(ptr noundef nonnull %d, i64 noundef %conv, i64 noundef 4, ptr noundef nonnull @asc1) #8 %14 = load i32, ptr %n, align 4, !tbaa !5 %conv46 = sext i32 %14 to i64 call void @qsort(ptr noundef nonnull %c, i64 noundef %conv46, i64 noundef 8, ptr noundef nonnull @asc2) #8 call void @llvm.lifetime.start.p0(i64 40016, ptr nonnull %count) #8 %15 = load i32, ptr %n, align 4, !tbaa !5 %cmp48274 = icmp sgt i32 %15, 0 br i1 %cmp48274, label %for.cond56.preheader, label %for.end75.thread339 for.end75.thread339: ; preds = %for.end42 call void @llvm.lifetime.start.p0(i64 80032, ptr nonnull %v) #8 br label %for.end189 for.cond56.preheader: ; preds = %for.end42 %16 = zext i32 %15 to i64 %17 = shl nuw nsw i64 %16, 2 call void @llvm.memset.p0.i64(ptr nonnull align 16 %count, i8 0, i64 %17, i1 false), !tbaa !5 %cmp58277.not = icmp eq i32 %15, 1 br i1 %cmp58277.not, label %for.end75.thread, label %for.body60.preheader for.end75.thread: ; preds = %for.cond56.preheader call void @llvm.lifetime.start.p0(i64 80032, ptr nonnull %v) #8 br label %for.cond89.preheader.lr.ph for.body60.preheader: ; preds = %for.cond56.preheader %sub57 = add nsw i32 %15, -1 %wide.trip.count313 = zext i32 %sub57 to i64 br label %for.body60 for.body60: ; preds = %for.body60.preheader, %for.body60 %indvars.iv309 = phi i64 [ 0, %for.body60.preheader ], [ %indvars.iv.next310, %for.body60 ] %18 = shl nuw nsw i64 %indvars.iv309, 1 %arrayidx63 = getelementptr inbounds [20004 x i32], ptr @a, i64 0, i64 %18 %19 = load i32, ptr %arrayidx63, align 8, !tbaa !5 %idxprom64 = sext i32 %19 to i64 %arrayidx65 = getelementptr inbounds [10004 x i32], ptr %count, i64 0, i64 %idxprom64 %20 = load i32, ptr %arrayidx65, align 4, !tbaa !5 %inc66 = add nsw i32 %20, 1 store i32 %inc66, ptr %arrayidx65, align 4, !tbaa !5 %arrayidx69 = getelementptr inbounds [20004 x i32], ptr @b, i64 0, i64 %18 %21 = load i32, ptr %arrayidx69, align 8, !tbaa !5 %idxprom70 = sext i32 %21 to i64 %arrayidx71 = getelementptr inbounds [10004 x i32], ptr %count, i64 0, i64 %idxprom70 %22 = load i32, ptr %arrayidx71, align 4, !tbaa !5 %inc72 = add nsw i32 %22, 1 store i32 %inc72, ptr %arrayidx71, align 4, !tbaa !5 %indvars.iv.next310 = add nuw nsw i64 %indvars.iv309, 1 %exitcond314.not = icmp eq i64 %indvars.iv.next310, %wide.trip.count313 br i1 %exitcond314.not, label %for.end75, label %for.body60, !llvm.loop !18 for.end75: ; preds = %for.body60 call void @llvm.lifetime.start.p0(i64 80032, ptr nonnull %v) #8 br i1 %cmp48274, label %for.cond89.preheader.lr.ph, label %for.end189 for.cond89.preheader.lr.ph: ; preds = %for.end75.thread, %for.end75 %23 = zext i32 %15 to i64 %24 = shl nuw nsw i64 %23, 3 call void @llvm.memset.p0.i64(ptr nonnull align 16 %v, i8 -1, i64 %24, i1 false), !tbaa !9 %mul126 = shl nuw nsw i32 %15, 1 %sub127 = add nsw i32 %mul126, -2 %cmp129285.not = icmp eq i32 %15, 1 %wide.trip.count329 = zext i32 %15 to i64 %xtraiter = and i64 %wide.trip.count329, 1 %25 = icmp eq i32 %15, 1 %unroll_iter = and i64 %wide.trip.count329, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.body92.preheader for.body92.preheader: ; preds = %for.inc187, %for.cond89.preheader.lr.ph %indvars.iv326 = phi i64 [ 0, %for.cond89.preheader.lr.ph ], [ %indvars.iv.next327, %for.inc187 ] %ans.0291 = phi i64 [ 0, %for.cond89.preheader.lr.ph ], [ %add125, %for.inc187 ] br i1 %25, label %for.end114.unr-lcssa, label %for.body92 for.body92: ; preds = %for.body92.preheader, %for.inc112.1 %indvars.iv318 = phi i64 [ %indvars.iv.next319.1, %for.inc112.1 ], [ 0, %for.body92.preheader ] %min.0282 = phi i32 [ %min.1.1, %for.inc112.1 ], [ -1, %for.body92.preheader ] %niter = phi i64 [ %niter.next.1, %for.inc112.1 ], [ 0, %for.body92.preheader ] %cmp93 = icmp slt i32 %min.0282, 0 %arrayidx96 = getelementptr inbounds [10004 x i64], ptr %v, i64 0, i64 %indvars.iv318 %26 = load i64, ptr %arrayidx96, align 16, !tbaa !9 %cmp97 = icmp slt i64 %26, 0 br i1 %cmp93, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %for.body92 %27 = trunc i64 %indvars.iv318 to i32 %spec.select342 = select i1 %cmp97, i32 %27, i32 %min.0282 br label %for.inc112 if.else: ; preds = %for.body92 br i1 %cmp97, label %land.lhs.true103, label %for.inc112 land.lhs.true103: ; preds = %if.else %arrayidx105 = getelementptr inbounds [10004 x i32], ptr %count, i64 0, i64 %indvars.iv318 %28 = load i32, ptr %arrayidx105, align 8, !tbaa !5 %idxprom106 = zext i32 %min.0282 to i64 %arrayidx107 = getelementptr inbounds [10004 x i32], ptr %count, i64 0, i64 %idxprom106 %29 = load i32, ptr %arrayidx107, align 4, !tbaa !5 %cmp108 = icmp slt i32 %28, %29 %30 = trunc i64 %indvars.iv318 to i32 %spec.select = select i1 %cmp108, i32 %30, i32 %min.0282 br label %for.inc112 for.inc112: ; preds = %land.lhs.true, %land.lhs.true103, %if.else %min.1 = phi i32 [ %min.0282, %if.else ], [ %spec.select, %land.lhs.true103 ], [ %spec.select342, %land.lhs.true ] %indvars.iv.next319 = or i64 %indvars.iv318, 1 %cmp93.1 = icmp slt i32 %min.1, 0 %arrayidx96.1 = getelementptr inbounds [10004 x i64], ptr %v, i64 0, i64 %indvars.iv.next319 %31 = load i64, ptr %arrayidx96.1, align 8, !tbaa !9 %cmp97.1 = icmp slt i64 %31, 0 br i1 %cmp93.1, label %land.lhs.true.1, label %if.else.1 if.else.1: ; preds = %for.inc112 br i1 %cmp97.1, label %land.lhs.true103.1, label %for.inc112.1 land.lhs.true103.1: ; preds = %if.else.1 %arrayidx105.1 = getelementptr inbounds [10004 x i32], ptr %count, i64 0, i64 %indvars.iv.next319 %32 = load i32, ptr %arrayidx105.1, align 4, !tbaa !5 %idxprom106.1 = zext i32 %min.1 to i64 %arrayidx107.1 = getelementptr inbounds [10004 x i32], ptr %count, i64 0, i64 %idxprom106.1 %33 = load i32, ptr %arrayidx107.1, align 4, !tbaa !5 %cmp108.1 = icmp slt i32 %32, %33 %34 = trunc i64 %indvars.iv.next319 to i32 %spec.select.1 = select i1 %cmp108.1, i32 %34, i32 %min.1 br label %for.inc112.1 land.lhs.true.1: ; preds = %for.inc112 %35 = trunc i64 %indvars.iv.next319 to i32 %spec.select342.1 = select i1 %cmp97.1, i32 %35, i32 %min.1 br label %for.inc112.1 for.inc112.1: ; preds = %land.lhs.true.1, %land.lhs.true103.1, %if.else.1 %min.1.1 = phi i32 [ %min.1, %if.else.1 ], [ %spec.select.1, %land.lhs.true103.1 ], [ %spec.select342.1, %land.lhs.true.1 ] %indvars.iv.next319.1 = add nuw nsw i64 %indvars.iv318, 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.end114.unr-lcssa, label %for.body92, !llvm.loop !19 for.end114.unr-lcssa: ; preds = %for.inc112.1, %for.body92.preheader %min.1.lcssa.ph = phi i32 [ undef, %for.body92.preheader ], [ %min.1.1, %for.inc112.1 ] %indvars.iv318.unr = phi i64 [ 0, %for.body92.preheader ], [ %indvars.iv.next319.1, %for.inc112.1 ] %min.0282.unr = phi i32 [ -1, %for.body92.preheader ], [ %min.1.1, %for.inc112.1 ] br i1 %lcmp.mod.not, label %for.end114, label %for.body92.epil for.body92.epil: ; preds = %for.end114.unr-lcssa %cmp93.epil = icmp slt i32 %min.0282.unr, 0 %arrayidx96.epil = getelementptr inbounds [10004 x i64], ptr %v, i64 0, i64 %indvars.iv318.unr %36 = load i64, ptr %arrayidx96.epil, align 8, !tbaa !9 %cmp97.epil = icmp slt i64 %36, 0 br i1 %cmp93.epil, label %land.lhs.true.epil, label %if.else.epil if.else.epil: ; preds = %for.body92.epil br i1 %cmp97.epil, label %land.lhs.true103.epil, label %for.end114 land.lhs.true103.epil: ; preds = %if.else.epil %arrayidx105.epil = getelementptr inbounds [10004 x i32], ptr %count, i64 0, i64 %indvars.iv318.unr %37 = load i32, ptr %arrayidx105.epil, align 4, !tbaa !5 %idxprom106.epil = zext i32 %min.0282.unr to i64 %arrayidx107.epil = getelementptr inbounds [10004 x i32], ptr %count, i64 0, i64 %idxprom106.epil %38 = load i32, ptr %arrayidx107.epil, align 4, !tbaa !5 %cmp108.epil = icmp slt i32 %37, %38 %39 = trunc i64 %indvars.iv318.unr to i32 %spec.select.epil = select i1 %cmp108.epil, i32 %39, i32 %min.0282.unr br label %for.end114 land.lhs.true.epil: ; preds = %for.body92.epil %40 = trunc i64 %indvars.iv318.unr to i32 %spec.select342.epil = select i1 %cmp97.epil, i32 %40, i32 %min.0282.unr br label %for.end114 for.end114: ; preds = %if.else.epil, %land.lhs.true103.epil, %land.lhs.true.epil, %for.end114.unr-lcssa %min.1.lcssa = phi i32 [ %min.1.lcssa.ph, %for.end114.unr-lcssa ], [ %min.0282.unr, %if.else.epil ], [ %spec.select.epil, %land.lhs.true103.epil ], [ %spec.select342.epil, %land.lhs.true.epil ] %arrayidx116 = getelementptr inbounds [10004 x i64], ptr %c, i64 0, i64 %indvars.iv326 %41 = load i64, ptr %arrayidx116, align 8, !tbaa !9 %idxprom117 = sext i32 %min.1.lcssa to i64 %arrayidx118 = getelementptr inbounds [10004 x i64], ptr %v, i64 0, i64 %idxprom117 store i64 %41, ptr %arrayidx118, align 8, !tbaa !9 %arrayidx122 = getelementptr inbounds [10004 x i32], ptr %count, i64 0, i64 %idxprom117 %42 = load i32, ptr %arrayidx122, align 4, !tbaa !5 %conv123 = sext i32 %42 to i64 %mul124 = mul nsw i64 %41, %conv123 %add125 = add nsw i64 %mul124, %ans.0291 br i1 %cmp129285.not, label %while.end, label %while.body while.body: ; preds = %for.end114, %while.body %q.0287 = phi i32 [ %q.0.div, %while.body ], [ %sub127, %for.end114 ] %p.0286 = phi i32 [ %div.p.0, %while.body ], [ 0, %for.end114 ] %add131 = add nsw i32 %q.0287, %p.0286 %div = sdiv i32 %add131, 2 %idxprom132 = sext i32 %div to i64 %arrayidx133 = getelementptr inbounds [20004 x i32], ptr %d, i64 0, i64 %idxprom132 %43 = load i32, ptr %arrayidx133, align 4, !tbaa !5 %idxprom134 = sext i32 %43 to i64 %arrayidx135 = getelementptr inbounds [20004 x i32], ptr @a, i64 0, i64 %idxprom134 %44 = load i32, ptr %arrayidx135, align 4, !tbaa !5 %cmp136 = icmp slt i32 %44, %min.1.lcssa %div.p.0 = select i1 %cmp136, i32 %div, i32 %p.0286 %q.0.div = select i1 %cmp136, i32 %q.0287, i32 %div %sub128 = sub nsw i32 %q.0.div, %div.p.0 %cmp129 = icmp sgt i32 %sub128, 1 br i1 %cmp129, label %while.body, label %while.end, !llvm.loop !20 while.end: ; preds = %while.body, %for.end114 %p.0.lcssa = phi i32 [ 0, %for.end114 ], [ %div.p.0, %while.body ] %idxprom141 = sext i32 %p.0.lcssa to i64 %arrayidx142 = getelementptr inbounds [20004 x i32], ptr %d, i64 0, i64 %idxprom141 %45 = load i32, ptr %arrayidx142, align 4, !tbaa !5 %idxprom143 = sext i32 %45 to i64 %arrayidx144 = getelementptr inbounds [20004 x i32], ptr @a, i64 0, i64 %idxprom143 %46 = load i32, ptr %arrayidx144, align 4, !tbaa !5 %cmp145 = icmp slt i32 %46, %min.1.lcssa %inc148 = zext i1 %cmp145 to i32 %spec.select264 = add nsw i32 %p.0.lcssa, %inc148 %cmp151 = icmp slt i32 %spec.select264, %mul126 br i1 %cmp151, label %while.cond154.preheader, label %for.inc187 while.cond154.preheader: ; preds = %while.end %47 = zext i1 %cmp145 to i64 %48 = add nsw i64 %idxprom141, %47 br label %while.cond154 while.cond154: ; preds = %while.cond154.preheader, %if.end178 %indvars.iv323 = phi i64 [ %48, %while.cond154.preheader ], [ %indvars.iv.next324, %if.end178 ] %arrayidx156 = getelementptr inbounds [20004 x i32], ptr %d, i64 0, i64 %indvars.iv323 %49 = load i32, ptr %arrayidx156, align 4, !tbaa !5 %idxprom157 = sext i32 %49 to i64 %arrayidx158 = getelementptr inbounds [20004 x i32], ptr @a, i64 0, i64 %idxprom157 %50 = load i32, ptr %arrayidx158, align 4, !tbaa !5 %cmp159 = icmp eq i32 %50, %min.1.lcssa br i1 %cmp159, label %while.body161, label %for.inc187 while.body161: ; preds = %while.cond154 %arrayidx165 = getelementptr inbounds [20004 x i32], ptr @b, i64 0, i64 %idxprom157 %51 = load i32, ptr %arrayidx165, align 4, !tbaa !5 %idxprom166 = sext i32 %51 to i64 %arrayidx167 = getelementptr inbounds [10004 x i64], ptr %v, i64 0, i64 %idxprom166 %52 = load i64, ptr %arrayidx167, align 8, !tbaa !9 %cmp168 = icmp slt i64 %52, 0 br i1 %cmp168, label %if.then170, label %if.end178 if.then170: ; preds = %while.body161 %arrayidx176 = getelementptr inbounds [10004 x i32], ptr %count, i64 0, i64 %idxprom166 %53 = load i32, ptr %arrayidx176, align 4, !tbaa !5 %dec177 = add nsw i32 %53, -1 store i32 %dec177, ptr %arrayidx176, align 4, !tbaa !5 br label %if.end178 if.end178: ; preds = %if.then170, %while.body161 %indvars.iv.next324 = add nsw i64 %indvars.iv323, 1 %54 = trunc i64 %indvars.iv.next324 to i32 %cmp181 = icmp eq i32 %mul126, %54 br i1 %cmp181, label %for.inc187, label %while.cond154, !llvm.loop !21 for.inc187: ; preds = %if.end178, %while.cond154, %while.end %indvars.iv.next327 = add nuw nsw i64 %indvars.iv326, 1 %exitcond330.not = icmp eq i64 %indvars.iv.next327, %wide.trip.count329 br i1 %exitcond330.not, label %for.end189, label %for.body92.preheader, !llvm.loop !22 for.end189: ; preds = %for.inc187, %for.end75, %for.end75.thread339 %ans.0.lcssa = phi i64 [ 0, %for.end75.thread339 ], [ 0, %for.end75 ], [ %add125, %for.inc187 ] %call190 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %ans.0.lcssa) %55 = load i32, ptr %n, align 4, !tbaa !5 %cmp193294 = icmp sgt i32 %55, 1 br i1 %cmp193294, label %for.body195, label %for.end201 for.body195: ; preds = %for.end189, %for.body195 %indvars.iv331 = phi i64 [ %indvars.iv.next332, %for.body195 ], [ 0, %for.end189 ] %arrayidx197 = getelementptr inbounds [10004 x i64], ptr %v, i64 0, i64 %indvars.iv331 %56 = load i64, ptr %arrayidx197, align 8, !tbaa !9 %call198 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %56) %indvars.iv.next332 = add nuw nsw i64 %indvars.iv331, 1 %57 = load i32, ptr %n, align 4, !tbaa !5 %sub192 = add nsw i32 %57, -1 %58 = sext i32 %sub192 to i64 %cmp193 = icmp slt i64 %indvars.iv.next332, %58 br i1 %cmp193, label %for.body195, label %for.end201.loopexit, !llvm.loop !23 for.end201.loopexit: ; preds = %for.body195 %59 = and i64 %indvars.iv.next332, 4294967295 br label %for.end201 for.end201: ; preds = %for.end201.loopexit, %for.end189 %i.7.lcssa = phi i64 [ 0, %for.end189 ], [ %59, %for.end201.loopexit ] %arrayidx203 = getelementptr inbounds [10004 x i64], ptr %v, i64 0, i64 %i.7.lcssa %60 = load i64, ptr %arrayidx203, align 8, !tbaa !9 %call204 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %60) call void @llvm.lifetime.end.p0(i64 80032, ptr nonnull %v) #8 call void @llvm.lifetime.end.p0(i64 40016, ptr nonnull %count) #8 call void @llvm.lifetime.end.p0(i64 80016, ptr nonnull %d) #8 call void @llvm.lifetime.end.p0(i64 80032, ptr nonnull %c) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #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 #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #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 = { 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 #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 = { 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, !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 = !{!"long long", !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} !20 = distinct !{!20, !12} !21 = distinct !{!21, !12} !22 = distinct !{!22, !12} !23 = distinct !{!23, !12}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> #define lli long long int #define min(a,b) ((a)<(b)?(a):(b)) #define max(a,b) ((a)>(b)?(a):(b)) lli solve(int j,int k,int s,int *x,lli ***dp,bool ***bl){ //printf("j = %3d k = %3d s = %3d x = %3d\n",j,k,s,x[j] ); if(bl[j][k][s]){ return dp[j][k][s]; } bl[j][k][s] = 1; if(j == 0 && k == 0 && s == 0){ return dp[j][k][s] = 1; }else if(j > 0 && s < x[j]){ return dp[j][k][s] = solve(j-1,k,s,x,dp,bl); }else if(j > 0 && k > 0 && s >= x[j]){ return dp[j][k][s] = solve(j-1,k,s,x,dp,bl) + solve(j-1,k-1,s-x[j],x,dp,bl); } return dp[j][k][s] = 0; } int main(void){ int i,j; int n,a; int *x; lli ***dp; bool ***bl; lli res = 0; scanf("%d%d",&n,&a); dp = calloc(sizeof(lli**),n+1); bl = calloc(sizeof(bool**),n+1); x = calloc(sizeof(int),n+1); for(i=1;i<=n;i++){ scanf("%d",&x[i]); } for(i=0;i<=n;i++){ dp[i] = calloc(sizeof(lli*),n+1); bl[i] = calloc(sizeof(bool*),n+1); for(j=0;j<=n;j++){ dp[i][j] = calloc(sizeof(lli),n*a+1); bl[i][j] = calloc(sizeof(bool),n*a+1); } } for(i=1;i<=n;i++){ res += solve(n,i,i*a,x,dp,bl); } printf("%lld\n", res); return 0; } /* 想定解法1 */
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119004/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119004/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local i64 @solve(i32 noundef %j, i32 noundef %k, i32 noundef %s, ptr noundef %x, ptr noundef %dp, ptr noundef %bl) local_unnamed_addr #0 { entry: %idxprom = sext i32 %j to i64 %arrayidx = getelementptr inbounds ptr, ptr %bl, i64 %idxprom %0 = load ptr, ptr %arrayidx, align 8, !tbaa !5 %idxprom1 = sext i32 %k to i64 %arrayidx2 = getelementptr inbounds ptr, ptr %0, i64 %idxprom1 %1 = load ptr, ptr %arrayidx2, align 8, !tbaa !5 %idxprom3 = sext i32 %s to i64 %arrayidx4 = getelementptr inbounds i8, ptr %1, i64 %idxprom3 %2 = load i8, ptr %arrayidx4, align 1, !tbaa !9, !range !11, !noundef !12 %tobool.not = icmp eq i8 %2, 0 br i1 %tobool.not, label %if.end, label %if.then if.then: ; preds = %entry %arrayidx6 = getelementptr inbounds ptr, ptr %dp, i64 %idxprom %3 = load ptr, ptr %arrayidx6, align 8, !tbaa !5 %arrayidx8 = getelementptr inbounds ptr, ptr %3, i64 %idxprom1 %4 = load ptr, ptr %arrayidx8, align 8, !tbaa !5 %arrayidx10 = getelementptr inbounds i64, ptr %4, i64 %idxprom3 %5 = load i64, ptr %arrayidx10, align 8, !tbaa !13 br label %common.ret129 if.end: ; preds = %entry store i8 1, ptr %arrayidx4, align 1, !tbaa !9 %6 = or i32 %k, %j %7 = or i32 %6, %s %or.cond71 = icmp eq i32 %7, 0 br i1 %or.cond71, label %if.then20, label %if.else if.then20: ; preds = %if.end %arrayidx22 = getelementptr inbounds ptr, ptr %dp, i64 %idxprom %8 = load ptr, ptr %arrayidx22, align 8, !tbaa !5 %arrayidx24 = getelementptr inbounds ptr, ptr %8, i64 %idxprom1 %9 = load ptr, ptr %arrayidx24, align 8, !tbaa !5 %arrayidx26 = getelementptr inbounds i64, ptr %9, i64 %idxprom3 store i64 1, ptr %arrayidx26, align 8, !tbaa !13 br label %common.ret129 if.else: ; preds = %if.end %cmp27 = icmp sgt i32 %j, 0 br i1 %cmp27, label %land.lhs.true28, label %if.end64 land.lhs.true28: ; preds = %if.else %arrayidx30 = getelementptr inbounds i32, ptr %x, i64 %idxprom %10 = load i32, ptr %arrayidx30, align 4, !tbaa !15 %cmp31 = icmp sgt i32 %10, %s br i1 %cmp31, label %if.then32, label %if.else39 common.ret129: ; preds = %if.end64, %if.then20, %if.then, %if.then47, %if.then32 %common.ret129.op = phi i64 [ %call, %if.then32 ], [ %add, %if.then47 ], [ %5, %if.then ], [ 1, %if.then20 ], [ 0, %if.end64 ] ret i64 %common.ret129.op if.then32: ; preds = %land.lhs.true28 %sub = add nsw i32 %j, -1 %call = tail call i64 @solve(i32 noundef %sub, i32 noundef %k, i32 noundef %s, ptr noundef nonnull %x, ptr noundef %dp, ptr noundef nonnull %bl) %arrayidx34 = getelementptr inbounds ptr, ptr %dp, i64 %idxprom %11 = load ptr, ptr %arrayidx34, align 8, !tbaa !5 %arrayidx36 = getelementptr inbounds ptr, ptr %11, i64 %idxprom1 %12 = load ptr, ptr %arrayidx36, align 8, !tbaa !5 %arrayidx38 = getelementptr inbounds i64, ptr %12, i64 %idxprom3 store i64 %call, ptr %arrayidx38, align 8, !tbaa !13 br label %common.ret129 if.else39: ; preds = %land.lhs.true28 %cmp42 = icmp sgt i32 %k, 0 br i1 %cmp42, label %if.then47, label %if.end64 if.then47: ; preds = %if.else39 %sub48 = add nsw i32 %j, -1 %call49 = tail call i64 @solve(i32 noundef %sub48, i32 noundef %k, i32 noundef %s, ptr noundef nonnull %x, ptr noundef %dp, ptr noundef nonnull %bl) %sub51 = add nsw i32 %k, -1 %13 = load i32, ptr %arrayidx30, align 4, !tbaa !15 %sub54 = sub nsw i32 %s, %13 %call55 = tail call i64 @solve(i32 noundef %sub48, i32 noundef %sub51, i32 noundef %sub54, ptr noundef nonnull %x, ptr noundef %dp, ptr noundef nonnull %bl) %add = add nsw i64 %call55, %call49 %arrayidx57 = getelementptr inbounds ptr, ptr %dp, i64 %idxprom %14 = load ptr, ptr %arrayidx57, align 8, !tbaa !5 %arrayidx59 = getelementptr inbounds ptr, ptr %14, i64 %idxprom1 %15 = load ptr, ptr %arrayidx59, align 8, !tbaa !5 %arrayidx61 = getelementptr inbounds i64, ptr %15, i64 %idxprom3 store i64 %add, ptr %arrayidx61, align 8, !tbaa !13 br label %common.ret129 if.end64: ; preds = %if.else, %if.else39 %arrayidx66 = getelementptr inbounds ptr, ptr %dp, i64 %idxprom %16 = load ptr, ptr %arrayidx66, align 8, !tbaa !5 %arrayidx68 = getelementptr inbounds ptr, ptr %16, i64 %idxprom1 %17 = load ptr, ptr %arrayidx68, align 8, !tbaa !5 %arrayidx70 = getelementptr inbounds i64, ptr %17, i64 %idxprom3 store i64 0, ptr %arrayidx70, align 8, !tbaa !13 br label %common.ret129 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %a = 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 %a) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a) %0 = load i32, ptr %n, align 4, !tbaa !15 %add = add nsw i32 %0, 1 %conv = sext i32 %add to i64 %call1 = call noalias ptr @calloc(i64 noundef 8, i64 noundef %conv) #6 %call4 = call noalias ptr @calloc(i64 noundef 8, i64 noundef %conv) #6 %call7 = call noalias ptr @calloc(i64 noundef 4, i64 noundef %conv) #6 %cmp.not83 = icmp slt i32 %0, 1 br i1 %cmp.not83, label %for.cond10.preheader, label %for.body for.cond10.preheader: ; preds = %for.body, %entry %1 = phi i32 [ %0, %entry ], [ %3, %for.body ] %cmp11.not87 = icmp slt i32 %1, 0 br i1 %cmp11.not87, label %for.end58, label %for.body13.lr.ph for.body13.lr.ph: ; preds = %for.cond10.preheader %add14 = add nuw i32 %1, 1 %conv15 = sext i32 %add14 to i64 %2 = load i32, ptr %a, align 4 %mul = mul nsw i32 %2, %1 %add28 = add nsw i32 %mul, 1 %conv29 = sext i32 %add28 to i64 %wide.trip.count101 = zext i32 %add14 to i64 br label %for.body13 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds i32, ptr %call7, i64 %indvars.iv %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr %n, align 4, !tbaa !15 %4 = sext i32 %3 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %4 br i1 %cmp.not.not, label %for.body, label %for.cond10.preheader, !llvm.loop !17 for.cond49.preheader: ; preds = %for.cond24.for.inc46_crit_edge %cmp50.not89 = icmp slt i32 %1, 1 br i1 %cmp50.not89, label %for.end58, label %for.body52 for.body13: ; preds = %for.body13.lr.ph, %for.cond24.for.inc46_crit_edge %indvars.iv98 = phi i64 [ 0, %for.body13.lr.ph ], [ %indvars.iv.next99, %for.cond24.for.inc46_crit_edge ] %call16 = call noalias ptr @calloc(i64 noundef 8, i64 noundef %conv15) #6 %arrayidx18 = getelementptr inbounds ptr, ptr %call1, i64 %indvars.iv98 store ptr %call16, ptr %arrayidx18, align 8, !tbaa !5 %call21 = call noalias ptr @calloc(i64 noundef 8, i64 noundef %conv15) #6 %arrayidx23 = getelementptr inbounds ptr, ptr %call4, i64 %indvars.iv98 store ptr %call21, ptr %arrayidx23, align 8, !tbaa !5 br label %for.body27 for.body27: ; preds = %for.body13, %for.body27 %indvars.iv95 = phi i64 [ 0, %for.body13 ], [ %indvars.iv.next96, %for.body27 ] %call30 = call noalias ptr @calloc(i64 noundef 8, i64 noundef %conv29) #6 %5 = load ptr, ptr %arrayidx18, align 8, !tbaa !5 %arrayidx34 = getelementptr inbounds ptr, ptr %5, i64 %indvars.iv95 store ptr %call30, ptr %arrayidx34, align 8, !tbaa !5 %call38 = call noalias ptr @calloc(i64 noundef 1, i64 noundef %conv29) #6 %6 = load ptr, ptr %arrayidx23, align 8, !tbaa !5 %arrayidx42 = getelementptr inbounds ptr, ptr %6, i64 %indvars.iv95 store ptr %call38, ptr %arrayidx42, align 8, !tbaa !5 %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1 %exitcond.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count101 br i1 %exitcond.not, label %for.cond24.for.inc46_crit_edge, label %for.body27, !llvm.loop !19 for.cond24.for.inc46_crit_edge: ; preds = %for.body27 %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %exitcond102.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count101 br i1 %exitcond102.not, label %for.cond49.preheader, label %for.body13, !llvm.loop !20 for.body52: ; preds = %for.cond49.preheader, %for.body52 %7 = phi i32 [ %9, %for.body52 ], [ %1, %for.cond49.preheader ] %res.091 = phi i64 [ %add55, %for.body52 ], [ 0, %for.cond49.preheader ] %i.290 = phi i32 [ %inc57, %for.body52 ], [ 1, %for.cond49.preheader ] %8 = load i32, ptr %a, align 4, !tbaa !15 %mul53 = mul nsw i32 %8, %i.290 %call54 = call i64 @solve(i32 noundef %7, i32 noundef %i.290, i32 noundef %mul53, ptr noundef %call7, ptr noundef %call1, ptr noundef %call4) %add55 = add nsw i64 %call54, %res.091 %inc57 = add nuw nsw i32 %i.290, 1 %9 = load i32, ptr %n, align 4, !tbaa !15 %cmp50.not.not = icmp slt i32 %i.290, %9 br i1 %cmp50.not.not, label %for.body52, label %for.end58, !llvm.loop !21 for.end58: ; preds = %for.body52, %for.cond10.preheader, %for.cond49.preheader %res.0.lcssa = phi i64 [ 0, %for.cond49.preheader ], [ 0, %for.cond10.preheader ], [ %add55, %for.body52 ] %call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %res.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @calloc(i64 noundef, i64 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 = { 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 #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 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 #5 = { nounwind } attributes #6 = { nounwind allocsize(0,1) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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 = !{!"_Bool", !7, i64 0} !11 = !{i8 0, i8 2} !12 = !{} !13 = !{!14, !14, i64 0} !14 = !{!"long long", !7, i64 0} !15 = !{!16, !16, i64 0} !16 = !{!"int", !7, i64 0} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.mustprogress"} !19 = distinct !{!19, !18} !20 = distinct !{!20, !18} !21 = distinct !{!21, !18}
#include <stdio.h> #define MAX_M 100 #define MAX_N 1000000 #define min(a,b) (a < b ? a : b) void insertionSort(int*,int,int,int*); void shellSort(int*,int); void print(int*,int*,int,int,int); int main(){ int n,A[MAX_N],i; scanf("%d",&n); for(i = 0 ; i < n ; i++){ scanf("%d",&A[i]); } shellSort(A,n); return 0; } void insertionSort(int *A,int n,int g,int *cnt){ int i,j,v; for(i = g ; i < n ; i++){ v = A[i]; j = i - g; while(j >= 0 && A[j] > v){ A[j+g] = A[j]; j = j - g; (*cnt)++; } A[j+g] = v; } } void shellSort(int *A,int n){ int G[MAX_M],i,m = 1,cnt = 0; while(m*4+1 < n){ m = m*4+1; } for(i = 0 ; m > 0 ; m /= 4,i++){ G[i] = m; } m = min(i,MAX_M); for(i = 0 ; i < m ; i++){ insertionSort(A,n,G[i],&cnt); } print(A,G,n,m,cnt); } void print(int *A,int *G,int n,int m,int cnt){ int i; printf("%d\n",m); for(i = 0 ; i < m ; i++){ printf("%d%c",G[i],(i < m-1 ? ' ' : '\n')); } printf("%d\n",cnt); for(i = 0 ; i < n ; i++){ printf("%d\n",A[i]); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119048/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119048/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%d%c\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %A = alloca [1000000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %A) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %0, 0 br i1 %cmp4, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] call void @shellSort(ptr noundef nonnull %A, i32 noundef %.lcssa) call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %A) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @shellSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 { entry: %G = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %G) #5 br label %while.cond while.cond: ; preds = %while.cond, %entry %m.0 = phi i32 [ 1, %entry ], [ %add, %while.cond ] %mul = shl nsw i32 %m.0, 2 %add = or i32 %mul, 1 %cmp = icmp slt i32 %add, %n br i1 %cmp, label %while.cond, label %for.cond.preheader, !llvm.loop !11 for.cond.preheader: ; preds = %while.cond %cmp337 = icmp sgt i32 %m.0, 0 br i1 %cmp337, label %for.body, label %for.end12.thread for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %m.139 = phi i32 [ %div28, %for.body ], [ %m.0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv store i32 %m.139, ptr %arrayidx, align 4, !tbaa !5 %div28 = lshr i32 %m.139, 2 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp3.not = icmp ult i32 %m.139, 4 br i1 %cmp3.not, label %for.end, label %for.body, !llvm.loop !12 for.end: ; preds = %for.body %0 = trunc i64 %indvars.iv.next to i32 %cond = tail call i32 @llvm.umin.i32(i32 %0, i32 100) %cmp640.not = icmp eq i32 %0, 0 br i1 %cmp640.not, label %for.end12.thread, label %for.body7.lr.ph for.body7.lr.ph: ; preds = %for.end %wide.trip.count.i = sext i32 %n to i64 %wide.trip.count = and i64 %indvars.iv.next, 4294967295 br label %for.body7 for.body7: ; preds = %for.body7.lr.ph, %insertionSort.exit %indvars.iv45 = phi i64 [ 0, %for.body7.lr.ph ], [ %indvars.iv.next46, %insertionSort.exit ] %cnt.041 = phi i32 [ 0, %for.body7.lr.ph ], [ %cnt.4, %insertionSort.exit ] %arrayidx9 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv45 %1 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp36.i = icmp slt i32 %1, %n br i1 %cmp36.i, label %for.body.preheader.i, label %insertionSort.exit for.body.preheader.i: ; preds = %for.body7 %2 = sext i32 %1 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i %cnt.1 = phi i32 [ %cnt.041, %for.body.preheader.i ], [ %cnt.3, %while.end.i ] %indvars.iv.i = phi i64 [ %2, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ] %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %4 = trunc i64 %indvars.iv.i to i32 %5 = sub i32 %4, %1 br label %land.rhs.i land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i %cnt.2 = phi i32 [ %cnt.1, %land.rhs.preheader.i ], [ %inc.i, %while.body.i ] %j.034.i = phi i32 [ %5, %land.rhs.preheader.i ], [ %j.0.i, %while.body.i ] %i.0.pn33.i = phi i32 [ %4, %land.rhs.preheader.i ], [ %j.034.i, %while.body.i ] %idxprom2.i = zext i32 %j.034.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i %6 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp sgt i32 %6, %3 br i1 %cmp4.i, label %while.body.i, label %while.end.i while.body.i: ; preds = %land.rhs.i %idxprom7.i = sext i32 %i.0.pn33.i to i64 %arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i store i32 %6, ptr %arrayidx8.i, align 4, !tbaa !5 %inc.i = add nsw i32 %cnt.2, 1 %j.0.i = sub nsw i32 %j.034.i, %1 %cmp1.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !13 while.end.i: ; preds = %while.body.i, %land.rhs.i %cnt.3 = phi i32 [ %inc.i, %while.body.i ], [ %cnt.2, %land.rhs.i ] %i.0.pn.lcssa.ph.i = phi i32 [ %j.034.i, %while.body.i ], [ %i.0.pn33.i, %land.rhs.i ] %idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64 %arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i store i32 %3, ptr %arrayidx12.i, align 4, !tbaa !5 %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !14 insertionSort.exit: ; preds = %while.end.i, %for.body7 %cnt.4 = phi i32 [ %cnt.041, %for.body7 ], [ %cnt.3, %while.end.i ] %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1 %exitcond.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count br i1 %exitcond.not, label %for.end12, label %for.body7, !llvm.loop !15 for.end12.thread: ; preds = %for.end, %for.cond.preheader %cond51.ph = phi i32 [ %cond, %for.end ], [ 0, %for.cond.preheader ] %call.i56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond51.ph) br label %for.end.i for.end12: ; preds = %insertionSort.exit %call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cond) br i1 %cmp640.not, label %for.end.i, label %for.body.lr.ph.i for.body.lr.ph.i: ; preds = %for.end12 %sub.i = add nsw i32 %cond, -1 %7 = zext i32 %sub.i to i64 %wide.trip.count.i30 = zext i32 %cond to i64 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.lr.ph.i %indvars.iv.i31 = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i34, %for.body.i ] %arrayidx.i32 = getelementptr inbounds i32, ptr %G, i64 %indvars.iv.i31 %8 = load i32, ptr %arrayidx.i32, align 4, !tbaa !5 %cmp1.i33 = icmp ult i64 %indvars.iv.i31, %7 %cond.i = select i1 %cmp1.i33, i32 32, i32 10 %call2.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8, i32 noundef %cond.i) %indvars.iv.next.i34 = add nuw nsw i64 %indvars.iv.i31, 1 %exitcond.not.i35 = icmp eq i64 %indvars.iv.next.i34, %wide.trip.count.i30 br i1 %exitcond.not.i35, label %for.end.i, label %for.body.i, !llvm.loop !16 for.end.i: ; preds = %for.body.i, %for.end12.thread, %for.end12 %cnt.0.lcssa57 = phi i32 [ 0, %for.end12.thread ], [ %cnt.4, %for.end12 ], [ %cnt.4, %for.body.i ] %call3.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt.0.lcssa57) %cmp523.i = icmp sgt i32 %n, 0 br i1 %cmp523.i, label %for.body6.preheader.i, label %print.exit for.body6.preheader.i: ; preds = %for.end.i %wide.trip.count29.i = zext i32 %n to i64 br label %for.body6.i for.body6.i: ; preds = %for.body6.i, %for.body6.preheader.i %indvars.iv26.i = phi i64 [ 0, %for.body6.preheader.i ], [ %indvars.iv.next27.i, %for.body6.i ] %arrayidx8.i29 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv26.i %9 = load i32, ptr %arrayidx8.i29, align 4, !tbaa !5 %call9.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9) %indvars.iv.next27.i = add nuw nsw i64 %indvars.iv26.i, 1 %exitcond30.not.i = icmp eq i64 %indvars.iv.next27.i, %wide.trip.count29.i br i1 %exitcond30.not.i, label %print.exit, label %for.body6.i, !llvm.loop !17 print.exit: ; preds = %for.body6.i, %for.end.i call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %G) #5 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(argmem: readwrite) uwtable define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g, ptr nocapture noundef %cnt) local_unnamed_addr #3 { entry: %cmp36 = icmp slt i32 %g, %n br i1 %cmp36, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %n to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %while.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %g br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ] %i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ] %idxprom2 = zext i32 %j.034 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2 %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %5, %1 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn33 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 %6 = load i32, ptr %cnt, align 4, !tbaa !5 %inc = add nsw i32 %6, 1 store i32 %inc, ptr %cnt, align 4, !tbaa !5 %j.0 = sub nsw i32 %j.034, %g %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !13 while.end: ; preds = %land.rhs, %while.body %i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ] %idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64 %arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11 store i32 %1, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !14 for.end: ; preds = %while.end, %entry ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(ptr nocapture noundef readonly %A, ptr nocapture noundef readonly %G, i32 noundef %n, i32 noundef %m, i32 noundef %cnt) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m) %cmp21 = icmp sgt i32 %m, 0 br i1 %cmp21, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %sub = add nsw i32 %m, -1 %0 = zext i32 %sub to i64 %wide.trip.count = zext i32 %m to i64 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.body %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds i32, ptr %G, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp1 = icmp ult i64 %indvars.iv, %0 %cond = select i1 %cmp1, i32 32, i32 10 %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1, i32 noundef %cond) %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 !16 for.end: ; preds = %for.body, %entry %call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %cnt) %cmp523 = icmp sgt i32 %n, 0 br i1 %cmp523, label %for.body6.preheader, label %for.end12 for.body6.preheader: ; preds = %for.end %wide.trip.count29 = zext i32 %n to i64 br label %for.body6 for.body6: ; preds = %for.body6.preheader, %for.body6 %indvars.iv26 = phi i64 [ 0, %for.body6.preheader ], [ %indvars.iv.next27, %for.body6 ] %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv26 %2 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %call9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2) %indvars.iv.next27 = add nuw nsw i64 %indvars.iv26, 1 %exitcond30.not = icmp eq i64 %indvars.iv.next27, %wide.trip.count29 br i1 %exitcond30.not, label %for.end12, label %for.body6, !llvm.loop !17 for.end12: ; preds = %for.body6, %for.end ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umin.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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} !17 = distinct !{!17, !10}
#include <stdio.h> #include <stdlib.h> int InsertionSort(int *, int ,int); int CreateG(int, int, int *); int main() { int i, j; int n; int *A; int m; int G[100]; int count = 0; // input scanf("%d", &n); A = (int *)malloc(n * sizeof(int)); for(i = 0; i < n; i++) { scanf("%d", &A[i]); } // shell sort m = CreateG(n, 0, G); for(i = 0; i < m; i++) { count += InsertionSort(A, n, G[i]); } // output printf("%d\n", m); for(i = 0; i < m - 1; i++) { printf("%d ", G[i]); } printf("%d\n%d\n", G[i], count); for(i = 0; i < n; i++) { printf("%d\n", A[i]); } return 0; } // ??????????????? g ????????¢??????????´??????????????±???¨???????????\????????? int InsertionSort(int A[], int n, int g) { int i, j; int tmp; int count = 0; for(i = g; i < n; i++) { j = i - g; tmp = A[i]; while(j >= 0 && A[j] > tmp) { A[j + g] = A[j]; j = j - g; A[j + g] = tmp; count++; } } return count; } // G[] ????????????????????¢??° // G[0] <= n ?????? G[i] - G[i + 1] = 3 ^ (m - n) // ex: 121, 40, 13, 4, 1 (n = 130) // n: G ????????? d: ????????? // G[]:??????????????¨??????????????? // retval: G[] ???????´???° m int CreateG(int n, int d, int G[]) { int i; static int m = 0; static int factorial = 1; d += factorial; factorial *= 3; if(d > n) return 0; CreateG(n, d, G); G[m] = d; m++; return m; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119105/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119105/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.3 = private unnamed_addr constant [7 x i8] c"%d\0A%d\0A\00", align 1 @CreateG.m = internal unnamed_addr global i32 0, align 4 @CreateG.factorial = internal unnamed_addr global i32 1, align 4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %G = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %G) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #7 %cmp56 = icmp sgt i32 %0, 0 br i1 %cmp56, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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 %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] %call4 = call i32 @CreateG(i32 noundef %.lcssa, i32 noundef 0, ptr noundef nonnull %G) %cmp658 = icmp sgt i32 %call4, 0 br i1 %cmp658, label %for.body8.lr.ph, label %for.end14.thread for.end14.thread: ; preds = %for.end %call1581 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call4) br label %for.end25 for.body8.lr.ph: ; preds = %for.end %3 = load i32, ptr %n, align 4, !tbaa !5 %wide.trip.count.i = sext i32 %3 to i64 %wide.trip.count = zext i32 %call4 to i64 br label %for.body8 for.body8: ; preds = %for.body8.lr.ph, %InsertionSort.exit %indvars.iv69 = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next70, %InsertionSort.exit ] %count.060 = phi i32 [ 0, %for.body8.lr.ph ], [ %add, %InsertionSort.exit ] %arrayidx10 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv69 %4 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp39.i = icmp slt i32 %4, %3 br i1 %cmp39.i, label %for.body.preheader.i, label %InsertionSort.exit for.body.preheader.i: ; preds = %for.body8 %5 = sext i32 %4 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %for.inc.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %5, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ] %count.041.i = phi i32 [ 0, %for.body.preheader.i ], [ %count.1.lcssa.ph.i, %for.inc.i ] %arrayidx.i = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i %6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %7 = trunc i64 %indvars.iv.i to i32 %8 = sub i32 %7, %4 br label %land.rhs.i land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i %j.037.i = phi i32 [ %j.0.i, %while.body.i ], [ %8, %land.rhs.preheader.i ] %count.136.i = phi i32 [ %inc.i, %while.body.i ], [ %count.041.i, %land.rhs.preheader.i ] %i.0.pn35.i = phi i32 [ %j.037.i, %while.body.i ], [ %7, %land.rhs.preheader.i ] %idxprom2.i = zext i32 %j.037.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom2.i %9 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp sgt i32 %9, %6 br i1 %cmp4.i, label %while.body.i, label %for.inc.i while.body.i: ; preds = %land.rhs.i %idxprom7.i = sext i32 %i.0.pn35.i to i64 %arrayidx8.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom7.i store i32 %9, ptr %arrayidx8.i, align 4, !tbaa !5 store i32 %6, ptr %arrayidx3.i, align 4, !tbaa !5 %inc.i = add nsw i32 %count.136.i, 1 %j.0.i = sub nsw i32 %j.037.i, %4 %cmp1.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp1.i, label %land.rhs.i, label %for.inc.i, !llvm.loop !11 for.inc.i: ; preds = %while.body.i, %land.rhs.i %count.1.lcssa.ph.i = phi i32 [ %inc.i, %while.body.i ], [ %count.136.i, %land.rhs.i ] %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %InsertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !12 InsertionSort.exit: ; preds = %for.inc.i, %for.body8 %count.0.lcssa.i = phi i32 [ 0, %for.body8 ], [ %count.1.lcssa.ph.i, %for.inc.i ] %add = add nsw i32 %count.0.lcssa.i, %count.060 %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1 %exitcond.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count br i1 %exitcond.not, label %for.end14, label %for.body8, !llvm.loop !13 for.end14: ; preds = %InsertionSort.exit %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call4) %sub = add i32 %call4, -1 %cmp1762 = icmp sgt i32 %call4, 1 br i1 %cmp1762, label %for.body19.preheader, label %for.end25 for.body19.preheader: ; preds = %for.end14 %wide.trip.count75 = zext i32 %sub to i64 br label %for.body19 for.body19: ; preds = %for.body19.preheader, %for.body19 %indvars.iv72 = phi i64 [ 0, %for.body19.preheader ], [ %indvars.iv.next73, %for.body19 ] %arrayidx21 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %indvars.iv72 %10 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1 %exitcond76.not = icmp eq i64 %indvars.iv.next73, %wide.trip.count75 br i1 %exitcond76.not, label %for.end25.loopexit, label %for.body19, !llvm.loop !14 for.end25.loopexit: ; preds = %for.body19 %11 = zext i32 %sub to i64 br label %for.end25 for.end25: ; preds = %for.end14, %for.end14.thread, %for.end25.loopexit %count.0.lcssa84 = phi i32 [ %add, %for.end25.loopexit ], [ 0, %for.end14.thread ], [ %add, %for.end14 ] %i.2.lcssa = phi i64 [ %11, %for.end25.loopexit ], [ 0, %for.end14.thread ], [ 0, %for.end14 ] %arrayidx27 = getelementptr inbounds [100 x i32], ptr %G, i64 0, i64 %i.2.lcssa %12 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %12, i32 noundef %count.0.lcssa84) %13 = load i32, ptr %n, align 4, !tbaa !5 %cmp3065 = icmp sgt i32 %13, 0 br i1 %cmp3065, label %for.body32, label %for.end38 for.body32: ; preds = %for.end25, %for.body32 %indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body32 ], [ 0, %for.end25 ] %arrayidx34 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv77 %14 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14) %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1 %15 = load i32, ptr %n, align 4, !tbaa !5 %16 = sext i32 %15 to i64 %cmp30 = icmp slt i64 %indvars.iv.next78, %16 br i1 %cmp30, label %for.body32, label %for.end38, !llvm.loop !15 for.end38: ; preds = %for.body32, %for.end25 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %G) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: write, inaccessiblemem: none) uwtable define dso_local i32 @CreateG(i32 noundef %n, i32 noundef %d, ptr nocapture noundef writeonly %G) local_unnamed_addr #4 { entry: %0 = load i32, ptr @CreateG.factorial, align 4, !tbaa !5 %add = add nsw i32 %0, %d %mul = mul nsw i32 %0, 3 store i32 %mul, ptr @CreateG.factorial, align 4, !tbaa !5 %cmp = icmp sgt i32 %add, %n br i1 %cmp, label %common.ret6, label %if.end common.ret6: ; preds = %entry, %if.end %common.ret6.op = phi i32 [ %inc, %if.end ], [ 0, %entry ] ret i32 %common.ret6.op if.end: ; preds = %entry %call = tail call i32 @CreateG(i32 noundef %n, i32 noundef %add, ptr noundef %G) %1 = load i32, ptr @CreateG.m, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds i32, ptr %G, i64 %idxprom store i32 %add, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %1, 1 store i32 %inc, ptr @CreateG.m, align 4, !tbaa !5 br label %common.ret6 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @InsertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #5 { entry: %cmp39 = icmp slt i32 %g, %n br i1 %cmp39, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %n to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %for.inc, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %count.041 = phi i32 [ 0, %for.body.preheader ], [ %count.1.lcssa.ph, %for.inc ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = sub i32 %2, %g %4 = trunc i64 %indvars.iv to i32 br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %j.037 = phi i32 [ %j.0, %while.body ], [ %3, %land.rhs.preheader ] %count.136 = phi i32 [ %inc, %while.body ], [ %count.041, %land.rhs.preheader ] %i.0.pn35 = phi i32 [ %j.037, %while.body ], [ %4, %land.rhs.preheader ] %idxprom2 = zext i32 %j.037 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2 %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %5, %1 br i1 %cmp4, label %while.body, label %for.inc while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn35 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 store i32 %1, ptr %arrayidx3, align 4, !tbaa !5 %inc = add nsw i32 %count.136, 1 %j.0 = sub nsw i32 %j.037, %g %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %for.inc, !llvm.loop !11 for.inc: ; preds = %while.body, %land.rhs %count.1.lcssa.ph = phi i32 [ %inc, %while.body ], [ %count.136, %land.rhs ] %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !12 for.end: ; preds = %for.inc, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1.lcssa.ph, %for.inc ] ret i32 %count.0.lcssa } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nosync nounwind memory(readwrite, argmem: write, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } attributes #7 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include<stdio.h> #include<stdlib.h> #include<math.h> void Insertion(int*, int, int); void Shell(int*, int); int cnt=0, m, *G; int main(){ int i, n, *A; scanf("%d",&n); A = (int *)malloc(sizeof(int) * n); for(i=0; i<n; i++) scanf("%d",&A[i]); Shell(A, n); printf("%d\n",m); for(i=0; i<m; i++){ printf("%d",G[i]); printf(i != m-1 ? " " : "\n"); } printf("%d\n",cnt); for(i=0; i<n; i++){ printf("%d",A[i]); printf("\n"); } free(A); free(G); return 0; } void Insertion(int* A, int n, int g){ int i, j, v; for(i=g; i<n; i++){ v = A[i]; j = i - g; while(j >= 0 && A[j] > v){ A[j+g] = A[j]; j = j - g; cnt++; } A[j+g] = v; } } void Shell(int* A, int n){ int i; cnt = 0; for(i=0; i<n; i++) if(n < (pow(3,i+1)-1) / 2) break; m = i; G = (int *)malloc(sizeof(int) * m); for(i=0; i<m; i++) G[i] = (pow(3,m-i)-1) / 2; for(i=0; i<m; i++) Insertion(A, n, G[i]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119156/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119156/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @cnt = dso_local local_unnamed_addr global i32 0, align 4 @.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 @m = dso_local local_unnamed_addr global i32 0, align 4 @G = dso_local local_unnamed_addr global ptr null, align 8 @.str.2 = private unnamed_addr constant [2 x i8] c" \00", align 1 @.str.3 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #10 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #11 %cmp42 = icmp sgt i32 %0, 0 br i1 %cmp42, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %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 %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] call void @Shell(ptr noundef %call1, i32 noundef %.lcssa) %3 = load i32, ptr @m, align 4, !tbaa !5 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) %4 = load i32, ptr @m, align 4, !tbaa !5 %cmp644 = icmp sgt i32 %4, 0 br i1 %cmp644, label %for.body8, label %for.end17 for.body8: ; preds = %for.end, %for.body8 %indvars.iv50 = phi i64 [ %indvars.iv.next51, %for.body8 ], [ 0, %for.end ] %5 = load ptr, ptr @G, align 8, !tbaa !11 %arrayidx10 = getelementptr inbounds i32, ptr %5, i64 %indvars.iv50 %6 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6) %7 = load i32, ptr @m, align 4, !tbaa !5 %sub = add nsw i32 %7, -1 %8 = zext i32 %sub to i64 %cmp12.not = icmp eq i64 %indvars.iv50, %8 %cond = select i1 %cmp12.not, ptr @.str.3, ptr @.str.2 %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond) %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1 %9 = load i32, ptr @m, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp6 = icmp slt i64 %indvars.iv.next51, %10 br i1 %cmp6, label %for.body8, label %for.end17, !llvm.loop !13 for.end17: ; preds = %for.body8, %for.end %11 = load i32, ptr @cnt, align 4, !tbaa !5 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11) %12 = load i32, ptr %n, align 4, !tbaa !5 %cmp2046 = icmp sgt i32 %12, 0 br i1 %cmp2046, label %for.body22, label %for.end29 for.body22: ; preds = %for.end17, %for.body22 %indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body22 ], [ 0, %for.end17 ] %arrayidx24 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv53 %13 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %13) %putchar = call i32 @putchar(i32 10) %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1 %14 = load i32, ptr %n, align 4, !tbaa !5 %15 = sext i32 %14 to i64 %cmp20 = icmp slt i64 %indvars.iv.next54, %15 br i1 %cmp20, label %for.body22, label %for.end29, !llvm.loop !14 for.end29: ; preds = %for.body22, %for.end17 call void @free(ptr noundef %call1) #10 %16 = load ptr, ptr @G, align 8, !tbaa !11 call void @free(ptr noundef %16) #10 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind uwtable define dso_local void @Shell(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #4 { entry: store i32 0, ptr @cnt, align 4, !tbaa !5 %conv = sitofp i32 %n to double %smax = tail call i32 @llvm.smax.i32(i32 %n, i32 0) br label %for.cond for.cond: ; preds = %for.body, %entry %i.0 = phi i32 [ 0, %entry ], [ %add, %for.body ] %exitcond.not = icmp eq i32 %i.0, %smax br i1 %exitcond.not, label %for.end, label %for.body for.body: ; preds = %for.cond %add = add nuw i32 %i.0, 1 %conv1 = sitofp i32 %add to double %call = tail call double @pow(double noundef 3.000000e+00, double noundef %conv1) #10 %sub = fadd double %call, -1.000000e+00 %div = fmul double %sub, 5.000000e-01 %cmp2 = fcmp ogt double %div, %conv br i1 %cmp2, label %for.end, label %for.cond, !llvm.loop !15 for.end: ; preds = %for.body, %for.cond %i.0.lcssa = phi i32 [ %i.0, %for.body ], [ %smax, %for.cond ] store i32 %i.0.lcssa, ptr @m, align 4, !tbaa !5 %conv4 = zext i32 %i.0.lcssa to i64 %mul = shl nuw nsw i64 %conv4, 2 %call5 = tail call noalias ptr @malloc(i64 noundef %mul) #11 store ptr %call5, ptr @G, align 8, !tbaa !11 %cmp740.not = icmp eq i32 %i.0.lcssa, 0 br i1 %cmp740.not, label %for.end27, label %for.body9 for.cond19.preheader: ; preds = %for.body9 %cmp2042 = icmp sgt i32 %3, 0 br i1 %cmp2042, label %for.body22.lr.ph, label %for.end27 for.body22.lr.ph: ; preds = %for.cond19.preheader %wide.trip.count.i = sext i32 %n to i64 br label %for.body22 for.body9: ; preds = %for.end, %for.body9 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body9 ], [ 0, %for.end ] %0 = phi i32 [ %3, %for.body9 ], [ %i.0.lcssa, %for.end ] %1 = trunc i64 %indvars.iv to i32 %sub10 = sub nsw i32 %0, %1 %conv11 = sitofp i32 %sub10 to double %call12 = tail call double @pow(double noundef 3.000000e+00, double noundef %conv11) #10 %sub13 = fadd double %call12, -1.000000e+00 %div14 = fmul double %sub13, 5.000000e-01 %conv15 = fptosi double %div14 to i32 %2 = load ptr, ptr @G, align 8, !tbaa !11 %arrayidx = getelementptr inbounds i32, ptr %2, i64 %indvars.iv store i32 %conv15, ptr %arrayidx, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @m, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp7 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp7, label %for.body9, label %for.cond19.preheader, !llvm.loop !16 for.body22: ; preds = %for.body22.lr.ph, %Insertion.exit %5 = phi i32 [ %3, %for.body22.lr.ph ], [ %13, %Insertion.exit ] %indvars.iv45 = phi i64 [ 0, %for.body22.lr.ph ], [ %indvars.iv.next46, %Insertion.exit ] %arrayidx24 = getelementptr inbounds i32, ptr %2, i64 %indvars.iv45 %6 = load i32, ptr %arrayidx24, align 4, !tbaa !5 %cmp36.i = icmp slt i32 %6, %n br i1 %cmp36.i, label %for.body.preheader.i, label %Insertion.exit for.body.preheader.i: ; preds = %for.body22 %7 = sext i32 %6 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %7, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ] %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %8 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %9 = trunc i64 %indvars.iv.i to i32 %10 = sub i32 %9, %6 br label %land.rhs.i land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i %j.034.i = phi i32 [ %j.0.i, %while.body.i ], [ %10, %land.rhs.preheader.i ] %i.0.pn33.i = phi i32 [ %j.034.i, %while.body.i ], [ %9, %land.rhs.preheader.i ] %idxprom2.i = zext i32 %j.034.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i %11 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp sgt i32 %11, %8 br i1 %cmp4.i, label %while.body.i, label %while.end.i while.body.i: ; preds = %land.rhs.i %idxprom7.i = sext i32 %i.0.pn33.i to i64 %arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i store i32 %11, ptr %arrayidx8.i, align 4, !tbaa !5 %12 = load i32, ptr @cnt, align 4, !tbaa !5 %inc.i = add nsw i32 %12, 1 store i32 %inc.i, ptr @cnt, align 4, !tbaa !5 %j.0.i = sub nsw i32 %j.034.i, %6 %cmp1.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !17 while.end.i: ; preds = %while.body.i, %land.rhs.i %i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn33.i, %land.rhs.i ], [ %j.034.i, %while.body.i ] %idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64 %arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i store i32 %8, ptr %arrayidx12.i, align 4, !tbaa !5 %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %Insertion.exit.loopexit, label %land.rhs.preheader.i, !llvm.loop !18 Insertion.exit.loopexit: ; preds = %while.end.i %.pre = load i32, ptr @m, align 4, !tbaa !5 br label %Insertion.exit Insertion.exit: ; preds = %Insertion.exit.loopexit, %for.body22 %13 = phi i32 [ %.pre, %Insertion.exit.loopexit ], [ %5, %for.body22 ] %indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1 %14 = sext i32 %13 to i64 %cmp20 = icmp slt i64 %indvars.iv.next46, %14 br i1 %cmp20, label %for.body22, label %for.end27, !llvm.loop !19 for.end27: ; preds = %Insertion.exit, %for.end, %for.cond19.preheader ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @Insertion(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #6 { entry: %cmp36 = icmp slt i32 %g, %n br i1 %cmp36, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %n to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %while.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %g br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ] %i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ] %idxprom2 = zext i32 %j.034 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2 %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %5, %1 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn33 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 %6 = load i32, ptr @cnt, align 4, !tbaa !5 %inc = add nsw i32 %6, 1 store i32 %inc, ptr @cnt, align 4, !tbaa !5 %j.0 = sub nsw i32 %j.034, %g %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !17 while.end: ; preds = %land.rhs, %while.body %i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ] %idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64 %arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11 store i32 %1, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !18 for.end: ; preds = %while.end, %entry ret void } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #9 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { 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 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 #8 = { nofree nounwind } attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind } attributes #11 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"any pointer", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include<stdio.h> #include<math.h> #include<string.h> #include<stdlib.h> int main() { int a,b,c,d,e,f,g; scanf("%d",&a); while(~scanf("%d",&b)) { d=0; e=0; int op[b],ob[b]; for(c=0; c<b; c++) scanf("%d",&op[c]); for(c=0; c<b; c++) scanf("%d",&ob[c]); if(op[0]==1) d=1; if(op[0]==-1) e=1; if(op[0]!=ob[0]) printf("NO\n"); else { for(c=1; c<b; c++) { if(op[c]==ob[c]) { if(op[c]==1) d=1; if(op[c]==-1) e=1; continue; } else if(ob[c]>op[c]&&d==1) { if(op[c]==1) d=1; if(op[c]==-1) e=1; continue; } else if(ob[c]<op[c]&&e==1) { if(op[c]==1) d=1; if(op[c]==-1) e=1; continue; } else break; } if(c==b) printf("YES\n"); else printf("NO\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1192/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1192/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.3 = 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: %a = alloca i32, align 4 %b = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1129 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %tobool.not130 = icmp eq i32 %call1129, -1 br i1 %tobool.not130, label %while.end, label %while.body while.body: ; preds = %entry, %if.end90 %0 = load i32, ptr %b, 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 %b, align 4, !tbaa !5 %4 = zext i32 %3 to i64 %vla2 = alloca i32, i64 %4, align 16 %cmp119 = icmp sgt i32 %3, 0 br i1 %cmp119, label %for.body, label %for.end12 for.cond4.preheader: ; preds = %for.body %cmp5121 = icmp sgt i32 %5, 0 br i1 %cmp5121, label %for.body6, label %for.end12 for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call3 = 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 %b, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !9 for.body6: ; preds = %for.cond4.preheader, %for.body6 %indvars.iv133 = phi i64 [ %indvars.iv.next134, %for.body6 ], [ 0, %for.cond4.preheader ] %arrayidx8 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv133 %call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx8) %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %7 = load i32, ptr %b, align 4, !tbaa !5 %8 = sext i32 %7 to i64 %cmp5 = icmp slt i64 %indvars.iv.next134, %8 br i1 %cmp5, label %for.body6, label %for.end12, !llvm.loop !11 for.end12: ; preds = %for.body6, %while.body, %for.cond4.preheader %.lcssa = phi i32 [ %5, %for.cond4.preheader ], [ %3, %while.body ], [ %7, %for.body6 ] %9 = load i32, ptr %vla, align 16, !tbaa !5 %10 = load i32, ptr %vla2, align 16, !tbaa !5 %cmp21.not = icmp eq i32 %9, %10 br i1 %cmp21.not, label %for.cond24.preheader, label %if.end90 for.cond24.preheader: ; preds = %for.end12 %cmp25123 = icmp sgt i32 %.lcssa, 1 br i1 %cmp25123, label %for.body26.preheader, label %for.end83 for.body26.preheader: ; preds = %for.cond24.preheader %cmp14 = icmp eq i32 %9, 1 %spec.select = zext i1 %cmp14 to i32 %cmp16 = icmp eq i32 %9, -1 %e.0 = zext i1 %cmp16 to i32 %wide.trip.count = zext i32 %.lcssa to i64 br label %for.body26 for.body26: ; preds = %for.body26.preheader, %for.inc81 %indvars.iv136 = phi i64 [ 1, %for.body26.preheader ], [ %indvars.iv.next137, %for.inc81 ] %d.1125 = phi i32 [ %spec.select, %for.body26.preheader ], [ %d.5, %for.inc81 ] %e.1124 = phi i32 [ %e.0, %for.body26.preheader ], [ %e.2, %for.inc81 ] %arrayidx28 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv136 %11 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %arrayidx30 = getelementptr inbounds i32, ptr %vla2, i64 %indvars.iv136 %12 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %cmp31 = icmp eq i32 %11, %12 br i1 %cmp31, label %if.then32, label %if.else43 if.then32: ; preds = %for.body26 %cmp35 = icmp eq i32 %11, 1 %spec.select115 = select i1 %cmp35, i32 1, i32 %d.1125 %cmp40 = icmp eq i32 %11, -1 %spec.select117 = select i1 %cmp40, i32 1, i32 %e.1124 br label %for.inc81 if.else43: ; preds = %for.body26 %cmp48 = icmp sgt i32 %12, %11 %cmp49 = icmp eq i32 %d.1125, 1 %or.cond = select i1 %cmp48, i1 %cmp49, i1 false br i1 %or.cond, label %if.then50, label %if.else61 if.then50: ; preds = %if.else43 %cmp58 = icmp eq i32 %11, -1 %spec.select118 = select i1 %cmp58, i32 1, i32 %e.1124 br label %for.inc81 if.else61: ; preds = %if.else43 %cmp66 = icmp slt i32 %12, %11 %cmp68 = icmp eq i32 %e.1124, 1 %or.cond91 = select i1 %cmp66, i1 %cmp68, i1 false br i1 %or.cond91, label %if.then69, label %for.end83.loopexit if.then69: ; preds = %if.else61 %cmp72 = icmp eq i32 %11, 1 %spec.select116 = select i1 %cmp72, i32 1, i32 %d.1125 br label %for.inc81 for.inc81: ; preds = %if.then50, %if.then32, %if.then69 %e.2 = phi i32 [ 1, %if.then69 ], [ %spec.select117, %if.then32 ], [ %spec.select118, %if.then50 ] %d.5 = phi i32 [ %spec.select116, %if.then69 ], [ %spec.select115, %if.then32 ], [ 1, %if.then50 ] %indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1 %exitcond.not = icmp eq i64 %indvars.iv.next137, %wide.trip.count br i1 %exitcond.not, label %if.end90, label %for.body26, !llvm.loop !12 for.end83.loopexit: ; preds = %if.else61 %13 = trunc i64 %indvars.iv136 to i32 br label %for.end83 for.end83: ; preds = %for.end83.loopexit, %for.cond24.preheader %c.2.lcssa = phi i32 [ 1, %for.cond24.preheader ], [ %13, %for.end83.loopexit ] %cmp84 = icmp eq i32 %c.2.lcssa, %.lcssa %spec.select145 = select i1 %cmp84, ptr @str.3, ptr @str.4 br label %if.end90 if.end90: ; preds = %for.inc81, %for.end83, %for.end12 %str.3.sink = phi ptr [ @str.4, %for.end12 ], [ %spec.select145, %for.end83 ], [ @str.3, %for.inc81 ] %puts113 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink) call void @llvm.stackrestore.p0(ptr %2) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %tobool.not = icmp eq i32 %call1, -1 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %if.end90, %entry 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 declare ptr @llvm.stacksave.p0() #3 ; 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 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include<stdio.h> int main() { int t; scanf("%d",&t); while(t--) { int n; scanf("%d",&n); if(n%10==9) printf("%d\n",((n/10)+1)); else printf("%d\n",n/10); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11925/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11925/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec5 = add nsw i32 %0, -1 store i32 %dec5, ptr %t, align 4, !tbaa !5 %tobool.not6 = icmp eq i32 %0, 0 br i1 %tobool.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %1, 10 %cmp = icmp eq i32 %rem, 9 %div = sdiv i32 %1, 10 %add = zext i1 %cmp to i32 %div.sink = add nsw i32 %div, %add %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 %2 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %2, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %2, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry call void @llvm.lifetime.end.p0(i64 4, 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 = !{!"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() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); //freopen("error.txt","w",stderr); #endif long int t,n; scanf ("%ld\n",&t); for (int i=1;i<=t;i++) { scanf ("%ld\n",&n); if (n%10==9) { printf("%ld\n",((n/10)+1)); } else { printf("%ld\n",((n/10))); } } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11930/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11930/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"input.txt\00", align 1 @.str.1 = private unnamed_addr constant [2 x i8] c"r\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 @.str.2 = private unnamed_addr constant [11 x i8] c"output.txt\00", align 1 @.str.3 = private unnamed_addr constant [2 x i8] c"w\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 @.str.4 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i64, align 8 %n = alloca i64, align 8 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %0) #4 %1 = load ptr, ptr @stdout, align 8, !tbaa !5 %call1 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %1) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %t) %2 = load i64, ptr %t, align 8, !tbaa !9 %cmp.not11 = icmp slt i64 %2, 1 br i1 %cmp.not11, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %t) #4 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %n) %3 = load i64, ptr %n, align 8, !tbaa !9 %rem = srem i64 %3, 10 %cmp5 = icmp eq i64 %rem, 9 %div = sdiv i64 %3, 10 %add = zext i1 %cmp5 to i64 %add.sink = add nsw i64 %div, %add %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %add.sink) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %4 = load i64, ptr %t, align 8, !tbaa !9 %cmp.not = icmp slt i64 %4, %indvars.iv.next br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !11 } declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) 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 @__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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { "no-trapping-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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> void insertionSort(int A[], int n, int g); void shellSort(int A[], int n); int cnt; int main(void){ int n; scanf("%d", &n); int A[n], i; for(i=0; i<n; i++){ scanf(" %d", &A[i]); } shellSort(A, n); printf("%d\n", cnt); for(i=0; i<n; i++) printf("%d\n", A[i]); return 0; } void insertionSort(int A[], int n, int g){ int i, v, j; for(i=g; i<n; i++){ v=A[i]; j=i-g; while(0<=j && v<A[j]){ A[j+g]=A[j]; j=j-g; cnt++; } A[j+g]=v; } } void shellSort(int A[], int n){ int g[100], m, i; g[0]=1; for(m=1; 3*g[m-1]+1<=n; m++) g[m]=g[m-1]*3+1; printf("%d\n", m); cnt=0; for(i=m-1; i>=0; i--) { if(i==0) printf("%d\n", g[i]); else printf("%d ", g[i]); insertionSort(A, n, g[i]); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119343/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119343/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c" %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @cnt = dso_local local_unnamed_addr global i32 0, align 4 @.str.3 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp17 = icmp sgt i32 %3, 0 br i1 %cmp17, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds 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 %.lcssa = phi i32 [ %3, %entry ], [ %4, %for.body ] call void @shellSort(ptr noundef nonnull %vla, i32 noundef %.lcssa) %6 = load i32, ptr @cnt, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %6) %7 = load i32, ptr %n, align 4, !tbaa !5 %cmp419 = icmp sgt i32 %7, 0 br i1 %cmp419, label %for.body5, label %for.end11 for.body5: ; preds = %for.end, %for.body5 %indvars.iv23 = phi i64 [ %indvars.iv.next24, %for.body5 ], [ 0, %for.end ] %arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv23 %8 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8) %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp4 = icmp slt i64 %indvars.iv.next24, %10 br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !11 for.end11: ; preds = %for.body5, %for.end call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind uwtable define dso_local void @shellSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 { entry: %g = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %g) #5 %cmp.not.not36 = icmp sgt i32 %n, 3 br i1 %cmp.not.not36, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %mul38 = phi i32 [ %mul, %for.body ], [ 3, %entry ] %add = add nsw i32 %mul38, 1 %arrayidx8 = getelementptr inbounds [100 x i32], ptr %g, i64 0, i64 %indvars.iv store i32 %add, ptr %arrayidx8, align 4, !tbaa !5 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %mul = mul nsw i32 %add, 3 %cmp.not.not = icmp slt i32 %mul, %n br i1 %cmp.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !12 for.end.loopexit: ; preds = %for.body %0 = trunc i64 %indvars.iv.next to i32 %1 = and i64 %indvars.iv, 4294967295 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %m.0.lcssa = phi i32 [ 1, %entry ], [ %0, %for.end.loopexit ] %sub.lcssa = phi i64 [ 0, %entry ], [ %1, %for.end.loopexit ] %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %m.0.lcssa) store i32 0, ptr @cnt, align 4, !tbaa !5 %wide.trip.count.i = sext i32 %n to i64 br label %for.body12 for.body12: ; preds = %for.end, %insertionSort.exit %indvars.iv42 = phi i64 [ %sub.lcssa, %for.end ], [ %indvars.iv.next43, %insertionSort.exit ] %cmp13 = icmp eq i64 %indvars.iv42, 0 br i1 %cmp13, label %if.then, label %if.else if.then: ; preds = %for.body12 %call16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1) br label %if.end if.else: ; preds = %for.body12 %arrayidx18 = getelementptr inbounds [100 x i32], ptr %g, i64 0, i64 %indvars.iv42 %2 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %2) br label %if.end if.end: ; preds = %if.else, %if.then %3 = phi i32 [ %2, %if.else ], [ 1, %if.then ] %cmp36.i = icmp slt i32 %3, %n br i1 %cmp36.i, label %for.body.preheader.i, label %insertionSort.exit for.body.preheader.i: ; preds = %if.end %4 = sext i32 %3 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %4, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ] %arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i %5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %6 = trunc i64 %indvars.iv.i to i32 %7 = sub i32 %6, %3 br label %land.rhs.i land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i %j.034.i = phi i32 [ %j.0.i, %while.body.i ], [ %7, %land.rhs.preheader.i ] %i.0.pn33.i = phi i32 [ %j.034.i, %while.body.i ], [ %6, %land.rhs.preheader.i ] %idxprom2.i = zext i32 %j.034.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i %8 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5 %cmp4.i = icmp slt i32 %5, %8 br i1 %cmp4.i, label %while.body.i, label %while.end.i while.body.i: ; preds = %land.rhs.i %idxprom7.i = sext i32 %i.0.pn33.i to i64 %arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i store i32 %8, ptr %arrayidx8.i, align 4, !tbaa !5 %9 = load i32, ptr @cnt, align 4, !tbaa !5 %inc.i = add nsw i32 %9, 1 store i32 %inc.i, ptr @cnt, align 4, !tbaa !5 %j.0.i = sub nsw i32 %j.034.i, %3 %cmp1.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !13 while.end.i: ; preds = %while.body.i, %land.rhs.i %i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn33.i, %land.rhs.i ], [ %j.034.i, %while.body.i ] %idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64 %arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i store i32 %5, ptr %arrayidx12.i, align 4, !tbaa !5 %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !14 insertionSort.exit: ; preds = %while.end.i, %if.end %indvars.iv.next43 = add nsw i64 %indvars.iv42, -1 %cmp11 = icmp sgt i64 %indvars.iv42, 0 br i1 %cmp11, label %for.body12, label %for.end23, !llvm.loop !15 for.end23: ; preds = %insertionSort.exit call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %g) #5 ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #4 { entry: %cmp36 = icmp slt i32 %g, %n br i1 %cmp36, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %n to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %while.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ] %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %g br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %while.body %j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ] %i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ] %idxprom2 = zext i32 %j.034 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2 %5 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %cmp4 = icmp slt i32 %1, %5 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %land.rhs %idxprom7 = sext i32 %i.0.pn33 to i64 %arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7 store i32 %5, ptr %arrayidx8, align 4, !tbaa !5 %6 = load i32, ptr @cnt, align 4, !tbaa !5 %inc = add nsw i32 %6, 1 store i32 %inc, ptr @cnt, align 4, !tbaa !5 %j.0 = sub nsw i32 %j.034, %g %cmp1 = icmp sgt i32 %j.0, -1 br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !13 while.end: ; preds = %land.rhs, %while.body %i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ] %idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64 %arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11 store i32 %1, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !14 for.end: ; preds = %while.end, %entry ret void } attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree 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 #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> #include <stdlib.h> #include <math.h> int insertionSort(int *, int, int); void shellSort(int *, int); int main() { int n; scanf("%d", &n); int *A = (int *)malloc(n * sizeof(int)); for (int i = 0; i < n; i++) scanf("%d", &A[i]); shellSort(A, n); return 0; } int insertionSort(int *a, int max, int g) { int i, j; int count = 0; for (i = g; i < max; i++) { int key = a[i]; for (j = i - g; j >= 0 && a[j] > key; count++) { a[j + g] = a[j]; j -= g; } a[j + g] = key; } return count; } void shellSort(int *a, int max) { int count = 0, m = 0; int i; int *g = (int *)malloc(max * sizeof(int)); int denom = 2; if (max == 1) { g[m] = max; m++; } else { while (max / denom > 0) { g[m] = max / denom; denom *= 2; m++; } } for (i = 0; i < m; i++) { count += insertionSort(a, max, g[i]); } printf("%d\n", m); for (i = 0; i < m - 1; i++) printf("%d ", g[i]); printf("%d\n", g[i]); printf("%d\n", count); for (i = 0; i < max - 1; i++) printf("%d ", a[i]); printf("%d\n", a[i]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119387/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119387/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %conv = sext i32 %0 to i64 %mul = shl nsw i64 %conv, 2 %call1 = call noalias ptr @malloc(i64 noundef %mul) #6 %cmp7 = icmp sgt i32 %0, 0 br i1 %cmp7, label %for.body, label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ] call void @shellSort(ptr noundef %call1, i32 noundef %.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local void @shellSort(ptr nocapture noundef %a, i32 noundef %max) local_unnamed_addr #0 { entry: %conv = sext i32 %max to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #6 %cmp = icmp eq i32 %max, 1 br i1 %cmp, label %if.end.thread107, label %while.cond.preheader while.cond.preheader: ; preds = %entry %cmp276 = icmp sgt i32 %max, 1 br i1 %cmp276, label %while.body.preheader, label %for.end.thread while.body.preheader: ; preds = %while.cond.preheader %div75118119 = lshr i32 %max, 1 br label %while.body if.end.thread107: ; preds = %entry store i32 1, ptr %call, align 4, !tbaa !5 br label %for.body.preheader while.body: ; preds = %while.body.preheader, %while.body %indvars.iv = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next, %while.body ] %div79 = phi i32 [ %div75118119, %while.body.preheader ], [ %div, %while.body ] %denom.078 = phi i32 [ 2, %while.body.preheader ], [ %mul7, %while.body ] %arrayidx6 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv store i32 %div79, ptr %arrayidx6, align 4, !tbaa !5 %mul7 = shl nsw i32 %denom.078, 1 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %div = sdiv i32 %max, %mul7 %cmp2 = icmp sgt i32 %div, 0 br i1 %cmp2, label %while.body, label %if.end, !llvm.loop !11 if.end: ; preds = %while.body %0 = trunc i64 %indvars.iv.next to i32 %cmp980.not = icmp eq i32 %0, 0 br i1 %cmp980.not, label %for.end.thread, label %for.body.preheader for.body.preheader: ; preds = %if.end.thread107, %if.end %m.1110 = phi i32 [ 1, %if.end.thread107 ], [ %0, %if.end ] %wide.trip.count = zext i32 %m.1110 to i64 br label %for.body for.body: ; preds = %for.body.preheader, %insertionSort.exit %indvars.iv91 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next92, %insertionSort.exit ] %count.082 = phi i32 [ 0, %for.body.preheader ], [ %add, %insertionSort.exit ] %arrayidx12 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv91 %1 = load i32, ptr %arrayidx12, align 4, !tbaa !5 %cmp44.i = icmp slt i32 %1, %max br i1 %cmp44.i, label %for.body.preheader.i, label %insertionSort.exit for.body.preheader.i: ; preds = %for.body %2 = sext i32 %1 to i64 br label %land.rhs.preheader.i land.rhs.preheader.i: ; preds = %for.end.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %2, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.end.i ] %count.045.i = phi i32 [ 0, %for.body.preheader.i ], [ %count.1.lcssa.ph.i, %for.end.i ] %arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i %3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %4 = trunc i64 %indvars.iv.i to i32 %5 = sub i32 %4, %1 br label %land.rhs.i land.rhs.i: ; preds = %for.body6.i, %land.rhs.preheader.i %j.040.i = phi i32 [ %j.0.i, %for.body6.i ], [ %5, %land.rhs.preheader.i ] %count.139.i = phi i32 [ %inc.i, %for.body6.i ], [ %count.045.i, %land.rhs.preheader.i ] %i.0.pn38.i = phi i32 [ %j.040.i, %for.body6.i ], [ %4, %land.rhs.preheader.i ] %idxprom3.i = zext i32 %j.040.i to i64 %arrayidx4.i = getelementptr inbounds i32, ptr %a, i64 %idxprom3.i %6 = load i32, ptr %arrayidx4.i, align 4, !tbaa !5 %cmp5.i = icmp sgt i32 %6, %3 br i1 %cmp5.i, label %for.body6.i, label %for.end.i for.body6.i: ; preds = %land.rhs.i %idxprom9.i = sext i32 %i.0.pn38.i to i64 %arrayidx10.i = getelementptr inbounds i32, ptr %a, i64 %idxprom9.i store i32 %6, ptr %arrayidx10.i, align 4, !tbaa !5 %inc.i = add nsw i32 %count.139.i, 1 %j.0.i = sub nsw i32 %j.040.i, %1 %cmp2.i = icmp sgt i32 %j.0.i, -1 br i1 %cmp2.i, label %land.rhs.i, label %for.end.i, !llvm.loop !12 for.end.i: ; preds = %for.body6.i, %land.rhs.i %i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn38.i, %land.rhs.i ], [ %j.040.i, %for.body6.i ] %count.1.lcssa.ph.i = phi i32 [ %count.139.i, %land.rhs.i ], [ %inc.i, %for.body6.i ] %idxprom13.i = sext i32 %i.0.pn.lcssa.ph.i to i64 %arrayidx14.i = getelementptr inbounds i32, ptr %a, i64 %idxprom13.i store i32 %3, ptr %arrayidx14.i, align 4, !tbaa !5 %indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %conv br i1 %exitcond.not.i, label %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !13 insertionSort.exit: ; preds = %for.end.i, %for.body %count.0.lcssa.i = phi i32 [ 0, %for.body ], [ %count.1.lcssa.ph.i, %for.end.i ] %add = add nsw i32 %count.0.lcssa.i, %count.082 %indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1 %exitcond.not = icmp eq i64 %indvars.iv.next92, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14 for.end.thread: ; preds = %if.end, %while.cond.preheader %call15113 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0) br label %for.end25 for.end: ; preds = %insertionSort.exit %call15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.1110) %sub = add i32 %m.1110, -1 %cmp1784 = icmp sgt i32 %m.1110, 1 br i1 %cmp1784, label %for.body19.preheader, label %for.end25 for.body19.preheader: ; preds = %for.end %wide.trip.count97 = zext i32 %sub to i64 br label %for.body19 for.body19: ; preds = %for.body19.preheader, %for.body19 %indvars.iv94 = phi i64 [ 0, %for.body19.preheader ], [ %indvars.iv.next95, %for.body19 ] %arrayidx21 = getelementptr inbounds i32, ptr %call, i64 %indvars.iv94 %7 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %call22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7) %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %exitcond98.not = icmp eq i64 %indvars.iv.next95, %wide.trip.count97 br i1 %exitcond98.not, label %for.end25.loopexit, label %for.body19, !llvm.loop !15 for.end25.loopexit: ; preds = %for.body19 %8 = zext i32 %sub to i64 br label %for.end25 for.end25: ; preds = %for.end, %for.end.thread, %for.end25.loopexit %count.0.lcssa116 = phi i32 [ %add, %for.end25.loopexit ], [ 0, %for.end.thread ], [ %add, %for.end ] %i.1.lcssa = phi i64 [ %8, %for.end25.loopexit ], [ 0, %for.end.thread ], [ 0, %for.end ] %arrayidx27 = getelementptr inbounds i32, ptr %call, i64 %i.1.lcssa %9 = load i32, ptr %arrayidx27, align 4, !tbaa !5 %call28 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9) %call29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %count.0.lcssa116) %sub31 = add i32 %max, -1 %cmp3287 = icmp sgt i32 %max, 1 br i1 %cmp3287, label %for.body34.preheader, label %for.end40 for.body34.preheader: ; preds = %for.end25 %wide.trip.count102 = zext i32 %sub31 to i64 br label %for.body34 for.body34: ; preds = %for.body34.preheader, %for.body34 %indvars.iv99 = phi i64 [ 0, %for.body34.preheader ], [ %indvars.iv.next100, %for.body34 ] %arrayidx36 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv99 %10 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %call37 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %exitcond103.not = icmp eq i64 %indvars.iv.next100, %wide.trip.count102 br i1 %exitcond103.not, label %for.end40.loopexit, label %for.body34, !llvm.loop !16 for.end40.loopexit: ; preds = %for.body34 %11 = zext i32 %sub31 to i64 br label %for.end40 for.end40: ; preds = %for.end25, %for.end40.loopexit %i.2.lcssa = phi i64 [ %11, %for.end40.loopexit ], [ 0, %for.end25 ] %arrayidx42 = getelementptr inbounds i32, ptr %a, i64 %i.2.lcssa %12 = load i32, ptr %arrayidx42, align 4, !tbaa !5 %call43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12) ret void } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @insertionSort(ptr nocapture noundef %a, i32 noundef %max, i32 noundef %g) local_unnamed_addr #4 { entry: %cmp44 = icmp slt i32 %g, %max br i1 %cmp44, label %for.body.preheader, label %for.end17 for.body.preheader: ; preds = %entry %0 = sext i32 %g to i64 %wide.trip.count = sext i32 %max to i64 br label %land.rhs.preheader land.rhs.preheader: ; preds = %for.end, %for.body.preheader %indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.end ] %count.045 = phi i32 [ 0, %for.body.preheader ], [ %count.1.lcssa.ph, %for.end ] %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %2 = trunc i64 %indvars.iv to i32 %3 = trunc i64 %indvars.iv to i32 %4 = sub i32 %3, %g br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %for.body6 %j.040 = phi i32 [ %j.0, %for.body6 ], [ %4, %land.rhs.preheader ] %count.139 = phi i32 [ %inc, %for.body6 ], [ %count.045, %land.rhs.preheader ] %i.0.pn38 = phi i32 [ %j.040, %for.body6 ], [ %2, %land.rhs.preheader ] %idxprom3 = zext i32 %j.040 to i64 %arrayidx4 = getelementptr inbounds i32, ptr %a, i64 %idxprom3 %5 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %5, %1 br i1 %cmp5, label %for.body6, label %for.end for.body6: ; preds = %land.rhs %idxprom9 = sext i32 %i.0.pn38 to i64 %arrayidx10 = getelementptr inbounds i32, ptr %a, i64 %idxprom9 store i32 %5, ptr %arrayidx10, align 4, !tbaa !5 %inc = add nsw i32 %count.139, 1 %j.0 = sub nsw i32 %j.040, %g %cmp2 = icmp sgt i32 %j.0, -1 br i1 %cmp2, label %land.rhs, label %for.end, !llvm.loop !12 for.end: ; preds = %land.rhs, %for.body6 %i.0.pn.lcssa.ph = phi i32 [ %i.0.pn38, %land.rhs ], [ %j.040, %for.body6 ] %count.1.lcssa.ph = phi i32 [ %count.139, %land.rhs ], [ %inc, %for.body6 ] %idxprom13 = sext i32 %i.0.pn.lcssa.ph to i64 %arrayidx14 = getelementptr inbounds i32, ptr %a, i64 %idxprom13 store i32 %1, ptr %arrayidx14, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end17, label %land.rhs.preheader, !llvm.loop !13 for.end17: ; preds = %for.end, %entry %count.0.lcssa = phi i32 [ 0, %entry ], [ %count.1.lcssa.ph, %for.end ] ret i32 %count.0.lcssa } ; 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 allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind allocsize(0) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = 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> int main() { int t; long long int n, j; scanf("%d", &t); int T[t]; for(int i=0; i<t; i++) scanf("%lld", &T[i]); for(int i=0; i<t; i++) { j=0; if(T[i]%10 == 9) j++; j=j+(T[i]/10); printf("%lld\n", j); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11943/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11943/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %t, align 4, !tbaa !5 %cmp24 = icmp sgt i32 %3, 0 br i1 %cmp24, label %for.body, label %for.cond.cleanup5 for.cond3.preheader: ; preds = %for.body %4 = icmp sgt i32 %5, 0 br i1 %4, label %for.body6, label %for.cond.cleanup5 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 %5 = load i32, ptr %t, 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.cond3.preheader, !llvm.loop !9 for.cond.cleanup5: ; preds = %for.body6, %entry, %for.cond3.preheader call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4 ret i32 0 for.body6: ; preds = %for.cond3.preheader, %for.body6 %indvars.iv29 = phi i64 [ %indvars.iv.next30, %for.body6 ], [ 0, %for.cond3.preheader ] %arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv29 %7 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %rem = srem i32 %7, 10 %cmp9 = icmp eq i32 %rem, 9 %spec.select = zext i1 %cmp9 to i64 %div = sdiv i32 %7, 10 %conv = sext i32 %div to i64 %add = add nsw i64 %spec.select, %conv %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %add) %indvars.iv.next30 = add nuw nsw i64 %indvars.iv29, 1 %8 = load i32, ptr %t, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp4 = icmp slt i64 %indvars.iv.next30, %9 br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(){ int N,K; scanf("%d %d",&N,&K); if(N%K>0){ printf("%d",1); } else{ printf("%d",0); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119473/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119473/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = load i32, ptr %K, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp sgt i32 %rem, 0 %. = zext i1 %cmp to i32 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ int n,k; scanf("%d%d",&n,&k); if(n % k){ printf("1"); } else { printf("0"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119516/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119516/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %k, align 4, !tbaa !5 %rem = srem i32 %0, %1 %tobool.not = icmp eq i32 %rem, 0 %. = select i1 %tobool.not, i32 48, i32 49 %putchar = call i32 @putchar(i32 %.) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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> #include <stdlib.h> #include <math.h> #include <string.h> #include <ctype.h> #define max(a,b) a>=b?a:b #define min(a,b) a<b?a:b #define inf 1000000000 #include <math.h> #include <stdio.h> #include <string.h> #include <ctype.h> #define MOD 1000000007 #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> int main(){ int n,i=0; scanf("%d",&n); int a[1001]={0}; while (i<n) { int j; scanf("%d",&j); a[j]++; i++; } i=0; n=(n+1)/2; while (i<1001) { if(a[i]>n) break; i++; } if(i==1001) printf("YES\n"); else printf("NO\n"); return 0; }/* void siftDown(long long int numbers[],long long int root,long long int bottom) { long long int maxChild = root * 2 + 1; // Find the biggest child if(maxChild < bottom) { long long int otherChild = maxChild + 1; // Reversed for stability maxChild = (numbers[otherChild] > numbers[maxChild])?otherChild:maxChild; } else { // Don't overflow if(maxChild > bottom) return; } // If we have the correct ordering, we are done. if(numbers[root] >= numbers[maxChild]) return; // Swap long long int temp = numbers[root]; numbers[root] = numbers[maxChild]; numbers[maxChild] = temp; // Tail queue recursion. Will be compiled as a loop with correct compiler switches. siftDown(numbers, maxChild, bottom); } void heapSort(long long int numbers[],long long int array_size) { long long int i, temp; for (i = (array_size / 2); i >= 0; i--) { siftDown(numbers, i, array_size - 1); } for (i = array_size-1; i >= 1; i--) { // Swap temp = numbers[0]; numbers[0] = numbers[i]; numbers[i] = temp; siftDown(numbers, 0, i-1); } } struct bstnodel{ long long int val,w; struct bstnodel *l,*r,*p; }*sentinell; void swapi(long long *a,int i,int j) { long long int temp; temp=a[i]; a[i]=a[j]; a[j]=temp; } void qsi(long long int *a,int ll,int lr) { int i,last; if(ll>=lr) return; swapi(a,ll,(ll+lr)/2); last=ll; for(i=ll+1;i<=lr;i++) if(a[i]<=a[ll]) swapi(a,++last,i); swapi(a,ll,last); qsi(a,ll,last-1); qsi(a,last+1,lr); } int bstinsert2(struct bstnodel **r,long long int val,struct bstnodel **p,long long int weight){ if((*r)==sentinell){ (*r)=malloc(sizeof(struct bstnodel)); (*r)->val=val; (*r)->r=(*r)->l=sentinell; (*r)->w=weight; if(p!=NULL) (*r)->p=(*p); else (*r)->p=NULL; return 1; } else if((*r)->val==val){ if((*r)->w>weight) (*r)->w=weight; return 0; } else if((*r)->val>val){ p=r; return bstinsert2(&((*r)->l), val,p,weight); } else if((*r)->val<val){ p=r; return bstinsert2(&((*r)->r), val,p,weight); } return 0; } void b_inorder(struct bstnodel *r,long long int *a,int *i){ if(r!=NULL){ b_inorder(r->l,a,i); a[*i]=r->w; (*i)++; b_inorder(r->r,a,i); } } void fastRead(long long int *a) { char c=0; while (c<33) c=getchar_unlocked(); *a=0; while (c>33) { *a=*a*10+c-'0'; c=getchar_unlocked(); } } int main(){ int t; fastRead(&t); while (t) { long long int n,i=0; long long int sum=0; struct bstnodel *r=NULL; fastRead(&n); int a[n],b[n],u=0; while (i<n) { fastRead(&a[i]); fastRead(&b[i]); if(bstinsert2(&r, a[i], NULL,b[i])){ u++; //printf("%d %d\n",b[i],a[i]); } i++; } //qsi(b, a, 0, n-1); i=0; //u=0; /*while(i<n){ if(bstinsert2(&r, a[i], NULL,b[i])){ u++; //printf("%d %d\n",b[i],a[i]); } i++; }*/ /* long long int arr[u]; int h=0; b_inorder(r,arr,&h); heapSort(arr, h); h=0; while (h<u) { sum+=((h+1)*arr[h]); h++; } i=0; long long int sum1=0; while (i<u) { sum1+=(h*arr[i]); i++; } i=0; long long int sum2=0; while (i<n) { sum2+=(h*b[i]); i++; } sum2=sum2-sum1+sum; printf("%lld\n",sum2); t--; } return 0; } /*struct nod { int val; struct nod *next; }; int left(int i){ return 2*i+1; } int right(int i){ return 2*i+2; } int parent(int i){ return (i-1)/2; } void create_adj(int num_v,struct nod *p[num_v],int ver1,int ver2,int weight){ struct nod *tmp=malloc(sizeof(struct nod)); tmp->val=ver2; //tmp->d=0; //tmp->color='w'; tmp->next=p[ver1]; //tmp->weight=weight; //tmp->par=0; p[ver1]=tmp; } void max_heapify_0(int n,int a[n][2],int i){ int l=left(i),r=right(i),smallest; if(l<n && a[l][1]>a[i][1]) smallest=l; else smallest=i; if(r<n && a[r][1]>a[smallest][1]) smallest=r; if(smallest!=i){ //b[smallest]=a[i][1]; //b[i]=a[smallest][1]; int t=smallest,p=i; a[p][0]=a[p][0]+a[t][0]; a[t][0]=a[p][0]-a[t][0]; a[p][0]=a[p][0]-a[t][0]; a[p][1]=a[p][1]+a[t][1]; a[t][1]=a[p][1]-a[t][1]; a[p][1]=a[p][1]-a[t][1]; max_heapify_0(n, a, smallest); } } void build_maxheap_0(int n,int a[n][2]){ int i; for(i=parent(n-1);i>=0;i--) max_heapify_0(n, a, i); } int maxheap_extract_0(int *n,int a[*n][2]){ int minn=a[0][0],minn1=a[0][1]; if (a[0][1]==0) { return 0; } a[0][0]=a[*n-1][0]; a[0][1]=a[*n-1][1]; a[*n-1][0]=minn; a[*n-1][1]=minn1; (*n)--; max_heapify_0(*n, a, 0); return minn; } int ver[6001][2],vver[6001][2],vv[6001],v_i[6001],g[6001]; struct nod *p[6001]; int main(){ int t; scanf("%d",&t); while (t) { int n,m,k,i=0,sum=0; scanf("%d%d%d",&n,&m,&k); while (i<n) { p[i]=NULL; ver[i][1]=0; ver[i][0]=i; g[i]=0; v_i[i]=0; vv[i]=0; i++; } i=0; int mx=0,mxi=0,cnv=0; while(i<m){ int a,b; scanf("%d %d",&a,&b); create_adj(6001, p, a, b, 0); create_adj(6001, p, b, a, 0); v_i[a]++; v_i[b]++; g[a]=g[b]=1; if(v_i[a]>mx){ mx=v_i[a]; mxi=a; cnv=1; } else if(v_i[a]==mx){ cnv++; } if (v_i[b]>mx) { mx=v_i[b]; mxi=b; cnv=1; } else if(v_i[b]==mx){ cnv++; } i++; } ver[0][0]=mxi; ver[0][1]=mx; vv[mxi]=1; int len=1; int count=0; i=0; while (i<n) { if(g[i]){ count++; } i++; } if(cnv==count && mx==(count-1)){ printf("0\n"); return 0; } while(1){ int len1=0; while (len) { int v=maxheap_extract_0(&len, ver);//printf("ext = %d\n",v); //sum+=k; int kk=0; struct nod *pp=p[v]; while (pp!=NULL) { if(vv[pp->val]==0) kk=1; vv[pp->val]=1; pp=pp->next; } pp=p[v]; while (pp!=NULL) { //printf("%d\n",pp->val); vv[pp->val]=1; int value=0; struct nod *rs=p[pp->val]; while (rs!=NULL) { if (vv[rs->val]==0) { value++;//printf("\t%d\n",rs->val); } rs=rs->next; } if(value>0){kk=1; vver[len1][0]=pp->val;vver[len1][1]=value; i=len1; while(i>0 && vver[i][1]>vver[parent(i)][1]){ vver[i][1]=vver[i][1]+vver[parent(i)][1]; vver[parent(i)][1]=vver[i][1]-vver[parent(i)][1]; vver[i][1]=vver[i][1]-vver[parent(i)][1]; vver[i][0]+=vver[parent(i)][0]; vver[parent(i)][0]=vver[i][0]-vver[parent(i)][0]; vver[i][0]=vver[i][0]-vver[parent(i)][0]; i=parent(i); } len1++; } pp=pp->next; } sum+=(k*kk); } if(len1==0){ break; } else{ int hi=0; while (hi<len1) { ver[hi][0]=vver[hi][0]; ver[hi][1]=vver[hi][1]; hi++; } len=len1; } } printf("%d\n",sum); t--; } return 0; } */
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11956/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11956/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [1001 x i32], align 16 %j = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %a, i8 0, i64 4004, i1 false) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp24 = icmp sgt i32 %0, 0 br i1 %cmp24, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %i.025 = phi i32 [ %inc2, %while.body ], [ 0, %entry ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %j) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %j) %1 = load i32, ptr %j, align 4, !tbaa !5 %idxprom = sext i32 %1 to i64 %arrayidx = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %idxprom %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !5 %inc2 = add nuw nsw i32 %i.025, 1 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %j) #5 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc2, %3 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry %.lcssa = phi i32 [ %0, %entry ], [ %3, %while.body ] %add = add nsw i32 %.lcssa, 1 %div = sdiv i32 %add, 2 store i32 %div, ptr %n, align 4, !tbaa !5 br label %while.body5 while.body5: ; preds = %if.end.3, %while.end %indvars.iv = phi i64 [ 0, %while.end ], [ %indvars.iv.next.3, %if.end.3 ] %arrayidx7 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv %4 = load i32, ptr %arrayidx7, align 16, !tbaa !5 %cmp8 = icmp sgt i32 %4, %div br i1 %cmp8, label %if.end15, label %if.end if.end: ; preds = %while.body5 %indvars.iv.next = or i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 1001 br i1 %exitcond.not, label %if.end15, label %while.body5.1, !llvm.loop !11 while.body5.1: ; preds = %if.end %arrayidx7.1 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv.next %5 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5 %cmp8.1 = icmp sgt i32 %5, %div br i1 %cmp8.1, label %if.end15, label %if.end.1 if.end.1: ; preds = %while.body5.1 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx7.2 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv.next.1 %6 = load i32, ptr %arrayidx7.2, align 8, !tbaa !5 %cmp8.2 = icmp sgt i32 %6, %div br i1 %cmp8.2, label %if.end15, label %if.end.2 if.end.2: ; preds = %if.end.1 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx7.3 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv.next.2 %7 = load i32, ptr %arrayidx7.3, align 4, !tbaa !5 %cmp8.3 = icmp sgt i32 %7, %div br i1 %cmp8.3, label %if.end15, label %if.end.3 if.end.3: ; preds = %if.end.2 %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4 br label %while.body5 if.end15: ; preds = %if.end.2, %if.end.1, %while.body5.1, %while.body5, %if.end %str.sink = phi ptr [ @str.3, %if.end ], [ @str, %while.body5 ], [ @str, %while.body5.1 ], [ @str, %if.end.1 ], [ @str, %if.end.2 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: 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 nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void){ int n,k; scanf("%d %d",&n,&k); if(n%k==0){ printf("%d\n",0); }else{ printf("%d\n",1); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119602/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119602/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %k, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp ne i32 %rem, 0 %. = zext i1 %cmp to i32 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(){ int N,K; scanf("%d %d",&N,&K); printf("%d\n",!!(N%K)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119646/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119646/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = load i32, ptr %K, align 4, !tbaa !5 %rem = srem i32 %0, %1 %tobool = icmp ne i32 %rem, 0 %lnot.ext = zext i1 %tobool to i32 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %lnot.ext) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { int n,a[100],i,d[100]={},k,max; scanf("%d",&n); for(i=0;i<n;i++) {scanf("%d",&a[i]);} for(i=0;i<n;i++) {for(k=i+1;k<n;k++) {if(a[i]==a[k]&&a[i]!=-1) {a[k]=-1; d[i]++; } else { continue;} }if(a[i]!=-1) {d[i]++;} } max=d[0]; for(i=0;i<n;i++) { if(d[i]>max) {max=d[i]; } else {continue;}} if(n-max>=max-1) {printf("YES");} else {printf("NO");} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11969/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11969/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [100 x i32], align 16 %d = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %d) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %d, i8 0, i64 400, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp78 = icmp sgt i32 %0, 0 br i1 %cmp78, label %for.body, label %for.end49 for.cond2.preheader: ; preds = %for.body %cmp382 = icmp sgt i32 %2, 0 br i1 %cmp382, label %for.body4.preheader, label %for.end49 for.body4.preheader: ; preds = %for.cond2.preheader %1 = zext i32 %2 to i64 %wide.trip.count98 = zext i32 %2 to i64 br label %for.body4 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.body4.preheader, %for.inc32 %indvars.iv95 = phi i64 [ 0, %for.body4.preheader ], [ %indvars.iv.next96, %for.inc32 ] %indvars.iv90 = phi i64 [ 1, %for.body4.preheader ], [ %indvars.iv.next91, %for.inc32 ] %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1 %cmp680 = icmp ult i64 %indvars.iv.next96, %1 br i1 %cmp680, label %for.body7.lr.ph, label %for.end23 for.body7.lr.ph: ; preds = %for.body4 %arrayidx9 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv95 %arrayidx19 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv95 br label %for.body7 for.body7: ; preds = %for.body7.lr.ph, %for.inc21 %indvars.iv92 = phi i64 [ %indvars.iv90, %for.body7.lr.ph ], [ %indvars.iv.next93, %for.inc21 ] %4 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv92 %5 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %cmp12 = icmp ne i32 %4, %5 %cmp15.not = icmp eq i32 %4, -1 %or.cond = or i1 %cmp15.not, %cmp12 br i1 %or.cond, label %for.inc21, label %if.then if.then: ; preds = %for.body7 store i32 -1, ptr %arrayidx11, align 4, !tbaa !5 %6 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %inc20 = add nsw i32 %6, 1 store i32 %inc20, ptr %arrayidx19, align 4, !tbaa !5 br label %for.inc21 for.inc21: ; preds = %for.body7, %if.then %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1 %exitcond.not = icmp eq i64 %indvars.iv.next93, %wide.trip.count98 br i1 %exitcond.not, label %for.end23, label %for.body7, !llvm.loop !11 for.end23: ; preds = %for.inc21, %for.body4 %arrayidx25 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv95 %7 = load i32, ptr %arrayidx25, align 4, !tbaa !5 %cmp26.not = icmp eq i32 %7, -1 br i1 %cmp26.not, label %for.inc32, label %if.then27 if.then27: ; preds = %for.end23 %arrayidx29 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv95 %8 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %inc30 = add nsw i32 %8, 1 store i32 %inc30, ptr %arrayidx29, align 4, !tbaa !5 br label %for.inc32 for.inc32: ; preds = %for.end23, %if.then27 %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1 %exitcond99.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count98 br i1 %exitcond99.not, label %for.end34, label %for.body4, !llvm.loop !12 for.end34: ; preds = %for.inc32 %.pre = load i32, ptr %d, align 16, !tbaa !5 br i1 %cmp382, label %for.body38.preheader, label %for.end49 for.body38.preheader: ; preds = %for.end34 %wide.trip.count103 = zext i32 %2 to i64 %min.iters.check = icmp ult i32 %2, 8 br i1 %min.iters.check, label %for.body38.preheader114, label %vector.ph vector.ph: ; preds = %for.body38.preheader %n.vec = and i64 %wide.trip.count98, 4294967288 %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %11, %vector.body ] %vec.phi112 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %12, %vector.body ] %9 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %9, align 16, !tbaa !5 %10 = getelementptr inbounds i32, ptr %9, i64 4 %wide.load113 = load <4 x i32>, ptr %10, align 16, !tbaa !5 %11 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi) %12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load113, <4 x i32> %vec.phi112) %index.next = add nuw i64 %index, 8 %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 %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %11, <4 x i32> %12) %14 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count98 br i1 %cmp.n, label %for.end49, label %for.body38.preheader114 for.body38.preheader114: ; preds = %for.body38.preheader, %middle.block %indvars.iv100.ph = phi i64 [ 0, %for.body38.preheader ], [ %n.vec, %middle.block ] %max.086.ph = phi i32 [ %.pre, %for.body38.preheader ], [ %14, %middle.block ] br label %for.body38 for.body38: ; preds = %for.body38.preheader114, %for.body38 %indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.body38 ], [ %indvars.iv100.ph, %for.body38.preheader114 ] %max.086 = phi i32 [ %spec.select, %for.body38 ], [ %max.086.ph, %for.body38.preheader114 ] %arrayidx40 = getelementptr inbounds [100 x i32], ptr %d, i64 0, i64 %indvars.iv100 %15 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %15, i32 %max.086) %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1 %exitcond104.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count103 br i1 %exitcond104.not, label %for.end49, label %for.body38, !llvm.loop !16 for.end49: ; preds = %for.body38, %middle.block, %entry, %for.cond2.preheader, %for.end34 %.lcssa107111 = phi i32 [ %2, %for.end34 ], [ %2, %for.cond2.preheader ], [ %0, %entry ], [ %2, %middle.block ], [ %2, %for.body38 ] %max.0.lcssa = phi i32 [ %.pre, %for.end34 ], [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %14, %middle.block ], [ %spec.select, %for.body38 ] %sub = sub nsw i32 %.lcssa107111, %max.0.lcssa %sub50 = add nsw i32 %max.0.lcssa, -1 %cmp51.not = icmp slt i32 %sub, %sub50 %.str.2..str.1 = select i1 %cmp51.not, ptr @.str.2, ptr @.str.1 %call55 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %d) #5 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14}
#include <stdio.h> int main(void){ // Your code here! int N,K; scanf("%d %d",&N,&K); printf("%d\n",((N%K)!=0)); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119732/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119732/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %K = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K) %0 = load i32, ptr %N, align 4, !tbaa !5 %1 = load i32, ptr %K, align 4, !tbaa !5 %rem = srem i32 %0, %1 %cmp = icmp ne i32 %rem, 0 %conv = zext i1 %cmp to i32 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %conv) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> #include <stdbool.h> #define LL long long #define DB double #define INF 1145141919810364364 #define PI 3.14159265358979 #define MIN(x,y) ((x)<(y)?(x):(y)) #define MAX(x,y) ((x)<(y)?(y):(x)) #define FOR(i,a,n) for(i=a;i<n;i++) #define rep(i,n) FOR(i,0,n) #define MOD 1000000007 //#define MOD 998244353 #define ERR 0.00000000000001 #define NUM 200010 void swap(LL* a,LL* b){LL tmp=*a;*a=*b;*b=tmp;} void YN(int a){if(a==1)printf("Yes\n");if(a==0)printf("No\n");} LL pwmn(LL a,LL n){LL ans=1;while(ans<a)ans*=n;return ans;} LL GCD(LL a,LL b){LL c=1,tmp=MAX(a,b);b=MIN(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;} LL LCM(LL a,LL b){return a*b/GCD(a,b);} int lcmp(const void* a,const void* b){if(*(LL*)a>*(LL*)b)return 1;if(*(LL*)a<*(LL*)b)return -1;return 0;} int lcmpr(const void* a,const void* b){if(*(LL*)a>*(LL*)b)return -1;if(*(LL*)a<*(LL*)b)return 1;return 0;} int ccmp(const void* a,const void* b){return *(char*)a-*(char*)b;} int ccmpr(const void* a,const void* b){return *(char*)b-*(char*)a;} int scmp(const void* a,const void* b){return strcmp((char*)a,(char*)b);} int scmpr(const void* a,const void* b){return strcmp((char*)b,(char*)a);} LL mod(LL a,LL m){if(a<0)return a%m+m;else return a%m;} LL DIV(LL a,LL d){LL m=MOD,x=1,y=0,k;while(m){k=d/m;d-=k*m;swap(&m,&d);x-=k*y;swap(&x,&y);}return mod(a*mod(x,MOD),MOD);} LL FAC(LL a){LL i,ans=1;FOR(i,1,a+1){ans*=i;if(MOD>0&&ans>MOD)ans%=MOD;}return ans;} LL POW(LL a,LL n){LL ans=1;while(n>0){if(n&1)ans=ans*a%MOD;a=a*a%MOD;n>>=1;}return ans;} LL fact[NUM],finv[NUM],inv[NUM]; void comi(){LL i;fact[0]=fact[1]=1;finv[0]=finv[1]=1;inv[1]=1;FOR(i,2,NUM){fact[i]=fact[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}} LL com(LL n,LL k){if(n<k||n<0||k<0)return 0;return fact[n]*(finv[k]*finv[n-k]%MOD)%MOD;} LL st,seg[26][1048576]={0}; void sadd(LL j,LL i,LL n){ i+=st-1; seg[j][i]+=n; while(i>0){ i=(i-1)/2; seg[j][i]+=n; } } LL ssum(LL j,LL a,LL b,LL k,LL l,LL r){ if(r<=a||b<=l)return 0; if(a<=l&&r<=b)return seg[j][k]; return ssum(j,a,b,2*k+1,l,(l+r)/2)+ssum(j,a,b,2*k+2,(l+r)/2,r); } int main(){ LL N,Q,j,k,n,i,l,r,ans,p,q; scanf("%lld",&N); char S[N+1],c; scanf("%s %lld",S,&Q); st=pwmn(N,2); rep(j,N)sadd(S[j]-'a',j,1); rep(j,Q){ scanf("%lld",&n); if(n==1){ scanf("%lld %c",&i,&c); sadd(S[i-1]-'a',i-1,-1); S[i-1]=c; sadd(c-'a',i-1,1); }else{ scanf("%lld %lld",&l,&r); ans=0; rep(k,26)if(ssum(k,l-1,r,0,0,st)>0)ans++; printf("%lld\n",ans); } } //printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119776/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119776/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @fact = dso_local local_unnamed_addr global [200010 x i64] zeroinitializer, align 16 @finv = dso_local local_unnamed_addr global [200010 x i64] zeroinitializer, align 16 @inv = dso_local local_unnamed_addr global [200010 x i64] zeroinitializer, align 16 @seg = dso_local local_unnamed_addr global [26 x [1048576 x i64]] zeroinitializer, align 16 @st = dso_local local_unnamed_addr global i64 0, align 8 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.3 = private unnamed_addr constant [8 x i8] c"%s %lld\00", align 1 @.str.4 = private unnamed_addr constant [8 x i8] c"%lld %c\00", align 1 @.str.5 = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.6 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.7 = private unnamed_addr constant [3 x i8] c"No\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 %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 store i64 %1, ptr %a, align 8, !tbaa !5 store i64 %0, ptr %b, 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: nofree nounwind uwtable define dso_local void @YN(i32 noundef %a) local_unnamed_addr #2 { entry: switch i32 %a, label %if.end4 [ i32 1, label %if.end4.sink.split i32 0, label %if.then2 ] if.then2: ; preds = %entry br label %if.end4.sink.split if.end4.sink.split: ; preds = %entry, %if.then2 %str.sink = phi ptr [ @str.7, %if.then2 ], [ @str, %entry ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) br label %if.end4 if.end4: ; preds = %if.end4.sink.split, %entry ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @pwmn(i64 noundef %a, i64 noundef %n) local_unnamed_addr #4 { entry: %cmp3 = icmp sgt i64 %a, 1 br i1 %cmp3, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %ans.04 = phi i64 [ %mul, %while.body ], [ 1, %entry ] %mul = mul nsw i64 %ans.04, %n %cmp = icmp slt i64 %mul, %a br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %while.body, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %mul, %while.body ] ret i64 %ans.0.lcssa } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @GCD(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) %cond5 = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) br label %while.body while.body: ; preds = %entry, %while.body %a.addr.019 = phi i64 [ %cond, %entry ], [ %b.addr.018, %while.body ] %b.addr.018 = phi i64 [ %cond5, %entry ], [ %rem, %while.body ] %rem = srem i64 %a.addr.019, %b.addr.018 %cmp6.not = icmp eq i64 %rem, 0 br i1 %cmp6.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %while.body ret i64 %b.addr.018 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @LCM(i64 noundef %a, i64 noundef %b) local_unnamed_addr #5 { entry: %cond.i = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) %cond5.i = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) br label %while.body.i while.body.i: ; preds = %while.body.i, %entry %a.addr.019.i = phi i64 [ %cond.i, %entry ], [ %b.addr.018.i, %while.body.i ] %b.addr.018.i = phi i64 [ %cond5.i, %entry ], [ %rem.i, %while.body.i ] %rem.i = srem i64 %a.addr.019.i, %b.addr.018.i %cmp6.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp6.not.i, label %GCD.exit, label %while.body.i, !llvm.loop !11 GCD.exit: ; preds = %while.body.i %mul = mul nsw i64 %b, %a %div = sdiv i64 %mul, %b.addr.018.i ret i64 %div } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @lcmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp slt 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 @lcmpr(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp slt i64 %0, %1 %. = zext 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 @ccmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %0 = load i8, ptr %a, align 1, !tbaa !12 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !12 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @ccmpr(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %0 = load i8, ptr %b, align 1, !tbaa !12 %conv = sext i8 %0 to i32 %1 = load i8, ptr %a, align 1, !tbaa !12 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @scmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #7 { 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 #8 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @scmpr(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #7 { 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(none) uwtable define dso_local i64 @mod(i64 noundef %a, i64 noundef %m) local_unnamed_addr #9 { entry: %cmp = icmp slt i64 %a, 0 %rem = srem i64 %a, %m %add = select i1 %cmp, i64 %m, i64 0 %retval.0 = add nsw i64 %rem, %add ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @DIV(i64 noundef %a, i64 noundef %d) local_unnamed_addr #4 { entry: br label %while.body while.body: ; preds = %entry, %while.body %y.018 = phi i64 [ 0, %entry ], [ %sub2, %while.body ] %x.017 = phi i64 [ 1, %entry ], [ %y.018, %while.body ] %m.016 = phi i64 [ 1000000007, %entry ], [ %sub.recomposed, %while.body ] %d.addr.015 = phi i64 [ %d, %entry ], [ %m.016, %while.body ] %div = sdiv i64 %d.addr.015, %m.016 %mul = mul nsw i64 %div, %m.016 %sub.recomposed = srem i64 %d.addr.015, %m.016 %mul1 = mul nsw i64 %div, %y.018 %sub2 = sub nsw i64 %x.017, %mul1 %tobool.not = icmp eq i64 %sub.recomposed, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %while.body %cmp.i = icmp slt i64 %y.018, 0 %rem.i = srem i64 %y.018, 1000000007 %add.i = select i1 %cmp.i, i64 1000000007, i64 0 %retval.0.i = add nsw i64 %add.i, %rem.i %mul3 = mul nsw i64 %retval.0.i, %a %cmp.i6 = icmp slt i64 %mul3, 0 %rem.i7 = srem i64 %mul3, 1000000007 %add.i8 = select i1 %cmp.i6, i64 1000000007, i64 0 %retval.0.i9 = add nsw i64 %add.i8, %rem.i7 ret i64 %retval.0.i9 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @FAC(i64 noundef %a) local_unnamed_addr #4 { entry: %cmp.not7 = icmp slt i64 %a, 1 br i1 %cmp.not7, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %a, 1 %0 = icmp eq i64 %a, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %a, -2 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %ans.09 = phi i64 [ 1, %for.body.preheader.new ], [ %ans.1.1, %for.body ] %i.08 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %mul = mul nsw i64 %ans.09, %i.08 %cmp1 = icmp sgt i64 %mul, 1000000007 %rem = urem i64 %mul, 1000000007 %ans.1 = select i1 %cmp1, i64 %rem, i64 %mul %inc = add nuw i64 %i.08, 1 %mul.1 = mul nsw i64 %ans.1, %inc %cmp1.1 = icmp sgt i64 %mul.1, 1000000007 %rem.1 = urem i64 %mul.1, 1000000007 %ans.1.1 = select i1 %cmp1.1, i64 %rem.1, i64 %mul.1 %inc.1 = add nuw i64 %i.08, 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 !14 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %ans.1.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %ans.1.1, %for.body ] %ans.09.unr = phi i64 [ 1, %for.body.preheader ], [ %ans.1.1, %for.body ] %i.08.unr = phi i64 [ 1, %for.body.preheader ], [ %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 %mul.epil = mul nsw i64 %ans.09.unr, %i.08.unr %cmp1.epil = icmp sgt i64 %mul.epil, 1000000007 %rem.epil = urem i64 %mul.epil, 1000000007 %ans.1.epil = select i1 %cmp1.epil, i64 %rem.epil, i64 %mul.epil br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %ans.1.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %ans.1.epil, %for.body.epil ] ret i64 %ans.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @POW(i64 noundef %a, i64 noundef %n) local_unnamed_addr #4 { entry: %cmp8 = icmp sgt i64 %n, 0 br i1 %cmp8, label %while.body, label %while.end while.body: ; preds = %entry, %if.end %ans.011 = phi i64 [ %ans.1, %if.end ], [ 1, %entry ] %n.addr.010 = phi i64 [ %shr, %if.end ], [ %n, %entry ] %a.addr.09 = phi i64 [ %rem2, %if.end ], [ %a, %entry ] %and = and i64 %n.addr.010, 1 %tobool.not = icmp eq i64 %and, 0 br i1 %tobool.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul nsw i64 %ans.011, %a.addr.09 %rem = srem i64 %mul, 1000000007 br label %if.end if.end: ; preds = %if.then, %while.body %ans.1 = phi i64 [ %rem, %if.then ], [ %ans.011, %while.body ] %mul1 = mul nsw i64 %a.addr.09, %a.addr.09 %rem2 = urem i64 %mul1, 1000000007 %shr = lshr i64 %n.addr.010, 1 %cmp.not = icmp ult i64 %n.addr.010, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !15 while.end: ; preds = %if.end, %entry %ans.0.lcssa = phi i64 [ 1, %entry ], [ %ans.1, %if.end ] ret i64 %ans.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @comi() local_unnamed_addr #10 { entry: store i64 1, ptr getelementptr inbounds ([200010 x i64], ptr @fact, i64 0, i64 1), align 8, !tbaa !5 store i64 1, ptr @fact, align 16, !tbaa !5 store i64 1, ptr getelementptr inbounds ([200010 x i64], ptr @finv, i64 0, i64 1), align 8, !tbaa !5 store i64 1, ptr @finv, align 16, !tbaa !5 store i64 1, ptr getelementptr inbounds ([200010 x i64], ptr @inv, i64 0, i64 1), align 8, !tbaa !5 br label %for.body for.body: ; preds = %entry, %for.body %0 = phi i64 [ 1, %entry ], [ %rem12, %for.body ] %1 = phi i64 [ 1, %entry ], [ %rem, %for.body ] %i.026 = phi i64 [ 2, %entry ], [ %inc, %for.body ] %mul = mul nsw i64 %1, %i.026 %rem = srem i64 %mul, 1000000007 %arrayidx1 = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %i.026 store i64 %rem, ptr %arrayidx1, align 8, !tbaa !5 %rem2.rhs.trunc = trunc i64 %i.026 to i32 %rem224 = urem i32 1000000007, %rem2.rhs.trunc %rem2.zext = zext i32 %rem224 to i64 %arrayidx3 = getelementptr inbounds [200010 x i64], ptr @inv, i64 0, i64 %rem2.zext %2 = load i64, ptr %arrayidx3, align 8, !tbaa !5 %div25 = udiv i32 1000000007, %rem2.rhs.trunc %div.zext = zext i32 %div25 to i64 %mul4 = mul nsw i64 %2, %div.zext %rem5 = srem i64 %mul4, 1000000007 %sub6 = sub nsw i64 1000000007, %rem5 %arrayidx7 = getelementptr inbounds [200010 x i64], ptr @inv, i64 0, i64 %i.026 store i64 %sub6, ptr %arrayidx7, align 8, !tbaa !5 %mul11 = mul nuw nsw i64 %sub6, %0 %rem12 = urem i64 %mul11, 1000000007 %arrayidx13 = getelementptr inbounds [200010 x i64], ptr @finv, i64 0, i64 %i.026 store i64 %rem12, ptr %arrayidx13, align 8, !tbaa !5 %inc = add nuw nsw i64 %i.026, 1 %exitcond.not = icmp eq i64 %inc, 200010 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !16 for.end: ; preds = %for.body ret void } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @com(i64 noundef %n, i64 noundef %k) local_unnamed_addr #11 { entry: %cmp = icmp slt i64 %n, %k %0 = or i64 %k, %n %1 = icmp slt i64 %0, 0 %or.cond8 = or i1 %cmp, %1 br i1 %or.cond8, label %return, label %if.end if.end: ; preds = %entry %arrayidx = getelementptr inbounds [200010 x i64], ptr @fact, i64 0, i64 %n %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %arrayidx4 = getelementptr inbounds [200010 x i64], ptr @finv, i64 0, i64 %k %3 = load i64, ptr %arrayidx4, align 8, !tbaa !5 %sub = sub nsw i64 %n, %k %arrayidx5 = getelementptr inbounds [200010 x i64], ptr @finv, i64 0, i64 %sub %4 = load i64, ptr %arrayidx5, align 8, !tbaa !5 %mul = mul nsw i64 %4, %3 %rem = srem i64 %mul, 1000000007 %mul6 = mul nsw i64 %rem, %2 %rem7 = srem i64 %mul6, 1000000007 br label %return return: ; preds = %entry, %if.end %retval.0 = phi i64 [ %rem7, %if.end ], [ 0, %entry ] ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local void @sadd(i64 noundef %j, i64 noundef %i, i64 noundef %n) local_unnamed_addr #10 { entry: %0 = load i64, ptr @st, align 8, !tbaa !5 %sub = add i64 %i, -1 %add = add i64 %sub, %0 %arrayidx1 = getelementptr inbounds [26 x [1048576 x i64]], ptr @seg, i64 0, i64 %j, i64 %add %1 = load i64, ptr %arrayidx1, align 8, !tbaa !5 %add2 = add nsw i64 %1, %n store i64 %add2, ptr %arrayidx1, align 8, !tbaa !5 %cmp14 = icmp sgt i64 %add, 0 br i1 %cmp14, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %i.addr.015 = phi i64 [ %div13, %while.body ], [ %add, %entry ] %sub3 = add nsw i64 %i.addr.015, -1 %div13 = lshr i64 %sub3, 1 %arrayidx5 = getelementptr inbounds [26 x [1048576 x i64]], ptr @seg, i64 0, i64 %j, i64 %div13 %2 = load i64, ptr %arrayidx5, align 8, !tbaa !5 %add6 = add nsw i64 %2, %n store i64 %add6, ptr %arrayidx5, align 8, !tbaa !5 %cmp.not = icmp ult i64 %sub3, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !17 while.end: ; preds = %while.body, %entry ret void } ; Function Attrs: nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @ssum(i64 noundef %j, i64 noundef %a, i64 noundef %b, i64 noundef %k, i64 noundef %l, i64 noundef %r) local_unnamed_addr #12 { entry: %cmp.not = icmp sgt i64 %r, %a %cmp1.not36 = icmp sgt i64 %b, %l %or.cond37 = and i1 %cmp.not, %cmp1.not36 br i1 %or.cond37, label %if.end.lr.ph, label %return if.end.lr.ph: ; preds = %entry %cmp3.not = icmp sgt i64 %r, %b br i1 %cmp3.not, label %if.end.us, label %if.end if.end.us: ; preds = %if.end.lr.ph, %if.end.us %l.tr40.us = phi i64 [ %div.us, %if.end.us ], [ %l, %if.end.lr.ph ] %k.tr39.us = phi i64 [ %add9.us, %if.end.us ], [ %k, %if.end.lr.ph ] %accumulator.tr38.us = phi i64 [ %add13.us, %if.end.us ], [ 0, %if.end.lr.ph ] %mul.us = shl nsw i64 %k.tr39.us, 1 %add.us = or i64 %mul.us, 1 %add7.us = add nsw i64 %l.tr40.us, %r %div.us = sdiv i64 %add7.us, 2 %call.us = tail call i64 @ssum(i64 noundef %j, i64 noundef %a, i64 noundef %b, i64 noundef %add.us, i64 noundef %l.tr40.us, i64 noundef %div.us) %add9.us = add nsw i64 %mul.us, 2 %add13.us = add nsw i64 %call.us, %accumulator.tr38.us %cmp1.not.us = icmp slt i64 %div.us, %b br i1 %cmp1.not.us, label %if.end.us, label %return if.end: ; preds = %if.end.lr.ph, %if.end6 %l.tr40 = phi i64 [ %div, %if.end6 ], [ %l, %if.end.lr.ph ] %k.tr39 = phi i64 [ %add9, %if.end6 ], [ %k, %if.end.lr.ph ] %accumulator.tr38 = phi i64 [ %add13, %if.end6 ], [ 0, %if.end.lr.ph ] %cmp2.not = icmp slt i64 %l.tr40, %a br i1 %cmp2.not, label %if.end6, label %if.then4 if.then4: ; preds = %if.end %arrayidx5 = getelementptr inbounds [26 x [1048576 x i64]], ptr @seg, i64 0, i64 %j, i64 %k.tr39 %0 = load i64, ptr %arrayidx5, align 8, !tbaa !5 br label %return if.end6: ; preds = %if.end %mul = shl nsw i64 %k.tr39, 1 %add = or i64 %mul, 1 %add7 = add nsw i64 %l.tr40, %r %div = sdiv i64 %add7, 2 %call = tail call i64 @ssum(i64 noundef %j, i64 noundef %a, i64 noundef %b, i64 noundef %add, i64 noundef %l.tr40, i64 noundef %div) %add9 = add nsw i64 %mul, 2 %add13 = add nsw i64 %call, %accumulator.tr38 %cmp1.not = icmp slt i64 %div, %b br i1 %cmp1.not, label %if.end, label %return return: ; preds = %if.end6, %if.end.us, %entry, %if.then4 %accumulator.tr35 = phi i64 [ %accumulator.tr38, %if.then4 ], [ 0, %entry ], [ %add13.us, %if.end.us ], [ %add13, %if.end6 ] %retval.0 = phi i64 [ %0, %if.then4 ], [ 0, %entry ], [ 0, %if.end.us ], [ 0, %if.end6 ] %accumulator.ret.tr = add nsw i64 %retval.0, %accumulator.tr35 ret i64 %accumulator.ret.tr } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %N = alloca i64, align 8 %Q = alloca i64, align 8 %n = alloca i64, align 8 %i = alloca i64, align 8 %l = alloca i64, align 8 %r = alloca i64, align 8 %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %N) #17 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %Q) #17 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #17 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #17 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %l) #17 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %r) #17 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %N) %0 = load i64, ptr %N, align 8, !tbaa !5 %add = add nsw i64 %0, 1 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i8, i64 %add, align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #17 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %vla, ptr noundef nonnull %Q) %2 = load i64, ptr %N, align 8, !tbaa !5 %cmp3.i = icmp sgt i64 %2, 1 br i1 %cmp3.i, label %while.body.i, label %pwmn.exit while.body.i: ; preds = %entry, %while.body.i %ans.04.i = phi i64 [ %mul.i, %while.body.i ], [ 1, %entry ] %mul.i = shl nsw i64 %ans.04.i, 1 %cmp.i = icmp slt i64 %mul.i, %2 br i1 %cmp.i, label %while.body.i, label %pwmn.exit, !llvm.loop !9 pwmn.exit: ; preds = %while.body.i, %entry %ans.0.lcssa.i = phi i64 [ 1, %entry ], [ %mul.i, %while.body.i ] store i64 %ans.0.lcssa.i, ptr @st, align 8, !tbaa !5 %cmp78 = icmp sgt i64 %2, 0 br i1 %cmp78, label %for.body.lr.ph, label %for.cond4.preheader for.body.lr.ph: ; preds = %pwmn.exit %sub.i = add i64 %ans.0.lcssa.i, -1 br label %for.body for.cond4.preheader: ; preds = %sadd.exit, %pwmn.exit %invariant.gep = getelementptr i8, ptr %vla, i64 -1 %3 = load i64, ptr %Q, align 8, !tbaa !5 %cmp584 = icmp sgt i64 %3, 0 br i1 %cmp584, label %for.body7, label %for.end42 for.body: ; preds = %for.body.lr.ph, %sadd.exit %j.079 = phi i64 [ 0, %for.body.lr.ph ], [ %inc, %sadd.exit ] %arrayidx = getelementptr inbounds i8, ptr %vla, i64 %j.079 %4 = load i8, ptr %arrayidx, align 1, !tbaa !12 %conv = sext i8 %4 to i64 %sub = add nsw i64 %conv, -97 %add.i = add i64 %sub.i, %j.079 %arrayidx1.i = getelementptr inbounds [26 x [1048576 x i64]], ptr @seg, i64 0, i64 %sub, i64 %add.i %5 = load i64, ptr %arrayidx1.i, align 8, !tbaa !5 %add2.i = add nsw i64 %5, 1 store i64 %add2.i, ptr %arrayidx1.i, align 8, !tbaa !5 %cmp14.i = icmp sgt i64 %add.i, 0 br i1 %cmp14.i, label %while.body.i51, label %sadd.exit while.body.i51: ; preds = %for.body, %while.body.i51 %i.addr.015.i = phi i64 [ %div13.i, %while.body.i51 ], [ %add.i, %for.body ] %sub3.i = add nsw i64 %i.addr.015.i, -1 %div13.i = lshr i64 %sub3.i, 1 %arrayidx5.i = getelementptr inbounds [26 x [1048576 x i64]], ptr @seg, i64 0, i64 %sub, i64 %div13.i %6 = load i64, ptr %arrayidx5.i, align 8, !tbaa !5 %add6.i = add nsw i64 %6, 1 store i64 %add6.i, ptr %arrayidx5.i, align 8, !tbaa !5 %cmp.not.i = icmp ult i64 %sub3.i, 2 br i1 %cmp.not.i, label %sadd.exit, label %while.body.i51, !llvm.loop !17 sadd.exit: ; preds = %while.body.i51, %for.body %inc = add nuw nsw i64 %j.079, 1 %exitcond.not = icmp eq i64 %inc, %2 br i1 %exitcond.not, label %for.cond4.preheader, label %for.body, !llvm.loop !18 for.body7: ; preds = %for.cond4.preheader, %for.inc40 %j.185 = phi i64 [ %inc41, %for.inc40 ], [ 0, %for.cond4.preheader ] %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n) %7 = load i64, ptr %n, align 8, !tbaa !5 %cmp9 = icmp eq i64 %7, 1 br i1 %cmp9, label %if.then, label %if.else if.then: ; preds = %for.body7 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %i, ptr noundef nonnull %c) %8 = load i64, ptr %i, align 8, !tbaa !5 %gep = getelementptr i8, ptr %invariant.gep, i64 %8 %9 = load i8, ptr %gep, align 1, !tbaa !12 %conv14 = sext i8 %9 to i64 %sub15 = add nsw i64 %conv14, -97 %10 = load i64, ptr @st, align 8, !tbaa !5 %sub.i52 = add i64 %8, -2 %add.i53 = add i64 %sub.i52, %10 %arrayidx1.i54 = getelementptr inbounds [26 x [1048576 x i64]], ptr @seg, i64 0, i64 %sub15, i64 %add.i53 %11 = load i64, ptr %arrayidx1.i54, align 8, !tbaa !5 %add2.i55 = add nsw i64 %11, -1 store i64 %add2.i55, ptr %arrayidx1.i54, align 8, !tbaa !5 %cmp14.i56 = icmp sgt i64 %add.i53, 0 br i1 %cmp14.i56, label %while.body.i57, label %sadd.exit64 while.body.i57: ; preds = %if.then, %while.body.i57 %i.addr.015.i58 = phi i64 [ %div13.i60, %while.body.i57 ], [ %add.i53, %if.then ] %sub3.i59 = add nsw i64 %i.addr.015.i58, -1 %div13.i60 = lshr i64 %sub3.i59, 1 %arrayidx5.i61 = getelementptr inbounds [26 x [1048576 x i64]], ptr @seg, i64 0, i64 %sub15, i64 %div13.i60 %12 = load i64, ptr %arrayidx5.i61, align 8, !tbaa !5 %add6.i62 = add nsw i64 %12, -1 store i64 %add6.i62, ptr %arrayidx5.i61, align 8, !tbaa !5 %cmp.not.i63 = icmp ult i64 %sub3.i59, 2 br i1 %cmp.not.i63, label %sadd.exit64, label %while.body.i57, !llvm.loop !17 sadd.exit64: ; preds = %while.body.i57, %if.then %13 = load i8, ptr %c, align 1, !tbaa !12 store i8 %13, ptr %gep, align 1, !tbaa !12 %conv20 = sext i8 %13 to i64 %sub21 = add nsw i64 %conv20, -97 %arrayidx1.i67 = getelementptr inbounds [26 x [1048576 x i64]], ptr @seg, i64 0, i64 %sub21, i64 %add.i53 %14 = load i64, ptr %arrayidx1.i67, align 8, !tbaa !5 %add2.i68 = add nsw i64 %14, 1 store i64 %add2.i68, ptr %arrayidx1.i67, align 8, !tbaa !5 br i1 %cmp14.i56, label %while.body.i70, label %for.inc40 while.body.i70: ; preds = %sadd.exit64, %while.body.i70 %i.addr.015.i71 = phi i64 [ %div13.i73, %while.body.i70 ], [ %add.i53, %sadd.exit64 ] %sub3.i72 = add nsw i64 %i.addr.015.i71, -1 %div13.i73 = lshr i64 %sub3.i72, 1 %arrayidx5.i74 = getelementptr inbounds [26 x [1048576 x i64]], ptr @seg, i64 0, i64 %sub21, i64 %div13.i73 %15 = load i64, ptr %arrayidx5.i74, align 8, !tbaa !5 %add6.i75 = add nsw i64 %15, 1 store i64 %add6.i75, ptr %arrayidx5.i74, align 8, !tbaa !5 %cmp.not.i76 = icmp ult i64 %sub3.i72, 2 br i1 %cmp.not.i76, label %for.inc40, label %while.body.i70, !llvm.loop !17 if.else: ; preds = %for.body7 %call24 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %l, ptr noundef nonnull %r) %16 = load i64, ptr %l, align 8, !tbaa !5 %sub29 = add nsw i64 %16, -1 %17 = load i64, ptr %r, align 8, !tbaa !5 %18 = load i64, ptr @st, align 8, !tbaa !5 %call30 = call i64 @ssum(i64 noundef 0, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31 = icmp sgt i64 %call30, 0 %inc34 = zext i1 %cmp31 to i64 %call30.1 = call i64 @ssum(i64 noundef 1, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.1 = icmp sgt i64 %call30.1, 0 %inc34.1 = zext i1 %cmp31.1 to i64 %spec.select.1 = add nuw nsw i64 %inc34, %inc34.1 %call30.2 = call i64 @ssum(i64 noundef 2, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.2 = icmp sgt i64 %call30.2, 0 %inc34.2 = zext i1 %cmp31.2 to i64 %spec.select.2 = add nuw nsw i64 %spec.select.1, %inc34.2 %call30.3 = call i64 @ssum(i64 noundef 3, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.3 = icmp sgt i64 %call30.3, 0 %inc34.3 = zext i1 %cmp31.3 to i64 %spec.select.3 = add nuw nsw i64 %spec.select.2, %inc34.3 %call30.4 = call i64 @ssum(i64 noundef 4, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.4 = icmp sgt i64 %call30.4, 0 %inc34.4 = zext i1 %cmp31.4 to i64 %spec.select.4 = add nuw nsw i64 %spec.select.3, %inc34.4 %call30.5 = call i64 @ssum(i64 noundef 5, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.5 = icmp sgt i64 %call30.5, 0 %inc34.5 = zext i1 %cmp31.5 to i64 %spec.select.5 = add nuw nsw i64 %spec.select.4, %inc34.5 %call30.6 = call i64 @ssum(i64 noundef 6, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.6 = icmp sgt i64 %call30.6, 0 %inc34.6 = zext i1 %cmp31.6 to i64 %spec.select.6 = add nuw nsw i64 %spec.select.5, %inc34.6 %call30.7 = call i64 @ssum(i64 noundef 7, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.7 = icmp sgt i64 %call30.7, 0 %inc34.7 = zext i1 %cmp31.7 to i64 %spec.select.7 = add nuw nsw i64 %spec.select.6, %inc34.7 %call30.8 = call i64 @ssum(i64 noundef 8, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.8 = icmp sgt i64 %call30.8, 0 %inc34.8 = zext i1 %cmp31.8 to i64 %spec.select.8 = add nuw nsw i64 %spec.select.7, %inc34.8 %call30.9 = call i64 @ssum(i64 noundef 9, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.9 = icmp sgt i64 %call30.9, 0 %inc34.9 = zext i1 %cmp31.9 to i64 %spec.select.9 = add nuw nsw i64 %spec.select.8, %inc34.9 %call30.10 = call i64 @ssum(i64 noundef 10, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.10 = icmp sgt i64 %call30.10, 0 %inc34.10 = zext i1 %cmp31.10 to i64 %spec.select.10 = add nuw nsw i64 %spec.select.9, %inc34.10 %call30.11 = call i64 @ssum(i64 noundef 11, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.11 = icmp sgt i64 %call30.11, 0 %inc34.11 = zext i1 %cmp31.11 to i64 %spec.select.11 = add nuw nsw i64 %spec.select.10, %inc34.11 %call30.12 = call i64 @ssum(i64 noundef 12, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.12 = icmp sgt i64 %call30.12, 0 %inc34.12 = zext i1 %cmp31.12 to i64 %spec.select.12 = add nuw nsw i64 %spec.select.11, %inc34.12 %call30.13 = call i64 @ssum(i64 noundef 13, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.13 = icmp sgt i64 %call30.13, 0 %inc34.13 = zext i1 %cmp31.13 to i64 %spec.select.13 = add nuw nsw i64 %spec.select.12, %inc34.13 %call30.14 = call i64 @ssum(i64 noundef 14, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.14 = icmp sgt i64 %call30.14, 0 %inc34.14 = zext i1 %cmp31.14 to i64 %spec.select.14 = add nuw nsw i64 %spec.select.13, %inc34.14 %call30.15 = call i64 @ssum(i64 noundef 15, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.15 = icmp sgt i64 %call30.15, 0 %inc34.15 = zext i1 %cmp31.15 to i64 %spec.select.15 = add nuw nsw i64 %spec.select.14, %inc34.15 %call30.16 = call i64 @ssum(i64 noundef 16, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.16 = icmp sgt i64 %call30.16, 0 %inc34.16 = zext i1 %cmp31.16 to i64 %spec.select.16 = add nuw nsw i64 %spec.select.15, %inc34.16 %call30.17 = call i64 @ssum(i64 noundef 17, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.17 = icmp sgt i64 %call30.17, 0 %inc34.17 = zext i1 %cmp31.17 to i64 %spec.select.17 = add nuw nsw i64 %spec.select.16, %inc34.17 %call30.18 = call i64 @ssum(i64 noundef 18, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.18 = icmp sgt i64 %call30.18, 0 %inc34.18 = zext i1 %cmp31.18 to i64 %spec.select.18 = add nuw nsw i64 %spec.select.17, %inc34.18 %call30.19 = call i64 @ssum(i64 noundef 19, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.19 = icmp sgt i64 %call30.19, 0 %inc34.19 = zext i1 %cmp31.19 to i64 %spec.select.19 = add nuw nsw i64 %spec.select.18, %inc34.19 %call30.20 = call i64 @ssum(i64 noundef 20, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.20 = icmp sgt i64 %call30.20, 0 %inc34.20 = zext i1 %cmp31.20 to i64 %spec.select.20 = add nuw nsw i64 %spec.select.19, %inc34.20 %call30.21 = call i64 @ssum(i64 noundef 21, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.21 = icmp sgt i64 %call30.21, 0 %inc34.21 = zext i1 %cmp31.21 to i64 %spec.select.21 = add nuw nsw i64 %spec.select.20, %inc34.21 %call30.22 = call i64 @ssum(i64 noundef 22, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.22 = icmp sgt i64 %call30.22, 0 %inc34.22 = zext i1 %cmp31.22 to i64 %spec.select.22 = add nuw nsw i64 %spec.select.21, %inc34.22 %call30.23 = call i64 @ssum(i64 noundef 23, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.23 = icmp sgt i64 %call30.23, 0 %inc34.23 = zext i1 %cmp31.23 to i64 %spec.select.23 = add nuw nsw i64 %spec.select.22, %inc34.23 %call30.24 = call i64 @ssum(i64 noundef 24, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.24 = icmp sgt i64 %call30.24, 0 %inc34.24 = zext i1 %cmp31.24 to i64 %spec.select.24 = add nuw nsw i64 %spec.select.23, %inc34.24 %call30.25 = call i64 @ssum(i64 noundef 25, i64 noundef %sub29, i64 noundef %17, i64 noundef 0, i64 noundef 0, i64 noundef %18) %cmp31.25 = icmp sgt i64 %call30.25, 0 %inc34.25 = zext i1 %cmp31.25 to i64 %spec.select.25 = add nuw nsw i64 %spec.select.24, %inc34.25 %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i64 noundef %spec.select.25) br label %for.inc40 for.inc40: ; preds = %while.body.i70, %sadd.exit64, %if.else %inc41 = add nuw nsw i64 %j.185, 1 %19 = load i64, ptr %Q, align 8, !tbaa !5 %cmp5 = icmp slt i64 %inc41, %19 br i1 %cmp5, label %for.body7, label %for.end42, !llvm.loop !19 for.end42: ; preds = %for.inc40, %for.cond4.preheader call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #17 call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %r) #17 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #17 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #17 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #17 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %Q) #17 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #17 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() #13 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #13 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #14 ; 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 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nosync nounwind memory(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 = { 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 #8 = { 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 #9 = { 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 #10 = { 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 #11 = { 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 #12 = { nofree nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #13 = { mustprogress nocallback nofree nosync nounwind willreturn } 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 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = !{!7, !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include <stdio.h> int main() { int num[4] = { 0,-1,-1,-1 }; int N, M, s, c; scanf("%d %d", &N, &M); for (int i = 1;i <= M;i++) { scanf("%d %d", &s, &c); if (num[s] == -1 || num[s] == c) num[s] = c; else { printf("-1"); return 0; } } if (num[1] == 0) { if (N > 1) { printf("-1"); return 0; } } if (num[1] == -1) { if (N > 1) num[1] = 1; } for (int i = 1;i <= N;i++) { if (num[i] == -1) num[i] = 0; printf("%d", num[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119826/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119826/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @__const.main.num = private unnamed_addr constant [4 x i32] [i32 0, i32 -1, i32 -1, i32 -1], align 16 @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"-1\00", align 1 @.str.2 = 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: %num = alloca [4 x i32], align 16 %N = alloca i32, align 4 %M = alloca i32, align 4 %s = alloca i32, align 4 %c = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %num) #4 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %num, ptr noundef nonnull align 16 dereferenceable(16) @__const.main.num, i64 16, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M) %0 = load i32, ptr %M, align 4, !tbaa !5 %cmp.not56 = icmp slt i32 %0, 1 br i1 %cmp.not56, label %for.end.thread, label %for.body for.end.thread: ; preds = %entry %arrayidx961 = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 1 %1 = load i32, ptr %N, align 4 %cmp1263 = icmp sgt i32 %1, 1 br label %if.end16 for.body: ; preds = %entry, %if.then %i.057 = phi i32 [ %inc, %if.then ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %c) %2 = load i32, ptr %s, align 4, !tbaa !5 %idxprom = sext i32 %2 to i64 %arrayidx = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 %idxprom %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp2 = icmp eq i32 %3, -1 %4 = load i32, ptr %c, align 4 %cmp5 = icmp eq i32 %3, %4 %or.cond55 = select i1 %cmp2, i1 true, i1 %cmp5 br i1 %or.cond55, label %if.then, label %cleanup44.sink.split if.then: ; preds = %for.body store i32 %4, ptr %arrayidx, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.057, 1 %5 = load i32, ptr %M, align 4, !tbaa !5 %cmp.not.not = icmp slt i32 %i.057, %5 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %if.then %arrayidx9.phi.trans.insert = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 1 %.pre = load i32, ptr %arrayidx9.phi.trans.insert, align 4, !tbaa !5 %arrayidx9 = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 1 %cmp10 = icmp eq i32 %.pre, 0 %6 = load i32, ptr %N, align 4 %cmp12 = icmp sgt i32 %6, 1 %or.cond = select i1 %cmp10, i1 %cmp12, i1 false br i1 %or.cond, label %cleanup44.sink.split, label %if.end16 if.end16: ; preds = %for.end.thread, %for.end %cmp1266 = phi i1 [ %cmp1263, %for.end.thread ], [ %cmp12, %for.end ] %7 = phi i32 [ %1, %for.end.thread ], [ %6, %for.end ] %arrayidx965 = phi ptr [ %arrayidx961, %for.end.thread ], [ %arrayidx9, %for.end ] %8 = phi i32 [ -1, %for.end.thread ], [ %.pre, %for.end ] %cmp18 = icmp eq i32 %8, -1 %or.cond49 = select i1 %cmp18, i1 %cmp1266, i1 false br i1 %or.cond49, label %if.then21, label %if.end24 if.then21: ; preds = %if.end16 store i32 1, ptr %arrayidx965, align 4, !tbaa !5 br label %if.end24 if.end24: ; preds = %if.then21, %if.end16 %cmp27.not58 = icmp slt i32 %7, 1 br i1 %cmp27.not58, label %cleanup44, label %for.body29 for.body29: ; preds = %if.end24, %for.body29 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body29 ], [ 1, %if.end24 ] %arrayidx31 = getelementptr inbounds [4 x i32], ptr %num, i64 0, i64 %indvars.iv %9 = load i32, ptr %arrayidx31, align 4, !tbaa !5 %cmp32 = icmp eq i32 %9, -1 %spec.store.select = select i1 %cmp32, i32 0, i32 %9 store i32 %spec.store.select, ptr %arrayidx31, align 4 %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.store.select) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %10 = load i32, ptr %N, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp27.not.not = icmp slt i64 %indvars.iv, %11 br i1 %cmp27.not.not, label %for.body29, label %cleanup44, !llvm.loop !11 cleanup44.sink.split: ; preds = %for.body, %for.end %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1) br label %cleanup44 cleanup44: ; preds = %for.body29, %cleanup44.sink.split, %if.end24 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %num) #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: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main() { int a,b; scanf("%d %d",&a,&b); int i=0; while(1) { i++; a*=3; b*=2; if(a>b) break; } printf("%d",i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11987/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11987/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %while.cond, %entry %mul15 = phi i32 [ %b.promoted, %entry ], [ %mul1, %while.cond ] %mul4 = phi i32 [ %a.promoted, %entry ], [ %mul, %while.cond ] %i.0 = phi i32 [ 0, %entry ], [ %inc, %while.cond ] %inc = add nuw nsw i32 %i.0, 1 %mul = mul nsw i32 %mul4, 3 %mul1 = shl nsw i32 %mul15, 1 %cmp = icmp sgt i32 %mul, %mul1 br i1 %cmp, label %while.end, label %while.cond while.end: ; preds = %while.cond store i32 %mul, ptr %a, align 4, !tbaa !5 store i32 %mul1, ptr %b, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %inc) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <stdlib.h> int main() { int a,b; int x=0; scanf("%d%d",&a,&b); while(a<=b) { a*=3; b*=2; x++; } printf("%d",x); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11992/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11992/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %cmp.not6 = icmp sgt i32 %a.promoted, %b.promoted br i1 %cmp.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %x.09 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %mul48 = phi i32 [ %mul, %while.body ], [ %a.promoted, %entry ] %mul157 = phi i32 [ %mul1, %while.body ], [ %b.promoted, %entry ] %mul = mul nsw i32 %mul48, 3 %mul1 = shl nsw i32 %mul157, 1 %inc = add nuw nsw i32 %x.09, 1 %cmp.not = icmp sgt i32 %mul, %mul1 br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %mul, ptr %a, align 4, !tbaa !5 store i32 %mul1, ptr %b, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %x.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.0.lcssa) 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> #define ll long long int main(){ int n,k=1; scanf("%d",&n); ll a[n+1],b[n+1]; for(int i=1;i<=n;i++) scanf("%lld",&a[i]); ll c[n]; for(int i=1;i<n-1;i+=2){ c[k]=a[i]-a[i+1]; k++; } c[k]=a[n]; ll sum=0; for(int i=1;i<=k;i++) sum+=c[i]; b[1]=sum; for(int i=1;i<=n;i++){ if(i!=n) b[i+1]=a[i]-b[i]+a[i]; else b[n]=a[n]-b[1]+a[n]; } for(int i=1;i<=n;i++) printf("%lld ",b[i]); printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119970/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119970/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld \00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %add1 = add nsw i32 %3, 1 %4 = zext i32 %add1 to i64 %vla2 = alloca i64, i64 %4, align 16 %cmp.not101 = icmp slt i32 %3, 1 br i1 %cmp.not101, label %for.cond.cleanup.thread, label %for.body for.cond.cleanup.thread: ; preds = %entry %5 = zext i32 %3 to i64 %vla4137 = alloca i64, i64 %5, align 16 br label %for.cond.cleanup8 for.cond.cleanup: ; preds = %for.body %6 = zext i32 %22 to i64 %vla4 = alloca i64, i64 %6, align 16 %cmp7103 = icmp sgt i32 %22, 2 br i1 %cmp7103, label %for.body9.preheader, label %for.cond.cleanup8 for.body9.preheader: ; preds = %for.cond.cleanup %7 = add nsw i32 %22, -3 %8 = lshr i32 %7, 1 %9 = add nuw nsw i32 %8, 2 %wide.trip.count = zext i32 %9 to i64 %invariant.gep = getelementptr i64, ptr %vla, i64 1 %10 = lshr i32 %7, 1 %narrow = add nuw i32 %10, 1 %11 = zext i32 %narrow to i64 %min.iters.check = icmp ult i32 %7, 6 br i1 %min.iters.check, label %for.body9.preheader165, label %vector.ph vector.ph: ; preds = %for.body9.preheader %n.vec = and i64 %11, 4294967292 %ind.end = or i64 %n.vec, 1 %12 = shl nuw nsw i64 %n.vec, 1 %ind.end141 = or i64 %12, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %13 = shl i64 %index, 1 %offset.idx = or i64 %13, 1 %14 = or i64 %13, 5 %offset.idx143 = or i64 %index, 1 %15 = getelementptr inbounds i64, ptr %vla, i64 %offset.idx %16 = getelementptr inbounds i64, ptr %vla, i64 %14 %wide.vec = load <4 x i64>, ptr %15, align 8, !tbaa !9 %wide.vec144 = load <4 x i64>, ptr %16, align 8, !tbaa !9 %strided.vec = shufflevector <4 x i64> %wide.vec, <4 x i64> poison, <2 x i32> <i32 0, i32 2> %strided.vec145 = shufflevector <4 x i64> %wide.vec144, <4 x i64> poison, <2 x i32> <i32 0, i32 2> %strided.vec146 = shufflevector <4 x i64> %wide.vec, <4 x i64> poison, <2 x i32> <i32 1, i32 3> %strided.vec147 = shufflevector <4 x i64> %wide.vec144, <4 x i64> poison, <2 x i32> <i32 1, i32 3> %17 = sub nsw <2 x i64> %strided.vec, %strided.vec146 %18 = sub nsw <2 x i64> %strided.vec145, %strided.vec147 %19 = getelementptr inbounds i64, ptr %vla4, i64 %offset.idx143 store <2 x i64> %17, ptr %19, align 8, !tbaa !9 %20 = getelementptr inbounds i64, ptr %19, i64 2 store <2 x i64> %18, ptr %20, align 8, !tbaa !9 %index.next = add nuw i64 %index, 4 %21 = icmp eq i64 %index.next, %n.vec br i1 %21, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %11 br i1 %cmp.n, label %for.cond.cleanup8, label %for.body9.preheader165 for.body9.preheader165: ; preds = %for.body9.preheader, %middle.block %indvars.iv118.ph = phi i64 [ 1, %for.body9.preheader ], [ %ind.end, %middle.block ] %indvars.iv115.ph = phi i64 [ 1, %for.body9.preheader ], [ %ind.end141, %middle.block ] br label %for.body9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %22 = load i32, ptr %n, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %23 br i1 %cmp.not.not, label %for.body, label %for.cond.cleanup, !llvm.loop !15 for.cond.cleanup8: ; preds = %for.body9, %middle.block, %for.cond.cleanup, %for.cond.cleanup.thread %vla4139 = phi ptr [ %vla4137, %for.cond.cleanup.thread ], [ %vla4, %for.cond.cleanup ], [ %vla4, %middle.block ], [ %vla4, %for.body9 ] %24 = phi i64 [ %5, %for.cond.cleanup.thread ], [ %6, %for.cond.cleanup ], [ %6, %middle.block ], [ %6, %for.body9 ] %25 = phi i32 [ %3, %for.cond.cleanup.thread ], [ %22, %for.cond.cleanup ], [ %22, %middle.block ], [ %22, %for.body9 ] %k.0.lcssa = phi i32 [ 1, %for.cond.cleanup.thread ], [ 1, %for.cond.cleanup ], [ %9, %middle.block ], [ %9, %for.body9 ] %idxprom22 = sext i32 %25 to i64 %arrayidx23 = getelementptr inbounds i64, ptr %vla, i64 %idxprom22 %26 = load i64, ptr %arrayidx23, align 8, !tbaa !9 %idxprom24 = zext i32 %k.0.lcssa to i64 %arrayidx25 = getelementptr inbounds i64, ptr %vla4139, i64 %idxprom24 store i64 %26, ptr %arrayidx25, align 8, !tbaa !9 %27 = add nuw nsw i32 %k.0.lcssa, 1 %wide.trip.count126 = zext i32 %27 to i64 %28 = zext i32 %k.0.lcssa to i64 %min.iters.check150 = icmp ult i32 %k.0.lcssa, 4 br i1 %min.iters.check150, label %for.body30.preheader, label %vector.ph151 vector.ph151: ; preds = %for.cond.cleanup8 %n.vec153 = and i64 %28, 4294967292 %ind.end154 = or i64 %n.vec153, 1 br label %vector.body157 vector.body157: ; preds = %vector.body157, %vector.ph151 %index158 = phi i64 [ 0, %vector.ph151 ], [ %index.next162, %vector.body157 ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph151 ], [ %31, %vector.body157 ] %vec.phi159 = phi <2 x i64> [ zeroinitializer, %vector.ph151 ], [ %32, %vector.body157 ] %offset.idx160 = or i64 %index158, 1 %29 = getelementptr inbounds i64, ptr %vla4139, i64 %offset.idx160 %wide.load = load <2 x i64>, ptr %29, align 8, !tbaa !9 %30 = getelementptr inbounds i64, ptr %29, i64 2 %wide.load161 = load <2 x i64>, ptr %30, align 8, !tbaa !9 %31 = add <2 x i64> %wide.load, %vec.phi %32 = add <2 x i64> %wide.load161, %vec.phi159 %index.next162 = add nuw i64 %index158, 4 %33 = icmp eq i64 %index.next162, %n.vec153 br i1 %33, label %middle.block148, label %vector.body157, !llvm.loop !16 middle.block148: ; preds = %vector.body157 %bin.rdx = add <2 x i64> %32, %31 %34 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n156 = icmp eq i64 %n.vec153, %28 br i1 %cmp.n156, label %for.cond.cleanup29, label %for.body30.preheader for.body30.preheader: ; preds = %for.cond.cleanup8, %middle.block148 %indvars.iv123.ph = phi i64 [ 1, %for.cond.cleanup8 ], [ %ind.end154, %middle.block148 ] %sum.0107.ph = phi i64 [ 0, %for.cond.cleanup8 ], [ %34, %middle.block148 ] br label %for.body30 for.body9: ; preds = %for.body9.preheader165, %for.body9 %indvars.iv118 = phi i64 [ %indvars.iv.next119, %for.body9 ], [ %indvars.iv118.ph, %for.body9.preheader165 ] %indvars.iv115 = phi i64 [ %indvars.iv.next116, %for.body9 ], [ %indvars.iv115.ph, %for.body9.preheader165 ] %arrayidx11 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv115 %35 = load i64, ptr %arrayidx11, align 8, !tbaa !9 %gep = getelementptr i64, ptr %invariant.gep, i64 %indvars.iv115 %36 = load i64, ptr %gep, align 8, !tbaa !9 %sub15 = sub nsw i64 %35, %36 %arrayidx17 = getelementptr inbounds i64, ptr %vla4, i64 %indvars.iv118 store i64 %sub15, ptr %arrayidx17, align 8, !tbaa !9 %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1 %indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 2 %exitcond.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup8, label %for.body9, !llvm.loop !17 for.cond.cleanup29: ; preds = %for.body30, %middle.block148 %add33.lcssa = phi i64 [ %34, %middle.block148 ], [ %add33, %for.body30 ] %arrayidx37 = getelementptr inbounds i64, ptr %vla2, i64 1 store i64 %add33.lcssa, ptr %arrayidx37, align 8, !tbaa !9 %cmp40.not109 = icmp slt i32 %25, 1 br i1 %cmp40.not109, label %for.cond.cleanup70, label %for.body42.lr.ph for.body42.lr.ph: ; preds = %for.cond.cleanup29 %factor100 = shl i64 %26, 1 %arrayidx63 = getelementptr inbounds i64, ptr %vla2, i64 %idxprom22 %37 = add nuw i32 %25, 1 %wide.trip.count132 = zext i32 %37 to i64 br label %for.body42 for.body30: ; preds = %for.body30.preheader, %for.body30 %indvars.iv123 = phi i64 [ %indvars.iv.next124, %for.body30 ], [ %indvars.iv123.ph, %for.body30.preheader ] %sum.0107 = phi i64 [ %add33, %for.body30 ], [ %sum.0107.ph, %for.body30.preheader ] %arrayidx32 = getelementptr inbounds i64, ptr %vla4139, i64 %indvars.iv123 %38 = load i64, ptr %arrayidx32, align 8, !tbaa !9 %add33 = add nsw i64 %38, %sum.0107 %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1 %exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126 br i1 %exitcond127.not, label %for.cond.cleanup29, label %for.body30, !llvm.loop !18 for.cond68.preheader: ; preds = %for.inc64 br i1 %cmp40.not109, label %for.cond.cleanup70, label %for.body71 for.body42: ; preds = %for.body42.lr.ph, %for.inc64 %indvars.iv128 = phi i64 [ 1, %for.body42.lr.ph ], [ %indvars.iv.next129.pre-phi, %for.inc64 ] %cmp43.not = icmp eq i64 %indvars.iv128, %24 br i1 %cmp43.not, label %if.else, label %if.then if.then: ; preds = %for.body42 %arrayidx45 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv128 %39 = load i64, ptr %arrayidx45, align 8, !tbaa !9 %arrayidx47 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv128 %40 = load i64, ptr %arrayidx47, align 8, !tbaa !9 %factor = shl i64 %39, 1 %add51 = sub i64 %factor, %40 %41 = add nuw nsw i64 %indvars.iv128, 1 %arrayidx54 = getelementptr inbounds i64, ptr %vla2, i64 %41 store i64 %add51, ptr %arrayidx54, align 8, !tbaa !9 br label %for.inc64 if.else: ; preds = %for.body42 %42 = load i64, ptr %arrayidx37, align 8, !tbaa !9 %add61 = sub i64 %factor100, %42 store i64 %add61, ptr %arrayidx63, align 8, !tbaa !9 %.pre = add nuw nsw i64 %indvars.iv128, 1 br label %for.inc64 for.inc64: ; preds = %if.then, %if.else %indvars.iv.next129.pre-phi = phi i64 [ %41, %if.then ], [ %.pre, %if.else ] %exitcond133.not = icmp eq i64 %indvars.iv.next129.pre-phi, %wide.trip.count132 br i1 %exitcond133.not, label %for.cond68.preheader, label %for.body42, !llvm.loop !19 for.cond.cleanup70: ; preds = %for.body71, %for.cond.cleanup29, %for.cond68.preheader %putchar = call i32 @putchar(i32 10) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 for.body71: ; preds = %for.cond68.preheader, %for.body71 %indvars.iv134 = phi i64 [ %indvars.iv.next135, %for.body71 ], [ 1, %for.cond68.preheader ] %arrayidx73 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv134 %43 = load i64, ptr %arrayidx73, align 8, !tbaa !9 %call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %43) %indvars.iv.next135 = add nuw nsw i64 %indvars.iv134, 1 %44 = load i32, ptr %n, align 4, !tbaa !5 %45 = sext i32 %44 to i64 %cmp69.not.not = icmp slt i64 %indvars.iv134, %45 br i1 %cmp69.not.not, label %for.body71, label %for.cond.cleanup70, !llvm.loop !20 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = 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, !13, !14} !17 = distinct !{!17, !12, !14, !13} !18 = distinct !{!18, !12, !14, !13} !19 = distinct !{!19, !12} !20 = distinct !{!20, !12}
#include<stdio.h> int main(void){ long int n,a[200000],b[200000],i,j; scanf("%ld",&n); for(i=0;i<n;i++){ scanf("%ld",&a[i]); b[0]+=a[i]; } b[0]/=2; for(i=0;i<(n-1)/2;i++){ b[0]-=a[(1+2*i)%n]; } for(i=1;i<n;i++){ b[i]=a[i-1]-b[i-1]; } for(i=0;i<n;i++){ printf("%ld ",2*b[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120011/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120011/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \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 [200000 x i64], align 16 %b = alloca [200000 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 1600000, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp52 = icmp sgt i64 %0, 0 br i1 %cmp52, label %for.body, label %for.end36 for.body: ; preds = %entry, %for.body %i.053 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %1 = phi i64 [ %add, %for.body ], [ undef, %entry ] %arrayidx = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %i.053 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %2 = load i64, ptr %arrayidx, align 8, !tbaa !5 %add = add nsw i64 %1, %2 %inc = add nuw nsw i64 %i.053, 1 %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %4 = sdiv i64 %add, 2 %cmp757 = icmp sgt i64 %3, 2 br i1 %cmp757, label %for.body8.preheader, label %for.cond16.preheader for.body8.preheader: ; preds = %for.end %sub = add nsw i64 %3, -1 %div67172 = lshr i64 %sub, 1 %5 = icmp eq i64 %div67172, 1 br i1 %5, label %for.cond16.preheader.loopexit.unr-lcssa, label %for.body8.preheader.new for.body8.preheader.new: ; preds = %for.body8.preheader %unroll_iter = and i64 %div67172, 9223372036854775806 br label %for.body8 for.cond16.preheader.loopexit.unr-lcssa.loopexit: ; preds = %for.body8 %6 = shl nuw nsw i64 %inc14.1, 1 %7 = or i64 %6, 1 br label %for.cond16.preheader.loopexit.unr-lcssa for.cond16.preheader.loopexit.unr-lcssa: ; preds = %for.cond16.preheader.loopexit.unr-lcssa.loopexit, %for.body8.preheader %sub12.lcssa.ph = phi i64 [ undef, %for.body8.preheader ], [ %sub12.1, %for.cond16.preheader.loopexit.unr-lcssa.loopexit ] %i.158.unr = phi i64 [ 1, %for.body8.preheader ], [ %7, %for.cond16.preheader.loopexit.unr-lcssa.loopexit ] %.unr = phi i64 [ %4, %for.body8.preheader ], [ %sub12.1, %for.cond16.preheader.loopexit.unr-lcssa.loopexit ] %8 = and i64 %sub, 2 %lcmp.mod.not = icmp eq i64 %8, 0 br i1 %lcmp.mod.not, label %for.cond16.preheader, label %for.body8.epil for.body8.epil: ; preds = %for.cond16.preheader.loopexit.unr-lcssa %rem.epil = srem i64 %i.158.unr, %3 %arrayidx10.epil = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %rem.epil %9 = load i64, ptr %arrayidx10.epil, align 8, !tbaa !5 %sub12.epil = sub nsw i64 %.unr, %9 br label %for.cond16.preheader for.cond16.preheader: ; preds = %for.body8.epil, %for.cond16.preheader.loopexit.unr-lcssa, %for.end %.lcssa56 = phi i64 [ %4, %for.end ], [ %sub12.lcssa.ph, %for.cond16.preheader.loopexit.unr-lcssa ], [ %sub12.epil, %for.body8.epil ] store i64 %.lcssa56, ptr %b, align 16, !tbaa !5 %cmp1760 = icmp sgt i64 %3, 1 br i1 %cmp1760, label %for.body18.preheader, label %for.cond28.preheader for.body18.preheader: ; preds = %for.cond16.preheader %10 = add i64 %3, -1 %11 = add i64 %3, -2 %xtraiter74 = and i64 %10, 3 %12 = icmp ult i64 %11, 3 br i1 %12, label %for.cond28.preheader.loopexit.unr-lcssa, label %for.body18.preheader.new for.body18.preheader.new: ; preds = %for.body18.preheader %unroll_iter77 = and i64 %10, -4 br label %for.body18 for.body8: ; preds = %for.body8, %for.body8.preheader.new %i.158 = phi i64 [ 0, %for.body8.preheader.new ], [ %inc14.1, %for.body8 ] %13 = phi i64 [ %4, %for.body8.preheader.new ], [ %sub12.1, %for.body8 ] %niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.body8 ] %mul = shl nuw nsw i64 %i.158, 1 %add9 = or i64 %mul, 1 %rem = srem i64 %add9, %3 %arrayidx10 = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %rem %14 = load i64, ptr %arrayidx10, align 8, !tbaa !5 %inc14 = shl nuw i64 %i.158, 1 %add9.1 = or i64 %inc14, 3 %rem.1 = srem i64 %add9.1, %3 %arrayidx10.1 = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %rem.1 %15 = load i64, ptr %arrayidx10.1, align 8, !tbaa !5 %16 = add i64 %14, %15 %sub12.1 = sub i64 %13, %16 %inc14.1 = add nuw nsw i64 %i.158, 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.cond16.preheader.loopexit.unr-lcssa.loopexit, label %for.body8, !llvm.loop !11 for.cond28.preheader.loopexit.unr-lcssa: ; preds = %for.body18, %for.body18.preheader %.unr75 = phi i64 [ %.lcssa56, %for.body18.preheader ], [ %sub23.3, %for.body18 ] %i.261.unr = phi i64 [ 1, %for.body18.preheader ], [ %inc26.3, %for.body18 ] %lcmp.mod76.not = icmp eq i64 %xtraiter74, 0 br i1 %lcmp.mod76.not, label %for.cond28.preheader, label %for.body18.epil for.body18.epil: ; preds = %for.cond28.preheader.loopexit.unr-lcssa, %for.body18.epil %17 = phi i64 [ %sub23.epil, %for.body18.epil ], [ %.unr75, %for.cond28.preheader.loopexit.unr-lcssa ] %i.261.epil = phi i64 [ %inc26.epil, %for.body18.epil ], [ %i.261.unr, %for.cond28.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body18.epil ], [ 0, %for.cond28.preheader.loopexit.unr-lcssa ] %sub19.epil = add nsw i64 %i.261.epil, -1 %arrayidx20.epil = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %sub19.epil %18 = load i64, ptr %arrayidx20.epil, align 8, !tbaa !5 %sub23.epil = sub nsw i64 %18, %17 %arrayidx24.epil = getelementptr inbounds [200000 x i64], ptr %b, i64 0, i64 %i.261.epil store i64 %sub23.epil, ptr %arrayidx24.epil, align 8, !tbaa !5 %inc26.epil = add nuw nsw i64 %i.261.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter74 br i1 %epil.iter.cmp.not, label %for.cond28.preheader, label %for.body18.epil, !llvm.loop !12 for.cond28.preheader: ; preds = %for.cond28.preheader.loopexit.unr-lcssa, %for.body18.epil, %for.cond16.preheader %cmp2962 = icmp sgt i64 %3, 0 br i1 %cmp2962, label %for.body30, label %for.end36 for.body18: ; preds = %for.body18, %for.body18.preheader.new %19 = phi i64 [ %.lcssa56, %for.body18.preheader.new ], [ %sub23.3, %for.body18 ] %i.261 = phi i64 [ 1, %for.body18.preheader.new ], [ %inc26.3, %for.body18 ] %niter78 = phi i64 [ 0, %for.body18.preheader.new ], [ %niter78.next.3, %for.body18 ] %sub19 = add nsw i64 %i.261, -1 %arrayidx20 = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %sub19 %20 = load i64, ptr %arrayidx20, align 8, !tbaa !5 %sub23 = sub nsw i64 %20, %19 %arrayidx24 = getelementptr inbounds [200000 x i64], ptr %b, i64 0, i64 %i.261 store i64 %sub23, ptr %arrayidx24, align 8, !tbaa !5 %inc26 = add nuw nsw i64 %i.261, 1 %arrayidx20.1 = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %i.261 %21 = load i64, ptr %arrayidx20.1, align 8, !tbaa !5 %sub23.1 = sub nsw i64 %21, %sub23 %arrayidx24.1 = getelementptr inbounds [200000 x i64], ptr %b, i64 0, i64 %inc26 store i64 %sub23.1, ptr %arrayidx24.1, align 8, !tbaa !5 %inc26.1 = add nuw nsw i64 %i.261, 2 %sub19.2 = add nuw nsw i64 %i.261, 1 %arrayidx20.2 = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %sub19.2 %22 = load i64, ptr %arrayidx20.2, align 8, !tbaa !5 %sub23.2 = sub nsw i64 %22, %sub23.1 %arrayidx24.2 = getelementptr inbounds [200000 x i64], ptr %b, i64 0, i64 %inc26.1 store i64 %sub23.2, ptr %arrayidx24.2, align 8, !tbaa !5 %inc26.2 = add nuw nsw i64 %i.261, 3 %sub19.3 = add nuw nsw i64 %i.261, 2 %arrayidx20.3 = getelementptr inbounds [200000 x i64], ptr %a, i64 0, i64 %sub19.3 %23 = load i64, ptr %arrayidx20.3, align 8, !tbaa !5 %sub23.3 = sub nsw i64 %23, %sub23.2 %arrayidx24.3 = getelementptr inbounds [200000 x i64], ptr %b, i64 0, i64 %inc26.2 store i64 %sub23.3, ptr %arrayidx24.3, align 8, !tbaa !5 %inc26.3 = add nuw nsw i64 %i.261, 4 %niter78.next.3 = add nuw i64 %niter78, 4 %niter78.ncmp.3 = icmp eq i64 %niter78.next.3, %unroll_iter77 br i1 %niter78.ncmp.3, label %for.cond28.preheader.loopexit.unr-lcssa, label %for.body18, !llvm.loop !14 for.body30: ; preds = %for.cond28.preheader, %for.body30 %i.363 = phi i64 [ %inc35, %for.body30 ], [ 0, %for.cond28.preheader ] %arrayidx31 = getelementptr inbounds [200000 x i64], ptr %b, i64 0, i64 %i.363 %24 = load i64, ptr %arrayidx31, align 8, !tbaa !5 %mul32 = shl nsw i64 %24, 1 %call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %mul32) %inc35 = add nuw nsw i64 %i.363, 1 %25 = load i64, ptr %n, align 8, !tbaa !5 %cmp29 = icmp slt i64 %inc35, %25 br i1 %cmp29, label %for.body30, label %for.end36, !llvm.loop !15 for.end36: ; preds = %for.body30, %entry, %for.cond28.preheader call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 1600000, ptr nonnull %a) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10}
#include <stdio.h> #include <string.h> #include <stdbool.h> #include <stdint.h> #include <stdlib.h> #include <limits.h> #include <math.h> int acs(const void *a, const void *b) { return *(int *)a - *(int *)b; } /* 1,2,3,4.. */ int des(const void *a, const void *b) { return *(int *)b - *(int *)a; } /* 8,7,6,5.. */ int cmp_char(const void *a, const void *b) { return *(char *)a - *(char *)b; } /* a,b,c,d.. */ int cmp_str(const void *a, const void *b) { return strcmp(*(const char **)a, *(const char **)b); } /* aaa,aab.. */ #define min(a, b) (a < b ? a : b) #define max(a, b) (a > b ? a : b) #define rep(i, l, r) for (int i = l; i < r; i++) #define MAX 100001 #define MOD 1000000007 typedef long long int lli; int main(void) { int n, k; char s[MAX]; scanf("%d %d %s", &n, &k, s); int nsize = 0, num[MAX]; // 1-0-...-0-1と並ぶ配列 int now = 1; // 今見ている数 int cnt = 0; // 今見ている数の連続して並んでいる数 rep(i, 0, n) { if (s[i] == (char)('0' + now)) cnt++; else { num[nsize++] = cnt; now = 1 - now; cnt = 1; } } num[nsize++] = cnt; // 最後が0で終わっている場合(1-0-...1-0) // 最後を1で終わっている配列にする(1-0-...-0-1) if (nsize % 2 == 0) num[nsize++] = 0; /********** 尺取法 ***********/ // int range = 2 * k + 1; // 尺 // int ans = 0; // int left = 0; // int right = 0; // int tmp = 0; // [left, right)のsum(仮ans) // for (int i = 0; i < nsize; i += 2) { // 左端に合わせてループ // int nleft = i; // int nright = min(nleft + range, nsize); // // 左差分を計算 // while (left < nleft) { // tmp -= num[left]; // left++; // } // // 右差分を計算 // while (right < nright) { // tmp += num[right]; // right++; // } // ans = max(ans, tmp); // } /********** 累積和 ***********/ // 累積和を計算 // sum: 0 2 3 5 7 // num: 2 1 2 2 // num[left, right)の和 = sum[right] - sum[left] int sum[MAX]; sum[0] = 0; rep(i, 0, nsize + 1) { sum[i + 1] = sum[i] + num[i]; } int ans = 0; int range = 2 * k + 1; // 1-0-1-...-0-1の1に着目するため、2ずつ足していく for (int i = 0; i < nsize; i += 2) { int left = i; int right = min(i + range, nsize); ans = max(ans, sum[right] - sum[left]); } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120055/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120055/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %s\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 @acs(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @des(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_char(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !9 %conv = sext i8 %0 to i32 %1 = load i8, ptr %b, align 1, !tbaa !9 %conv1 = sext i8 %1 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; Function Attrs: mustprogress nofree nounwind willreturn memory(read, inaccessiblemem: none) uwtable define dso_local i32 @cmp_str(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #1 { entry: %0 = load ptr, ptr %a, align 8, !tbaa !10 %1 = load ptr, ptr %b, align 8, !tbaa !10 %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) %1) #7 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %k = alloca i32, align 4 %s = alloca [100001 x i8], align 16 %num = alloca [100001 x i32], align 16 %sum = alloca [100001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #8 call void @llvm.lifetime.start.p0(i64 100001, ptr nonnull %s) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k, ptr noundef nonnull %s) call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %num) #8 %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp94 = icmp sgt i32 %0, 0 br i1 %cmp94, label %for.body.preheader, label %if.end18.thread if.end18.thread: ; preds = %entry store i32 0, ptr %num, align 16, !tbaa !5 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %sum) #8 store i32 0, ptr %sum, align 16, !tbaa !5 br label %for.body26.preheader for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %0 to i64 br label %for.body for.cond.cleanup: ; preds = %for.inc %inc9 = add nsw i32 %nsize.1, 1 %idxprom10 = sext i32 %nsize.1 to i64 %arrayidx11 = getelementptr inbounds [100001 x i32], ptr %num, i64 0, i64 %idxprom10 store i32 %cnt.1, ptr %arrayidx11, align 4, !tbaa !5 %1 = and i32 %inc9, 1 %cmp12 = icmp eq i32 %1, 0 br i1 %cmp12, label %if.then14, label %if.end18 for.body: ; preds = %for.body.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ] %nsize.098 = phi i32 [ 0, %for.body.preheader ], [ %nsize.1, %for.inc ] %now.097 = phi i32 [ 1, %for.body.preheader ], [ %now.1, %for.inc ] %cnt.096 = phi i32 [ 0, %for.body.preheader ], [ %cnt.1, %for.inc ] %arrayidx = getelementptr inbounds [100001 x i8], ptr %s, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx, align 1, !tbaa !9 %conv = sext i8 %2 to i32 %conv1 = add nuw nsw i32 %now.097, 48 %conv2 = and i32 %conv1, 255 %cmp3 = icmp eq i32 %conv2, %conv br i1 %cmp3, label %if.then, label %if.else if.then: ; preds = %for.body %inc = add nsw i32 %cnt.096, 1 br label %for.inc if.else: ; preds = %for.body %inc5 = add nsw i32 %nsize.098, 1 %idxprom6 = sext i32 %nsize.098 to i64 %arrayidx7 = getelementptr inbounds [100001 x i32], ptr %num, i64 0, i64 %idxprom6 store i32 %cnt.096, ptr %arrayidx7, align 4, !tbaa !5 %sub = sub nuw nsw i32 1, %now.097 br label %for.inc for.inc: ; preds = %if.then, %if.else %cnt.1 = phi i32 [ %inc, %if.then ], [ 1, %if.else ] %now.1 = phi i32 [ %now.097, %if.then ], [ %sub, %if.else ] %nsize.1 = phi i32 [ %nsize.098, %if.then ], [ %inc5, %if.else ] %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12 if.then14: ; preds = %for.cond.cleanup %inc15 = add nsw i32 %nsize.1, 2 %idxprom16 = sext i32 %inc9 to i64 %arrayidx17 = getelementptr inbounds [100001 x i32], ptr %num, i64 0, i64 %idxprom16 store i32 0, ptr %arrayidx17, align 4, !tbaa !5 br label %if.end18 if.end18: ; preds = %if.then14, %for.cond.cleanup %nsize.2 = phi i32 [ %inc15, %if.then14 ], [ %inc9, %for.cond.cleanup ] call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %sum) #8 store i32 0, ptr %sum, align 16, !tbaa !5 %cmp23.not100 = icmp slt i32 %nsize.2, 0 br i1 %cmp23.not100, label %for.cond.cleanup43, label %for.body26.preheader for.body26.preheader: ; preds = %if.end18.thread, %if.end18 %nsize.2123 = phi i32 [ 1, %if.end18.thread ], [ %nsize.2, %if.end18 ] %3 = add nuw i32 %nsize.2123, 1 %wide.trip.count110 = zext i32 %3 to i64 %xtraiter = and i64 %wide.trip.count110, 3 %4 = icmp ult i32 %nsize.2123, 3 br i1 %4, label %for.cond.cleanup25.unr-lcssa, label %for.body26.preheader.new for.body26.preheader.new: ; preds = %for.body26.preheader %unroll_iter = and i64 %wide.trip.count110, 4294967292 br label %for.body26 for.cond.cleanup25.unr-lcssa: ; preds = %for.body26, %for.body26.preheader %.unr = phi i32 [ 0, %for.body26.preheader ], [ %add31.3, %for.body26 ] %indvars.iv107.unr = phi i64 [ 0, %for.body26.preheader ], [ %indvars.iv.next108.3, %for.body26 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup25, label %for.body26.epil for.body26.epil: ; preds = %for.cond.cleanup25.unr-lcssa, %for.body26.epil %5 = phi i32 [ %add31.epil, %for.body26.epil ], [ %.unr, %for.cond.cleanup25.unr-lcssa ] %indvars.iv107.epil = phi i64 [ %indvars.iv.next108.epil, %for.body26.epil ], [ %indvars.iv107.unr, %for.cond.cleanup25.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body26.epil ], [ 0, %for.cond.cleanup25.unr-lcssa ] %arrayidx30.epil = getelementptr inbounds [100001 x i32], ptr %num, i64 0, i64 %indvars.iv107.epil %6 = load i32, ptr %arrayidx30.epil, align 4, !tbaa !5 %add31.epil = add nsw i32 %6, %5 %indvars.iv.next108.epil = add nuw nsw i64 %indvars.iv107.epil, 1 %arrayidx34.epil = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %indvars.iv.next108.epil store i32 %add31.epil, ptr %arrayidx34.epil, align 4, !tbaa !5 %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.cleanup25, label %for.body26.epil, !llvm.loop !14 for.cond.cleanup25: ; preds = %for.body26.epil, %for.cond.cleanup25.unr-lcssa %7 = load i32, ptr %k, align 4, !tbaa !5 %mul = shl nsw i32 %7, 1 %add38 = or i32 %mul, 1 %cmp41102.not = icmp eq i32 %nsize.2123, 0 br i1 %cmp41102.not, label %for.cond.cleanup43, label %for.body44.preheader for.body44.preheader: ; preds = %for.cond.cleanup25 %8 = zext i32 %nsize.2123 to i64 %9 = add nsw i64 %8, -1 %10 = lshr i64 %9, 1 %11 = add nuw i64 %10, 1 %xtraiter129 = and i64 %11, 1 %12 = icmp ult i32 %nsize.2123, 3 br i1 %12, label %for.cond.cleanup43.loopexit.unr-lcssa, label %for.body44.preheader.new for.body44.preheader.new: ; preds = %for.body44.preheader %unroll_iter133 = and i64 %11, -2 br label %for.body44 for.body26: ; preds = %for.body26, %for.body26.preheader.new %13 = phi i32 [ 0, %for.body26.preheader.new ], [ %add31.3, %for.body26 ] %indvars.iv107 = phi i64 [ 0, %for.body26.preheader.new ], [ %indvars.iv.next108.3, %for.body26 ] %niter = phi i64 [ 0, %for.body26.preheader.new ], [ %niter.next.3, %for.body26 ] %arrayidx30 = getelementptr inbounds [100001 x i32], ptr %num, i64 0, i64 %indvars.iv107 %14 = load i32, ptr %arrayidx30, align 16, !tbaa !5 %add31 = add nsw i32 %14, %13 %indvars.iv.next108 = or i64 %indvars.iv107, 1 %arrayidx34 = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %indvars.iv.next108 store i32 %add31, ptr %arrayidx34, align 4, !tbaa !5 %arrayidx30.1 = getelementptr inbounds [100001 x i32], ptr %num, i64 0, i64 %indvars.iv.next108 %15 = load i32, ptr %arrayidx30.1, align 4, !tbaa !5 %add31.1 = add nsw i32 %15, %add31 %indvars.iv.next108.1 = or i64 %indvars.iv107, 2 %arrayidx34.1 = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %indvars.iv.next108.1 store i32 %add31.1, ptr %arrayidx34.1, align 8, !tbaa !5 %arrayidx30.2 = getelementptr inbounds [100001 x i32], ptr %num, i64 0, i64 %indvars.iv.next108.1 %16 = load i32, ptr %arrayidx30.2, align 8, !tbaa !5 %add31.2 = add nsw i32 %16, %add31.1 %indvars.iv.next108.2 = or i64 %indvars.iv107, 3 %arrayidx34.2 = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %indvars.iv.next108.2 store i32 %add31.2, ptr %arrayidx34.2, align 4, !tbaa !5 %arrayidx30.3 = getelementptr inbounds [100001 x i32], ptr %num, i64 0, i64 %indvars.iv.next108.2 %17 = load i32, ptr %arrayidx30.3, align 4, !tbaa !5 %add31.3 = add nsw i32 %17, %add31.2 %indvars.iv.next108.3 = add nuw nsw i64 %indvars.iv107, 4 %arrayidx34.3 = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %indvars.iv.next108.3 store i32 %add31.3, ptr %arrayidx34.3, align 16, !tbaa !5 %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.cleanup25.unr-lcssa, label %for.body26, !llvm.loop !16 for.cond.cleanup43.loopexit.unr-lcssa: ; preds = %for.body44, %for.body44.preheader %ans.0.sub53.lcssa.ph = phi i32 [ undef, %for.body44.preheader ], [ %ans.0.sub53.1, %for.body44 ] %indvars.iv112.unr = phi i64 [ 0, %for.body44.preheader ], [ %indvars.iv.next113.1, %for.body44 ] %ans.0103.unr = phi i32 [ 0, %for.body44.preheader ], [ %ans.0.sub53.1, %for.body44 ] %lcmp.mod131.not = icmp eq i64 %xtraiter129, 0 br i1 %lcmp.mod131.not, label %for.cond.cleanup43, label %for.body44.epil for.body44.epil: ; preds = %for.cond.cleanup43.loopexit.unr-lcssa %18 = trunc i64 %indvars.iv112.unr to i32 %add45.epil = add nsw i32 %add38, %18 %cond.epil = call i32 @llvm.smin.i32(i32 %add45.epil, i32 %nsize.2123) %idxprom49.epil = sext i32 %cond.epil to i64 %arrayidx50.epil = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %idxprom49.epil %19 = load i32, ptr %arrayidx50.epil, align 4, !tbaa !5 %arrayidx52.epil = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %indvars.iv112.unr %20 = load i32, ptr %arrayidx52.epil, align 8, !tbaa !5 %sub53.epil = sub nsw i32 %19, %20 %ans.0.sub53.epil = call i32 @llvm.smax.i32(i32 %ans.0103.unr, i32 %sub53.epil) br label %for.cond.cleanup43 for.cond.cleanup43: ; preds = %for.body44.epil, %for.cond.cleanup43.loopexit.unr-lcssa, %if.end18, %for.cond.cleanup25 %ans.0.lcssa = phi i32 [ 0, %for.cond.cleanup25 ], [ 0, %if.end18 ], [ %ans.0.sub53.lcssa.ph, %for.cond.cleanup43.loopexit.unr-lcssa ], [ %ans.0.sub53.epil, %for.body44.epil ] %call68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %sum) #8 call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %num) #8 call void @llvm.lifetime.end.p0(i64 100001, ptr nonnull %s) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 ret i32 0 for.body44: ; preds = %for.body44, %for.body44.preheader.new %indvars.iv112 = phi i64 [ 0, %for.body44.preheader.new ], [ %indvars.iv.next113.1, %for.body44 ] %ans.0103 = phi i32 [ 0, %for.body44.preheader.new ], [ %ans.0.sub53.1, %for.body44 ] %niter134 = phi i64 [ 0, %for.body44.preheader.new ], [ %niter134.next.1, %for.body44 ] %21 = trunc i64 %indvars.iv112 to i32 %add45 = add nsw i32 %add38, %21 %cond = call i32 @llvm.smin.i32(i32 %add45, i32 %nsize.2123) %idxprom49 = sext i32 %cond to i64 %arrayidx50 = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %idxprom49 %22 = load i32, ptr %arrayidx50, align 4, !tbaa !5 %arrayidx52 = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %indvars.iv112 %23 = load i32, ptr %arrayidx52, align 16, !tbaa !5 %sub53 = sub nsw i32 %22, %23 %ans.0.sub53 = call i32 @llvm.smax.i32(i32 %ans.0103, i32 %sub53) %indvars.iv.next113 = or i64 %indvars.iv112, 2 %24 = trunc i64 %indvars.iv.next113 to i32 %add45.1 = add nsw i32 %add38, %24 %cond.1 = call i32 @llvm.smin.i32(i32 %add45.1, i32 %nsize.2123) %idxprom49.1 = sext i32 %cond.1 to i64 %arrayidx50.1 = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %idxprom49.1 %25 = load i32, ptr %arrayidx50.1, align 4, !tbaa !5 %arrayidx52.1 = getelementptr inbounds [100001 x i32], ptr %sum, i64 0, i64 %indvars.iv.next113 %26 = load i32, ptr %arrayidx52.1, align 8, !tbaa !5 %sub53.1 = sub nsw i32 %25, %26 %ans.0.sub53.1 = call i32 @llvm.smax.i32(i32 %ans.0.sub53, i32 %sub53.1) %indvars.iv.next113.1 = add nuw nsw i64 %indvars.iv112, 4 %niter134.next.1 = add nuw nsw i64 %niter134, 2 %niter134.ncmp.1.not = icmp eq i64 %niter134.next.1, %unroll_iter133 br i1 %niter134.ncmp.1.not, label %for.cond.cleanup43.loopexit.unr-lcssa, label %for.body44, !llvm.loop !17 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree nounwind willreturn memory(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 #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind willreturn memory(read) } 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 = !{!"int", !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 = !{!"any pointer", !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"} !16 = distinct !{!16, !13} !17 = distinct !{!17, !13}
#include <stdio.h> int max(int a,int b) {return a>b?a:b;} int run(int *u, int l, int k) { int s[100001] = {u[0]}, m = u[0], i; for(i = 1; i < l; i++) { s[i] = s[i - 1] + u[i]; if(!(i % 2) && i >= k*2) { m = max(m, s[i] - (i - k*2 - 1 >= 0 ? s[i - k*2 - 1] : 0)); } else if(i == l - 1) m = max(m, s[i] - (i - k*2 >= 0 ? s[i - k*2] : 0)); } return m; } int main() { int n, k, s[100000], u[100001], l = 0, m, c = 1, i; char t; scanf("%d %d ", &n, &k); for(i = 0; i < n; i++) { scanf("%c", &t); s[i] = t - '0'; if(!i) { m = s[i]; if(!m) u[l++] = 0; } else if(s[i] == m) c++; else { u[l++] = c; m = !m; c = 1; } } u[l++] = c; printf("%d", run(u, l, k)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120099/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120099/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%c\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"%d\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 nosync nounwind memory(argmem: read) uwtable define dso_local i32 @run(ptr nocapture noundef readonly %u, i32 noundef %l, i32 noundef %k) local_unnamed_addr #1 { entry: %s = alloca [100001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %s) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %s, i8 0, i64 400004, i1 false) %0 = load i32, ptr %u, align 4, !tbaa !5 store i32 %0, ptr %s, align 16, !tbaa !5 %cmp62 = icmp sgt i32 %l, 1 br i1 %cmp62, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %mul = shl nsw i32 %k, 1 %1 = xor i32 %mul, -1 %sub20 = add nsw i32 %l, -1 %2 = sext i32 %mul to i64 %3 = zext i32 %sub20 to i64 %wide.trip.count = zext i32 %l to i64 %4 = sub nsw i64 %3, %2 %cmp27 = icmp sgt i64 %4, -1 %idxprom31 = and i64 %4, 4294967295 %arrayidx32 = getelementptr inbounds [100001 x i32], ptr %s, i64 0, i64 %idxprom31 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %5 = phi i32 [ %0, %for.body.lr.ph ], [ %add, %for.inc ] %indvars.iv = phi i64 [ 1, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ] %m.063 = phi i32 [ %0, %for.body.lr.ph ], [ %m.1, %for.inc ] %arrayidx4 = getelementptr inbounds i32, ptr %u, i64 %indvars.iv %6 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %add = add nsw i32 %6, %5 %arrayidx6 = getelementptr inbounds [100001 x i32], ptr %s, i64 0, i64 %indvars.iv store i32 %add, ptr %arrayidx6, align 4, !tbaa !5 %7 = trunc i64 %indvars.iv to i32 %rem = and i32 %7, 1 %tobool.not = icmp ne i32 %rem, 0 %cmp7.not = icmp slt i64 %indvars.iv, %2 %or.cond = select i1 %tobool.not, i1 true, i1 %cmp7.not br i1 %or.cond, label %if.else, label %if.then if.then: ; preds = %for.body %sub12 = add i32 %7, %1 %cmp13 = icmp sgt i32 %sub12, -1 br i1 %cmp13, label %cond.true, label %cond.end cond.true: ; preds = %if.then %idxprom17 = zext i32 %sub12 to i64 %arrayidx18 = getelementptr inbounds [100001 x i32], ptr %s, i64 0, i64 %idxprom17 %8 = load i32, ptr %arrayidx18, align 4, !tbaa !5 br label %cond.end cond.end: ; preds = %if.then, %cond.true %cond = phi i32 [ %8, %cond.true ], [ 0, %if.then ] %sub19 = sub nsw i32 %add, %cond %cond.i = tail call i32 @llvm.smax.i32(i32 %m.063, i32 %sub19) br label %for.inc if.else: ; preds = %for.body %cmp21 = icmp eq i64 %indvars.iv, %3 br i1 %cmp21, label %if.then22, label %for.inc if.then22: ; preds = %if.else br i1 %cmp27, label %cond.true28, label %cond.end34 cond.true28: ; preds = %if.then22 %9 = load i32, ptr %arrayidx32, align 4, !tbaa !5 br label %cond.end34 cond.end34: ; preds = %if.then22, %cond.true28 %cond35 = phi i32 [ %9, %cond.true28 ], [ 0, %if.then22 ] %sub36 = sub nsw i32 %add, %cond35 %cond.i61 = tail call i32 @llvm.smax.i32(i32 %m.063, i32 %sub36) br label %for.inc for.inc: ; preds = %cond.end, %cond.end34, %if.else %m.1 = phi i32 [ %cond.i61, %cond.end34 ], [ %m.063, %if.else ], [ %cond.i, %cond.end ] %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 !9 for.end: ; preds = %for.inc, %entry %m.0.lcssa = phi i32 [ %0, %entry ], [ %m.1, %for.inc ] call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %s) #7 ret i32 %m.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #4 { entry: %s.i = alloca [100001 x i32], align 16 %n = alloca i32, align 4 %k = alloca i32, align 4 %u = alloca [100001 x i32], align 16 %t = alloca i8, align 1 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 void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %u) #7 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %t) #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 %cmp39 = icmp sgt i32 %0, 0 br i1 %cmp39, label %if.then.peel, label %for.end if.then.peel: ; preds = %entry %call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t) %1 = load i8, ptr %t, align 1, !tbaa !11 %conv.peel = sext i8 %1 to i32 %sub.peel = add nsw i32 %conv.peel, -48 %tobool4.not.peel = icmp eq i32 %sub.peel, 0 br i1 %tobool4.not.peel, label %if.then5.peel, label %for.inc.peel if.then5.peel: ; preds = %if.then.peel store i32 0, ptr %u, align 16, !tbaa !5 br label %for.inc.peel for.inc.peel: ; preds = %if.then5.peel, %if.then.peel %l.1.peel = phi i32 [ 0, %if.then.peel ], [ 1, %if.then5.peel ] %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp.peel = icmp sgt i32 %2, 1 br i1 %cmp.peel, label %if.else, label %for.end if.else: ; preds = %for.inc.peel, %for.inc %i.043 = phi i32 [ %inc21, %for.inc ], [ 1, %for.inc.peel ] %c.042 = phi i32 [ %c.1, %for.inc ], [ 1, %for.inc.peel ] %m.041 = phi i32 [ %m.1, %for.inc ], [ %sub.peel, %for.inc.peel ] %l.040 = phi i32 [ %l.1, %for.inc ], [ %l.1.peel, %for.inc.peel ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t) %3 = load i8, ptr %t, align 1, !tbaa !11 %conv = sext i8 %3 to i32 %sub = add nsw i32 %conv, -48 %cmp10 = icmp eq i32 %sub, %m.041 br i1 %cmp10, label %if.then12, label %if.else14 if.then12: ; preds = %if.else %inc13 = add nsw i32 %c.042, 1 br label %for.inc if.else14: ; preds = %if.else %inc15 = add nsw i32 %l.040, 1 %idxprom16 = sext i32 %l.040 to i64 %arrayidx17 = getelementptr inbounds [100001 x i32], ptr %u, i64 0, i64 %idxprom16 store i32 %c.042, ptr %arrayidx17, align 4, !tbaa !5 %tobool18.not = icmp eq i32 %m.041, 0 %lnot.ext = zext i1 %tobool18.not to i32 br label %for.inc for.inc: ; preds = %if.else14, %if.then12 %l.1 = phi i32 [ %l.040, %if.then12 ], [ %inc15, %if.else14 ] %m.1 = phi i32 [ %m.041, %if.then12 ], [ %lnot.ext, %if.else14 ] %c.1 = phi i32 [ %inc13, %if.then12 ], [ 1, %if.else14 ] %inc21 = add nuw nsw i32 %i.043, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc21, %4 br i1 %cmp, label %if.else, label %for.end, !llvm.loop !12 for.end: ; preds = %for.inc, %for.inc.peel, %entry %l.0.lcssa = phi i32 [ 0, %entry ], [ %l.1.peel, %for.inc.peel ], [ %l.1, %for.inc ] %c.0.lcssa = phi i32 [ 1, %entry ], [ 1, %for.inc.peel ], [ %c.1, %for.inc ] %idxprom23 = sext i32 %l.0.lcssa to i64 %arrayidx24 = getelementptr inbounds [100001 x i32], ptr %u, i64 0, i64 %idxprom23 store i32 %c.0.lcssa, ptr %arrayidx24, align 4, !tbaa !5 %5 = load i32, ptr %k, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 400004, ptr nonnull %s.i) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400004) %s.i, i8 0, i64 400004, i1 false) %6 = load i32, ptr %u, align 16, !tbaa !5 store i32 %6, ptr %s.i, align 16, !tbaa !5 %cmp62.i = icmp sgt i32 %l.0.lcssa, 0 br i1 %cmp62.i, label %for.body.lr.ph.i, label %run.exit for.body.lr.ph.i: ; preds = %for.end %inc22 = add nuw nsw i32 %l.0.lcssa, 1 %mul.i = shl nsw i32 %5, 1 %7 = xor i32 %mul.i, -1 %8 = sext i32 %mul.i to i64 %9 = zext i32 %l.0.lcssa to i64 %wide.trip.count.i = zext i32 %inc22 to i64 %10 = sub nsw i64 %9, %8 %.fr = freeze i64 %10 %cmp27.i = icmp sgt i64 %.fr, -1 %idxprom31.i = and i64 %.fr, 4294967295 %arrayidx32.i = getelementptr inbounds [100001 x i32], ptr %s.i, i64 0, i64 %idxprom31.i br i1 %cmp27.i, label %for.body.i.us, label %for.body.i for.body.i.us: ; preds = %for.body.lr.ph.i, %for.inc.i.us %11 = phi i32 [ %add.i.us, %for.inc.i.us ], [ %6, %for.body.lr.ph.i ] %indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %for.inc.i.us ], [ 1, %for.body.lr.ph.i ] %m.063.i.us = phi i32 [ %m.1.i.us, %for.inc.i.us ], [ %6, %for.body.lr.ph.i ] %arrayidx4.i.us = getelementptr inbounds i32, ptr %u, i64 %indvars.iv.i.us %12 = load i32, ptr %arrayidx4.i.us, align 4, !tbaa !5 %add.i.us = add nsw i32 %12, %11 %arrayidx6.i.us = getelementptr inbounds [100001 x i32], ptr %s.i, i64 0, i64 %indvars.iv.i.us store i32 %add.i.us, ptr %arrayidx6.i.us, align 4, !tbaa !5 %13 = trunc i64 %indvars.iv.i.us to i32 %rem.i.us = and i32 %13, 1 %tobool.not.i.us = icmp ne i32 %rem.i.us, 0 %cmp7.not.i.us = icmp slt i64 %indvars.iv.i.us, %8 %or.cond.i.us = select i1 %tobool.not.i.us, i1 true, i1 %cmp7.not.i.us br i1 %or.cond.i.us, label %if.else.i.us, label %if.then.i.us if.then.i.us: ; preds = %for.body.i.us %sub12.i.us = add i32 %13, %7 %cmp13.i.us = icmp sgt i32 %sub12.i.us, -1 br i1 %cmp13.i.us, label %cond.true.i.us, label %cond.end.i.us cond.true.i.us: ; preds = %if.then.i.us %idxprom17.i.us = zext i32 %sub12.i.us to i64 %arrayidx18.i.us = getelementptr inbounds [100001 x i32], ptr %s.i, i64 0, i64 %idxprom17.i.us %14 = load i32, ptr %arrayidx18.i.us, align 4, !tbaa !5 br label %cond.end.i.us cond.end.i.us: ; preds = %cond.true.i.us, %if.then.i.us %cond.i.us = phi i32 [ %14, %cond.true.i.us ], [ 0, %if.then.i.us ] %sub19.i.us = sub nsw i32 %add.i.us, %cond.i.us %cond.i.i.us = call i32 @llvm.smax.i32(i32 %m.063.i.us, i32 %sub19.i.us) br label %for.inc.i.us if.else.i.us: ; preds = %for.body.i.us %cmp21.i.us = icmp eq i64 %indvars.iv.i.us, %9 br i1 %cmp21.i.us, label %if.then22.i.us, label %for.inc.i.us if.then22.i.us: ; preds = %if.else.i.us %15 = load i32, ptr %arrayidx32.i, align 4, !tbaa !5 %sub36.i.us = sub nsw i32 %add.i.us, %15 %cond.i61.i.us = call i32 @llvm.smax.i32(i32 %m.063.i.us, i32 %sub36.i.us) br label %for.inc.i.us for.inc.i.us: ; preds = %if.then22.i.us, %if.else.i.us, %cond.end.i.us %m.1.i.us = phi i32 [ %cond.i61.i.us, %if.then22.i.us ], [ %m.063.i.us, %if.else.i.us ], [ %cond.i.i.us, %cond.end.i.us ] %indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1 %exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i br i1 %exitcond.not.i.us, label %run.exit, label %for.body.i.us, !llvm.loop !9 for.body.i: ; preds = %for.body.lr.ph.i, %for.inc.i %16 = phi i32 [ %add.i, %for.inc.i ], [ %6, %for.body.lr.ph.i ] %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.inc.i ], [ 1, %for.body.lr.ph.i ] %m.063.i = phi i32 [ %m.1.i, %for.inc.i ], [ %6, %for.body.lr.ph.i ] %arrayidx4.i = getelementptr inbounds i32, ptr %u, i64 %indvars.iv.i %17 = load i32, ptr %arrayidx4.i, align 4, !tbaa !5 %add.i = add nsw i32 %17, %16 %arrayidx6.i = getelementptr inbounds [100001 x i32], ptr %s.i, i64 0, i64 %indvars.iv.i store i32 %add.i, ptr %arrayidx6.i, align 4, !tbaa !5 %18 = trunc i64 %indvars.iv.i to i32 %rem.i = and i32 %18, 1 %tobool.not.i = icmp ne i32 %rem.i, 0 %cmp7.not.i = icmp slt i64 %indvars.iv.i, %8 %or.cond.i = select i1 %tobool.not.i, i1 true, i1 %cmp7.not.i br i1 %or.cond.i, label %if.else.i, label %if.then.i if.then.i: ; preds = %for.body.i %sub12.i = add i32 %18, %7 %cmp13.i = icmp sgt i32 %sub12.i, -1 br i1 %cmp13.i, label %cond.true.i, label %cond.end.i cond.true.i: ; preds = %if.then.i %idxprom17.i = zext i32 %sub12.i to i64 %arrayidx18.i = getelementptr inbounds [100001 x i32], ptr %s.i, i64 0, i64 %idxprom17.i %19 = load i32, ptr %arrayidx18.i, align 4, !tbaa !5 br label %cond.end.i cond.end.i: ; preds = %cond.true.i, %if.then.i %cond.i = phi i32 [ %19, %cond.true.i ], [ 0, %if.then.i ] %sub19.i = sub nsw i32 %add.i, %cond.i %cond.i.i = call i32 @llvm.smax.i32(i32 %m.063.i, i32 %sub19.i) br label %for.inc.i if.else.i: ; preds = %for.body.i %cmp21.i = icmp eq i64 %indvars.iv.i, %9 br i1 %cmp21.i, label %if.then22.i, label %for.inc.i if.then22.i: ; preds = %if.else.i %cond.i61.i = call i32 @llvm.smax.i32(i32 %m.063.i, i32 %add.i) br label %for.inc.i for.inc.i: ; preds = %if.then22.i, %if.else.i, %cond.end.i %m.1.i = phi i32 [ %cond.i61.i, %if.then22.i ], [ %m.063.i, %if.else.i ], [ %cond.i.i, %cond.end.i ] %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %run.exit, label %for.body.i, !llvm.loop !9 run.exit: ; preds = %for.inc.i, %for.inc.i.us, %for.end %m.0.lcssa.i = phi i32 [ %6, %for.end ], [ %m.1.i.us, %for.inc.i.us ], [ %m.1.i, %for.inc.i ] call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %s.i) #7 %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %m.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %t) #7 call void @llvm.lifetime.end.p0(i64 400004, ptr nonnull %u) #7 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } 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 = !{!7, !7, i64 0} !12 = distinct !{!12, !10, !13} !13 = !{!"llvm.loop.peeled.count", i32 1}
#include<stdio.h> #include<string.h> #define cmp(day) strcmp(s,day)==0 int main() { char s[4]; scanf("%s",s); if(cmp("SUN")) puts("7"); else if(cmp("MON")) puts("6"); else if(cmp("TUE")) puts("5"); else if(cmp("WED")) puts("4"); else if(cmp("THU")) puts("3"); else if(cmp("FRI")) puts("2"); else puts("1"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120141/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120141/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"SUN\00", align 1 @.str.2 = private unnamed_addr constant [2 x i8] c"7\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"MON\00", align 1 @.str.4 = private unnamed_addr constant [2 x i8] c"6\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"TUE\00", align 1 @.str.6 = private unnamed_addr constant [2 x i8] c"5\00", align 1 @.str.7 = private unnamed_addr constant [4 x i8] c"WED\00", align 1 @.str.8 = private unnamed_addr constant [2 x i8] c"4\00", align 1 @.str.9 = private unnamed_addr constant [4 x i8] c"THU\00", align 1 @.str.10 = private unnamed_addr constant [2 x i8] c"3\00", align 1 @.str.11 = private unnamed_addr constant [4 x i8] c"FRI\00", align 1 @.str.12 = private unnamed_addr constant [2 x i8] c"2\00", align 1 @.str.13 = 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 [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.1, i64 4) %cmp = icmp eq i32 %bcmp, 0 br i1 %cmp, label %if.end39, label %if.else if.else: ; preds = %entry %bcmp40 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.3, i64 4) %cmp6 = icmp eq i32 %bcmp40, 0 br i1 %cmp6, label %if.end39, label %if.else9 if.else9: ; preds = %if.else %bcmp41 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.5, i64 4) %cmp12 = icmp eq i32 %bcmp41, 0 br i1 %cmp12, label %if.end39, label %if.else15 if.else15: ; preds = %if.else9 %bcmp42 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.7, i64 4) %cmp18 = icmp eq i32 %bcmp42, 0 br i1 %cmp18, label %if.end39, label %if.else21 if.else21: ; preds = %if.else15 %bcmp43 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.9, i64 4) %cmp24 = icmp eq i32 %bcmp43, 0 br i1 %cmp24, label %if.end39, label %if.else27 if.else27: ; preds = %if.else21 %bcmp44 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %s, ptr noundef nonnull dereferenceable(4) @.str.11, i64 4) %cmp30 = icmp eq i32 %bcmp44, 0 %.str.12..str.13 = select i1 %cmp30, ptr @.str.12, ptr @.str.13 br label %if.end39 if.end39: ; preds = %if.else27, %if.else21, %if.else15, %if.else9, %if.else, %entry %.str.4.sink = phi ptr [ @.str.2, %entry ], [ @.str.4, %if.else ], [ @.str.6, %if.else9 ], [ @.str.8, %if.else15 ], [ @.str.10, %if.else21 ], [ %.str.12..str.13, %if.else27 ] %call8 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.4.sink) call void @llvm.lifetime.end.p0(i64 4, 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 @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: 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)"}
#include <stdio.h> #include <stdlib.h> #include <math.h> #include <limits.h> #include <string.h> int main() { char *array[7]={"MON","TUE","WED","THU","FRI","SAT","SUN"}; char test[3]; int idx = 0; scanf("%s",&test); for (int i=0;i<7;i++){ if (strcmp(test,array[i])==0){ idx=i; break;} } if (idx+1==7){printf("7");} else { printf("%d",7-(idx+1)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120185/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120185/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"MON\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"TUE\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"WED\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"THU\00", align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"FRI\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"SAT\00", align 1 @.str.6 = private unnamed_addr constant [4 x i8] c"SUN\00", align 1 @.str.7 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.9 = 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: %test = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %test) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.7, ptr noundef nonnull %test) %call1 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %test, ptr noundef nonnull dereferenceable(4) @.str) #6 %cmp2 = icmp eq i32 %call1, 0 br i1 %cmp2, label %if.else, label %for.inc for.inc: ; preds = %entry %call1.1 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %test, ptr noundef nonnull dereferenceable(4) @.str.1) #6 %cmp2.1 = icmp eq i32 %call1.1, 0 br i1 %cmp2.1, label %if.else, label %for.inc.1 for.inc.1: ; preds = %for.inc %call1.2 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %test, ptr noundef nonnull dereferenceable(4) @.str.2) #6 %cmp2.2 = icmp eq i32 %call1.2, 0 br i1 %cmp2.2, label %if.else, label %for.inc.2 for.inc.2: ; preds = %for.inc.1 %call1.3 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %test, ptr noundef nonnull dereferenceable(4) @.str.3) #6 %cmp2.3 = icmp eq i32 %call1.3, 0 br i1 %cmp2.3, label %if.else, label %for.inc.3 for.inc.3: ; preds = %for.inc.2 %call1.4 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %test, ptr noundef nonnull dereferenceable(4) @.str.4) #6 %cmp2.4 = icmp eq i32 %call1.4, 0 br i1 %cmp2.4, label %if.else, label %for.inc.4 for.inc.4: ; preds = %for.inc.3 %call1.5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %test, ptr noundef nonnull dereferenceable(4) @.str.5) #6 %cmp2.5 = icmp eq i32 %call1.5, 0 br i1 %cmp2.5, label %if.else, label %for.inc.5 for.inc.5: ; preds = %for.inc.4 %call1.6 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %test, ptr noundef nonnull dereferenceable(4) @.str.6) #6 %cmp2.6 = icmp eq i32 %call1.6, 0 br i1 %cmp2.6, label %if.then4, label %if.else if.then4: ; preds = %for.inc.5 %putchar = call i32 @putchar(i32 55) br label %if.end8 if.else: ; preds = %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry, %for.inc.5 %idx.018.neg = phi i32 [ 6, %for.inc.5 ], [ 1, %for.inc.4 ], [ 2, %for.inc.3 ], [ 3, %for.inc.2 ], [ 4, %for.inc.1 ], [ 5, %for.inc ], [ 6, %entry ] %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %idx.018.neg) br label %if.end8 if.end8: ; preds = %if.else, %if.then4 call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %test) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress 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 #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)"}
#include<stdio.h> int main(void){ char s[4], date[8][4]={"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"}; scanf("%s",s); for(int i=0;i<7;i++){ if(date[i][0] == s[0] && date[i][1] ==s[1]){ printf("%d\n", 7-i); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120228/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120228/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %arrayidx10 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1 %0 = load i8, ptr %s, align 1, !tbaa !5 %cmp4 = icmp eq i8 %0, 83 br i1 %cmp4, label %land.lhs.true, label %for.inc land.lhs.true: ; preds = %entry %1 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %cmp12 = icmp eq i8 %1, 85 br i1 %cmp12, label %if.then, label %land.lhs.true.6 if.then: ; preds = %land.lhs.true %call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 7) %.pre = load i8, ptr %s, align 1, !tbaa !5 br label %for.inc for.inc: ; preds = %entry, %if.then %2 = phi i8 [ %0, %entry ], [ %.pre, %if.then ] %cmp4.1 = icmp eq i8 %2, 77 br i1 %cmp4.1, label %land.lhs.true.1, label %for.inc.1 land.lhs.true.1: ; preds = %for.inc %3 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %cmp12.1 = icmp eq i8 %3, 79 br i1 %cmp12.1, label %if.then.1, label %for.inc.6 if.then.1: ; preds = %land.lhs.true.1 %call14.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 6) %.pre22 = load i8, ptr %s, align 1, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %4 = phi i8 [ %.pre22, %if.then.1 ], [ %2, %for.inc ] %cmp4.2 = icmp eq i8 %4, 84 br i1 %cmp4.2, label %land.lhs.true.2, label %for.inc.2 land.lhs.true.2: ; preds = %for.inc.1 %5 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %cmp12.2 = icmp eq i8 %5, 85 br i1 %cmp12.2, label %if.then.2, label %land.lhs.true.4 if.then.2: ; preds = %land.lhs.true.2 %call14.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 5) %.pre23 = load i8, ptr %s, align 1, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %6 = phi i8 [ %.pre23, %if.then.2 ], [ %4, %for.inc.1 ] %cmp4.3 = icmp eq i8 %6, 87 br i1 %cmp4.3, label %land.lhs.true.3, label %for.inc.3 land.lhs.true.3: ; preds = %for.inc.2 %7 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %cmp12.3 = icmp eq i8 %7, 69 br i1 %cmp12.3, label %if.then.3, label %for.inc.6 if.then.3: ; preds = %land.lhs.true.3 %call14.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 4) %.pre24 = load i8, ptr %s, align 1, !tbaa !5 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.inc.2 %8 = phi i8 [ %.pre24, %if.then.3 ], [ %6, %for.inc.2 ] %cmp4.4 = icmp eq i8 %8, 84 br i1 %cmp4.4, label %land.lhs.true.4thread-pre-split, label %for.inc.4 land.lhs.true.4thread-pre-split: ; preds = %for.inc.3 %.pr = load i8, ptr %arrayidx10, align 1, !tbaa !5 br label %land.lhs.true.4 land.lhs.true.4: ; preds = %land.lhs.true.2, %land.lhs.true.4thread-pre-split %9 = phi i8 [ %.pr, %land.lhs.true.4thread-pre-split ], [ %5, %land.lhs.true.2 ] %cmp12.4 = icmp eq i8 %9, 72 br i1 %cmp12.4, label %if.then.4, label %for.inc.6 if.then.4: ; preds = %land.lhs.true.4 %call14.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 3) %.pre25 = load i8, ptr %s, align 1, !tbaa !5 br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.inc.3 %10 = phi i8 [ %.pre25, %if.then.4 ], [ %8, %for.inc.3 ] %cmp4.5 = icmp eq i8 %10, 70 br i1 %cmp4.5, label %land.lhs.true.5, label %for.inc.5 land.lhs.true.5: ; preds = %for.inc.4 %11 = load i8, ptr %arrayidx10, align 1, !tbaa !5 %cmp12.5 = icmp eq i8 %11, 82 br i1 %cmp12.5, label %if.then.5, label %for.inc.6 if.then.5: ; preds = %land.lhs.true.5 %call14.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 2) %.pre26 = load i8, ptr %s, align 1, !tbaa !5 br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.inc.4 %12 = phi i8 [ %.pre26, %if.then.5 ], [ %10, %for.inc.4 ] %cmp4.6 = icmp eq i8 %12, 83 br i1 %cmp4.6, label %land.lhs.true.6thread-pre-split, label %for.inc.6 land.lhs.true.6thread-pre-split: ; preds = %for.inc.5 %.pr46 = load i8, ptr %arrayidx10, align 1, !tbaa !5 br label %land.lhs.true.6 land.lhs.true.6: ; preds = %land.lhs.true, %land.lhs.true.6thread-pre-split %13 = phi i8 [ %.pr46, %land.lhs.true.6thread-pre-split ], [ %1, %land.lhs.true ] %cmp12.6 = icmp eq i8 %13, 65 br i1 %cmp12.6, label %if.then.6, label %for.inc.6 if.then.6: ; preds = %land.lhs.true.6 %call14.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 1) br label %for.inc.6 for.inc.6: ; preds = %land.lhs.true.1, %land.lhs.true.3, %land.lhs.true.4, %land.lhs.true.5, %if.then.6, %land.lhs.true.6, %for.inc.5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
// Ver19.03 #include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #define INF (1 << 29) * 2 #define LLINF 4545454545454545454 #define MOD 1000000007 #define ll long long #define ull unsigned long long #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) 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); } int main() { char a[5]; scanf("%s", a); if (strcmp(a, "SUN") == 0) printf("7\n"); if (strcmp(a, "MON") == 0) printf("6\n"); if (strcmp(a, "TUE") == 0) printf("5\n"); if (strcmp(a, "WED") == 0) printf("4\n"); if (strcmp(a, "THU") == 0) printf("3\n"); if (strcmp(a, "FRI") == 0) printf("2\n"); if (strcmp(a, "SAT") == 0) printf("1\n"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120286/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120286/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"SUN\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"MON\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"TUE\00", align 1 @.str.7 = private unnamed_addr constant [4 x i8] c"WED\00", align 1 @.str.9 = private unnamed_addr constant [4 x i8] c"THU\00", align 1 @.str.11 = private unnamed_addr constant [4 x i8] c"FRI\00", align 1 @.str.13 = private unnamed_addr constant [4 x i8] c"SAT\00", align 1 @str = private unnamed_addr constant [2 x i8] c"7\00", align 1 @str.15 = private unnamed_addr constant [2 x i8] c"6\00", align 1 @str.16 = private unnamed_addr constant [2 x i8] c"5\00", align 1 @str.17 = private unnamed_addr constant [2 x i8] c"4\00", align 1 @str.18 = private unnamed_addr constant [2 x i8] c"3\00", align 1 @str.19 = private unnamed_addr constant [2 x i8] c"2\00", align 1 @str.20 = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; 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) #0 { 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) #0 { 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 #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @upll) #7 ret void } ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @sortdown(ptr noundef %a, i32 noundef %n) local_unnamed_addr #1 { entry: %conv = sext i32 %n to i64 tail call void @qsort(ptr noundef %a, i64 noundef %conv, i64 noundef 8, ptr noundef nonnull @downll) #7 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %a = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %a) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %a, ptr noundef nonnull dereferenceable(4) @.str.1, i64 4) %cmp = icmp eq i32 %bcmp, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end if.end: ; preds = %if.then, %entry %bcmp40 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %a, ptr noundef nonnull dereferenceable(4) @.str.3, i64 4) %cmp6 = icmp eq i32 %bcmp40, 0 br i1 %cmp6, label %if.then7, label %if.end9 if.then7: ; preds = %if.end %puts41 = call i32 @puts(ptr nonnull dereferenceable(1) @str.15) br label %if.end9 if.end9: ; preds = %if.then7, %if.end %bcmp42 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %a, ptr noundef nonnull dereferenceable(4) @.str.5, i64 4) %cmp12 = icmp eq i32 %bcmp42, 0 br i1 %cmp12, label %if.then13, label %if.end15 if.then13: ; preds = %if.end9 %puts43 = call i32 @puts(ptr nonnull dereferenceable(1) @str.16) br label %if.end15 if.end15: ; preds = %if.then13, %if.end9 %bcmp44 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %a, ptr noundef nonnull dereferenceable(4) @.str.7, i64 4) %cmp18 = icmp eq i32 %bcmp44, 0 br i1 %cmp18, label %if.then19, label %if.end21 if.then19: ; preds = %if.end15 %puts45 = call i32 @puts(ptr nonnull dereferenceable(1) @str.17) br label %if.end21 if.end21: ; preds = %if.then19, %if.end15 %bcmp46 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %a, ptr noundef nonnull dereferenceable(4) @.str.9, i64 4) %cmp24 = icmp eq i32 %bcmp46, 0 br i1 %cmp24, label %if.then25, label %if.end27 if.then25: ; preds = %if.end21 %puts47 = call i32 @puts(ptr nonnull dereferenceable(1) @str.18) br label %if.end27 if.end27: ; preds = %if.then25, %if.end21 %bcmp48 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %a, ptr noundef nonnull dereferenceable(4) @.str.11, i64 4) %cmp30 = icmp eq i32 %bcmp48, 0 br i1 %cmp30, label %if.then31, label %if.end33 if.then31: ; preds = %if.end27 %puts49 = call i32 @puts(ptr nonnull dereferenceable(1) @str.19) br label %if.end33 if.end33: ; preds = %if.then31, %if.end27 %bcmp50 = call i32 @bcmp(ptr noundef nonnull dereferenceable(4) %a, ptr noundef nonnull dereferenceable(4) @.str.13, i64 4) %cmp36 = icmp eq i32 %bcmp50, 0 br i1 %cmp36, label %if.then37, label %if.end39 if.then37: ; preds = %if.end33 %puts51 = call i32 @puts(ptr nonnull dereferenceable(1) @str.20) br label %if.end39 if.end39: ; preds = %if.then37, %if.end33 call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %a) #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) #3 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree nounwind willreturn memory(argmem: read) declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #5 ; 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind willreturn memory(argmem: read) } 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 = !{!"long long", !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[3]; scanf("%s", S); if (!strcmp(S, "SUN")) { printf("7\n"); } else if (!strcmp(S, "MON")) { printf("6\n"); } else if (!strcmp(S, "TUE")) { printf("5\n"); } else if (!strcmp(S, "WED")) { printf("4\n"); } else if (!strcmp(S, "THU")) { printf("3\n"); } else if (!strcmp(S, "FRI")) { printf("2\n"); } else if (!strcmp(S, "SAT")) { printf("1\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120336/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120336/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"SUN\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"MON\00", align 1 @.str.5 = private unnamed_addr constant [4 x i8] c"TUE\00", align 1 @.str.7 = private unnamed_addr constant [4 x i8] c"WED\00", align 1 @.str.9 = private unnamed_addr constant [4 x i8] c"THU\00", align 1 @.str.11 = private unnamed_addr constant [4 x i8] c"FRI\00", align 1 @.str.13 = private unnamed_addr constant [4 x i8] c"SAT\00", align 1 @str = private unnamed_addr constant [2 x i8] c"7\00", align 1 @str.15 = private unnamed_addr constant [2 x i8] c"6\00", align 1 @str.16 = private unnamed_addr constant [2 x i8] c"5\00", align 1 @str.17 = private unnamed_addr constant [2 x i8] c"4\00", align 1 @str.18 = private unnamed_addr constant [2 x i8] c"3\00", align 1 @str.19 = private unnamed_addr constant [2 x i8] c"2\00", align 1 @str.20 = 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 [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %S) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %call2 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(4) @.str.1) #6 %tobool.not = icmp eq i32 %call2, 0 br i1 %tobool.not, label %if.end44.sink.split, label %if.else if.else: ; preds = %entry %call5 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(4) @.str.3) #6 %tobool6.not = icmp eq i32 %call5, 0 br i1 %tobool6.not, label %if.end44.sink.split, label %if.else9 if.else9: ; preds = %if.else %call11 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(4) @.str.5) #6 %tobool12.not = icmp eq i32 %call11, 0 br i1 %tobool12.not, label %if.end44.sink.split, label %if.else15 if.else15: ; preds = %if.else9 %call17 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(4) @.str.7) #6 %tobool18.not = icmp eq i32 %call17, 0 br i1 %tobool18.not, label %if.end44.sink.split, label %if.else21 if.else21: ; preds = %if.else15 %call23 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(4) @.str.9) #6 %tobool24.not = icmp eq i32 %call23, 0 br i1 %tobool24.not, label %if.end44.sink.split, label %if.else27 if.else27: ; preds = %if.else21 %call29 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(4) @.str.11) #6 %tobool30.not = icmp eq i32 %call29, 0 br i1 %tobool30.not, label %if.end44.sink.split, label %if.else33 if.else33: ; preds = %if.else27 %call35 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %S, ptr noundef nonnull dereferenceable(4) @.str.13) #6 %tobool36.not = icmp eq i32 %call35, 0 br i1 %tobool36.not, label %if.end44.sink.split, label %if.end44 if.end44.sink.split: ; preds = %if.else33, %if.else27, %if.else21, %if.else15, %if.else9, %if.else, %entry %str.15.sink = phi ptr [ @str, %entry ], [ @str.15, %if.else ], [ @str.16, %if.else9 ], [ @str.17, %if.else15 ], [ @str.18, %if.else21 ], [ @str.19, %if.else27 ], [ @str.20, %if.else33 ] %puts45 = call i32 @puts(ptr nonnull dereferenceable(1) %str.15.sink) br label %if.end44 if.end44: ; preds = %if.end44.sink.split, %if.else33 call void @llvm.lifetime.end.p0(i64 3, 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 i32 @strcmp(ptr nocapture noundef, 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)"}
#include <stdio.h> int main(int argc, char const *argv[]) { int a, b, i = 0; scanf("%d %d", &a, &b); while(a <= b) { a *= 3; b *= 2; i++; } printf("%d", i); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12038/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12038/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %a.promoted = load i32, ptr %a, align 4, !tbaa !5 %b.promoted = load i32, ptr %b, align 4, !tbaa !5 %cmp.not6 = icmp sgt i32 %a.promoted, %b.promoted br i1 %cmp.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %i.09 = phi i32 [ %inc, %while.body ], [ 0, %entry ] %mul48 = phi i32 [ %mul, %while.body ], [ %a.promoted, %entry ] %mul157 = phi i32 [ %mul1, %while.body ], [ %b.promoted, %entry ] %mul = mul nsw i32 %mul48, 3 %mul1 = shl nsw i32 %mul157, 1 %inc = add nuw nsw i32 %i.09, 1 %cmp.not = icmp sgt i32 %mul, %mul1 br i1 %cmp.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %mul, ptr %a, align 4, !tbaa !5 store i32 %mul1, ptr %b, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %entry %i.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %entry ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %i.0.lcssa) 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<stdlib.h> #include<string.h> #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};} //pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define SWAP(type, x, y) do { type tmp = x; x = y; y = tmp; } while (0) #define MOD 1000000007 typedef struct{ int priority; double value; }data; //昇順 int asc(const void* a, const void* b){ return *(int*)a-*(int*)b; } //降順 int desc(const void* a, const void* b){ return *(int*)b-*(int*)a; } int main(void){ char S[4]; scanf("%s",S); if(S[0]=='S'){ if(S[1]=='U') printf("7\n"); else printf("1\n"); } else if(S[0]=='M') printf("6\n"); else if(S[0]=='T'){ if(S[1]=='U') printf("5\n"); else printf("3\n"); } else if(S[0]=='W') printf("4\n"); else printf("2\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120422/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120422/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"2\00", align 1 @str.8 = private unnamed_addr constant [2 x i8] c"4\00", align 1 @str.9 = private unnamed_addr constant [2 x i8] c"3\00", align 1 @str.10 = private unnamed_addr constant [2 x i8] c"5\00", align 1 @str.11 = private unnamed_addr constant [2 x i8] c"6\00", align 1 @str.12 = private unnamed_addr constant [2 x i8] c"1\00", align 1 @str.13 = private unnamed_addr constant [2 x i8] c"7\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) local_unnamed_addr #0 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %S = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load i8, ptr %S, align 1, !tbaa !9 switch i8 %0, label %if.else38 [ i8 83, label %if.then i8 77, label %if.end43 i8 84, label %if.then21 i8 87, label %if.then36 ] if.then: ; preds = %entry %arrayidx2 = getelementptr inbounds [4 x i8], ptr %S, i64 0, i64 1 %1 = load i8, ptr %arrayidx2, align 1, !tbaa !9 %cmp4 = icmp eq i8 %1, 85 %str.13.str.12 = select i1 %cmp4, ptr @str.13, ptr @str.12 br label %if.end43 if.then21: ; preds = %entry %arrayidx22 = getelementptr inbounds [4 x i8], ptr %S, i64 0, i64 1 %2 = load i8, ptr %arrayidx22, align 1, !tbaa !9 %cmp24 = icmp eq i8 %2, 85 %str.10.str.9 = select i1 %cmp24, ptr @str.10, ptr @str.9 br label %if.end43 if.then36: ; preds = %entry br label %if.end43 if.else38: ; preds = %entry br label %if.end43 if.end43: ; preds = %if.then21, %entry, %if.then, %if.then36, %if.else38 %str.11.sink = phi ptr [ @str.8, %if.then36 ], [ @str, %if.else38 ], [ %str.13.str.12, %if.then ], [ @str.11, %entry ], [ %str.10.str.9, %if.then21 ] %puts47 = call i32 @puts(ptr nonnull dereferenceable(1) %str.11.sink) call void @llvm.lifetime.end.p0(i64 4, 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) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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}
#include<stdio.h> int main() { int n,a[1000],i,min=1000000,j; while(1){ scanf("%d",&n); min=1000000; if(n==0) break; for(i=0; i<n; i++){ scanf("%d",&a[i]); } for(j=0; j<n; j++){ for(i=0; i<n; i++){ if(i!=j){ int sa=a[i]-a[j]; if(sa<0){ sa=-sa; } if(min>sa){ min=sa; } } } } printf("%d\n",min); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120473/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120473/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #4 %call53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp54 = icmp eq i32 %0, 0 br i1 %cmp54, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end28 %1 = phi i32 [ %11, %for.end28 ], [ %0, %entry ] %cmp143 = icmp sgt i32 %1, 0 br i1 %cmp143, label %for.body, label %for.end28 for.cond3.preheader: ; preds = %for.body %cmp449 = icmp sgt i32 %9, 0 br i1 %cmp449, label %for.cond6.preheader.us.preheader, label %for.end28 for.cond6.preheader.us.preheader: ; preds = %for.cond3.preheader %wide.trip.count63 = zext i32 %9 to i64 %xtraiter = and i64 %wide.trip.count63, 1 %2 = icmp eq i32 %9, 1 %unroll_iter = and i64 %wide.trip.count63, 4294967294 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br label %for.cond6.preheader.us for.cond6.preheader.us: ; preds = %for.cond6.preheader.us.preheader, %for.cond6.for.inc26_crit_edge.us %indvars.iv60 = phi i64 [ 0, %for.cond6.preheader.us.preheader ], [ %indvars.iv.next61, %for.cond6.for.inc26_crit_edge.us ] %min.050.us = phi i32 [ 1000000, %for.cond6.preheader.us.preheader ], [ %min.3.us.lcssa, %for.cond6.for.inc26_crit_edge.us ] %arrayidx14.us = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv60 br i1 %2, label %for.cond6.for.inc26_crit_edge.us.unr-lcssa, label %for.body8.us for.body8.us: ; preds = %for.cond6.preheader.us, %for.inc23.us.1 %indvars.iv57 = phi i64 [ %indvars.iv.next58.1, %for.inc23.us.1 ], [ 0, %for.cond6.preheader.us ] %min.147.us = phi i32 [ %min.3.us.1, %for.inc23.us.1 ], [ %min.050.us, %for.cond6.preheader.us ] %niter = phi i64 [ %niter.next.1, %for.inc23.us.1 ], [ 0, %for.cond6.preheader.us ] %cmp9.not.us = icmp eq i64 %indvars.iv57, %indvars.iv60 br i1 %cmp9.not.us, label %for.inc23.us, label %if.then10.us if.then10.us: ; preds = %for.body8.us %arrayidx12.us = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv57 %3 = load i32, ptr %arrayidx12.us, align 8, !tbaa !5 %4 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %sub.us = sub nsw i32 %3, %4 %spec.select.us = call i32 @llvm.abs.i32(i32 %sub.us, i1 true) %min.2.us = call i32 @llvm.smin.i32(i32 %min.147.us, i32 %spec.select.us) br label %for.inc23.us for.inc23.us: ; preds = %if.then10.us, %for.body8.us %min.3.us = phi i32 [ %min.2.us, %if.then10.us ], [ %min.147.us, %for.body8.us ] %indvars.iv.next58 = or i64 %indvars.iv57, 1 %cmp9.not.us.1 = icmp eq i64 %indvars.iv.next58, %indvars.iv60 br i1 %cmp9.not.us.1, label %for.inc23.us.1, label %if.then10.us.1 if.then10.us.1: ; preds = %for.inc23.us %arrayidx12.us.1 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv.next58 %5 = load i32, ptr %arrayidx12.us.1, align 4, !tbaa !5 %6 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %sub.us.1 = sub nsw i32 %5, %6 %spec.select.us.1 = call i32 @llvm.abs.i32(i32 %sub.us.1, i1 true) %min.2.us.1 = call i32 @llvm.smin.i32(i32 %min.3.us, i32 %spec.select.us.1) br label %for.inc23.us.1 for.inc23.us.1: ; preds = %if.then10.us.1, %for.inc23.us %min.3.us.1 = phi i32 [ %min.2.us.1, %if.then10.us.1 ], [ %min.3.us, %for.inc23.us ] %indvars.iv.next58.1 = add nuw nsw i64 %indvars.iv57, 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.cond6.for.inc26_crit_edge.us.unr-lcssa, label %for.body8.us, !llvm.loop !9 for.cond6.for.inc26_crit_edge.us.unr-lcssa: ; preds = %for.inc23.us.1, %for.cond6.preheader.us %min.3.us.lcssa.ph = phi i32 [ undef, %for.cond6.preheader.us ], [ %min.3.us.1, %for.inc23.us.1 ] %indvars.iv57.unr = phi i64 [ 0, %for.cond6.preheader.us ], [ %indvars.iv.next58.1, %for.inc23.us.1 ] %min.147.us.unr = phi i32 [ %min.050.us, %for.cond6.preheader.us ], [ %min.3.us.1, %for.inc23.us.1 ] br i1 %lcmp.mod.not, label %for.cond6.for.inc26_crit_edge.us, label %for.body8.us.epil for.body8.us.epil: ; preds = %for.cond6.for.inc26_crit_edge.us.unr-lcssa %cmp9.not.us.epil = icmp eq i64 %indvars.iv57.unr, %indvars.iv60 br i1 %cmp9.not.us.epil, label %for.cond6.for.inc26_crit_edge.us, label %if.then10.us.epil if.then10.us.epil: ; preds = %for.body8.us.epil %arrayidx12.us.epil = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv57.unr %7 = load i32, ptr %arrayidx12.us.epil, align 4, !tbaa !5 %8 = load i32, ptr %arrayidx14.us, align 4, !tbaa !5 %sub.us.epil = sub nsw i32 %7, %8 %spec.select.us.epil = call i32 @llvm.abs.i32(i32 %sub.us.epil, i1 true) %min.2.us.epil = call i32 @llvm.smin.i32(i32 %min.147.us.unr, i32 %spec.select.us.epil) br label %for.cond6.for.inc26_crit_edge.us for.cond6.for.inc26_crit_edge.us: ; preds = %for.body8.us.epil, %if.then10.us.epil, %for.cond6.for.inc26_crit_edge.us.unr-lcssa %min.3.us.lcssa = phi i32 [ %min.3.us.lcssa.ph, %for.cond6.for.inc26_crit_edge.us.unr-lcssa ], [ %min.2.us.epil, %if.then10.us.epil ], [ %min.147.us.unr, %for.body8.us.epil ] %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1 %exitcond64.not = icmp eq i64 %indvars.iv.next61, %wide.trip.count63 br i1 %exitcond64.not, label %for.end28, label %for.cond6.preheader.us, !llvm.loop !11 for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %9 = load i32, ptr %n, align 4, !tbaa !5 %10 = sext i32 %9 to i64 %cmp1 = icmp slt i64 %indvars.iv.next, %10 br i1 %cmp1, label %for.body, label %for.cond3.preheader, !llvm.loop !12 for.end28: ; preds = %for.cond6.for.inc26_crit_edge.us, %for.cond.preheader, %for.cond3.preheader %min.0.lcssa = phi i32 [ 1000000, %for.cond3.preheader ], [ 1000000, %for.cond.preheader ], [ %min.3.us.lcssa, %for.cond6.for.inc26_crit_edge.us ] %call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %11 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %11, 0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end28, %entry call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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.abs.i32(i32, i1 immarg) #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"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> int main() { int n,ntemp; scanf("%d", &n); ntemp = n; int cnt = 1; while (pow(10, cnt) <= n) { cnt++; } int mysum = 0; for (int i = cnt; i >= 1; i--) { //printf("%d %d %d\n", i, (int) pow(10, i), n / (int) pow(10, i)); int sho = ntemp / (int) pow(10, i - 1); mysum += sho; ntemp -= (int) pow(10, i - 1) * sho; } if (n % mysum == 0) { puts("Yes"); } else { puts("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120523/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120523/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 br label %while.cond while.cond: ; preds = %while.cond, %entry %indvar = phi i32 [ %indvar.next, %while.cond ], [ 0, %entry ] %cnt.0 = phi i32 [ %inc, %while.cond ], [ 1, %entry ] %conv = sitofp i32 %cnt.0 to double %call1 = call double @pow(double noundef 1.000000e+01, double noundef %conv) #4 %1 = load i32, ptr %n, align 4, !tbaa !5 %conv2 = sitofp i32 %1 to double %cmp = fcmp ugt double %call1, %conv2 %inc = add nuw nsw i32 %cnt.0, 1 %indvar.next = add i32 %indvar, 1 br i1 %cmp, label %for.body.preheader, label %while.cond, !llvm.loop !9 for.body.preheader: ; preds = %while.cond %xtraiter = and i32 %cnt.0, 1 %2 = icmp eq i32 %indvar, 0 br i1 %2, label %for.cond.cleanup.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %cnt.0, 2147483646 br label %for.body for.cond.cleanup.unr-lcssa: ; preds = %for.body, %for.body.preheader %add.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %add.1, %for.body ] %ntemp.028.unr = phi i32 [ %0, %for.body.preheader ], [ %sub13.1, %for.body ] %i.027.unr = phi i32 [ %cnt.0, %for.body.preheader ], [ %sub.1, %for.body ] %mysum.026.unr = phi i32 [ 0, %for.body.preheader ], [ %add.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.unr-lcssa %sub.epil = add nsw i32 %i.027.unr, -1 %conv6.epil = sitofp i32 %sub.epil to double %call7.epil = call double @pow(double noundef 1.000000e+01, double noundef %conv6.epil) #4 %conv8.epil = fptosi double %call7.epil to i32 %div.epil = sdiv i32 %ntemp.028.unr, %conv8.epil %add.epil = add nsw i32 %div.epil, %mysum.026.unr %call11.epil = call double @pow(double noundef 1.000000e+01, double noundef %conv6.epil) #4 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.cond.cleanup.unr-lcssa, %for.body.epil %add.lcssa = phi i32 [ %add.lcssa.ph, %for.cond.cleanup.unr-lcssa ], [ %add.epil, %for.body.epil ] %3 = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %3, %add.lcssa %cmp14 = icmp eq i32 %rem, 0 %.str.1..str.2 = select i1 %cmp14, ptr @.str.1, ptr @.str.2 %call17 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body: ; preds = %for.body, %for.body.preheader.new %ntemp.028 = phi i32 [ %0, %for.body.preheader.new ], [ %sub13.1, %for.body ] %i.027 = phi i32 [ %cnt.0, %for.body.preheader.new ], [ %sub.1, %for.body ] %mysum.026 = phi i32 [ 0, %for.body.preheader.new ], [ %add.1, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %sub = add nsw i32 %i.027, -1 %conv6 = sitofp i32 %sub to double %call7 = call double @pow(double noundef 1.000000e+01, double noundef %conv6) #4 %conv8 = fptosi double %call7 to i32 %div = sdiv i32 %ntemp.028, %conv8 %add = add nsw i32 %div, %mysum.026 %call11 = call double @pow(double noundef 1.000000e+01, double noundef %conv6) #4 %conv12 = fptosi double %call11 to i32 %mul = mul nsw i32 %div, %conv12 %sub13 = sub nsw i32 %ntemp.028, %mul %sub.1 = add nsw i32 %i.027, -2 %conv6.1 = sitofp i32 %sub.1 to double %call7.1 = call double @pow(double noundef 1.000000e+01, double noundef %conv6.1) #4 %conv8.1 = fptosi double %call7.1 to i32 %div.1 = sdiv i32 %sub13, %conv8.1 %add.1 = add nsw i32 %div.1, %add %call11.1 = call double @pow(double noundef 1.000000e+01, double noundef %conv6.1) #4 %conv12.1 = fptosi double %call11.1 to i32 %mul.1 = mul nsw i32 %div.1, %conv12.1 %sub13.1 = sub nsw i32 %sub13, %mul.1 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1.not = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1.not, label %for.cond.cleanup.unr-lcssa, 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double 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 #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(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #include <math.h> int main() { int cnt = 0, n = 0, s = 0; char N[20]; for (int i = 0; i < 20; i++) { scanf("%c", &N[i]); if (N[i] == '\n') { break; } cnt++; } for (int i = 0; i < cnt; i++) { int x = (int)(N[i] - '0'); n += x * pow(10, cnt - i - 1); s += x; } if (n % s == 0) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120567/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120567/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %N) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i8, ptr %N, align 16, !tbaa !5 %cmp3 = icmp eq i8 %0, 10 br i1 %cmp3, label %if.end31, label %if.end if.end: ; preds = %entry %arrayidx.1 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %cmp3.1 = icmp eq i8 %1, 10 br i1 %cmp3.1, label %for.body11.preheader, label %if.end.1 if.end.1: ; preds = %if.end %arrayidx.2 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5 %cmp3.2 = icmp eq i8 %2, 10 br i1 %cmp3.2, label %for.body11.preheader, label %if.end.2 if.end.2: ; preds = %if.end.1 %arrayidx.3 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %cmp3.3 = icmp eq i8 %3, 10 br i1 %cmp3.3, label %for.body11.preheader, label %if.end.3 if.end.3: ; preds = %if.end.2 %arrayidx.4 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 4 %call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4) %4 = load i8, ptr %arrayidx.4, align 4, !tbaa !5 %cmp3.4 = icmp eq i8 %4, 10 br i1 %cmp3.4, label %for.body11.preheader, label %if.end.4 if.end.4: ; preds = %if.end.3 %arrayidx.5 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 5 %call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5) %5 = load i8, ptr %arrayidx.5, align 1, !tbaa !5 %cmp3.5 = icmp eq i8 %5, 10 br i1 %cmp3.5, label %for.body11.preheader, label %if.end.5 if.end.5: ; preds = %if.end.4 %arrayidx.6 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 6 %call.6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.6) %6 = load i8, ptr %arrayidx.6, align 2, !tbaa !5 %cmp3.6 = icmp eq i8 %6, 10 br i1 %cmp3.6, label %for.body11.preheader, label %if.end.6 if.end.6: ; preds = %if.end.5 %arrayidx.7 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 7 %call.7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.7) %7 = load i8, ptr %arrayidx.7, align 1, !tbaa !5 %cmp3.7 = icmp eq i8 %7, 10 br i1 %cmp3.7, label %for.body11.preheader, label %if.end.7 if.end.7: ; preds = %if.end.6 %arrayidx.8 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 8 %call.8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.8) %8 = load i8, ptr %arrayidx.8, align 8, !tbaa !5 %cmp3.8 = icmp eq i8 %8, 10 br i1 %cmp3.8, label %for.body11.preheader, label %if.end.8 if.end.8: ; preds = %if.end.7 %arrayidx.9 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 9 %call.9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.9) %9 = load i8, ptr %arrayidx.9, align 1, !tbaa !5 %cmp3.9 = icmp eq i8 %9, 10 br i1 %cmp3.9, label %for.body11.preheader, label %if.end.9 if.end.9: ; preds = %if.end.8 %arrayidx.10 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 10 %call.10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.10) %10 = load i8, ptr %arrayidx.10, align 2, !tbaa !5 %cmp3.10 = icmp eq i8 %10, 10 br i1 %cmp3.10, label %for.body11.preheader, label %if.end.10 if.end.10: ; preds = %if.end.9 %arrayidx.11 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 11 %call.11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.11) %11 = load i8, ptr %arrayidx.11, align 1, !tbaa !5 %cmp3.11 = icmp eq i8 %11, 10 br i1 %cmp3.11, label %for.body11.preheader, label %if.end.11 if.end.11: ; preds = %if.end.10 %arrayidx.12 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 12 %call.12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.12) %12 = load i8, ptr %arrayidx.12, align 4, !tbaa !5 %cmp3.12 = icmp eq i8 %12, 10 br i1 %cmp3.12, label %for.body11.preheader, label %if.end.12 if.end.12: ; preds = %if.end.11 %arrayidx.13 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 13 %call.13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.13) %13 = load i8, ptr %arrayidx.13, align 1, !tbaa !5 %cmp3.13 = icmp eq i8 %13, 10 br i1 %cmp3.13, label %for.body11.preheader, label %if.end.13 if.end.13: ; preds = %if.end.12 %arrayidx.14 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 14 %call.14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.14) %14 = load i8, ptr %arrayidx.14, align 2, !tbaa !5 %cmp3.14 = icmp eq i8 %14, 10 br i1 %cmp3.14, label %for.body11.preheader, label %if.end.14 if.end.14: ; preds = %if.end.13 %arrayidx.15 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 15 %call.15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.15) %15 = load i8, ptr %arrayidx.15, align 1, !tbaa !5 %cmp3.15 = icmp eq i8 %15, 10 br i1 %cmp3.15, label %for.body11.preheader, label %if.end.15 if.end.15: ; preds = %if.end.14 %arrayidx.16 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 16 %call.16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.16) %16 = load i8, ptr %arrayidx.16, align 16, !tbaa !5 %cmp3.16 = icmp eq i8 %16, 10 br i1 %cmp3.16, label %for.body11.preheader, label %if.end.16 if.end.16: ; preds = %if.end.15 %arrayidx.17 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 17 %call.17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.17) %17 = load i8, ptr %arrayidx.17, align 1, !tbaa !5 %cmp3.17 = icmp eq i8 %17, 10 br i1 %cmp3.17, label %for.body11.preheader, label %if.end.17 if.end.17: ; preds = %if.end.16 %arrayidx.18 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 18 %call.18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.18) %18 = load i8, ptr %arrayidx.18, align 2, !tbaa !5 %cmp3.18 = icmp eq i8 %18, 10 br i1 %cmp3.18, label %for.body11.preheader, label %if.end.18 if.end.18: ; preds = %if.end.17 %arrayidx.19 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 19 %call.19 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.19) %19 = load i8, ptr %arrayidx.19, align 1, !tbaa !5 %cmp3.19 = icmp eq i8 %19, 10 %spec.select = select i1 %cmp3.19, i32 19, i32 20 br label %for.body11.preheader for.body11.preheader: ; preds = %if.end.18, %if.end.17, %if.end.16, %if.end.15, %if.end.14, %if.end.13, %if.end.12, %if.end.11, %if.end.10, %if.end.9, %if.end.8, %if.end.7, %if.end.6, %if.end.5, %if.end.4, %if.end.3, %if.end.2, %if.end.1, %if.end %cnt.0.lcssa.ph = phi i32 [ 18, %if.end.17 ], [ 17, %if.end.16 ], [ 16, %if.end.15 ], [ 15, %if.end.14 ], [ 14, %if.end.13 ], [ 13, %if.end.12 ], [ 12, %if.end.11 ], [ 11, %if.end.10 ], [ 10, %if.end.9 ], [ 9, %if.end.8 ], [ 8, %if.end.7 ], [ 7, %if.end.6 ], [ 6, %if.end.5 ], [ 5, %if.end.4 ], [ 4, %if.end.3 ], [ 3, %if.end.2 ], [ 2, %if.end.1 ], [ 1, %if.end ], [ %spec.select, %if.end.18 ] %wide.trip.count = zext i32 %cnt.0.lcssa.ph to i64 %xtraiter = and i64 %wide.trip.count, 1 %20 = icmp eq i32 %cnt.0.lcssa.ph, 1 br i1 %20, label %for.cond.cleanup10.unr-lcssa, label %for.body11.preheader.new for.body11.preheader.new: ; preds = %for.body11.preheader %unroll_iter = and i64 %wide.trip.count, 30 br label %for.body11 for.cond.cleanup10.unr-lcssa.loopexit: ; preds = %for.body11 %21 = sitofp i32 %conv21.1 to double br label %for.cond.cleanup10.unr-lcssa for.cond.cleanup10.unr-lcssa: ; preds = %for.cond.cleanup10.unr-lcssa.loopexit, %for.body11.preheader %conv21.lcssa.ph = phi i32 [ undef, %for.body11.preheader ], [ %conv21.1, %for.cond.cleanup10.unr-lcssa.loopexit ] %add.lcssa.ph = phi i32 [ undef, %for.body11.preheader ], [ %add.1, %for.cond.cleanup10.unr-lcssa.loopexit ] %indvars.iv.unr = phi i64 [ 0, %for.body11.preheader ], [ %indvars.iv.next.1, %for.cond.cleanup10.unr-lcssa.loopexit ] %s.052.unr = phi i32 [ 0, %for.body11.preheader ], [ %add.1, %for.cond.cleanup10.unr-lcssa.loopexit ] %n.051.unr = phi double [ 0.000000e+00, %for.body11.preheader ], [ %21, %for.cond.cleanup10.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup10, label %for.body11.epil for.body11.epil: ; preds = %for.cond.cleanup10.unr-lcssa %indvars58.epil = trunc i64 %indvars.iv.unr to i32 %arrayidx13.epil = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 %indvars.iv.unr %22 = load i8, ptr %arrayidx13.epil, align 1, !tbaa !5 %conv14.epil = sext i8 %22 to i32 %sub.epil = add nsw i32 %conv14.epil, -48 %conv15.epil = sitofp i32 %sub.epil to double %23 = xor i32 %indvars58.epil, -1 %sub17.epil = add nsw i32 %cnt.0.lcssa.ph, %23 %conv18.epil = sitofp i32 %sub17.epil to double %call19.epil = call double @pow(double noundef 1.000000e+01, double noundef %conv18.epil) #6 %24 = call double @llvm.fmuladd.f64(double %conv15.epil, double %call19.epil, double %n.051.unr) %conv21.epil = fptosi double %24 to i32 %add.epil = add nsw i32 %sub.epil, %s.052.unr br label %for.cond.cleanup10 for.cond.cleanup10: ; preds = %for.cond.cleanup10.unr-lcssa, %for.body11.epil %conv21.lcssa = phi i32 [ %conv21.lcssa.ph, %for.cond.cleanup10.unr-lcssa ], [ %conv21.epil, %for.body11.epil ] %add.lcssa = phi i32 [ %add.lcssa.ph, %for.cond.cleanup10.unr-lcssa ], [ %add.epil, %for.body11.epil ] %25 = srem i32 %conv21.lcssa, %add.lcssa %26 = icmp eq i32 %25, 0 %spec.select62 = select i1 %26, ptr @str.3, ptr @str br label %if.end31 for.body11: ; preds = %for.body11, %for.body11.preheader.new %indvars.iv = phi i64 [ 0, %for.body11.preheader.new ], [ %indvars.iv.next.1, %for.body11 ] %s.052 = phi i32 [ 0, %for.body11.preheader.new ], [ %add.1, %for.body11 ] %n.051 = phi i32 [ 0, %for.body11.preheader.new ], [ %conv21.1, %for.body11 ] %niter = phi i64 [ 0, %for.body11.preheader.new ], [ %niter.next.1, %for.body11 ] %indvars58 = trunc i64 %indvars.iv to i32 %arrayidx13 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 %indvars.iv %27 = load i8, ptr %arrayidx13, align 2, !tbaa !5 %conv14 = sext i8 %27 to i32 %sub = add nsw i32 %conv14, -48 %conv15 = sitofp i32 %sub to double %28 = xor i32 %indvars58, -1 %sub17 = add nsw i32 %cnt.0.lcssa.ph, %28 %conv18 = sitofp i32 %sub17 to double %call19 = call double @pow(double noundef 1.000000e+01, double noundef %conv18) #6 %conv20 = sitofp i32 %n.051 to double %29 = call double @llvm.fmuladd.f64(double %conv15, double %call19, double %conv20) %conv21 = fptosi double %29 to i32 %add = add nsw i32 %sub, %s.052 %indvars.iv.next = or i64 %indvars.iv, 1 %indvars58.1 = trunc i64 %indvars.iv.next to i32 %arrayidx13.1 = getelementptr inbounds [20 x i8], ptr %N, i64 0, i64 %indvars.iv.next %30 = load i8, ptr %arrayidx13.1, align 1, !tbaa !5 %conv14.1 = sext i8 %30 to i32 %sub.1 = add nsw i32 %conv14.1, -48 %conv15.1 = sitofp i32 %sub.1 to double %31 = xor i32 %indvars58.1, -1 %sub17.1 = add nsw i32 %cnt.0.lcssa.ph, %31 %conv18.1 = sitofp i32 %sub17.1 to double %call19.1 = call double @pow(double noundef 1.000000e+01, double noundef %conv18.1) #6 %conv20.1 = sitofp i32 %conv21 to double %32 = call double @llvm.fmuladd.f64(double %conv15.1, double %call19.1, double %conv20.1) %conv21.1 = fptosi double %32 to i32 %add.1 = add nsw i32 %sub.1, %add %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup10.unr-lcssa.loopexit, label %for.body11, !llvm.loop !8 if.end31: ; preds = %for.cond.cleanup10, %entry %str.sink = phi ptr [ @str.3, %entry ], [ %spec.select62, %for.cond.cleanup10 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %N) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @pow(double noundef, double noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { int a,b,ans,c=0; scanf("%d%d",&a,&b); if(a==b) printf("1"); else { while(a<=b){ a=a*3; b=b*2; c++; } printf("%d",c); // ans=b/a; // printf("%d",ans+1); } //printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12061/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12061/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = 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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %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 %while.cond.preheader while.cond.preheader: ; preds = %entry %cmp2.not8 = icmp sgt i32 %0, %1 br i1 %cmp2.not8, label %while.end, label %while.body if.then: ; preds = %entry %putchar = call i32 @putchar(i32 49) br label %if.end while.body: ; preds = %while.cond.preheader, %while.body %c.011 = phi i32 [ %inc, %while.body ], [ 0, %while.cond.preheader ] %mul610 = phi i32 [ %mul, %while.body ], [ %0, %while.cond.preheader ] %mul379 = phi i32 [ %mul3, %while.body ], [ %1, %while.cond.preheader ] %mul = mul nsw i32 %mul610, 3 %mul3 = shl nsw i32 %mul379, 1 %inc = add nuw nsw i32 %c.011, 1 %cmp2.not = icmp sgt i32 %mul, %mul3 br i1 %cmp2.not, label %while.cond.while.end_crit_edge, label %while.body, !llvm.loop !9 while.cond.while.end_crit_edge: ; preds = %while.body store i32 %mul, ptr %a, align 4, !tbaa !5 store i32 %mul3, ptr %b, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader %c.0.lcssa = phi i32 [ %inc, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ] %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %c.0.lcssa) br label %if.end if.end: ; preds = %while.end, %if.then 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: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <math.h> #include <stdbool.h> int main(void){ int n,sn=0; scanf("%d",&n); int tmp=n; while(tmp!=0){ sn+=tmp%10; tmp/=10; } if(n%sn==0) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120653/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120653/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not8 = icmp eq i32 %0, 0 br i1 %cmp.not8, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %tmp.010 = phi i32 [ %div, %while.body ], [ %0, %entry ] %sn.09 = phi i32 [ %add, %while.body ], [ 0, %entry ] %rem = srem i32 %tmp.010, 10 %add = add nsw i32 %rem, %sn.09 %div = sdiv i32 %tmp.010, 10 %tmp.010.off = add i32 %tmp.010, 9 %cmp.not = icmp ult i32 %tmp.010.off, 19 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %sn.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] %rem1 = srem i32 %0, %sn.0.lcssa %cmp2 = icmp eq i32 %rem1, 0 %.str.1..str.2 = select i1 %cmp2, ptr @.str.1, ptr @.str.2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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<math.h> int main() { long int n, a, b, c=0; scanf("%ld", &n); a=n; while(a){ b=a%10; c+=b; a=a/10; } if(n%c==0) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120697/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120697/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %tobool.not8 = icmp eq i64 %0, 0 br i1 %tobool.not8, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %c.010 = phi i64 [ %add, %while.body ], [ 0, %entry ] %a.09 = phi i64 [ %div, %while.body ], [ %0, %entry ] %rem = srem i64 %a.09, 10 %add = add nsw i64 %c.010, %rem %div = sdiv i64 %a.09, 10 %a.09.off = add i64 %a.09, 9 %tobool.not = icmp ult i64 %a.09.off, 19 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %while.body, %entry %c.0.lcssa = phi i64 [ 0, %entry ], [ %add, %while.body ] %rem1 = srem i64 %0, %c.0.lcssa %cmp = icmp eq i64 %rem1, 0 %str.3.str = select i1 %cmp, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree 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() { long long int n,a,b; scanf("%lld%lld%lld",&n,&b,&a); int arr[n]; for (long long int i = 0; i < n; ++i) { scanf("%d",&arr[i]); } long long int initial=a,flag=0,dist=0; for (long long int i = 0; i < n; ++i) { if(arr[i]==0) { if(a>0) { a--; dist++; } else if(b>0) { b--; dist++; } else { flag=1; break; } } else { if(a<initial) { if(b>0) { b--; dist++; a++; } else if(a>0) { a--; dist++; } else { flag=1; break; } } else { if(a>0) { a--; dist++; } else if(b>0) { b--; dist++; if(a<initial) a++; } else { flag=1; break; } } } } if(dist<=n) printf("%lld\n",dist ); else printf("%lld\n",n); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12074/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12074/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %b, ptr noundef nonnull %a) %0 = load i64, ptr %n, align 8, !tbaa !5 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %0, align 16 %2 = load i64, ptr %n, align 8, !tbaa !5 %cmp81 = icmp sgt i64 %2, 0 br i1 %cmp81, label %for.body, label %cleanup for.cond.cleanup: ; preds = %for.body %3 = load i64, ptr %a, align 8, !tbaa !5 %cmp487 = icmp sgt i64 %4, 0 br i1 %cmp487, label %for.body6.preheader, label %cleanup for.body6.preheader: ; preds = %for.cond.cleanup %b.promoted = load i64, ptr %b, align 8, !tbaa !5 br label %for.body6 for.body: ; preds = %entry, %for.body %i.082 = phi i64 [ %inc, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %i.082 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %inc = add nuw nsw i64 %i.082, 1 %4 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %inc, %4 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9 for.body6: ; preds = %for.body6.preheader, %for.inc53 %i2.091 = phi i64 [ %inc54, %for.inc53 ], [ 0, %for.body6.preheader ] %dec378489 = phi i64 [ %dec3783, %for.inc53 ], [ %3, %for.body6.preheader ] %dec428688 = phi i64 [ %dec4285, %for.inc53 ], [ %b.promoted, %for.body6.preheader ] %arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %i2.091 %5 = load i32, ptr %arrayidx7, align 4, !tbaa !11 %cmp8 = icmp eq i32 %5, 0 br i1 %cmp8, label %if.then, label %if.else18 if.then: ; preds = %for.body6 %cmp9 = icmp sgt i64 %dec378489, 0 br i1 %cmp9, label %if.then10, label %if.else if.then10: ; preds = %if.then %dec = add nsw i64 %dec378489, -1 store i64 %dec, ptr %a, align 8, !tbaa !5 br label %for.inc53 if.else: ; preds = %if.then %cmp12 = icmp sgt i64 %dec428688, 0 br i1 %cmp12, label %if.then13, label %cleanup if.then13: ; preds = %if.else %dec14 = add nsw i64 %dec428688, -1 store i64 %dec14, ptr %b, align 8, !tbaa !5 br label %for.inc53 if.else18: ; preds = %for.body6 %cmp19 = icmp slt i64 %dec378489, %3 br i1 %cmp19, label %if.then20, label %if.else34 if.then20: ; preds = %if.else18 %cmp21 = icmp sgt i64 %dec428688, 0 br i1 %cmp21, label %if.then22, label %if.else26 if.then22: ; preds = %if.then20 %dec23 = add nsw i64 %dec428688, -1 store i64 %dec23, ptr %b, align 8, !tbaa !5 %inc25 = add nsw i64 %dec378489, 1 store i64 %inc25, ptr %a, align 8, !tbaa !5 br label %for.inc53 if.else26: ; preds = %if.then20 %cmp27 = icmp sgt i64 %dec378489, 0 br i1 %cmp27, label %if.then28, label %cleanup if.then28: ; preds = %if.else26 %dec29 = add nsw i64 %dec378489, -1 store i64 %dec29, ptr %a, align 8, !tbaa !5 br label %for.inc53 if.else34: ; preds = %if.else18 %cmp35 = icmp sgt i64 %dec378489, 0 br i1 %cmp35, label %if.then36, label %if.else39 if.then36: ; preds = %if.else34 %dec37 = add nsw i64 %dec378489, -1 store i64 %dec37, ptr %a, align 8, !tbaa !5 br label %for.inc53 if.else39: ; preds = %if.else34 %cmp40 = icmp sgt i64 %dec428688, 0 br i1 %cmp40, label %if.then41, label %cleanup if.then41: ; preds = %if.else39 %dec42 = add nsw i64 %dec428688, -1 store i64 %dec42, ptr %b, align 8, !tbaa !5 br label %for.inc53 for.inc53: ; preds = %if.then41, %if.then13, %if.then10, %if.then36, %if.then22, %if.then28 %dec4285 = phi i64 [ %dec42, %if.then41 ], [ %dec14, %if.then13 ], [ %dec428688, %if.then10 ], [ %dec428688, %if.then36 ], [ %dec23, %if.then22 ], [ %dec428688, %if.then28 ] %dec3783 = phi i64 [ %dec378489, %if.then41 ], [ %dec378489, %if.then13 ], [ %dec, %if.then10 ], [ %dec37, %if.then36 ], [ %inc25, %if.then22 ], [ %dec29, %if.then28 ] %inc54 = add nuw nsw i64 %i2.091, 1 %exitcond.not = icmp eq i64 %inc54, %4 br i1 %exitcond.not, label %if.end61, label %for.body6, !llvm.loop !13 cleanup: ; preds = %if.else, %if.else26, %if.else39, %entry, %for.cond.cleanup %.lcssa99 = phi i64 [ %4, %for.cond.cleanup ], [ %2, %entry ], [ %4, %if.else39 ], [ %4, %if.else26 ], [ %4, %if.else ] %dist.0.lcssa = phi i64 [ 0, %for.cond.cleanup ], [ 0, %entry ], [ %i2.091, %if.else39 ], [ %i2.091, %if.else26 ], [ %i2.091, %if.else ] %spec.select = call i64 @llvm.smin.i64(i64 %dist.0.lcssa, i64 %.lcssa99) br label %if.end61 if.end61: ; preds = %for.inc53, %cleanup %.lcssa99.sink = phi i64 [ %spec.select, %cleanup ], [ %4, %for.inc53 ] %call60 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %.lcssa99.sink) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"int", !7, i64 0} !13 = distinct !{!13, !10}
#include<stdio.h> int main(void){ int N,N1,sum = 0,i = 0,j; int S[11]; scanf("%d",&N); N1 = N; while(N > 0){ S[i] = N % 10; N = N / 10; i++; } for(j = 0;j < i;j++) sum = sum + S[j]; if(N1 % sum == 0) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120783/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120783/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %S = alloca [11 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5 call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %S) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp16 = icmp sgt i32 %0, 0 br i1 %cmp16, label %while.body, label %for.end for.cond.preheader: ; preds = %while.body store i32 %div15, ptr %N, align 4, !tbaa !5 %1 = and i64 %indvars.iv.next, 4294967295 %cmp118.not = icmp eq i64 %1, 0 br i1 %cmp118.not, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %for.cond.preheader %wide.trip.count = and i64 %indvars.iv.next, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 br i1 %min.iters.check, label %for.body.preheader30, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.mod.vf = and i64 %indvars.iv.next, 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 ], [ %4, %vector.body ] %vec.phi28 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ] %2 = getelementptr inbounds [11 x i32], ptr %S, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !5 %3 = getelementptr inbounds i32, ptr %2, i64 4 %wide.load29 = load <4 x i32>, ptr %3, align 16, !tbaa !5 %4 = add <4 x i32> %wide.load, %vec.phi %5 = add <4 x i32> %wide.load29, %vec.phi28 %index.next = add nuw i64 %index, 8 %6 = icmp eq i64 %index.next, %n.vec br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %5, %4 %7 = 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.end, label %for.body.preheader30 for.body.preheader30: ; preds = %for.body.preheader, %middle.block %indvars.iv23.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %sum.019.ph = phi i32 [ 0, %for.body.preheader ], [ %7, %middle.block ] br label %for.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %8 = phi i32 [ %div15, %while.body ], [ %0, %entry ] %rem = urem i32 %8, 10 %arrayidx = getelementptr inbounds [11 x i32], ptr %S, i64 0, i64 %indvars.iv store i32 %rem, ptr %arrayidx, align 4, !tbaa !5 %div15 = udiv i32 %8, 10 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %cmp.not = icmp ult i32 %8, 10 br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !13 for.body: ; preds = %for.body.preheader30, %for.body %indvars.iv23 = phi i64 [ %indvars.iv.next24, %for.body ], [ %indvars.iv23.ph, %for.body.preheader30 ] %sum.019 = phi i32 [ %add, %for.body ], [ %sum.019.ph, %for.body.preheader30 ] %arrayidx3 = getelementptr inbounds [11 x i32], ptr %S, i64 0, i64 %indvars.iv23 %9 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %add = add nsw i32 %9, %sum.019 %indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1 %exitcond.not = icmp eq i64 %indvars.iv.next24, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14 for.end: ; preds = %for.body, %middle.block, %entry, %for.cond.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ 0, %entry ], [ %7, %middle.block ], [ %add, %for.body ] %rem5 = srem i32 %0, %sum.0.lcssa %cmp6 = icmp eq i32 %rem5, 0 %str.3.str = select i1 %cmp6, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %S) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree 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"} !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> int main() { int n, s, tmp; s = 0; scanf("%d", &n); tmp = n; for (; tmp >= 1; tmp /= 10) s += (tmp % 10); if ((n % s) == 0) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120833/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120833/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp9 = icmp sgt i32 %0, 0 br i1 %cmp9, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %tmp.011 = phi i32 [ %div, %for.body ], [ %0, %entry ] %s.010 = phi i32 [ %add, %for.body ], [ 0, %entry ] %rem = urem i32 %tmp.011, 10 %add = add nuw nsw i32 %rem, %s.010 %div = udiv i32 %tmp.011, 10 %cmp.not = icmp ult i32 %tmp.011, 10 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %entry %s.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %rem1 = srem i32 %0, %s.0.lcssa %cmp2 = icmp eq i32 %rem1, 0 %str.3.str = select i1 %cmp2, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> int main() { long long n,m,k; scanf("%lld%lld%lld",&n,&m,&k); long long a[n+2],b[m+2]; a[0]=0; b[0]=0; scanf("%lld",&a[1]); for(int i=2;i<=n;i++){ long long tmp; scanf("%lld",&tmp); a[i]=a[i-1]+tmp; } scanf("%lld",&b[1]); for(long long i=2;i<=m;i++){ long long tmp; scanf("%lld",&tmp); b[i]=b[i-1]+tmp; } long long j=m; long long ans=0; for(int i=0;i<=m;i++){ if(b[i]<=k){ ans=i; j=i; }else{ break; } } if(a[n]+b[m]<=k){ printf("%lld",n+m); return 0; } for(long long i=1;i<=n;i++){ if(a[i]>k)break; while(a[i]+b[j]>k){ j--; } if(i+j>ans&&a[i]+b[j]<=k){ //printf("i=%lld j=%lld\n",i,j); ans=i+j; } } printf("%lld",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120884/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120884/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %m = alloca i64, align 8 %k = alloca i64, align 8 %tmp = alloca i64, align 8 %tmp20 = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %k) %0 = load i64, ptr %n, align 8, !tbaa !5 %add = add nsw i64 %0, 2 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %add, align 16 %2 = load i64, ptr %m, align 8, !tbaa !5 %add1 = add nsw i64 %2, 2 %vla2 = alloca i64, i64 %add1, align 16 store i64 0, ptr %vla, align 16, !tbaa !5 store i64 0, ptr %vla2, align 16, !tbaa !5 %arrayidx4 = getelementptr inbounds i64, ptr %vla, i64 1 %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx4) %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp.not114 = icmp slt i64 %3, 2 br i1 %cmp.not114, label %for.cond.cleanup, label %for.body.preheader for.body.preheader: ; preds = %entry %invariant.gep = getelementptr i64, ptr %vla, i64 -1 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry %arrayidx12 = getelementptr inbounds i64, ptr %vla2, i64 1 %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx12) %4 = load i64, ptr %m, align 8, !tbaa !5 %cmp16.not117 = icmp slt i64 %4, 2 br i1 %cmp16.not117, label %for.cond30.preheader, label %for.body19 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 2, %for.body.preheader ], [ %indvars.iv.next, %for.body ] call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %tmp) #5 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tmp) %gep = getelementptr i64, ptr %invariant.gep, i64 %indvars.iv %5 = load i64, ptr %gep, align 8, !tbaa !5 %6 = load i64, ptr %tmp, align 8, !tbaa !5 %add9 = add nsw i64 %6, %5 %arrayidx11 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv store i64 %add9, ptr %arrayidx11, align 8, !tbaa !5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %tmp) #5 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %7 = load i64, ptr %n, align 8, !tbaa !5 %cmp.not = icmp slt i64 %7, %indvars.iv.next br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9 for.cond30.preheader: ; preds = %for.body19, %for.cond.cleanup %.lcssa = phi i64 [ %4, %for.cond.cleanup ], [ %12, %for.body19 ] %cmp32.not119 = icmp slt i64 %.lcssa, 0 %.pre = load i64, ptr %k, align 8, !tbaa !5 br i1 %cmp32.not119, label %cleanup, label %for.body35.preheader for.body35.preheader: ; preds = %for.cond30.preheader %8 = load i64, ptr %vla2, align 16, !tbaa !5 %cmp38.not142 = icmp sgt i64 %8, %.pre br i1 %cmp38.not142, label %cleanup, label %for.cond30 for.body19: ; preds = %for.cond.cleanup, %for.body19 %i14.0118 = phi i64 [ %inc27, %for.body19 ], [ 2, %for.cond.cleanup ] call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %tmp20) #5 %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %tmp20) %9 = getelementptr i64, ptr %vla2, i64 %i14.0118 %arrayidx23 = getelementptr i64, ptr %9, i64 -1 %10 = load i64, ptr %arrayidx23, align 8, !tbaa !5 %11 = load i64, ptr %tmp20, align 8, !tbaa !5 %add24 = add nsw i64 %11, %10 store i64 %add24, ptr %9, align 8, !tbaa !5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %tmp20) #5 %inc27 = add nuw nsw i64 %i14.0118, 1 %12 = load i64, ptr %m, align 8, !tbaa !5 %cmp16.not.not = icmp slt i64 %i14.0118, %12 br i1 %cmp16.not.not, label %for.body19, label %for.cond30.preheader, !llvm.loop !11 for.cond30: ; preds = %for.body35.preheader, %for.body35 %indvars.iv137143 = phi i64 [ %indvars.iv.next138, %for.body35 ], [ 0, %for.body35.preheader ] %indvars.iv.next138 = add nuw i64 %indvars.iv137143, 1 %cmp32.not = icmp slt i64 %.lcssa, %indvars.iv.next138 br i1 %cmp32.not, label %cleanup, label %for.body35, !llvm.loop !12 for.body35: ; preds = %for.cond30 %arrayidx37 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv.next138 %13 = load i64, ptr %arrayidx37, align 8, !tbaa !5 %cmp38.not = icmp sgt i64 %13, %.pre br i1 %cmp38.not, label %cleanup, label %for.cond30, !llvm.loop !12 cleanup: ; preds = %for.body35, %for.cond30, %for.body35.preheader, %for.cond30.preheader %j.0.lcssa = phi i64 [ %.lcssa, %for.cond30.preheader ], [ %.lcssa, %for.body35.preheader ], [ %indvars.iv137143, %for.cond30 ], [ %indvars.iv137143, %for.body35 ] %ans.0.lcssa = phi i64 [ 0, %for.cond30.preheader ], [ 0, %for.body35.preheader ], [ %indvars.iv137143, %for.cond30 ], [ %indvars.iv137143, %for.body35 ] %14 = load i64, ptr %n, align 8, !tbaa !5 %arrayidx45 = getelementptr inbounds i64, ptr %vla, i64 %14 %15 = load i64, ptr %arrayidx45, align 8, !tbaa !5 %arrayidx46 = getelementptr inbounds i64, ptr %vla2, i64 %.lcssa %16 = load i64, ptr %arrayidx46, align 8, !tbaa !5 %add47 = add nsw i64 %16, %15 %cmp48.not = icmp sgt i64 %add47, %.pre br i1 %cmp48.not, label %for.cond55.preheader, label %if.then50 for.cond55.preheader: ; preds = %cleanup %cmp56.not128 = icmp slt i64 %14, 1 br i1 %cmp56.not128, label %cleanup86, label %for.body59 if.then50: ; preds = %cleanup %add51 = add nsw i64 %14, %.lcssa br label %cleanup86 for.body59: ; preds = %for.cond55.preheader, %while.end %i54.0131 = phi i64 [ %inc82, %while.end ], [ 1, %for.cond55.preheader ] %ans.1130 = phi i64 [ %ans.2, %while.end ], [ %ans.0.lcssa, %for.cond55.preheader ] %j.1129 = phi i64 [ %j.2, %while.end ], [ %j.0.lcssa, %for.cond55.preheader ] %arrayidx60 = getelementptr inbounds i64, ptr %vla, i64 %i54.0131 %17 = load i64, ptr %arrayidx60, align 8, !tbaa !5 %cmp61 = icmp sgt i64 %17, %.pre br i1 %cmp61, label %cleanup86, label %while.cond while.cond: ; preds = %for.body59, %while.cond %j.2 = phi i64 [ %dec, %while.cond ], [ %j.1129, %for.body59 ] %arrayidx66 = getelementptr inbounds i64, ptr %vla2, i64 %j.2 %18 = load i64, ptr %arrayidx66, align 8, !tbaa !5 %add67 = add nsw i64 %18, %17 %cmp68 = icmp sgt i64 %add67, %.pre %dec = add nsw i64 %j.2, -1 br i1 %cmp68, label %while.cond, label %while.end, !llvm.loop !13 while.end: ; preds = %while.cond %add70 = add nsw i64 %j.2, %i54.0131 %ans.2 = call i64 @llvm.smax.i64(i64 %add70, i64 %ans.1130) %inc82 = add nuw i64 %i54.0131, 1 %exitcond.not = icmp eq i64 %i54.0131, %14 br i1 %exitcond.not, label %cleanup86, label %for.body59, !llvm.loop !14 cleanup86: ; preds = %for.body59, %while.end, %for.cond55.preheader, %if.then50 %ans.1.lcssa.sink = phi i64 [ %add51, %if.then50 ], [ %ans.0.lcssa, %for.cond55.preheader ], [ %ans.1130, %for.body59 ], [ %ans.2, %while.end ] %call85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.1.lcssa.sink) call void @llvm.stackrestore.p0(ptr %1) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10}
#include<stdio.h> int main(){ long long int n, m, k; scanf("%lld%lld%lld", &n, &m, &k); long long int a[200005], b[200005], i, j; for(i = 0; i < n; i++) scanf("%lld", &a[i+1]); for(i = 0; i < m; i++) scanf("%lld", &b[i+1]); a[0] = b[0] = 0; for(i = 0; i < n; i++) a[i+1] += a[i]; for(i = 0; i < m; i++) b[i+1] += b[i]; long long int ans = 0; j = m; for(i = 0; i <= n; i++){ while(j >=0 && a[i] + b[j] > k) j--; if(j >= 0) if(ans < i + j) ans = i + j; } printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120941/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120941/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [13 x i8] c"%lld%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 %m = alloca i64, align 8 %k = alloca i64, align 8 %a = alloca [200005 x i64], align 16 %b = alloca [200005 x i64], align 16 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %k) call void @llvm.lifetime.start.p0(i64 1600040, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1600040, ptr nonnull %b) #4 %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp78 = icmp sgt i64 %0, 0 br i1 %cmp78, label %for.body, label %for.cond2.preheader for.cond2.preheader: ; preds = %for.body, %entry %1 = phi i64 [ %0, %entry ], [ %3, %for.body ] %2 = load i64, ptr %m, align 8, !tbaa !5 %cmp380 = icmp sgt i64 %2, 0 br i1 %cmp380, label %for.body4, label %for.end10 for.body: ; preds = %entry, %for.body %i.079 = phi i64 [ %add, %for.body ], [ 0, %entry ] %add = add nuw nsw i64 %i.079, 1 %arrayidx = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %add %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp = icmp slt i64 %add, %3 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.body4: ; preds = %for.cond2.preheader, %for.body4 %i.181 = phi i64 [ %add5, %for.body4 ], [ 0, %for.cond2.preheader ] %add5 = add nuw nsw i64 %i.181, 1 %arrayidx6 = getelementptr inbounds [200005 x i64], ptr %b, i64 0, i64 %add5 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %4 = load i64, ptr %m, align 8, !tbaa !5 %cmp3 = icmp slt i64 %add5, %4 br i1 %cmp3, label %for.body4, label %for.end10.loopexit, !llvm.loop !11 for.end10.loopexit: ; preds = %for.body4 %.pre = load i64, ptr %n, align 8, !tbaa !5 br label %for.end10 for.end10: ; preds = %for.end10.loopexit, %for.cond2.preheader %5 = phi i64 [ %1, %for.cond2.preheader ], [ %.pre, %for.end10.loopexit ] %.lcssa77 = phi i64 [ %2, %for.cond2.preheader ], [ %4, %for.end10.loopexit ] store i64 0, ptr %b, align 16, !tbaa !5 store i64 0, ptr %a, align 16, !tbaa !5 %cmp1482 = icmp sgt i64 %5, 0 br i1 %cmp1482, label %for.body15.preheader, label %for.cond23.preheader for.body15.preheader: ; preds = %for.end10 %xtraiter = and i64 %5, 3 %6 = icmp ult i64 %5, 4 br i1 %6, label %for.cond23.preheader.loopexit.unr-lcssa, label %for.body15.preheader.new for.body15.preheader.new: ; preds = %for.body15.preheader %unroll_iter = and i64 %5, -4 br label %for.body15 for.cond23.preheader.loopexit.unr-lcssa: ; preds = %for.body15, %for.body15.preheader %.unr = phi i64 [ 0, %for.body15.preheader ], [ %add19.3, %for.body15 ] %i.283.unr = phi i64 [ 0, %for.body15.preheader ], [ %add17.3, %for.body15 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond23.preheader, label %for.body15.epil for.body15.epil: ; preds = %for.cond23.preheader.loopexit.unr-lcssa, %for.body15.epil %7 = phi i64 [ %add19.epil, %for.body15.epil ], [ %.unr, %for.cond23.preheader.loopexit.unr-lcssa ] %i.283.epil = phi i64 [ %add17.epil, %for.body15.epil ], [ %i.283.unr, %for.cond23.preheader.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body15.epil ], [ 0, %for.cond23.preheader.loopexit.unr-lcssa ] %add17.epil = add nuw nsw i64 %i.283.epil, 1 %arrayidx18.epil = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %add17.epil %8 = load i64, ptr %arrayidx18.epil, align 8, !tbaa !5 %add19.epil = add nsw i64 %8, %7 store i64 %add19.epil, ptr %arrayidx18.epil, align 8, !tbaa !5 %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.cond23.preheader, label %for.body15.epil, !llvm.loop !12 for.cond23.preheader: ; preds = %for.cond23.preheader.loopexit.unr-lcssa, %for.body15.epil, %for.end10 %cmp2485 = icmp sgt i64 %.lcssa77, 0 br i1 %cmp2485, label %for.body25.preheader, label %for.cond33.preheader for.body25.preheader: ; preds = %for.cond23.preheader %xtraiter104 = and i64 %.lcssa77, 3 %9 = icmp ult i64 %.lcssa77, 4 br i1 %9, label %for.cond33.preheader.loopexit.unr-lcssa, label %for.body25.preheader.new for.body25.preheader.new: ; preds = %for.body25.preheader %unroll_iter108 = and i64 %.lcssa77, -4 br label %for.body25 for.body15: ; preds = %for.body15, %for.body15.preheader.new %10 = phi i64 [ 0, %for.body15.preheader.new ], [ %add19.3, %for.body15 ] %i.283 = phi i64 [ 0, %for.body15.preheader.new ], [ %add17.3, %for.body15 ] %niter = phi i64 [ 0, %for.body15.preheader.new ], [ %niter.next.3, %for.body15 ] %add17 = or i64 %i.283, 1 %arrayidx18 = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %add17 %11 = load i64, ptr %arrayidx18, align 8, !tbaa !5 %add19 = add nsw i64 %11, %10 store i64 %add19, ptr %arrayidx18, align 8, !tbaa !5 %add17.1 = or i64 %i.283, 2 %arrayidx18.1 = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %add17.1 %12 = load i64, ptr %arrayidx18.1, align 16, !tbaa !5 %add19.1 = add nsw i64 %12, %add19 store i64 %add19.1, ptr %arrayidx18.1, align 16, !tbaa !5 %add17.2 = or i64 %i.283, 3 %arrayidx18.2 = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %add17.2 %13 = load i64, ptr %arrayidx18.2, align 8, !tbaa !5 %add19.2 = add nsw i64 %13, %add19.1 store i64 %add19.2, ptr %arrayidx18.2, align 8, !tbaa !5 %add17.3 = add nuw nsw i64 %i.283, 4 %arrayidx18.3 = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %add17.3 %14 = load i64, ptr %arrayidx18.3, align 16, !tbaa !5 %add19.3 = add nsw i64 %14, %add19.2 store i64 %add19.3, ptr %arrayidx18.3, align 16, !tbaa !5 %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.cond23.preheader.loopexit.unr-lcssa, label %for.body15, !llvm.loop !14 for.cond33.preheader.loopexit.unr-lcssa: ; preds = %for.body25, %for.body25.preheader %.unr106 = phi i64 [ 0, %for.body25.preheader ], [ %add29.3, %for.body25 ] %i.386.unr = phi i64 [ 0, %for.body25.preheader ], [ %add27.3, %for.body25 ] %lcmp.mod107.not = icmp eq i64 %xtraiter104, 0 br i1 %lcmp.mod107.not, label %for.cond33.preheader, label %for.body25.epil for.body25.epil: ; preds = %for.cond33.preheader.loopexit.unr-lcssa, %for.body25.epil %15 = phi i64 [ %add29.epil, %for.body25.epil ], [ %.unr106, %for.cond33.preheader.loopexit.unr-lcssa ] %i.386.epil = phi i64 [ %add27.epil, %for.body25.epil ], [ %i.386.unr, %for.cond33.preheader.loopexit.unr-lcssa ] %epil.iter105 = phi i64 [ %epil.iter105.next, %for.body25.epil ], [ 0, %for.cond33.preheader.loopexit.unr-lcssa ] %add27.epil = add nuw nsw i64 %i.386.epil, 1 %arrayidx28.epil = getelementptr inbounds [200005 x i64], ptr %b, i64 0, i64 %add27.epil %16 = load i64, ptr %arrayidx28.epil, align 8, !tbaa !5 %add29.epil = add nsw i64 %16, %15 store i64 %add29.epil, ptr %arrayidx28.epil, align 8, !tbaa !5 %epil.iter105.next = add i64 %epil.iter105, 1 %epil.iter105.cmp.not = icmp eq i64 %epil.iter105.next, %xtraiter104 br i1 %epil.iter105.cmp.not, label %for.cond33.preheader, label %for.body25.epil, !llvm.loop !15 for.cond33.preheader: ; preds = %for.cond33.preheader.loopexit.unr-lcssa, %for.body25.epil, %for.cond23.preheader %cmp34.not90 = icmp slt i64 %5, 0 br i1 %cmp34.not90, label %for.end49, label %while.cond.preheader.lr.ph while.cond.preheader.lr.ph: ; preds = %for.cond33.preheader %17 = load i64, ptr %k, align 8 br label %while.cond.preheader for.body25: ; preds = %for.body25, %for.body25.preheader.new %18 = phi i64 [ 0, %for.body25.preheader.new ], [ %add29.3, %for.body25 ] %i.386 = phi i64 [ 0, %for.body25.preheader.new ], [ %add27.3, %for.body25 ] %niter109 = phi i64 [ 0, %for.body25.preheader.new ], [ %niter109.next.3, %for.body25 ] %add27 = or i64 %i.386, 1 %arrayidx28 = getelementptr inbounds [200005 x i64], ptr %b, i64 0, i64 %add27 %19 = load i64, ptr %arrayidx28, align 8, !tbaa !5 %add29 = add nsw i64 %19, %18 store i64 %add29, ptr %arrayidx28, align 8, !tbaa !5 %add27.1 = or i64 %i.386, 2 %arrayidx28.1 = getelementptr inbounds [200005 x i64], ptr %b, i64 0, i64 %add27.1 %20 = load i64, ptr %arrayidx28.1, align 16, !tbaa !5 %add29.1 = add nsw i64 %20, %add29 store i64 %add29.1, ptr %arrayidx28.1, align 16, !tbaa !5 %add27.2 = or i64 %i.386, 3 %arrayidx28.2 = getelementptr inbounds [200005 x i64], ptr %b, i64 0, i64 %add27.2 %21 = load i64, ptr %arrayidx28.2, align 8, !tbaa !5 %add29.2 = add nsw i64 %21, %add29.1 store i64 %add29.2, ptr %arrayidx28.2, align 8, !tbaa !5 %add27.3 = add nuw nsw i64 %i.386, 4 %arrayidx28.3 = getelementptr inbounds [200005 x i64], ptr %b, i64 0, i64 %add27.3 %22 = load i64, ptr %arrayidx28.3, align 16, !tbaa !5 %add29.3 = add nsw i64 %22, %add29.2 store i64 %add29.3, ptr %arrayidx28.3, align 16, !tbaa !5 %niter109.next.3 = add i64 %niter109, 4 %niter109.ncmp.3 = icmp eq i64 %niter109.next.3, %unroll_iter108 br i1 %niter109.ncmp.3, label %for.cond33.preheader.loopexit.unr-lcssa, label %for.body25, !llvm.loop !16 while.cond.preheader: ; preds = %while.cond.preheader.lr.ph, %for.inc47 %ans.093 = phi i64 [ 0, %while.cond.preheader.lr.ph ], [ %ans.1, %for.inc47 ] %j.092 = phi i64 [ %.lcssa77, %while.cond.preheader.lr.ph ], [ %j.176, %for.inc47 ] %i.491 = phi i64 [ 0, %while.cond.preheader.lr.ph ], [ %inc48, %for.inc47 ] %cmp3687 = icmp sgt i64 %j.092, -1 br i1 %cmp3687, label %land.rhs.lr.ph, label %for.inc47 land.rhs.lr.ph: ; preds = %while.cond.preheader %arrayidx37 = getelementptr inbounds [200005 x i64], ptr %a, i64 0, i64 %i.491 %23 = load i64, ptr %arrayidx37, align 8, !tbaa !5 br label %land.rhs land.rhs: ; preds = %land.rhs.lr.ph, %while.body %j.188 = phi i64 [ %j.092, %land.rhs.lr.ph ], [ %dec, %while.body ] %arrayidx38 = getelementptr inbounds [200005 x i64], ptr %b, i64 0, i64 %j.188 %24 = load i64, ptr %arrayidx38, align 8, !tbaa !5 %add39 = add nsw i64 %24, %23 %cmp40 = icmp sgt i64 %add39, %17 br i1 %cmp40, label %while.body, label %if.then while.body: ; preds = %land.rhs %dec = add nsw i64 %j.188, -1 %cmp36 = icmp sgt i64 %j.188, 0 br i1 %cmp36, label %land.rhs, label %for.inc47, !llvm.loop !17 if.then: ; preds = %land.rhs %add42 = add nsw i64 %j.188, %i.491 %spec.select = call i64 @llvm.smax.i64(i64 %ans.093, i64 %add42) br label %for.inc47 for.inc47: ; preds = %while.body, %while.cond.preheader, %if.then %j.176 = phi i64 [ %j.188, %if.then ], [ %j.092, %while.cond.preheader ], [ -1, %while.body ] %ans.1 = phi i64 [ %spec.select, %if.then ], [ %ans.093, %while.cond.preheader ], [ %ans.093, %while.body ] %inc48 = add nuw i64 %i.491, 1 %exitcond97.not = icmp eq i64 %i.491, %5 br i1 %exitcond97.not, label %for.end49, label %while.cond.preheader, !llvm.loop !18 for.end49: ; preds = %for.inc47, %for.cond33.preheader %ans.0.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %ans.1, %for.inc47 ] %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 1600040, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 1600040, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %k) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.unroll.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !13} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10}
#include<stdio.h> #include<string.h> int main(void) { int i,j,k,sw,e,e1,e2,i1,j1,c1,c2; char st1[201],st2[201],st3[201],st4[201]; while(1) { scanf("%s",st1); if(st1[0]=='.' && st1[1]=='\0') break; scanf("%s",st2); e2=0; c1=0; c2=0; for(i=0;i<=strlen(st1)-1;i++) { if(st1[i]=='"') c1++; } for(i=0;i<=strlen(st2)-1;i++) { if(st2[i]=='"') c2++; } if(c1!=c2) printf("DIFFERENT\n"); else { e=0; e1=0; i=0; while(st1[i]!='"' && st1[i]!='\0') { st3[i]=st1[i]; i++; } j=0; while(st2[j]!='"' && st2[j]!='\0') { st4[j]=st2[j]; j++; } if(i!=j) e=1; else { for(k=0;k<=j-1;k++) { if(st3[k]!=st4[k]) e1++; } } if(e1!=0) e=1; i1=0; j1=0; sw=1; while(st1[i]!='\0') { e1=0; i++; j++; while(st1[i]!='"' && st1[i]!='\0') { st3[i1]=st1[i]; i1++; i++; } while(st2[j]!='"' && st2[j]!='\0') { st4[j1]=st2[j]; j1++; j++; } if(i1!=j1) { if(sw==1) e2++; else e=1; } else { for(k=0;k<=i1-1;k++) { if(st3[k]!=st4[k]) e1++; } if(e1!=0) { if(sw==1) e2++; else e=1; } } i1=0; j1=0; sw=-sw; } if(e==0 && e2==0) printf("IDENTICAL\n"); else if(e==1 || e2>=2) printf("DIFFERENT\n"); else printf("CLOSE\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_120985/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_120985/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"CLOSE\00", align 1 @str.5 = private unnamed_addr constant [10 x i8] c"IDENTICAL\00", align 1 @str.6 = private unnamed_addr constant [10 x i8] c"DIFFERENT\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %st1 = alloca [201 x i8], align 16 %st2 = alloca [201 x i8], align 16 %st3 = alloca [201 x i8], align 16 %st4 = alloca [201 x i8], align 16 call void @llvm.lifetime.start.p0(i64 201, ptr nonnull %st1) #6 call void @llvm.lifetime.start.p0(i64 201, ptr nonnull %st2) #6 call void @llvm.lifetime.start.p0(i64 201, ptr nonnull %st3) #6 call void @llvm.lifetime.start.p0(i64 201, ptr nonnull %st4) #6 %call313 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %st1) %0 = load i8, ptr %st1, align 16, !tbaa !5 %cmp314 = icmp eq i8 %0, 46 %arrayidx2 = getelementptr inbounds [201 x i8], ptr %st1, i64 0, i64 1 %1 = load i8, ptr %arrayidx2, align 1 %cmp4315 = icmp eq i8 %1, 0 %or.cond316 = select i1 %cmp314, i1 %cmp4315, i1 false br i1 %or.cond316, label %while.end220, label %if.end if.end: ; preds = %entry, %if.end219 %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %st2) %call10 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %st1) #7 %min.iters.check406 = icmp ult i64 %call10, 8 br i1 %min.iters.check406, label %for.body.preheader, label %vector.ph407 vector.ph407: ; preds = %if.end %n.vec409 = and i64 %call10, -8 br label %vector.body412 vector.body412: ; preds = %vector.body412, %vector.ph407 %index413 = phi i64 [ 0, %vector.ph407 ], [ %index.next418, %vector.body412 ] %vec.phi414 = phi <4 x i32> [ zeroinitializer, %vector.ph407 ], [ %8, %vector.body412 ] %vec.phi415 = phi <4 x i32> [ zeroinitializer, %vector.ph407 ], [ %9, %vector.body412 ] %2 = getelementptr inbounds [201 x i8], ptr %st1, i64 0, i64 %index413 %wide.load416 = load <4 x i8>, ptr %2, align 8, !tbaa !5 %3 = getelementptr inbounds i8, ptr %2, i64 4 %wide.load417 = load <4 x i8>, ptr %3, align 4, !tbaa !5 %4 = icmp eq <4 x i8> %wide.load416, <i8 34, i8 34, i8 34, i8 34> %5 = icmp eq <4 x i8> %wide.load417, <i8 34, i8 34, i8 34, i8 34> %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.phi414, %6 %9 = add <4 x i32> %vec.phi415, %7 %index.next418 = add nuw i64 %index413, 8 %10 = icmp eq i64 %index.next418, %n.vec409 br i1 %10, label %middle.block404, label %vector.body412, !llvm.loop !8 middle.block404: ; preds = %vector.body412 %bin.rdx419 = add <4 x i32> %9, %8 %11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx419) %cmp.n411 = icmp eq i64 %call10, %n.vec409 br i1 %cmp.n411, label %for.cond20.preheader, label %for.body.preheader for.body.preheader: ; preds = %if.end, %middle.block404 %indvars.iv.ph = phi i64 [ 0, %if.end ], [ %n.vec409, %middle.block404 ] %c1.0291.ph = phi i32 [ 0, %if.end ], [ %11, %middle.block404 ] br label %for.body for.cond20.preheader: ; preds = %for.body, %middle.block404 %spec.select.lcssa = phi i32 [ %11, %middle.block404 ], [ %spec.select, %for.body ] %call23 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %st2) #7 %min.iters.check389 = icmp ult i64 %call23, 8 br i1 %min.iters.check389, label %for.body27.preheader, label %vector.ph390 vector.ph390: ; preds = %for.cond20.preheader %n.vec392 = and i64 %call23, -8 br label %vector.body395 vector.body395: ; preds = %vector.body395, %vector.ph390 %index396 = phi i64 [ 0, %vector.ph390 ], [ %index.next401, %vector.body395 ] %vec.phi397 = phi <4 x i32> [ zeroinitializer, %vector.ph390 ], [ %18, %vector.body395 ] %vec.phi398 = phi <4 x i32> [ zeroinitializer, %vector.ph390 ], [ %19, %vector.body395 ] %12 = getelementptr inbounds [201 x i8], ptr %st2, i64 0, i64 %index396 %wide.load399 = load <4 x i8>, ptr %12, align 8, !tbaa !5 %13 = getelementptr inbounds i8, ptr %12, i64 4 %wide.load400 = load <4 x i8>, ptr %13, align 4, !tbaa !5 %14 = icmp eq <4 x i8> %wide.load399, <i8 34, i8 34, i8 34, i8 34> %15 = icmp eq <4 x i8> %wide.load400, <i8 34, i8 34, i8 34, i8 34> %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.phi397, %16 %19 = add <4 x i32> %vec.phi398, %17 %index.next401 = add nuw i64 %index396, 8 %20 = icmp eq i64 %index.next401, %n.vec392 br i1 %20, label %middle.block387, label %vector.body395, !llvm.loop !12 middle.block387: ; preds = %vector.body395 %bin.rdx402 = add <4 x i32> %19, %18 %21 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx402) %cmp.n394 = icmp eq i64 %call23, %n.vec392 br i1 %cmp.n394, label %for.end38, label %for.body27.preheader for.body27.preheader: ; preds = %for.cond20.preheader, %middle.block387 %indvars.iv318.ph = phi i64 [ 0, %for.cond20.preheader ], [ %n.vec392, %middle.block387 ] %c2.0294.ph = phi i32 [ 0, %for.cond20.preheader ], [ %21, %middle.block387 ] br label %for.body27 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader ] %c1.0291 = phi i32 [ %spec.select, %for.body ], [ %c1.0291.ph, %for.body.preheader ] %arrayidx13 = getelementptr inbounds [201 x i8], ptr %st1, i64 0, i64 %indvars.iv %22 = load i8, ptr %arrayidx13, align 1, !tbaa !5 %cmp15 = icmp eq i8 %22, 34 %inc = zext i1 %cmp15 to i32 %spec.select = add nuw nsw i32 %c1.0291, %inc %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond = icmp eq i64 %indvars.iv.next, %call10 br i1 %exitcond, label %for.cond20.preheader, label %for.body, !llvm.loop !13 for.body27: ; preds = %for.body27.preheader, %for.body27 %indvars.iv318 = phi i64 [ %indvars.iv.next319, %for.body27 ], [ %indvars.iv318.ph, %for.body27.preheader ] %c2.0294 = phi i32 [ %spec.select277, %for.body27 ], [ %c2.0294.ph, %for.body27.preheader ] %arrayidx29 = getelementptr inbounds [201 x i8], ptr %st2, i64 0, i64 %indvars.iv318 %23 = load i8, ptr %arrayidx29, align 1, !tbaa !5 %cmp31 = icmp eq i8 %23, 34 %inc34 = zext i1 %cmp31 to i32 %spec.select277 = add nuw nsw i32 %c2.0294, %inc34 %indvars.iv.next319 = add nuw nsw i64 %indvars.iv318, 1 %exitcond321 = icmp eq i64 %indvars.iv.next319, %call23 br i1 %exitcond321, label %for.end38, label %for.body27, !llvm.loop !14 for.end38: ; preds = %for.body27, %middle.block387 %spec.select277.lcssa = phi i32 [ %21, %middle.block387 ], [ %spec.select277, %for.body27 ] %cmp39.not = icmp eq i32 %spec.select.lcssa, %spec.select277.lcssa br i1 %cmp39.not, label %while.cond43, label %if.end219 while.cond43: ; preds = %for.end38, %while.body54 %indvars.iv322 = phi i64 [ %indvars.iv.next323, %while.body54 ], [ 0, %for.end38 ] %arrayidx45 = getelementptr inbounds [201 x i8], ptr %st1, i64 0, i64 %indvars.iv322 %24 = load i8, ptr %arrayidx45, align 1, !tbaa !5 switch i8 %24, label %while.body54 [ i8 34, label %while.end i8 0, label %while.end ] while.body54: ; preds = %while.cond43 %arrayidx58 = getelementptr inbounds [201 x i8], ptr %st3, i64 0, i64 %indvars.iv322 store i8 %24, ptr %arrayidx58, align 1, !tbaa !5 %indvars.iv.next323 = add nuw i64 %indvars.iv322, 1 br label %while.cond43, !llvm.loop !15 while.end: ; preds = %while.cond43, %while.cond43 %25 = trunc i64 %indvars.iv322 to i32 br label %while.cond60 while.cond60: ; preds = %while.body73, %while.end %indvars.iv331 = phi i32 [ %indvars.iv.next332, %while.body73 ], [ 0, %while.end ] %indvars.iv325 = phi i64 [ %indvars.iv.next326, %while.body73 ], [ 0, %while.end ] %arrayidx62 = getelementptr inbounds [201 x i8], ptr %st2, i64 0, i64 %indvars.iv325 %26 = load i8, ptr %arrayidx62, align 1, !tbaa !5 switch i8 %26, label %while.body73 [ i8 34, label %while.end79 i8 0, label %while.end79 ] while.body73: ; preds = %while.cond60 %arrayidx77 = getelementptr inbounds [201 x i8], ptr %st4, i64 0, i64 %indvars.iv325 store i8 %26, ptr %arrayidx77, align 1, !tbaa !5 %indvars.iv.next326 = add nuw i64 %indvars.iv325, 1 %indvars.iv.next332 = add nuw i32 %indvars.iv331, 1 br label %while.cond60, !llvm.loop !16 while.end79: ; preds = %while.cond60, %while.cond60 %27 = trunc i64 %indvars.iv325 to i32 %cmp80.not = icmp eq i32 %25, %27 br i1 %cmp80.not, label %for.cond84.preheader, label %if.end103.thread for.cond84.preheader: ; preds = %while.end79 %cmp86.not.not296.not = icmp eq i32 %25, 0 br i1 %cmp86.not.not296.not, label %if.end103.thread, label %for.body88.preheader for.body88.preheader: ; preds = %for.cond84.preheader %wide.trip.count = zext i32 %indvars.iv331 to i64 %min.iters.check370 = icmp ult i32 %indvars.iv331, 8 br i1 %min.iters.check370, label %for.body88.preheader422, label %vector.ph371 vector.ph371: ; preds = %for.body88.preheader %n.vec373 = and i64 %wide.trip.count, 4294967288 br label %vector.body376 vector.body376: ; preds = %vector.body376, %vector.ph371 %index377 = phi i64 [ 0, %vector.ph371 ], [ %index.next384, %vector.body376 ] %vec.phi378 = phi <4 x i32> [ zeroinitializer, %vector.ph371 ], [ %38, %vector.body376 ] %vec.phi379 = phi <4 x i32> [ zeroinitializer, %vector.ph371 ], [ %39, %vector.body376 ] %28 = getelementptr inbounds [201 x i8], ptr %st3, i64 0, i64 %index377 %wide.load380 = load <4 x i8>, ptr %28, align 8, !tbaa !5 %29 = getelementptr inbounds i8, ptr %28, i64 4 %wide.load381 = load <4 x i8>, ptr %29, align 4, !tbaa !5 %30 = getelementptr inbounds [201 x i8], ptr %st4, i64 0, i64 %index377 %wide.load382 = load <4 x i8>, ptr %30, align 8, !tbaa !5 %31 = getelementptr inbounds i8, ptr %30, i64 4 %wide.load383 = load <4 x i8>, ptr %31, align 4, !tbaa !5 %32 = icmp ne <4 x i8> %wide.load380, %wide.load382 %33 = icmp ne <4 x i8> %wide.load381, %wide.load383 %34 = freeze <4 x i1> %32 %35 = freeze <4 x i1> %33 %36 = zext <4 x i1> %34 to <4 x i32> %37 = zext <4 x i1> %35 to <4 x i32> %38 = add <4 x i32> %vec.phi378, %36 %39 = add <4 x i32> %vec.phi379, %37 %index.next384 = add nuw i64 %index377, 8 %40 = icmp eq i64 %index.next384, %n.vec373 br i1 %40, label %middle.block368, label %vector.body376, !llvm.loop !17 middle.block368: ; preds = %vector.body376 %bin.rdx385 = add <4 x i32> %39, %38 %41 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx385) %cmp.n375 = icmp eq i64 %n.vec373, %wide.trip.count br i1 %cmp.n375, label %if.end103, label %for.body88.preheader422 for.body88.preheader422: ; preds = %for.body88.preheader, %middle.block368 %indvars.iv328.ph = phi i64 [ 0, %for.body88.preheader ], [ %n.vec373, %middle.block368 ] %e1.0.fr298.ph = phi i32 [ 0, %for.body88.preheader ], [ %41, %middle.block368 ] br label %for.body88 for.body88: ; preds = %for.body88.preheader422, %for.body88 %indvars.iv328 = phi i64 [ %indvars.iv.next329, %for.body88 ], [ %indvars.iv328.ph, %for.body88.preheader422 ] %e1.0.fr298 = phi i32 [ %spec.select278, %for.body88 ], [ %e1.0.fr298.ph, %for.body88.preheader422 ] %arrayidx90 = getelementptr inbounds [201 x i8], ptr %st3, i64 0, i64 %indvars.iv328 %42 = load i8, ptr %arrayidx90, align 1, !tbaa !5 %arrayidx93 = getelementptr inbounds [201 x i8], ptr %st4, i64 0, i64 %indvars.iv328 %43 = load i8, ptr %arrayidx93, align 1, !tbaa !5 %cmp95.not = icmp ne i8 %42, %43 %cmp95.not.fr = freeze i1 %cmp95.not %inc98 = zext i1 %cmp95.not.fr to i32 %spec.select278 = add i32 %e1.0.fr298, %inc98 %indvars.iv.next329 = add nuw nsw i64 %indvars.iv328, 1 %exitcond333.not = icmp eq i64 %indvars.iv.next329, %wide.trip.count br i1 %exitcond333.not, label %if.end103, label %for.body88, !llvm.loop !18 if.end103: ; preds = %for.body88, %middle.block368 %spec.select278.lcssa = phi i32 [ %41, %middle.block368 ], [ %spec.select278, %for.body88 ] %cmp104.not = icmp eq i32 %spec.select278.lcssa, 0 br i1 %cmp104.not, label %if.end103.thread, label %44 if.end103.thread: ; preds = %for.cond84.preheader, %while.end79, %if.end103 %e.0289 = phi i32 [ 0, %if.end103 ], [ 1, %while.end79 ], [ 0, %for.cond84.preheader ] br label %44 44: ; preds = %if.end103, %if.end103.thread %45 = phi i32 [ %e.0289, %if.end103.thread ], [ 1, %if.end103 ] %idxprom109303 = and i64 %indvars.iv322, 4294967295 %arrayidx110304 = getelementptr inbounds [201 x i8], ptr %st1, i64 0, i64 %idxprom109303 %46 = load i8, ptr %arrayidx110304, align 1, !tbaa !5 %cmp112.not305 = icmp eq i8 %46, 0 br i1 %cmp112.not305, label %while.end200, label %while.cond117.preheader while.cond117.preheader: ; preds = %44, %if.end198 %e2.0310 = phi i32 [ %e2.1, %if.end198 ], [ 0, %44 ] %e.2309 = phi i32 [ %e.3, %if.end198 ], [ %45, %44 ] %sw.0308 = phi i32 [ %sub199, %if.end198 ], [ 1, %44 ] %j.1307 = phi i64 [ %indvars.iv.next342, %if.end198 ], [ %indvars.iv325, %44 ] %i.3306 = phi i64 [ %indvars.iv.next335, %if.end198 ], [ %indvars.iv322, %44 ] %sext = shl i64 %i.3306, 32 %47 = ashr exact i64 %sext, 32 br label %while.cond117 while.cond117: ; preds = %while.cond117.preheader, %while.body130 %indvars.iv351 = phi i32 [ 0, %while.cond117.preheader ], [ %indvars.iv.next352, %while.body130 ] %indvars.iv336 = phi i64 [ 0, %while.cond117.preheader ], [ %indvars.iv.next337, %while.body130 ] %indvars.iv334 = phi i64 [ %47, %while.cond117.preheader ], [ %indvars.iv.next335, %while.body130 ] %indvars.iv.next335 = add nsw i64 %indvars.iv334, 1 %arrayidx119 = getelementptr inbounds [201 x i8], ptr %st1, i64 0, i64 %indvars.iv.next335 %48 = load i8, ptr %arrayidx119, align 1, !tbaa !5 switch i8 %48, label %while.body130 [ i8 34, label %while.end137 i8 0, label %while.end137 ] while.body130: ; preds = %while.cond117 %arrayidx134 = getelementptr inbounds [201 x i8], ptr %st3, i64 0, i64 %indvars.iv336 store i8 %48, ptr %arrayidx134, align 1, !tbaa !5 %indvars.iv.next337 = add nuw i64 %indvars.iv336, 1 %indvars.iv.next352 = add nuw i32 %indvars.iv351, 1 br label %while.cond117, !llvm.loop !19 while.end137: ; preds = %while.cond117, %while.cond117 %49 = trunc i64 %indvars.iv336 to i32 %sext355 = shl i64 %j.1307, 32 %50 = ashr exact i64 %sext355, 32 br label %while.cond138 while.cond138: ; preds = %while.body151, %while.end137 %indvars.iv343 = phi i64 [ %indvars.iv.next344, %while.body151 ], [ 0, %while.end137 ] %indvars.iv341 = phi i64 [ %indvars.iv.next342, %while.body151 ], [ %50, %while.end137 ] %indvars.iv.next342 = add i64 %indvars.iv341, 1 %arrayidx140 = getelementptr inbounds [201 x i8], ptr %st2, i64 0, i64 %indvars.iv.next342 %51 = load i8, ptr %arrayidx140, align 1, !tbaa !5 switch i8 %51, label %while.body151 [ i8 34, label %while.end158 i8 0, label %while.end158 ] while.body151: ; preds = %while.cond138 %arrayidx155 = getelementptr inbounds [201 x i8], ptr %st4, i64 0, i64 %indvars.iv343 store i8 %51, ptr %arrayidx155, align 1, !tbaa !5 %indvars.iv.next344 = add nuw i64 %indvars.iv343, 1 br label %while.cond138, !llvm.loop !20 while.end158: ; preds = %while.cond138, %while.cond138 %52 = trunc i64 %indvars.iv343 to i32 %cmp159.not = icmp eq i32 %49, %52 br i1 %cmp159.not, label %for.cond169.preheader, label %if.then161 for.cond169.preheader: ; preds = %while.end158 %cmp171.not.not299.not = icmp eq i32 %49, 0 br i1 %cmp171.not.not299.not, label %if.end198, label %for.body173.preheader for.body173.preheader: ; preds = %for.cond169.preheader %wide.trip.count353 = zext i32 %indvars.iv351 to i64 %min.iters.check = icmp ult i32 %indvars.iv351, 8 br i1 %min.iters.check, label %for.body173.preheader421, label %vector.ph vector.ph: ; preds = %for.body173.preheader %n.vec = and i64 %wide.trip.count353, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %61, %vector.body ] %vec.phi364 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %62, %vector.body ] %53 = getelementptr inbounds [201 x i8], ptr %st3, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %53, align 8, !tbaa !5 %54 = getelementptr inbounds i8, ptr %53, i64 4 %wide.load365 = load <4 x i8>, ptr %54, align 4, !tbaa !5 %55 = getelementptr inbounds [201 x i8], ptr %st4, i64 0, i64 %index %wide.load366 = load <4 x i8>, ptr %55, align 8, !tbaa !5 %56 = getelementptr inbounds i8, ptr %55, i64 4 %wide.load367 = load <4 x i8>, ptr %56, align 4, !tbaa !5 %57 = icmp ne <4 x i8> %wide.load, %wide.load366 %58 = icmp ne <4 x i8> %wide.load365, %wide.load367 %59 = zext <4 x i1> %57 to <4 x i32> %60 = zext <4 x i1> %58 to <4 x i32> %61 = add <4 x i32> %vec.phi, %59 %62 = add <4 x i32> %vec.phi364, %60 %index.next = add nuw i64 %index, 8 %63 = icmp eq i64 %index.next, %n.vec br i1 %63, label %middle.block, label %vector.body, !llvm.loop !21 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %62, %61 %64 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count353 br i1 %cmp.n, label %for.end187, label %for.body173.preheader421 for.body173.preheader421: ; preds = %for.body173.preheader, %middle.block %indvars.iv348.ph = phi i64 [ 0, %for.body173.preheader ], [ %n.vec, %middle.block ] %e1.3301.ph = phi i32 [ 0, %for.body173.preheader ], [ %64, %middle.block ] br label %for.body173 if.then161: ; preds = %while.end158 %cmp162 = icmp eq i32 %sw.0308, 1 %spec.select281 = select i1 %cmp162, i32 %e.2309, i32 1 %inc165 = zext i1 %cmp162 to i32 %spec.select282 = add nsw i32 %e2.0310, %inc165 br label %if.end198 for.body173: ; preds = %for.body173.preheader421, %for.body173 %indvars.iv348 = phi i64 [ %indvars.iv.next349, %for.body173 ], [ %indvars.iv348.ph, %for.body173.preheader421 ] %e1.3301 = phi i32 [ %spec.select280, %for.body173 ], [ %e1.3301.ph, %for.body173.preheader421 ] %arrayidx175 = getelementptr inbounds [201 x i8], ptr %st3, i64 0, i64 %indvars.iv348 %65 = load i8, ptr %arrayidx175, align 1, !tbaa !5 %arrayidx178 = getelementptr inbounds [201 x i8], ptr %st4, i64 0, i64 %indvars.iv348 %66 = load i8, ptr %arrayidx178, align 1, !tbaa !5 %cmp180.not = icmp ne i8 %65, %66 %inc183 = zext i1 %cmp180.not to i32 %spec.select280 = add nuw nsw i32 %e1.3301, %inc183 %indvars.iv.next349 = add nuw nsw i64 %indvars.iv348, 1 %exitcond354.not = icmp eq i64 %indvars.iv.next349, %wide.trip.count353 br i1 %exitcond354.not, label %for.end187, label %for.body173, !llvm.loop !22 for.end187: ; preds = %for.body173, %middle.block %spec.select280.lcssa = phi i32 [ %64, %middle.block ], [ %spec.select280, %for.body173 ] %cmp188.not = icmp eq i32 %spec.select280.lcssa, 0 br i1 %cmp188.not, label %if.end198, label %if.then190 if.then190: ; preds = %for.end187 %cmp191 = icmp eq i32 %sw.0308, 1 %spec.select283 = select i1 %cmp191, i32 %e.2309, i32 1 %inc194 = zext i1 %cmp191 to i32 %spec.select284 = add nsw i32 %e2.0310, %inc194 br label %if.end198 if.end198: ; preds = %for.cond169.preheader, %if.then190, %if.then161, %for.end187 %e.3 = phi i32 [ %e.2309, %for.end187 ], [ %spec.select281, %if.then161 ], [ %spec.select283, %if.then190 ], [ %e.2309, %for.cond169.preheader ] %e2.1 = phi i32 [ %e2.0310, %for.end187 ], [ %spec.select282, %if.then161 ], [ %spec.select284, %if.then190 ], [ %e2.0310, %for.cond169.preheader ] %sub199 = sub nsw i32 0, %sw.0308 %sext356 = shl i64 %indvars.iv.next335, 32 %idxprom109 = ashr exact i64 %sext356, 32 %arrayidx110 = getelementptr inbounds [201 x i8], ptr %st1, i64 0, i64 %idxprom109 %67 = load i8, ptr %arrayidx110, align 1, !tbaa !5 %cmp112.not = icmp eq i8 %67, 0 br i1 %cmp112.not, label %while.end200, label %while.cond117.preheader, !llvm.loop !23 while.end200: ; preds = %if.end198, %44 %e.2.lcssa = phi i32 [ %45, %44 ], [ %e.3, %if.end198 ] %e2.0.lcssa = phi i32 [ 0, %44 ], [ %e2.1, %if.end198 ] %cmp201 = icmp eq i32 %e.2.lcssa, 0 %cmp204 = icmp eq i32 %e2.0.lcssa, 0 %or.cond221 = select i1 %cmp201, i1 %cmp204, i1 false br i1 %or.cond221, label %if.end219, label %if.else208 if.else208: ; preds = %while.end200 %cmp209 = icmp eq i32 %e.2.lcssa, 1 %cmp211 = icmp sgt i32 %e2.0.lcssa, 1 %or.cond222 = select i1 %cmp209, i1 true, i1 %cmp211 %str.4.str = select i1 %or.cond222, ptr @str.6, ptr @str br label %if.end219 if.end219: ; preds = %if.else208, %while.end200, %for.end38 %str.5.sink = phi ptr [ @str.6, %for.end38 ], [ @str.5, %while.end200 ], [ %str.4.str, %if.else208 ] %puts275 = call i32 @puts(ptr nonnull dereferenceable(1) %str.5.sink) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %st1) %68 = load i8, ptr %st1, align 16, !tbaa !5 %cmp = icmp eq i8 %68, 46 %69 = load i8, ptr %arrayidx2, align 1 %cmp4 = icmp eq i8 %69, 0 %or.cond = select i1 %cmp, i1 %cmp4, i1 false br i1 %or.cond, label %while.end220, label %if.end while.end220: ; preds = %if.end219, %entry call void @llvm.lifetime.end.p0(i64 201, ptr nonnull %st4) #6 call void @llvm.lifetime.end.p0(i64 201, ptr nonnull %st3) #6 call void @llvm.lifetime.end.p0(i64 201, ptr nonnull %st2) #6 call void @llvm.lifetime.end.p0(i64 201, ptr nonnull %st1) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn 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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9, !10, !11} !9 = !{!"llvm.loop.mustprogress"} !10 = !{!"llvm.loop.isvectorized", i32 1} !11 = !{!"llvm.loop.unroll.runtime.disable"} !12 = distinct !{!12, !9, !10, !11} !13 = distinct !{!13, !9, !11, !10} !14 = distinct !{!14, !9, !11, !10} !15 = distinct !{!15, !9} !16 = distinct !{!16, !9} !17 = distinct !{!17, !9, !10, !11} !18 = distinct !{!18, !9, !11, !10} !19 = distinct !{!19, !9} !20 = distinct !{!20, !9} !21 = distinct !{!21, !9, !10, !11} !22 = distinct !{!22, !9, !11, !10} !23 = distinct !{!23, !9}
#include <stdio.h> //#include <stdlib.h> //#include <string.h> //#include <limits.h> //#include <math.h> int main() { int n; scanf("%d", &n); char s[n+1]; scanf("%s", s); int e[n+1], w[n+1], ans = 300001; w[0] = 0; e[n] = 0; for (int i=1; i<n+1; i++) w[i] = (s[i-1] == 'W') ? w[i-1]+1 : w[i-1]; for (int i=n-1; i>=0; i--) e[i] = (s[i] == 'E') ? e[i+1]+1 : e[i+1]; for (int i=0; i<n; i++) { int cnt = w[i] + e[i+1]; ans = (ans > cnt) ? cnt : ans; } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121027/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121027/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %0, 1 %1 = zext i32 %add to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i8, i64 %1, align 16 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %vla) %3 = load i32, ptr %n, align 4, !tbaa !5 %add2 = add i32 %3, 1 %4 = zext i32 %add2 to i64 %vla3 = alloca i32, i64 %4, align 16 %vla3116 = ptrtoint ptr %vla3 to i64 %vla5 = alloca i32, i64 %4, align 16 store i32 0, ptr %vla5, align 16, !tbaa !5 %idxprom = sext i32 %3 to i64 %arrayidx6 = getelementptr inbounds i32, ptr %vla3, i64 %idxprom store i32 0, ptr %arrayidx6, align 4, !tbaa !5 %cmp.not86 = icmp slt i32 %3, 1 br i1 %cmp.not86, label %for.cond.cleanup52, label %for.body.preheader for.body.preheader: ; preds = %entry %invariant.gep = getelementptr i8, ptr %vla, i64 -1 %5 = add nsw i64 %4, -1 %xtraiter = and i64 %5, 1 %6 = icmp eq i32 %add2, 2 br i1 %6, label %for.cond23.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %5, -2 %invariant.gep145 = getelementptr i32, ptr %vla5, i64 1 br label %for.body for.cond23.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.1, %for.body ] %indvars.iv.unr = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond23.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond23.preheader.unr-lcssa %gep.epil = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv.unr %7 = load i8, ptr %gep.epil, align 1, !tbaa !9 %cmp10.epil = icmp eq i8 %7, 87 %add15.epil = zext i1 %cmp10.epil to i32 %spec.select.epil = add nuw nsw i32 %.unr, %add15.epil %arrayidx20.epil = getelementptr inbounds i32, ptr %vla5, i64 %indvars.iv.unr store i32 %spec.select.epil, ptr %arrayidx20.epil, align 4, !tbaa !5 br label %for.cond23.preheader for.cond23.preheader: ; preds = %for.cond23.preheader.unr-lcssa, %for.body.epil %cmp2489 = icmp sgt i32 %3, 0 br i1 %cmp2489, label %for.body27.preheader, label %for.cond.cleanup52 for.body27.preheader: ; preds = %for.cond23.preheader %8 = zext i32 %3 to i64 %min.iters.check = icmp ult i32 %3, 36 br i1 %min.iters.check, label %for.body27.preheader143, label %vector.scevcheck vector.scevcheck: ; preds = %for.body27.preheader %9 = add nsw i64 %8, -1 %10 = add i32 %3, -1 %11 = trunc i64 %9 to i32 %12 = icmp ult i32 %10, %11 %13 = icmp ugt i64 %9, 4294967295 %14 = or i1 %12, %13 %15 = zext i32 %10 to i64 %16 = shl nuw nsw i64 %15, 2 %scevgep = getelementptr i8, ptr %vla3, i64 %16 %mul.result110.neg = mul nsw i64 %9, -4 %17 = getelementptr i8, ptr %scevgep, i64 %mul.result110.neg %18 = icmp ugt ptr %17, %scevgep %19 = shl nuw nsw i64 %8, 2 %scevgep112 = getelementptr i8, ptr %vla3, i64 %19 %mul.result114.neg = mul nsw i64 %9, -4 %20 = getelementptr i8, ptr %scevgep112, i64 %mul.result114.neg %21 = icmp ugt ptr %20, %scevgep112 %22 = or i1 %18, %14 %23 = or i1 %21, %22 br i1 %23, label %for.body27.preheader143, label %vector.memcheck vector.memcheck: ; preds = %vector.scevcheck %24 = shl nuw nsw i64 %8, 2 %25 = add i64 %24, %vla3116 %26 = add i32 %3, -1 %27 = zext i32 %26 to i64 %28 = shl nuw nsw i64 %27, 2 %29 = add i64 %28, %vla3116 %30 = sub i64 %25, %29 %diff.check = icmp ult i64 %30, 32 br i1 %diff.check, label %for.body27.preheader143, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %8, 4294967288 %ind.end = and i64 %8, 7 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = sub i64 %8, %index %31 = add i64 %offset.idx, 4294967295 %32 = and i64 %31, 4294967295 %33 = getelementptr inbounds i8, ptr %vla, i64 %32 %34 = getelementptr inbounds i8, ptr %33, i64 -3 %wide.load = load <4 x i8>, ptr %34, align 1, !tbaa !9 %reverse = shufflevector <4 x i8> %wide.load, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %35 = getelementptr inbounds i8, ptr %33, i64 -7 %wide.load117 = load <4 x i8>, ptr %35, align 1, !tbaa !9 %reverse118 = shufflevector <4 x i8> %wide.load117, <4 x i8> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %36 = icmp eq <4 x i8> %reverse, <i8 69, i8 69, i8 69, i8 69> %37 = icmp eq <4 x i8> %reverse118, <i8 69, i8 69, i8 69, i8 69> %38 = getelementptr inbounds i32, ptr %vla3, i64 %offset.idx %39 = getelementptr inbounds i32, ptr %38, i64 -3 %wide.load119 = load <4 x i32>, ptr %39, align 4, !tbaa !5 %reverse120 = shufflevector <4 x i32> %wide.load119, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %40 = getelementptr inbounds i32, ptr %38, i64 -7 %wide.load121 = load <4 x i32>, ptr %40, align 4, !tbaa !5 %reverse122 = shufflevector <4 x i32> %wide.load121, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %41 = zext <4 x i1> %36 to <4 x i32> %42 = zext <4 x i1> %37 to <4 x i32> %43 = add nsw <4 x i32> %reverse120, %41 %44 = add nsw <4 x i32> %reverse122, %42 %45 = getelementptr inbounds i32, ptr %vla3, i64 %32 %reverse123 = shufflevector <4 x i32> %43, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %46 = getelementptr inbounds i32, ptr %45, i64 -3 store <4 x i32> %reverse123, ptr %46, align 4, !tbaa !5 %reverse124 = shufflevector <4 x i32> %44, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %47 = getelementptr inbounds i32, ptr %45, i64 -7 store <4 x i32> %reverse124, ptr %47, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %48 = icmp eq i64 %index.next, %n.vec br i1 %48, label %middle.block, label %vector.body, !llvm.loop !10 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %n.vec, %8 br i1 %cmp.n, label %for.cond49.preheader, label %for.body27.preheader143 for.body27.preheader143: ; preds = %vector.memcheck, %vector.scevcheck, %for.body27.preheader, %middle.block %indvars.iv97.ph = phi i64 [ %8, %vector.memcheck ], [ %8, %vector.scevcheck ], [ %8, %for.body27.preheader ], [ %ind.end, %middle.block ] br label %for.body27 for.body: ; preds = %for.body, %for.body.preheader.new %49 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.1, %for.body ] %indvars.iv = phi i64 [ 1, %for.body.preheader.new ], [ %indvars.iv.next.1, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ] %gep = getelementptr i8, ptr %invariant.gep, i64 %indvars.iv %50 = load i8, ptr %gep, align 1, !tbaa !9 %cmp10 = icmp eq i8 %50, 87 %add15 = zext i1 %cmp10 to i32 %spec.select = add nuw nsw i32 %49, %add15 %arrayidx20 = getelementptr inbounds i32, ptr %vla5, i64 %indvars.iv store i32 %spec.select, ptr %arrayidx20, align 4, !tbaa !5 %gep.1 = getelementptr i8, ptr %vla, i64 %indvars.iv %51 = load i8, ptr %gep.1, align 1, !tbaa !9 %cmp10.1 = icmp eq i8 %51, 87 %add15.1 = zext i1 %cmp10.1 to i32 %spec.select.1 = add nuw nsw i32 %spec.select, %add15.1 %gep146 = getelementptr i32, ptr %invariant.gep145, i64 %indvars.iv store i32 %spec.select.1, ptr %gep146, align 4, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond23.preheader.unr-lcssa, label %for.body, !llvm.loop !14 for.cond49.preheader: ; preds = %for.body27, %middle.block br i1 %cmp2489, label %for.body53.preheader, label %for.cond.cleanup52 for.body53.preheader: ; preds = %for.cond49.preheader %wide.trip.count104 = zext i32 %3 to i64 %min.iters.check127 = icmp ult i32 %3, 8 br i1 %min.iters.check127, label %for.body53.preheader141, label %vector.ph128 vector.ph128: ; preds = %for.body53.preheader %n.vec130 = and i64 %8, 4294967288 br label %vector.body133 vector.body133: ; preds = %vector.body133, %vector.ph128 %index134 = phi i64 [ 0, %vector.ph128 ], [ %index.next140, %vector.body133 ] %vec.phi = phi <4 x i32> [ <i32 300001, i32 300001, i32 300001, i32 300001>, %vector.ph128 ], [ %59, %vector.body133 ] %vec.phi135 = phi <4 x i32> [ <i32 300001, i32 300001, i32 300001, i32 300001>, %vector.ph128 ], [ %60, %vector.body133 ] %52 = getelementptr inbounds i32, ptr %vla5, i64 %index134 %wide.load136 = load <4 x i32>, ptr %52, align 16, !tbaa !5 %53 = getelementptr inbounds i32, ptr %52, i64 4 %wide.load137 = load <4 x i32>, ptr %53, align 16, !tbaa !5 %54 = or i64 %index134, 1 %55 = getelementptr inbounds i32, ptr %vla3, i64 %54 %wide.load138 = load <4 x i32>, ptr %55, align 4, !tbaa !5 %56 = getelementptr inbounds i32, ptr %55, i64 4 %wide.load139 = load <4 x i32>, ptr %56, align 4, !tbaa !5 %57 = add nsw <4 x i32> %wide.load138, %wide.load136 %58 = add nsw <4 x i32> %wide.load139, %wide.load137 %59 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi, <4 x i32> %57) %60 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %vec.phi135, <4 x i32> %58) %index.next140 = add nuw i64 %index134, 8 %61 = icmp eq i64 %index.next140, %n.vec130 br i1 %61, label %middle.block125, label %vector.body133, !llvm.loop !15 middle.block125: ; preds = %vector.body133 %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %59, <4 x i32> %60) %62 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n132 = icmp eq i64 %n.vec130, %8 br i1 %cmp.n132, label %for.cond.cleanup52, label %for.body53.preheader141 for.body53.preheader141: ; preds = %for.body53.preheader, %middle.block125 %indvars.iv100.ph = phi i64 [ 0, %for.body53.preheader ], [ %n.vec130, %middle.block125 ] %ans.093.ph = phi i32 [ 300001, %for.body53.preheader ], [ %62, %middle.block125 ] br label %for.body53 for.body27: ; preds = %for.body27.preheader143, %for.body27 %indvars.iv97 = phi i64 [ %indvars.iv.next98, %for.body27 ], [ %indvars.iv97.ph, %for.body27.preheader143 ] %indvars.iv.next98 = add nsw i64 %indvars.iv97, -1 %idxprom28 = and i64 %indvars.iv.next98, 4294967295 %arrayidx29 = getelementptr inbounds i8, ptr %vla, i64 %idxprom28 %63 = load i8, ptr %arrayidx29, align 1, !tbaa !9 %cmp31 = icmp eq i8 %63, 69 %arrayidx36 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv97 %64 = load i32, ptr %arrayidx36, align 4, !tbaa !5 %add37 = zext i1 %cmp31 to i32 %cond43 = add nsw i32 %64, %add37 %arrayidx45 = getelementptr inbounds i32, ptr %vla3, i64 %idxprom28 store i32 %cond43, ptr %arrayidx45, align 4, !tbaa !5 %cmp24 = icmp ugt i64 %indvars.iv97, 1 br i1 %cmp24, label %for.body27, label %for.cond49.preheader, !llvm.loop !16 for.cond.cleanup52: ; preds = %for.body53, %middle.block125, %entry, %for.cond23.preheader, %for.cond49.preheader %ans.0.lcssa = phi i32 [ 300001, %for.cond49.preheader ], [ 300001, %for.cond23.preheader ], [ 300001, %entry ], [ %62, %middle.block125 ], [ %cond65, %for.body53 ] %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %ans.0.lcssa) call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body53: ; preds = %for.body53.preheader141, %for.body53 %indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.body53 ], [ %indvars.iv100.ph, %for.body53.preheader141 ] %ans.093 = phi i32 [ %cond65, %for.body53 ], [ %ans.093.ph, %for.body53.preheader141 ] %arrayidx55 = getelementptr inbounds i32, ptr %vla5, i64 %indvars.iv100 %65 = load i32, ptr %arrayidx55, align 4, !tbaa !5 %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1 %arrayidx58 = getelementptr inbounds i32, ptr %vla3, i64 %indvars.iv.next101 %66 = load i32, ptr %arrayidx58, align 4, !tbaa !5 %add59 = add nsw i32 %66, %65 %cond65 = call i32 @llvm.smin.i32(i32 %ans.093, i32 %add59) %exitcond105.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count104 br i1 %exitcond105.not, label %for.cond.cleanup52, label %for.body53, !llvm.loop !17 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11, !12, !13} !11 = !{!"llvm.loop.mustprogress"} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !11} !15 = distinct !{!15, !11, !12, !13} !16 = distinct !{!16, !11, !12} !17 = distinct !{!17, !11, !13, !12}
#include <stdio.h> #include <string.h> #include <limits.h> int main(void) { int n; char s[300001] = {}; scanf("%d %s", &n, s); size_t l = strlen(s); int e[300001] = {}; int w[300001] = {}; for (size_t i = 0; i < l; i++) { if (s[i] == 'E') { e[i + 1] = e[i] + 1; w[i + 1] = w[i]; } else { e[i + 1] = e[i]; w[i + 1] = w[i] + 1; } } for (size_t i = 0; i < l; i++) { // printf("%d %d\n", e[i], w[i]); } int ret = INT_MAX; for (size_t i = 0; i < l; i++) { int tmp = w[i] - w[0] + e[l] - e[i + 1]; if (tmp < ret) { ret = tmp; } } printf("%d\n", ret); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121070/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121070/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %s\00", align 1 @.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 %s = alloca [300001 x i8], align 16 %e = alloca [300001 x i32], align 16 %w = alloca [300001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 300001, ptr nonnull %s) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(300001) %s, i8 0, i64 300001, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %s) %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #7 call void @llvm.lifetime.start.p0(i64 1200004, ptr nonnull %e) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1200004) %e, i8 0, i64 1200004, i1 false) call void @llvm.lifetime.start.p0(i64 1200004, ptr nonnull %w) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1200004) %w, i8 0, i64 1200004, i1 false) %cmp69.not = icmp eq i64 %call2, 0 br i1 %cmp69.not, label %for.cond.cleanup31, label %for.body for.cond19.preheader: ; preds = %for.inc br i1 %cmp69.not, label %for.cond.cleanup31, label %for.body32.lr.ph for.body: ; preds = %entry, %for.inc %i.070 = phi i64 [ %add6.sink, %for.inc ], [ 0, %entry ] %arrayidx = getelementptr inbounds [300001 x i8], ptr %s, i64 0, i64 %i.070 %0 = load i8, ptr %arrayidx, align 1, !tbaa !5 %cmp3 = icmp eq i8 %0, 69 %arrayidx5 = getelementptr inbounds [300001 x i32], ptr %e, i64 0, i64 %i.070 %1 = load i32, ptr %arrayidx5, align 4, !tbaa !8 br i1 %cmp3, label %if.then, label %if.else if.then: ; preds = %for.body %add = add nsw i32 %1, 1 %add6 = add nuw i64 %i.070, 1 %arrayidx7 = getelementptr inbounds [300001 x i32], ptr %e, i64 0, i64 %add6 store i32 %add, ptr %arrayidx7, align 4, !tbaa !8 %arrayidx8 = getelementptr inbounds [300001 x i32], ptr %w, i64 0, i64 %i.070 %2 = load i32, ptr %arrayidx8, align 4, !tbaa !8 br label %for.inc if.else: ; preds = %for.body %add12 = add nuw i64 %i.070, 1 %arrayidx13 = getelementptr inbounds [300001 x i32], ptr %e, i64 0, i64 %add12 store i32 %1, ptr %arrayidx13, align 4, !tbaa !8 %arrayidx14 = getelementptr inbounds [300001 x i32], ptr %w, i64 0, i64 %i.070 %3 = load i32, ptr %arrayidx14, align 4, !tbaa !8 %add15 = add nsw i32 %3, 1 br label %for.inc for.inc: ; preds = %if.then, %if.else %add6.sink = phi i64 [ %add6, %if.then ], [ %add12, %if.else ] %.sink = phi i32 [ %2, %if.then ], [ %add15, %if.else ] %arrayidx10 = getelementptr inbounds [300001 x i32], ptr %w, i64 0, i64 %add6.sink store i32 %.sink, ptr %arrayidx10, align 4, !tbaa !8 %exitcond.not = icmp eq i64 %add6.sink, %call2 br i1 %exitcond.not, label %for.cond19.preheader, label %for.body, !llvm.loop !10 for.body32.lr.ph: ; preds = %for.cond19.preheader %4 = load i32, ptr %w, align 16, !tbaa !8 %arrayidx35 = getelementptr inbounds [300001 x i32], ptr %e, i64 0, i64 %call2 %5 = load i32, ptr %arrayidx35, align 4, !tbaa !8 %min.iters.check = icmp ult i64 %call2, 8 br i1 %min.iters.check, label %for.body32.preheader, label %vector.ph vector.ph: ; preds = %for.body32.lr.ph %n.vec = and i64 %call2, -8 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %5, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %broadcast.splatinsert79 = insertelement <4 x i32> poison, i32 %4, i64 0 %broadcast.splat80 = shufflevector <4 x i32> %broadcast.splatinsert79, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph ], [ %17, %vector.body ] %vec.phi75 = phi <4 x i32> [ <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, %vector.ph ], [ %18, %vector.body ] %6 = getelementptr inbounds [300001 x i32], ptr %w, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %6, align 16, !tbaa !8 %7 = getelementptr inbounds i32, ptr %6, i64 4 %wide.load76 = load <4 x i32>, ptr %7, align 16, !tbaa !8 %8 = or i64 %index, 1 %9 = getelementptr inbounds [300001 x i32], ptr %e, i64 0, i64 %8 %wide.load77 = load <4 x i32>, ptr %9, align 4, !tbaa !8 %10 = getelementptr inbounds i32, ptr %9, i64 4 %wide.load78 = load <4 x i32>, ptr %10, align 4, !tbaa !8 %11 = add <4 x i32> %wide.load, %broadcast.splat %12 = add <4 x i32> %wide.load76, %broadcast.splat %13 = add <4 x i32> %broadcast.splat80, %wide.load77 %14 = add <4 x i32> %broadcast.splat80, %wide.load78 %15 = sub <4 x i32> %11, %13 %16 = sub <4 x i32> %12, %14 %17 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %15, <4 x i32> %vec.phi) %18 = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %16, <4 x i32> %vec.phi75) %index.next = add nuw i64 %index, 8 %19 = icmp eq i64 %index.next, %n.vec br i1 %19, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %17, <4 x i32> %18) %20 = call i32 @llvm.vector.reduce.smin.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %call2, %n.vec br i1 %cmp.n, label %for.cond.cleanup31, label %for.body32.preheader for.body32.preheader: ; preds = %for.body32.lr.ph, %middle.block %i27.073.ph = phi i64 [ 0, %for.body32.lr.ph ], [ %n.vec, %middle.block ] %ret.072.ph = phi i32 [ 2147483647, %for.body32.lr.ph ], [ %20, %middle.block ] br label %for.body32 for.cond.cleanup31: ; preds = %for.body32, %middle.block, %entry, %for.cond19.preheader %ret.0.lcssa = phi i32 [ 2147483647, %for.cond19.preheader ], [ 2147483647, %entry ], [ %20, %middle.block ], [ %spec.select, %for.body32 ] %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ret.0.lcssa) call void @llvm.lifetime.end.p0(i64 1200004, ptr nonnull %w) #6 call void @llvm.lifetime.end.p0(i64 1200004, ptr nonnull %e) #6 call void @llvm.lifetime.end.p0(i64 300001, ptr nonnull %s) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 for.body32: ; preds = %for.body32.preheader, %for.body32 %i27.073 = phi i64 [ %add37, %for.body32 ], [ %i27.073.ph, %for.body32.preheader ] %ret.072 = phi i32 [ %spec.select, %for.body32 ], [ %ret.072.ph, %for.body32.preheader ] %arrayidx33 = getelementptr inbounds [300001 x i32], ptr %w, i64 0, i64 %i27.073 %21 = load i32, ptr %arrayidx33, align 4, !tbaa !8 %add37 = add nuw i64 %i27.073, 1 %arrayidx38 = getelementptr inbounds [300001 x i32], ptr %e, i64 0, i64 %add37 %22 = load i32, ptr %arrayidx38, align 4, !tbaa !8 %23 = add i32 %21, %5 %24 = add i32 %4, %22 %sub39 = sub i32 %23, %24 %spec.select = call i32 @llvm.smin.i32(i32 %sub39, i32 %ret.072) %exitcond74.not = icmp eq i64 %add37, %call2 br i1 %exitcond74.not, label %for.cond.cleanup31, label %for.body32, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smin.v4i32(<4 x i32>) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !11, !14, !13}
#pragma warning(disable:4996) #include <stdio.h> #include <stdlib.h> #include <string.h> #define _USE_MATH_DEFINES #include <math.h> #include <float.h> #pragma region 定義 typedef long long ll; typedef unsigned long long ull; #define _itoa(A,N) sprintf(A, "%d", N); int i_dsort(const void* a, const void* b); int i_asort(const void* a, const void* b); int _gcd(int a, int b); int _swp(int* a, int* b); int _cknum(char* a, int n); int _atoi(char* s, int len); int s_asort(const void* a, const void* b); int s_dsort(const void* a, const void* b); //昇順 int s_asort(const void* a, const void* b) { return(strcmp((char*)a, (char*)b)); } int s_dsort(const void* a, const void* b) { return(strcmp((char*)b, (char*)a)); } int i_dsort(const void* a, const void* b) { return(*(int*)b - *(int*)a); } int i_asort(const void* a, const void* b) { return(*(int*)a - *(int*)b); } int i_gcd(int a, int b); int i_gcd(int a, int b) { if (!b)return a; return i_gcd(b, a % b); } int i_lcm(int a, int b); int i_lcm(int a, int b) { return (a * b) / i_gcd(a, b); } int ll_gcd(ll a, ll b); int ll_gcd(ll a, ll b) { if (!b)return a; return ll_gcd(b, a % b); } int ll_lcm(ll a, ll b); int ll_lcm(ll a, ll b) { return (a * b) / ll_gcd(a, b); } // puts("Yes\n") puts("No\n") // scanf("%d.%d") 浮動小数点入力を整数2つで得る //#define pai 3.1415926535 //#define _USE_MATH_DEFINES でM_PIが使える #define deg_rad(X) (X*(M_PI/180)) int _swp(int* a, int* b) { int tmp; tmp = *b; *b = *a; *a = tmp; return 0; } #define _abs(x) ((x)>0?(x):-(x)) #define _min(x,y) ((x)<(y)?(x):(y)) #define _max(x,y) ((x)<(y)?(y):(x)) int _cknum(char* a, int n) { int i; char t = '0'; for (i = 0; i < n; i++) { if (a[i] < '0' || a[i]>'9') return 1; } return 0; } int _atoi(char* s, int len) { char tmp[20]; memcpy(tmp, s, len); tmp[len] = 0x00; return (atoi(tmp)); } //素因数分解 pf素数が入る pc 素数の数 //ll _pfact(ll a); //static ll pf[100000000]; //static ll pc; // //ll _pfact(ll a) { // long i, r; // if (a % 2 == 0) { // pf[pc] = 2; pc++; // return(_pfact(a / 2)); // } // r = sqrt(a); // for (i = 3; i <= r; i += 2) { // if (a % i == 0) { // pf[pc] = i; pc++; // return(_pfact(a / i)); // } // } // if (a != 1) { // pf[pc] = a; pc++; // } // return 0; // //} //同じものの最初の文字をNULLにして降順 int _sort(const void* a, const void* b); int _sort(const void* a, const void* b) { char rc; rc = strcmp((char*)b, (char*)a); if (rc == 0) { *(char*)a = 0x00; return(1); } return(rc); } // 立っている ビットの数 int bitcount(unsigned int uc); int bitcount(unsigned int uc) { int bit; for (bit = 0; 0 != uc; uc = (unsigned int)(uc >> 1)) if (0 != (uc & 1))++bit; return bit; }//bitco //10進数の桁数の総和 int _sumdig(int n); int _sumdig(int n) { int sum = 0; while (n > 0) { sum += n % 10;n /= 10;} return(sum); } #define _rnd(a,b) ((a+b-1)/b) // A/Bの余りを繰り上げる #define _abs(x) ((x)<0 ? -(x) : (x)) #define _MAX 200000 #pragma endregion // ABC145 C - Average Length //int main(void) { // int n,i, x[9],y[9],cnt=0; // double sum=0; // // scanf("%d", &n); // for (i = 0; i < n; i++) // scanf("%d %d", &x[i], &y[i]); // // for(i=0;i<n-1;i++) // for (int j = i + 1; j < n; j++) { // sum += hypot(x[i] - x[j], y[i] - y[j]); // cnt++; // printf("%d %lf\n", cnt, sum); // } // printf("%lf\n",sum/cnt); // return 0; //} // C - Sugar Water //int main(void) { // int a, b, c, d, e, f; // int mn, mx; // scanf("%d%d%d%d%d%d", &a, &b, &c, &d, &e, &f); // // int tmp,i; // for (i = 1;; i++) { // tmp = i * 100 + i * e; // if (tmp > f) break; // if (i % a && i % b)continue; // if (i % c && i % d)continue; // break; // } // // printf("%d %d", i * 100, tmp); // return 0; //} //AGC 013 A - Sorted Arrays //int main(void) { // int a,b,n,flg,cnt=1; // // scanf("%d", &n); // scanf("%d%d", &b,&a); // flg = a - b; b = a; // for (int i = 2; i < n; i++) { // scanf("%d", &a); // if (a - b != flg && a-b && flg) // cnt++; // flg = a - b; // b = a; // } // printf("%d", cnt); // return 0; // //} //ABC071 C - Make a Rectangle static int a[100001]; int main(void) { int n; scanf("%d", &n); int i; for (i = 0; i < n; i++) scanf("%d", &a[i]); qsort(a, n, sizeof(int), i_dsort); for (i = 0; i < n; i++) if (a[i] == a[i + 1])break; if (i == n){printf("0\n"); return 0;} ll ans = (ll)a[i]; i+=2; for(;i<n;i++) if (a[i] == a[i + 1])break; if (i == n) { printf("0\n"); return 0; } printf("%lld\n",ans * (ll)a[i]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121113/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121113/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @a = internal global [100001 x i32] zeroinitializer, align 16 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_asort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { 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 #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_dsort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 { 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 @i_dsort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #2 { 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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @i_asort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 { 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 norecurse nosync nounwind memory(none) uwtable define dso_local i32 @i_gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %tobool.not4 = icmp eq i32 %b, 0 br i1 %tobool.not4, label %return, label %if.end if.end: ; preds = %entry, %if.end %b.tr6 = phi i32 [ %rem, %if.end ], [ %b, %entry ] %a.tr5 = phi i32 [ %b.tr6, %if.end ], [ %a, %entry ] %rem = srem i32 %a.tr5, %b.tr6 %tobool.not = icmp eq i32 %rem, 0 br i1 %tobool.not, label %return, label %if.end return: ; preds = %if.end, %entry %a.tr.lcssa = phi i32 [ %a, %entry ], [ %b.tr6, %if.end ] ret i32 %a.tr.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @i_lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %tobool.not4.i = icmp eq i32 %b, 0 br i1 %tobool.not4.i, label %i_gcd.exit, label %if.end.i if.end.i: ; preds = %entry, %if.end.i %b.tr6.i = phi i32 [ %rem.i, %if.end.i ], [ %b, %entry ] %a.tr5.i = phi i32 [ %b.tr6.i, %if.end.i ], [ %a, %entry ] %rem.i = srem i32 %a.tr5.i, %b.tr6.i %tobool.not.i = icmp eq i32 %rem.i, 0 br i1 %tobool.not.i, label %i_gcd.exit, label %if.end.i i_gcd.exit: ; preds = %if.end.i, %entry %a.tr.lcssa.i = phi i32 [ %a, %entry ], [ %b.tr6.i, %if.end.i ] %mul = mul nsw i32 %b, %a %div = sdiv i32 %mul, %a.tr.lcssa.i ret i32 %div } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @ll_gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %tobool.not4 = icmp eq i64 %b, 0 br i1 %tobool.not4, label %if.then, label %if.end if.then: ; preds = %if.end, %entry %a.tr.lcssa = phi i64 [ %a, %entry ], [ %b.tr6, %if.end ] %conv = trunc i64 %a.tr.lcssa to i32 ret i32 %conv if.end: ; preds = %entry, %if.end %b.tr6 = phi i64 [ %rem, %if.end ], [ %b, %entry ] %a.tr5 = phi i64 [ %b.tr6, %if.end ], [ %a, %entry ] %rem = srem i64 %a.tr5, %b.tr6 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %if.then, label %if.end } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @ll_lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %tobool.not4.i = icmp eq i64 %b, 0 br i1 %tobool.not4.i, label %ll_gcd.exit, label %if.end.i if.end.i: ; preds = %entry, %if.end.i %b.tr6.i = phi i64 [ %rem.i, %if.end.i ], [ %b, %entry ] %a.tr5.i = phi i64 [ %b.tr6.i, %if.end.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 %ll_gcd.exit, label %if.end.i ll_gcd.exit: ; preds = %if.end.i, %entry %a.tr.lcssa.i = phi i64 [ %a, %entry ], [ %b.tr6.i, %if.end.i ] %mul = mul nsw i64 %b, %a %sext = shl i64 %a.tr.lcssa.i, 32 %conv = ashr exact i64 %sext, 32 %div = sdiv i64 %mul, %conv %conv1 = trunc i64 %div to i32 ret i32 %conv1 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @_swp(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %b, align 4, !tbaa !5 %1 = load i32, ptr %a, align 4, !tbaa !5 store i32 %1, ptr %b, align 4, !tbaa !5 store i32 %0, ptr %a, align 4, !tbaa !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) #5 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #5 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @_cknum(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #6 { entry: %cmp13 = icmp sgt i32 %n, 0 br i1 %cmp13, label %for.body.preheader, label %cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.cond: ; preds = %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !9 for.body: ; preds = %for.body.preheader, %for.cond %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ] %arrayidx = getelementptr inbounds i8, ptr %a, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !11 %1 = add i8 %0, -58 %or.cond = icmp ult i8 %1, -10 br i1 %or.cond, label %cleanup, label %for.cond cleanup: ; preds = %for.body, %for.cond, %entry %retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %for.body ] ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn uwtable define dso_local i32 @_atoi(ptr nocapture noundef readonly %s, i32 noundef %len) local_unnamed_addr #7 { entry: %tmp = alloca [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %tmp) #17 %conv = sext i32 %len to i64 call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %tmp, ptr align 1 %s, i64 %conv, i1 false) %arrayidx = getelementptr inbounds [20 x i8], ptr %tmp, i64 0, i64 %conv store i8 0, ptr %arrayidx, align 1, !tbaa !11 %call.i = call i64 @strtol(ptr nocapture noundef nonnull %tmp, ptr noundef null, i32 noundef 10) #17 %conv.i = trunc i64 %call.i to i32 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %tmp) #17 ret i32 %conv.i } ; 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) #8 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite) uwtable define dso_local i32 @_sort(ptr nocapture noundef %a, ptr nocapture noundef readonly %b) local_unnamed_addr #9 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #16 %sext = shl i32 %call, 24 %cmp = icmp eq i32 %sext, 0 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i8 0, ptr %a, align 1, !tbaa !11 br label %cleanup if.end: ; preds = %entry %conv1 = ashr exact i32 %sext, 24 br label %cleanup cleanup: ; preds = %if.end, %if.then %retval.0 = phi i32 [ 1, %if.then ], [ %conv1, %if.end ] ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @bitcount(i32 noundef %uc) local_unnamed_addr #3 { entry: %cmp.not5 = icmp eq i32 %uc, 0 br i1 %cmp.not5, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %bit.07 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %uc.addr.06 = phi i32 [ %shr, %for.body ], [ %uc, %entry ] %and = and i32 %uc.addr.06, 1 %spec.select = add i32 %bit.07, %and %shr = lshr i32 %uc.addr.06, 1 %cmp.not = icmp ult i32 %uc.addr.06, 2 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !12 for.end: ; preds = %for.body, %entry %bit.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] ret i32 %bit.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @_sumdig(i32 noundef %n) local_unnamed_addr #3 { entry: %cmp4 = icmp sgt i32 %n, 0 br i1 %cmp4, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %sum.06 = phi i32 [ %add, %while.body ], [ 0, %entry ] %n.addr.05 = phi i32 [ %div, %while.body ], [ %n, %entry ] %rem = urem i32 %n.addr.05, 10 %add = add nuw nsw i32 %sum.06, %rem %div = udiv i32 %n.addr.05, 10 %cmp.not = icmp ult i32 %n.addr.05, 10 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %while.body, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] ret i32 %sum.0.lcssa } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #10 { 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 !5 %cmp68 = icmp sgt i32 %0, 0 br i1 %cmp68, 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 [100001 x i32], ptr @a, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14 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 @a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @i_dsort) #17 %3 = load i32, ptr %n, align 4, !tbaa !5 %smax = call i32 @llvm.smax.i32(i32 %3, i32 0) %wide.trip.count = zext i32 %smax to i64 br label %for.cond2 for.cond2: ; preds = %for.body5, %for.end %indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.body5 ], [ 0, %for.end ] %exitcond.not = icmp eq i64 %indvars.iv71, %wide.trip.count br i1 %exitcond.not, label %for.end14, label %for.body5 for.body5: ; preds = %for.cond2 %arrayidx7 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv71 %4 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1 %arrayidx9 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv.next72 %5 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %cmp10 = icmp eq i32 %4, %5 br i1 %cmp10, label %for.end14.split.loop.exit, label %for.cond2, !llvm.loop !15 for.end14.split.loop.exit: ; preds = %for.body5 %6 = trunc i64 %indvars.iv71 to i32 br label %for.end14 for.end14: ; preds = %for.cond2, %for.end14.split.loop.exit %i.1.lcssa = phi i32 [ %6, %for.end14.split.loop.exit ], [ %smax, %for.cond2 ] %cmp15 = icmp eq i32 %i.1.lcssa, %3 br i1 %cmp15, label %if.then17, label %if.end19 if.then17: ; preds = %for.end14 %puts66 = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup49 if.end19: ; preds = %for.end14 %idxprom20 = zext i32 %i.1.lcssa to i64 %arrayidx21 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %idxprom20 %7 = load i32, ptr %arrayidx21, align 4, !tbaa !5 %conv22 = sext i32 %7 to i64 %add23 = add i32 %i.1.lcssa, 2 %8 = add nuw nsw i64 %idxprom20, 2 %smax76 = call i32 @llvm.smax.i32(i32 %3, i32 %add23) br label %for.cond24 for.cond24: ; preds = %for.body27, %if.end19 %indvars.iv74 = phi i64 [ %indvars.iv.next75, %for.body27 ], [ %8, %if.end19 ] %9 = trunc i64 %indvars.iv74 to i32 %cmp25 = icmp sgt i32 %3, %9 br i1 %cmp25, label %for.body27, label %for.end39 for.body27: ; preds = %for.cond24 %arrayidx29 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv74 %10 = load i32, ptr %arrayidx29, align 4, !tbaa !5 %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1 %arrayidx32 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %indvars.iv.next75 %11 = load i32, ptr %arrayidx32, align 4, !tbaa !5 %cmp33 = icmp eq i32 %10, %11 br i1 %cmp33, label %for.end39, label %for.cond24, !llvm.loop !16 for.end39: ; preds = %for.body27, %for.cond24 %i.2.lcssa = phi i32 [ %9, %for.body27 ], [ %smax76, %for.cond24 ] %cmp40 = icmp eq i32 %i.2.lcssa, %3 br i1 %cmp40, label %if.then42, label %if.end44 if.then42: ; preds = %for.end39 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.3) br label %cleanup49 if.end44: ; preds = %for.end39 %idxprom45 = zext i32 %i.2.lcssa to i64 %arrayidx46 = getelementptr inbounds [100001 x i32], ptr @a, i64 0, i64 %idxprom45 %12 = load i32, ptr %arrayidx46, align 4, !tbaa !5 %conv47 = sext i32 %12 to i64 %mul = mul nsw i64 %conv47, %conv22 %call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mul) br label %cleanup49 cleanup49: ; preds = %if.then42, %if.end44, %if.then17 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #17 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #12 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #11 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #13 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #14 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #15 attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { 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 #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #6 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #9 = { mustprogress nofree 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 #10 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 "no-trapping-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 "no-trapping-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 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #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 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10}
#include <stdio.h> #define MAX_DATA 100000 int temp[MAX_DATA]; /* 最小でも配列と同じサイズの領域が必要 */ void MergeSort(int x[ ], int left, int right); /* 配列 x[ ] の left から right の要素のマージソートを行う */ void MergeSort(int x[ ], int left, int right) { int mid, i, j, k; if (left >= right) /* 配列の要素がひとつなら */ return; /* 何もしないで戻る */ /* ここでは分割しているだけ */ mid = (left + right) / 2; /* 中央の値より */ MergeSort(x, left, mid); /* 左を再帰呼び出し */ MergeSort(x, mid + 1, right); /* 右を再帰呼び出し */ /* x[left] から x[mid] を作業領域にコピー */ for (i = left; i <= mid; i++) temp[i] = x[i]; /* x[mid + 1] から x[right] は逆順にコピー */ for (i = mid + 1, j = right; i <= right; i++, j--) temp[i] = x[j]; i = left; /* i とj は作業領域のデーターを */ j = right; /* k は配列の要素を指している */ for (k = left; k <= right; k++) /* 小さい方から配列に戻す */ if (temp[i] <= temp[j]) /* ここでソートされる */ x[k] = temp[i++]; else x[k] = temp[j--]; } int main(void) { int i,j; /* ソートされるデータ */ int A[100000],N; long int eg[2]; for(i=0;i<100000;i++){ A[i]=0; } scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&A[i]); } MergeSort(A, 0, N - 1); for(j=0;j<2;j++){ for(i=1;i<N;i++){ if(A[N-i]==A[N-i-1]){ eg[j]=A[N-i]; A[N-i]=-2;A[N-i-1]=-1; break; } } } printf("%ld\n",eg[0]*eg[1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121157/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121157/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @temp = dso_local local_unnamed_addr global [100000 x i32] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable define dso_local void @MergeSort(ptr noundef %x, i32 noundef %left, i32 noundef %right) local_unnamed_addr #0 { entry: %x101 = ptrtoint ptr %x to i64 %cmp.not = icmp slt i32 %left, %right br i1 %cmp.not, label %if.end, label %cleanup if.end: ; preds = %entry %add = add nsw i32 %right, %left %div = sdiv i32 %add, 2 tail call void @MergeSort(ptr noundef %x, i32 noundef %left, i32 noundef %div) %add1 = add nsw i32 %div, 1 tail call void @MergeSort(ptr noundef %x, i32 noundef %add1, i32 noundef %right) %cmp2.not76 = icmp slt i32 %div, %left br i1 %cmp2.not76, label %for.cond6.preheader, label %for.body.preheader for.body.preheader: ; preds = %if.end %0 = sext i32 %left to i64 %1 = sub i32 %div, %left %2 = zext i32 %1 to i64 %3 = add nuw nsw i64 %2, 1 %min.iters.check = icmp ult i32 %1, 15 br i1 %min.iters.check, label %for.body.preheader127, label %vector.memcheck vector.memcheck: ; preds = %for.body.preheader %4 = shl nsw i64 %0, 2 %5 = add i64 %4, ptrtoint (ptr @temp to i64) %6 = add i64 %4, %x101 %7 = sub i64 %5, %6 %diff.check = icmp ult i64 %7, 32 br i1 %diff.check, label %for.body.preheader127, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %3, 8589934584 %ind.end = add nsw i64 %n.vec, %0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = add i64 %index, %0 %8 = getelementptr inbounds i32, ptr %x, i64 %offset.idx %wide.load = load <4 x i32>, ptr %8, align 4, !tbaa !5 %9 = getelementptr inbounds i32, ptr %8, i64 4 %wide.load102 = load <4 x i32>, ptr %9, align 4, !tbaa !5 %10 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %offset.idx store <4 x i32> %wide.load, ptr %10, align 4, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 store <4 x i32> %wide.load102, ptr %11, align 4, !tbaa !5 %index.next = add nuw i64 %index, 8 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %3, %n.vec br i1 %cmp.n, label %for.cond6.preheader, label %for.body.preheader127 for.body.preheader127: ; preds = %vector.memcheck, %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ %0, %vector.memcheck ], [ %0, %for.body.preheader ], [ %ind.end, %middle.block ] %13 = add nsw i32 %div, 1 %14 = trunc i64 %indvars.iv.ph to i32 %15 = sub i32 %13, %14 %16 = sub i32 %div, %14 %xtraiter = and i32 %15, 3 %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader127, %for.body.prol %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %indvars.iv.ph, %for.body.preheader127 ] %prol.iter = phi i32 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader127 ] %arrayidx.prol = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.prol %17 = load i32, ptr %arrayidx.prol, align 4, !tbaa !5 %arrayidx4.prol = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %indvars.iv.prol store i32 %17, ptr %arrayidx4.prol, align 4, !tbaa !5 %indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, 1 %prol.iter.next = add i32 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !13 for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader127 %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %for.body.preheader127 ], [ %indvars.iv.next.prol, %for.body.prol ] %18 = icmp ult i32 %16, 3 br i1 %18, label %for.cond6.preheader, label %for.body for.cond6.preheader: ; preds = %for.body.prol.loopexit, %for.body, %middle.block, %if.end %cmp7.not78.not = icmp slt i32 %div, %right br i1 %cmp7.not78.not, label %for.body8.preheader, label %for.cond16.preheader for.body8.preheader: ; preds = %for.cond6.preheader %19 = sext i32 %right to i64 %narrow = add nsw i32 %div, 1 %20 = sext i32 %narrow to i64 %21 = add i32 %right, 1 %22 = xor i32 %div, -1 %23 = add i32 %22, %right %24 = zext i32 %23 to i64 %25 = add nuw nsw i64 %24, 1 %min.iters.check109 = icmp ult i32 %23, 27 br i1 %min.iters.check109, label %for.body8.preheader126, label %vector.memcheck103 vector.memcheck103: ; preds = %for.body8.preheader %26 = sext i32 %div to i64 %27 = shl nsw i64 %26, 2 %28 = getelementptr i8, ptr @temp, i64 %27 %29 = xor i32 %div, -1 %30 = add i32 %29, %right %31 = zext i32 %30 to i64 %32 = shl nuw nsw i64 %31, 2 %33 = getelementptr i8, ptr @temp, i64 %27 %34 = getelementptr i8, ptr %33, i64 %32 %scevgep104 = getelementptr i8, ptr %34, i64 8 %35 = shl nsw i64 %19, 2 %36 = sub nsw i64 %35, %32 %scevgep105 = getelementptr i8, ptr %x, i64 %36 %37 = getelementptr i8, ptr %x, i64 %35 %bound0 = icmp ult ptr %28, %37 %bound1 = icmp ult ptr %scevgep105, %scevgep104 %found.conflict = and i1 %bound0, %bound1 br i1 %found.conflict, label %for.body8.preheader126, label %vector.ph110 vector.ph110: ; preds = %vector.memcheck103 %n.vec112 = and i64 %25, 8589934584 %ind.end113 = add nsw i64 %n.vec112, %20 %ind.end115 = sub nsw i64 %19, %n.vec112 br label %vector.body118 vector.body118: ; preds = %vector.body118, %vector.ph110 %index119 = phi i64 [ 0, %vector.ph110 ], [ %index.next125, %vector.body118 ] %offset.idx120 = sub i64 %19, %index119 %offset.idx121 = add i64 %index119, %20 %38 = getelementptr inbounds i32, ptr %x, i64 %offset.idx120 %39 = getelementptr inbounds i32, ptr %38, i64 -3 %wide.load122 = load <4 x i32>, ptr %39, align 4, !tbaa !5, !alias.scope !15 %reverse = shufflevector <4 x i32> %wide.load122, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %40 = getelementptr inbounds i32, ptr %38, i64 -7 %wide.load123 = load <4 x i32>, ptr %40, align 4, !tbaa !5, !alias.scope !15 %reverse124 = shufflevector <4 x i32> %wide.load123, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0> %41 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %offset.idx121 store <4 x i32> %reverse, ptr %41, align 4, !tbaa !5, !alias.scope !18, !noalias !15 %42 = getelementptr inbounds i32, ptr %41, i64 4 store <4 x i32> %reverse124, ptr %42, align 4, !tbaa !5, !alias.scope !18, !noalias !15 %index.next125 = add nuw i64 %index119, 8 %43 = icmp eq i64 %index.next125, %n.vec112 br i1 %43, label %middle.block107, label %vector.body118, !llvm.loop !20 middle.block107: ; preds = %vector.body118 %cmp.n117 = icmp eq i64 %25, %n.vec112 br i1 %cmp.n117, label %for.cond16.preheader, label %for.body8.preheader126 for.body8.preheader126: ; preds = %vector.memcheck103, %for.body8.preheader, %middle.block107 %indvars.iv89.ph = phi i64 [ %20, %vector.memcheck103 ], [ %20, %for.body8.preheader ], [ %ind.end113, %middle.block107 ] %indvars.iv87.ph = phi i64 [ %19, %vector.memcheck103 ], [ %19, %for.body8.preheader ], [ %ind.end115, %middle.block107 ] %44 = add i32 %right, 1 %45 = trunc i64 %indvars.iv89.ph to i32 %46 = sub i32 %44, %45 %47 = sub i32 %right, %45 %xtraiter128 = and i32 %46, 3 %lcmp.mod129.not = icmp eq i32 %xtraiter128, 0 br i1 %lcmp.mod129.not, label %for.body8.prol.loopexit, label %for.body8.prol for.body8.prol: ; preds = %for.body8.preheader126, %for.body8.prol %indvars.iv89.prol = phi i64 [ %indvars.iv.next90.prol, %for.body8.prol ], [ %indvars.iv89.ph, %for.body8.preheader126 ] %indvars.iv87.prol = phi i64 [ %indvars.iv.next88.prol, %for.body8.prol ], [ %indvars.iv87.ph, %for.body8.preheader126 ] %prol.iter130 = phi i32 [ %prol.iter130.next, %for.body8.prol ], [ 0, %for.body8.preheader126 ] %arrayidx10.prol = getelementptr inbounds i32, ptr %x, i64 %indvars.iv87.prol %48 = load i32, ptr %arrayidx10.prol, align 4, !tbaa !5 %arrayidx12.prol = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %indvars.iv89.prol store i32 %48, ptr %arrayidx12.prol, align 4, !tbaa !5 %indvars.iv.next90.prol = add nsw i64 %indvars.iv89.prol, 1 %indvars.iv.next88.prol = add nsw i64 %indvars.iv87.prol, -1 %prol.iter130.next = add i32 %prol.iter130, 1 %prol.iter130.cmp.not = icmp eq i32 %prol.iter130.next, %xtraiter128 br i1 %prol.iter130.cmp.not, label %for.body8.prol.loopexit, label %for.body8.prol, !llvm.loop !21 for.body8.prol.loopexit: ; preds = %for.body8.prol, %for.body8.preheader126 %indvars.iv89.unr = phi i64 [ %indvars.iv89.ph, %for.body8.preheader126 ], [ %indvars.iv.next90.prol, %for.body8.prol ] %indvars.iv87.unr = phi i64 [ %indvars.iv87.ph, %for.body8.preheader126 ], [ %indvars.iv.next88.prol, %for.body8.prol ] %49 = icmp ult i32 %47, 3 br i1 %49, label %for.cond16.preheader, label %for.body8.preheader126.new for.body8.preheader126.new: ; preds = %for.body8.prol.loopexit %invariant.gep = getelementptr i32, ptr %x, i64 -1 %invariant.gep131 = getelementptr i32, ptr %x, i64 -2 %invariant.gep133 = getelementptr i32, ptr %x, i64 -3 br label %for.body8 for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv = phi i64 [ %indvars.iv.next.3, %for.body ], [ %indvars.iv.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i32, ptr %x, i64 %indvars.iv %50 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx4 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %indvars.iv store i32 %50, ptr %arrayidx4, align 4, !tbaa !5 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next %51 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %arrayidx4.1 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %indvars.iv.next store i32 %51, ptr %arrayidx4.1, align 4, !tbaa !5 %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next.1 %52 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %arrayidx4.2 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %indvars.iv.next.1 store i32 %52, ptr %arrayidx4.2, align 4, !tbaa !5 %indvars.iv.next.2 = add nsw i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv.next.2 %53 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %arrayidx4.3 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %indvars.iv.next.2 store i32 %53, ptr %arrayidx4.3, align 4, !tbaa !5 %indvars.iv.next.3 = add nsw i64 %indvars.iv, 4 %lftr.wideiv.3 = trunc i64 %indvars.iv.next.3 to i32 %exitcond.not.3 = icmp eq i32 %add1, %lftr.wideiv.3 br i1 %exitcond.not.3, label %for.cond6.preheader, label %for.body, !llvm.loop !22 for.cond16.preheader: ; preds = %for.body8.prol.loopexit, %for.body8, %middle.block107, %for.cond6.preheader %cmp17.not81 = icmp sgt i32 %left, %right br i1 %cmp17.not81, label %cleanup, label %for.body18.preheader for.body18.preheader: ; preds = %for.cond16.preheader %54 = sext i32 %left to i64 %55 = add i32 %right, 1 br label %for.body18 for.body8: ; preds = %for.body8, %for.body8.preheader126.new %indvars.iv89 = phi i64 [ %indvars.iv89.unr, %for.body8.preheader126.new ], [ %indvars.iv.next90.3, %for.body8 ] %indvars.iv87 = phi i64 [ %indvars.iv87.unr, %for.body8.preheader126.new ], [ %indvars.iv.next88.3, %for.body8 ] %arrayidx10 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv87 %56 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %arrayidx12 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %indvars.iv89 store i32 %56, ptr %arrayidx12, align 4, !tbaa !5 %indvars.iv.next90 = add nsw i64 %indvars.iv89, 1 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv87 %57 = load i32, ptr %gep, align 4, !tbaa !5 %arrayidx12.1 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %indvars.iv.next90 store i32 %57, ptr %arrayidx12.1, align 4, !tbaa !5 %indvars.iv.next90.1 = add nsw i64 %indvars.iv89, 2 %gep132 = getelementptr i32, ptr %invariant.gep131, i64 %indvars.iv87 %58 = load i32, ptr %gep132, align 4, !tbaa !5 %arrayidx12.2 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %indvars.iv.next90.1 store i32 %58, ptr %arrayidx12.2, align 4, !tbaa !5 %indvars.iv.next90.2 = add nsw i64 %indvars.iv89, 3 %gep134 = getelementptr i32, ptr %invariant.gep133, i64 %indvars.iv87 %59 = load i32, ptr %gep134, align 4, !tbaa !5 %arrayidx12.3 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %indvars.iv.next90.2 store i32 %59, ptr %arrayidx12.3, align 4, !tbaa !5 %indvars.iv.next90.3 = add nsw i64 %indvars.iv89, 4 %indvars.iv.next88.3 = add nsw i64 %indvars.iv87, -4 %lftr.wideiv94.3 = trunc i64 %indvars.iv.next90.3 to i32 %exitcond95.not.3 = icmp eq i32 %21, %lftr.wideiv94.3 br i1 %exitcond95.not.3, label %for.cond16.preheader, label %for.body8, !llvm.loop !23 for.body18: ; preds = %for.body18.preheader, %for.body18 %indvars.iv96 = phi i64 [ %54, %for.body18.preheader ], [ %indvars.iv.next97, %for.body18 ] %j.183 = phi i32 [ %right, %for.body18.preheader ], [ %j.2, %for.body18 ] %i.282 = phi i32 [ %left, %for.body18.preheader ], [ %i.3, %for.body18 ] %idxprom19 = sext i32 %i.282 to i64 %arrayidx20 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %idxprom19 %60 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %idxprom21 = sext i32 %j.183 to i64 %arrayidx22 = getelementptr inbounds [100000 x i32], ptr @temp, i64 0, i64 %idxprom21 %61 = load i32, ptr %arrayidx22, align 4, !tbaa !5 %cmp23.not = icmp sle i32 %60, %61 %.sink = tail call i32 @llvm.smin.i32(i32 %60, i32 %61) %inc25 = zext i1 %cmp23.not to i32 %i.3 = add nsw i32 %i.282, %inc25 %not.cmp23.not = xor i1 %cmp23.not, true %dec30 = sext i1 %not.cmp23.not to i32 %j.2 = add nsw i32 %j.183, %dec30 %62 = getelementptr inbounds i32, ptr %x, i64 %indvars.iv96 store i32 %.sink, ptr %62, align 4 %indvars.iv.next97 = add nsw i64 %indvars.iv96, 1 %lftr.wideiv99 = trunc i64 %indvars.iv.next97 to i32 %exitcond100.not = icmp eq i32 %55, %lftr.wideiv99 br i1 %exitcond100.not, label %cleanup, label %for.body18, !llvm.loop !24 cleanup: ; preds = %for.body18, %for.cond16.preheader, %entry ret void } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %A = alloca [100000 x i32], align 16 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %A) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400000) %A, i8 0, i64 400000, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp265 = icmp sgt i32 %0, 0 br i1 %cmp265, label %for.body3, label %for.end9 for.body3: ; preds = %entry, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %entry ] %arrayidx5 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %N, align 4, !tbaa !5 %2 = sext i32 %1 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %2 br i1 %cmp2, label %for.body3, label %for.end9, !llvm.loop !25 for.end9: ; preds = %for.body3, %entry %.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body3 ] %sub = add nsw i32 %.lcssa, -1 call void @MergeSort(ptr noundef nonnull %A, i32 noundef 0, i32 noundef %sub) %3 = load i32, ptr %N, align 4, !tbaa !5 %cmp1467 = icmp sgt i32 %3, 1 call void @llvm.assume(i1 %cmp1467) %4 = zext i32 %3 to i64 %wide.trip.count = zext i32 %3 to i64 br label %for.body15.us for.body15.us: ; preds = %for.end9, %for.inc36.us %indvars.iv78 = phi i64 [ 1, %for.end9 ], [ %indvars.iv.next79, %for.inc36.us ] %5 = sub nsw i64 %4, %indvars.iv78 %arrayidx18.us = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %5 %6 = load i32, ptr %arrayidx18.us, align 4, !tbaa !5 %7 = add nsw i64 %5, -1 %arrayidx22.us = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %7 %8 = load i32, ptr %arrayidx22.us, align 4, !tbaa !5 %cmp23.us = icmp eq i32 %6, %8 br i1 %cmp23.us, label %if.then.us, label %for.inc36.us for.inc36.us: ; preds = %for.body15.us %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %exitcond.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count br i1 %exitcond.not, label %for.inc39.us, label %for.body15.us, !llvm.loop !26 if.then.us: ; preds = %for.body15.us %arrayidx18.us.le = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %5 %9 = trunc i64 %indvars.iv78 to i32 %conv.us = sext i32 %6 to i64 store i32 -2, ptr %arrayidx18.us.le, align 4, !tbaa !5 %10 = xor i32 %9, -1 %sub33.us = add i32 %3, %10 %idxprom34.us = sext i32 %sub33.us to i64 %arrayidx35.us = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %idxprom34.us store i32 -1, ptr %arrayidx35.us, align 4, !tbaa !5 br label %for.inc39.us for.inc39.us: ; preds = %for.inc36.us, %if.then.us %eg.sroa.0.0 = phi i64 [ %conv.us, %if.then.us ], [ undef, %for.inc36.us ] br label %for.body15.us.1 for.body15.us.1: ; preds = %for.inc36.us.1, %for.inc39.us %indvars.iv78.1 = phi i64 [ 1, %for.inc39.us ], [ %indvars.iv.next79.1, %for.inc36.us.1 ] %11 = sub nsw i64 %4, %indvars.iv78.1 %arrayidx18.us.1 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %11 %12 = load i32, ptr %arrayidx18.us.1, align 4, !tbaa !5 %13 = add nsw i64 %11, -1 %arrayidx22.us.1 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %13 %14 = load i32, ptr %arrayidx22.us.1, align 4, !tbaa !5 %cmp23.us.1 = icmp eq i32 %12, %14 br i1 %cmp23.us.1, label %if.then.us.1, label %for.inc36.us.1 for.inc36.us.1: ; preds = %for.body15.us.1 %indvars.iv.next79.1 = add nuw nsw i64 %indvars.iv78.1, 1 %exitcond.1.not = icmp eq i64 %indvars.iv.next79.1, %wide.trip.count br i1 %exitcond.1.not, label %for.inc39.us.1, label %for.body15.us.1, !llvm.loop !26 if.then.us.1: ; preds = %for.body15.us.1 %arrayidx18.us.1.le = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %11 %15 = trunc i64 %indvars.iv78.1 to i32 %conv.us.1 = sext i32 %12 to i64 store i32 -2, ptr %arrayidx18.us.1.le, align 4, !tbaa !5 %16 = xor i32 %15, -1 %sub33.us.1 = add i32 %3, %16 %idxprom34.us.1 = sext i32 %sub33.us.1 to i64 %arrayidx35.us.1 = getelementptr inbounds [100000 x i32], ptr %A, i64 0, i64 %idxprom34.us.1 store i32 -1, ptr %arrayidx35.us.1, align 4, !tbaa !5 br label %for.inc39.us.1 for.inc39.us.1: ; preds = %for.inc36.us.1, %if.then.us.1 %eg.sroa.4.0 = phi i64 [ %conv.us.1, %if.then.us.1 ], [ undef, %for.inc36.us.1 ] %17 = mul nsw i64 %eg.sroa.4.0, %eg.sroa.0.0 %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %17) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7 call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %A) #7 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) declare void @llvm.assume(i1 noundef) #6 attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) } 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, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.unroll.disable"} !15 = !{!16} !16 = distinct !{!16, !17} !17 = distinct !{!17, !"LVerDomain"} !18 = !{!19} !19 = distinct !{!19, !17} !20 = distinct !{!20, !10, !11, !12} !21 = distinct !{!21, !14} !22 = distinct !{!22, !10, !11} !23 = distinct !{!23, !10, !11} !24 = distinct !{!24, !10} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10}
#include <stdio.h> int main(){ int all_len=0,first_len=0,last_len,len_bin=0,flag=0,ret,flag2=0; long answer=0,k; char s,t,first,last; while(1){ ret = scanf("%c",&s); if(flag == 0){ first = s; t = s; flag = 1; } if(ret == EOF || s == '\n'){ last = t; answer += ((long)len_bin)/2; last_len = len_bin; break; } if(s == t){ ++len_bin; if(flag == 1) ++first_len; } else{ answer += ((long)len_bin)/2; flag = 2; flag2 = 1; len_bin = 1; } t = s; all_len += 1; } scanf("%ld",&k); if(all_len == 1) answer = k/2; else if(flag2 == 0) answer = (k * (long)all_len)/2; else if(first == last){ answer -= ((long)first_len)/2; answer -= ((long)last_len)/2; answer += ((long)first_len+(long)last_len)/2; answer *= k; answer -= ((long)first_len+(long)last_len)/2; answer += ((long)first_len)/2 + ((long)last_len)/2; }else answer *= k; printf("%ld\n",answer); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121207/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121207/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %k = alloca i64, align 8 %s = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %k) #3 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %s) #3 %call93 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1 %cmp194 = icmp eq i32 %call93, -1 %cmp295 = icmp eq i8 %0, 10 %or.cond96 = select i1 %cmp194, i1 true, i1 %cmp295 br i1 %or.cond96, label %if.then4, label %if.end6 if.then4.loopexit: ; preds = %if.end20 %1 = icmp eq i32 %flag2.1, 0 br label %if.then4 if.then4: ; preds = %if.then4.loopexit, %entry %len_bin.0.lcssa = phi i32 [ 0, %entry ], [ %len_bin.1, %if.then4.loopexit ] %first_len.0.lcssa = phi i32 [ 0, %entry ], [ %first_len.1, %if.then4.loopexit ] %flag2.0.lcssa = phi i1 [ true, %entry ], [ %1, %if.then4.loopexit ] %answer.0.lcssa = phi i64 [ 0, %entry ], [ %answer.1, %if.then4.loopexit ] %all_len.0.lcssa = phi i32 [ 0, %entry ], [ %add21, %if.then4.loopexit ] %t.1.lcssa = phi i8 [ %0, %entry ], [ %2, %if.then4.loopexit ] %conv5 = sext i32 %len_bin.0.lcssa to i64 %div91 = sdiv i32 %len_bin.0.lcssa, 2 %div.sext = sext i32 %div91 to i64 %add = add nsw i64 %answer.0.lcssa, %div.sext %call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k) %cmp23 = icmp eq i32 %all_len.0.lcssa, 1 br i1 %cmp23, label %if.then25, label %if.else27 if.end6: ; preds = %entry, %if.end20 %t.1103 = phi i8 [ %2, %if.end20 ], [ %0, %entry ] %2 = phi i8 [ %4, %if.end20 ], [ %0, %entry ] %all_len.0102 = phi i32 [ %add21, %if.end20 ], [ 0, %entry ] %answer.0101 = phi i64 [ %answer.1, %if.end20 ], [ 0, %entry ] %flag2.0100 = phi i32 [ %flag2.1, %if.end20 ], [ 0, %entry ] %first_len.099 = phi i32 [ %first_len.1, %if.end20 ], [ 0, %entry ] %flag.098 = phi i32 [ %flag.2, %if.end20 ], [ 0, %entry ] %len_bin.097 = phi i32 [ %len_bin.1, %if.end20 ], [ 0, %entry ] %cmp9 = icmp eq i8 %2, %t.1103 br i1 %cmp9, label %if.then11, label %if.else if.then11: ; preds = %if.end6 %inc = add nsw i32 %len_bin.097, 1 %cmp12 = icmp ult i32 %flag.098, 2 %spec.select = select i1 %cmp12, i32 1, i32 2 %inc15 = zext i1 %cmp12 to i32 %spec.select90 = add nsw i32 %first_len.099, %inc15 br label %if.end20 if.else: ; preds = %if.end6 %3 = sdiv i32 %len_bin.097, 2 %div18 = sext i32 %3 to i64 %add19 = add nsw i64 %answer.0101, %div18 br label %if.end20 if.end20: ; preds = %if.then11, %if.else %len_bin.1 = phi i32 [ 1, %if.else ], [ %inc, %if.then11 ] %flag.2 = phi i32 [ 2, %if.else ], [ %spec.select, %if.then11 ] %first_len.1 = phi i32 [ %first_len.099, %if.else ], [ %spec.select90, %if.then11 ] %flag2.1 = phi i32 [ 1, %if.else ], [ %flag2.0100, %if.then11 ] %answer.1 = phi i64 [ %add19, %if.else ], [ %answer.0101, %if.then11 ] %add21 = add nuw nsw i32 %all_len.0102, 1 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %4 = load i8, ptr %s, align 1 %cmp1 = icmp eq i32 %call, -1 %cmp2 = icmp eq i8 %4, 10 %or.cond = select i1 %cmp1, i1 true, i1 %cmp2 br i1 %or.cond, label %if.then4.loopexit, label %if.end6 if.then25: ; preds = %if.then4 %5 = load i64, ptr %k, align 8, !tbaa !5 %div26 = sdiv i64 %5, 2 br label %if.end65 if.else27: ; preds = %if.then4 br i1 %flag2.0.lcssa, label %if.then30, label %if.else33 if.then30: ; preds = %if.else27 %6 = load i64, ptr %k, align 8, !tbaa !5 %conv31 = zext i32 %all_len.0.lcssa to i64 %mul = mul nsw i64 %6, %conv31 %div32 = sdiv i64 %mul, 2 br label %if.end65 if.else33: ; preds = %if.else27 %cmp36 = icmp eq i8 %0, %t.1.lcssa br i1 %cmp36, label %if.then38, label %if.else61 if.then38: ; preds = %if.else33 %conv39 = sext i32 %first_len.0.lcssa to i64 %div4092 = sdiv i32 %first_len.0.lcssa, 2 %narrow = add nsw i32 %div4092, %div91 %7 = sext i32 %narrow to i64 %sub43 = sub i64 %add, %7 %add46 = add nsw i64 %conv39, %conv5 %div47 = sdiv i64 %add46, 2 %add48 = add nsw i64 %sub43, %div47 %8 = load i64, ptr %k, align 8, !tbaa !5 %mul49 = mul nsw i64 %8, %add48 %sub54 = sub nsw i64 %7, %div47 %add60 = add i64 %sub54, %mul49 br label %if.end65 if.else61: ; preds = %if.else33 %9 = load i64, ptr %k, align 8, !tbaa !5 %mul62 = mul nsw i64 %9, %add br label %if.end65 if.end65: ; preds = %if.then30, %if.else61, %if.then38, %if.then25 %answer.2 = phi i64 [ %div26, %if.then25 ], [ %div32, %if.then30 ], [ %add60, %if.then38 ], [ %mul62, %if.else61 ] %call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %answer.2) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %s) #3 call void @llvm.lifetime.end.p0(i64 8, 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: 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 is_shichigosan(long long x); int shichigosan(long long x, long long n){ if(x > n) return 0; int count = is_shichigosan(x) ? 1 : 0; count += shichigosan(x * 10 + 7, n); count += shichigosan(x * 10 + 5, n); count += shichigosan(x * 10 + 3, n); return count; } int is_shichigosan(long long x){ int qi = 0; int wu = 0; int san = 0; while(x > 0){ switch(x % 10){ case 7: qi++; break; case 5: wu++; break; case 3: san++; break; } x /= 10; } return qi && wu && san; } int main(){ long long n; scanf("%lld", &n); printf("%lld\n", shichigosan(0, n)); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121250/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121250/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @shichigosan(i64 noundef %x, i64 noundef %n) local_unnamed_addr #0 { entry: %cmp21 = icmp sgt i64 %x, %n br i1 %cmp21, label %return, label %if.end if.end: ; preds = %entry, %is_shichigosan.exit %x.tr23 = phi i64 [ %add8, %is_shichigosan.exit ], [ %x, %entry ] %accumulator.tr22 = phi i32 [ %add10, %is_shichigosan.exit ], [ 0, %entry ] %cmp12.i = icmp sgt i64 %x.tr23, 0 br i1 %cmp12.i, label %while.body.i, label %is_shichigosan.exit while.body.i: ; preds = %if.end, %sw.epilog.i %san.016.i = phi i32 [ %san.1.i, %sw.epilog.i ], [ 0, %if.end ] %wu.015.i = phi i32 [ %wu.1.i, %sw.epilog.i ], [ 0, %if.end ] %qi.014.i = phi i32 [ %qi.1.i, %sw.epilog.i ], [ 0, %if.end ] %x.addr.013.i = phi i64 [ %div.i, %sw.epilog.i ], [ %x.tr23, %if.end ] %rem.i = urem i64 %x.addr.013.i, 10 %div.i = udiv i64 %x.addr.013.i, 10 switch i64 %rem.i, label %sw.epilog.i [ i64 7, label %sw.bb.i i64 5, label %sw.bb1.i i64 3, label %sw.bb3.i ] sw.bb.i: ; preds = %while.body.i %inc.i = add nsw i32 %qi.014.i, 1 br label %sw.epilog.i sw.bb1.i: ; preds = %while.body.i %inc2.i = add nsw i32 %wu.015.i, 1 br label %sw.epilog.i sw.bb3.i: ; preds = %while.body.i %inc4.i = add nsw i32 %san.016.i, 1 br label %sw.epilog.i sw.epilog.i: ; preds = %sw.bb3.i, %sw.bb1.i, %sw.bb.i, %while.body.i %qi.1.i = phi i32 [ %qi.014.i, %while.body.i ], [ %qi.014.i, %sw.bb3.i ], [ %qi.014.i, %sw.bb1.i ], [ %inc.i, %sw.bb.i ] %wu.1.i = phi i32 [ %wu.015.i, %while.body.i ], [ %wu.015.i, %sw.bb3.i ], [ %inc2.i, %sw.bb1.i ], [ %wu.015.i, %sw.bb.i ] %san.1.i = phi i32 [ %san.016.i, %while.body.i ], [ %inc4.i, %sw.bb3.i ], [ %san.016.i, %sw.bb1.i ], [ %san.016.i, %sw.bb.i ] %cmp.not.i = icmp ult i64 %x.addr.013.i, 10 br i1 %cmp.not.i, label %while.end.loopexit.i, label %while.body.i, !llvm.loop !5 while.end.loopexit.i: ; preds = %sw.epilog.i %0 = icmp ne i32 %qi.1.i, 0 %1 = icmp ne i32 %wu.1.i, 0 %2 = select i1 %0, i1 %1, i1 false %3 = icmp ne i32 %san.1.i, 0 %4 = select i1 %2, i1 %3, i1 false %5 = zext i1 %4 to i32 br label %is_shichigosan.exit is_shichigosan.exit: ; preds = %if.end, %while.end.loopexit.i %qi.0.lcssa.i = phi i32 [ 0, %if.end ], [ %5, %while.end.loopexit.i ] %mul = mul nsw i64 %x.tr23, 10 %add = add nsw i64 %mul, 7 %call1 = tail call i32 @shichigosan(i64 noundef %add, i64 noundef %n) %add4 = add nsw i64 %mul, 5 %call5 = tail call i32 @shichigosan(i64 noundef %add4, i64 noundef %n) %add8 = add nsw i64 %mul, 3 %add2 = add i32 %qi.0.lcssa.i, %accumulator.tr22 %add6 = add i32 %add2, %call1 %add10 = add i32 %add6, %call5 %cmp = icmp sgt i64 %add8, %n br i1 %cmp, label %return, label %if.end return: ; preds = %is_shichigosan.exit, %entry %accumulator.tr.lcssa = phi i32 [ 0, %entry ], [ %add10, %is_shichigosan.exit ] ret i32 %accumulator.tr.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: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @is_shichigosan(i64 noundef %x) local_unnamed_addr #2 { entry: %cmp12 = icmp sgt i64 %x, 0 br i1 %cmp12, label %while.body, label %while.end while.body: ; preds = %entry, %sw.epilog %san.016 = phi i32 [ %san.1, %sw.epilog ], [ 0, %entry ] %wu.015 = phi i32 [ %wu.1, %sw.epilog ], [ 0, %entry ] %qi.014 = phi i32 [ %qi.1, %sw.epilog ], [ 0, %entry ] %x.addr.013 = phi i64 [ %div, %sw.epilog ], [ %x, %entry ] %rem = urem i64 %x.addr.013, 10 %div = udiv i64 %x.addr.013, 10 switch i64 %rem, label %sw.epilog [ i64 7, label %sw.bb i64 5, label %sw.bb1 i64 3, label %sw.bb3 ] sw.bb: ; preds = %while.body %inc = add nsw i32 %qi.014, 1 br label %sw.epilog sw.bb1: ; preds = %while.body %inc2 = add nsw i32 %wu.015, 1 br label %sw.epilog sw.bb3: ; preds = %while.body %inc4 = add nsw i32 %san.016, 1 br label %sw.epilog sw.epilog: ; preds = %while.body, %sw.bb3, %sw.bb1, %sw.bb %qi.1 = phi i32 [ %qi.014, %while.body ], [ %qi.014, %sw.bb3 ], [ %qi.014, %sw.bb1 ], [ %inc, %sw.bb ] %wu.1 = phi i32 [ %wu.015, %while.body ], [ %wu.015, %sw.bb3 ], [ %inc2, %sw.bb1 ], [ %wu.015, %sw.bb ] %san.1 = phi i32 [ %san.016, %while.body ], [ %inc4, %sw.bb3 ], [ %san.016, %sw.bb1 ], [ %san.016, %sw.bb ] %cmp.not = icmp ult i64 %x.addr.013, 10 br i1 %cmp.not, label %while.end.loopexit, label %while.body, !llvm.loop !5 while.end.loopexit: ; preds = %sw.epilog %0 = icmp ne i32 %qi.1, 0 %1 = icmp ne i32 %wu.1, 0 %2 = select i1 %0, i1 %1, i1 false %3 = icmp ne i32 %san.1, 0 %4 = select i1 %2, i1 %3, i1 false %5 = zext i1 %4 to i32 br label %while.end while.end: ; preds = %while.end.loopexit, %entry %qi.0.lcssa = phi i32 [ 0, %entry ], [ %5, %while.end.loopexit ] ret i32 %qi.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { 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) %0 = load i64, ptr %n, align 8, !tbaa !7 %call1 = call i32 @shichigosan(i64 noundef 0, i64 noundef %0) %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %call1) 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 #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-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 = !{!"long long", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #define int long long int O357[4] = {0, 3, 5, 7}; int convert(int n){ int ans, i; for(ans = 0, i = 1; n > 0; n /= 4, i *= 10){ ans += i * O357[n % 4]; } return ans; } int is_753(int n){ int f3, f5, f7; for(f3 = 0, f5 = 0, f7 = 0; n > 0; n /= 10){ if(n % 10 == 3){ f3 = 1; } else if(n % 10 == 5){ f5 = 1; } else if(n % 10 == 7){ f7 = 1; } else{ return 0; } } if(f3 == 1 && f5 == 1 && f7 == 1){ return 1; } else{ return 0; } } signed main(){ int N, i, ans = 0; scanf("%lld", &N); for(i = 1; convert(i) <= N; i++){ if(is_753(convert(i)) == 1){ // printf("convert(%d) = %d\n", i, convert(i)); ans++; } } printf("%lld\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121300/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121300/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @O357 = dso_local local_unnamed_addr global [4 x i64] [i64 0, i64 3, i64 5, i64 7], align 16 @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i64 @convert(i64 noundef %n) local_unnamed_addr #0 { entry: %cmp7 = icmp sgt i64 %n, 0 br i1 %cmp7, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.010 = phi i64 [ %mul1, %for.body ], [ 1, %entry ] %ans.09 = phi i64 [ %add, %for.body ], [ 0, %entry ] %n.addr.08 = phi i64 [ %div6, %for.body ], [ %n, %entry ] %rem = and i64 %n.addr.08, 3 %arrayidx = getelementptr inbounds [4 x i64], ptr @O357, i64 0, i64 %rem %0 = load i64, ptr %arrayidx, align 8, !tbaa !5 %mul = mul nsw i64 %0, %i.010 %add = add nsw i64 %mul, %ans.09 %div6 = lshr i64 %n.addr.08, 2 %mul1 = mul nsw i64 %i.010, 10 %cmp.not = icmp ult i64 %n.addr.08, 4 br i1 %cmp.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.body, %entry %ans.0.lcssa = phi i64 [ 0, %entry ], [ %add, %for.body ] ret i64 %ans.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(none) uwtable define dso_local i64 @is_753(i64 noundef %n) local_unnamed_addr #2 { entry: %cmp28 = icmp sgt i64 %n, 0 br i1 %cmp28, label %for.body, label %cleanup for.body: ; preds = %entry, %for.inc %f7.032 = phi i64 [ %f7.1, %for.inc ], [ 0, %entry ] %f5.031 = phi i64 [ %f5.1, %for.inc ], [ 0, %entry ] %f3.030 = phi i64 [ %f3.1, %for.inc ], [ 0, %entry ] %n.addr.029 = phi i64 [ %div, %for.inc ], [ %n, %entry ] %rem = urem i64 %n.addr.029, 10 %div = udiv i64 %n.addr.029, 10 switch i64 %rem, label %cleanup [ i64 3, label %for.inc i64 5, label %if.then4 i64 7, label %if.then8 ] if.then4: ; preds = %for.body br label %for.inc if.then8: ; preds = %for.body br label %for.inc for.inc: ; preds = %for.body, %if.then8, %if.then4 %f3.1 = phi i64 [ %f3.030, %if.then4 ], [ %f3.030, %if.then8 ], [ 1, %for.body ] %f5.1 = phi i64 [ 1, %if.then4 ], [ %f5.031, %if.then8 ], [ %f5.031, %for.body ] %f7.1 = phi i64 [ %f7.032, %if.then4 ], [ 1, %if.then8 ], [ %f7.032, %for.body ] %cmp.not = icmp ult i64 %n.addr.029, 10 br i1 %cmp.not, label %for.end.loopexit, label %for.body, !llvm.loop !11 for.end.loopexit: ; preds = %for.inc %0 = icmp eq i64 %f3.1, 1 %1 = icmp eq i64 %f5.1, 1 %2 = select i1 %0, i1 %1, i1 false %3 = icmp eq i64 %f7.1, 1 %4 = select i1 %2, i1 %3, i1 false %5 = zext i1 %4 to i64 br label %cleanup cleanup: ; preds = %for.body, %entry, %for.end.loopexit %retval.0 = phi i64 [ 0, %entry ], [ %5, %for.end.loopexit ], [ 0, %for.body ] ret i64 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { 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) %0 = load i64, ptr %N, align 8, !tbaa !5 br label %for.cond for.cond: ; preds = %7, %entry %i.0 = phi i64 [ 1, %entry ], [ %inc5, %7 ] %ans.0 = phi i64 [ 0, %entry ], [ %8, %7 ] br label %for.body.i for.body.i: ; preds = %for.body.i, %for.cond %i.010.i = phi i64 [ %mul1.i, %for.body.i ], [ 1, %for.cond ] %ans.09.i = phi i64 [ %add.i, %for.body.i ], [ 0, %for.cond ] %n.addr.08.i = phi i64 [ %div6.i, %for.body.i ], [ %i.0, %for.cond ] %rem.i = and i64 %n.addr.08.i, 3 %arrayidx.i = getelementptr inbounds [4 x i64], ptr @O357, i64 0, i64 %rem.i %1 = load i64, ptr %arrayidx.i, align 8, !tbaa !5 %mul.i = mul nsw i64 %1, %i.010.i %add.i = add nsw i64 %mul.i, %ans.09.i %div6.i = lshr i64 %n.addr.08.i, 2 %mul1.i = mul nsw i64 %i.010.i, 10 %cmp.not.i = icmp ult i64 %n.addr.08.i, 4 br i1 %cmp.not.i, label %convert.exit, label %for.body.i, !llvm.loop !9 convert.exit: ; preds = %for.body.i %cmp.not = icmp sgt i64 %add.i, %0 br i1 %cmp.not, label %for.end, label %for.body.i10 for.body.i10: ; preds = %convert.exit, %for.body.i10 %i.010.i11 = phi i64 [ %mul1.i19, %for.body.i10 ], [ 1, %convert.exit ] %ans.09.i12 = phi i64 [ %add.i17, %for.body.i10 ], [ 0, %convert.exit ] %n.addr.08.i13 = phi i64 [ %div6.i18, %for.body.i10 ], [ %i.0, %convert.exit ] %rem.i14 = and i64 %n.addr.08.i13, 3 %arrayidx.i15 = getelementptr inbounds [4 x i64], ptr @O357, i64 0, i64 %rem.i14 %2 = load i64, ptr %arrayidx.i15, align 8, !tbaa !5 %mul.i16 = mul nsw i64 %2, %i.010.i11 %add.i17 = add nsw i64 %mul.i16, %ans.09.i12 %div6.i18 = lshr i64 %n.addr.08.i13, 2 %mul1.i19 = mul nsw i64 %i.010.i11, 10 %cmp.not.i20 = icmp ult i64 %n.addr.08.i13, 4 br i1 %cmp.not.i20, label %convert.exit21, label %for.body.i10, !llvm.loop !9 convert.exit21: ; preds = %for.body.i10 %cmp28.i = icmp sgt i64 %add.i17, 0 br i1 %cmp28.i, label %for.body.i22, label %is_753.exit.thread for.body.i22: ; preds = %convert.exit21, %for.inc.i %f7.032.i = phi i64 [ %f7.1.i, %for.inc.i ], [ 0, %convert.exit21 ] %f5.031.i = phi i64 [ %f5.1.i, %for.inc.i ], [ 0, %convert.exit21 ] %f3.030.i = phi i64 [ %f3.1.i, %for.inc.i ], [ 0, %convert.exit21 ] %n.addr.029.i = phi i64 [ %div.i, %for.inc.i ], [ %add.i17, %convert.exit21 ] %rem.i23 = urem i64 %n.addr.029.i, 10 %div.i = udiv i64 %n.addr.029.i, 10 switch i64 %rem.i23, label %is_753.exit.thread [ i64 3, label %for.inc.i i64 5, label %if.then4.i i64 7, label %if.then8.i ] if.then4.i: ; preds = %for.body.i22 br label %for.inc.i if.then8.i: ; preds = %for.body.i22 br label %for.inc.i for.inc.i: ; preds = %if.then8.i, %if.then4.i, %for.body.i22 %f3.1.i = phi i64 [ %f3.030.i, %if.then4.i ], [ %f3.030.i, %if.then8.i ], [ 1, %for.body.i22 ] %f5.1.i = phi i64 [ 1, %if.then4.i ], [ %f5.031.i, %if.then8.i ], [ %f5.031.i, %for.body.i22 ] %f7.1.i = phi i64 [ %f7.032.i, %if.then4.i ], [ 1, %if.then8.i ], [ %f7.032.i, %for.body.i22 ] %cmp.not.i24 = icmp ult i64 %n.addr.029.i, 10 br i1 %cmp.not.i24, label %is_753.exit, label %for.body.i22, !llvm.loop !11 is_753.exit: ; preds = %for.inc.i %3 = icmp ne i64 %f3.1.i, 1 %4 = icmp ne i64 %f5.1.i, 1 %.not30 = select i1 %3, i1 true, i1 %4 %5 = icmp ne i64 %f7.1.i, 1 %6 = select i1 %.not30, i1 true, i1 %5 %inc = add nsw i64 %ans.0, 1 %cond.fr = freeze i1 %6 br i1 %cond.fr, label %is_753.exit.thread, label %7 is_753.exit.thread: ; preds = %for.body.i22, %convert.exit21, %is_753.exit br label %7 7: ; preds = %is_753.exit, %is_753.exit.thread %8 = phi i64 [ %ans.0, %is_753.exit.thread ], [ %inc, %is_753.exit ] %inc5 = add nuw nsw i64 %i.0, 1 br label %for.cond, !llvm.loop !12 for.end: ; preds = %convert.exit %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %ans.0) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %N) #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 norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-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 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> int main(void) { char S[5]; int i=0; scanf("%s",S); if(S[0]==S[1]) i++; if(S[0]==S[2]) i++; if(S[0]==S[3]) i++; if(i!=1) { printf("No\n"); return 0; } else i=0; if(S[1]==S[0]) i++; if(S[1]==S[2]) i++; if(S[1]==S[3]) i++; if(i!=1) { printf("No\n"); return 0; } else i=0; if(S[2]==S[0]) i++; if(S[2]==S[1]) i++; if(S[2]==S[3]) i++; if(i!=1) { printf("No\n"); return 0; } else i=0; if(S[3]==S[0]) i++; if(S[3]==S[1]) i++; if(S[3]==S[2]) i++; if(i!=1) printf("No\n"); else printf("Yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121344/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121344/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"Yes\00", align 1 @str.6 = 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 [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %S) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load i8, ptr %S, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 %spec.select = zext i1 %cmp to i32 %arrayidx6 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 2 %2 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %cmp8 = icmp eq i8 %0, %2 %inc11 = select i1 %cmp, i32 2, i32 1 %i.1 = select i1 %cmp8, i32 %inc11, i32 %spec.select %arrayidx15 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 3 %3 = load i8, ptr %arrayidx15, align 1, !tbaa !5 %cmp17 = icmp eq i8 %0, %3 %inc20 = zext i1 %cmp17 to i32 %i.2 = add nuw nsw i32 %i.1, %inc20 %cmp22.not = icmp eq i32 %i.2, 1 br i1 %cmp22.not, label %if.else, label %cleanup if.else: ; preds = %entry %cmp40 = icmp eq i8 %1, %2 %i.4 = select i1 %cmp40, i32 %inc11, i32 %spec.select %cmp49 = icmp eq i8 %1, %3 %inc52 = zext i1 %cmp49 to i32 %i.5 = add nuw nsw i32 %i.4, %inc52 %cmp54.not = icmp eq i32 %i.5, 1 br i1 %cmp54.not, label %if.else58, label %cleanup if.else58: ; preds = %if.else %spec.select148 = zext i1 %cmp8 to i32 %inc76 = select i1 %cmp8, i32 2, i32 1 %i.7 = select i1 %cmp40, i32 %inc76, i32 %spec.select148 %cmp82 = icmp eq i8 %2, %3 %inc85 = zext i1 %cmp82 to i32 %i.8 = add nuw nsw i32 %i.7, %inc85 %cmp87.not = icmp eq i32 %i.8, 1 br i1 %cmp87.not, label %if.else91, label %cleanup if.else91: ; preds = %if.else58 %inc109 = select i1 %cmp17, i32 2, i32 1 %i.10 = select i1 %cmp49, i32 %inc109, i32 %inc20 %i.11 = add nuw nsw i32 %i.10, %inc85 %cmp120.not = icmp eq i32 %i.11, 1 %str.str.3 = select i1 %cmp120.not, ptr @str, ptr @str.6 br label %cleanup cleanup: ; preds = %if.else91, %if.else58, %if.else, %entry %str.3.sink = phi ptr [ @str.6, %entry ], [ @str.6, %if.else ], [ @str.6, %if.else58 ], [ %str.str.3, %if.else91 ] %puts143 = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.sink) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %S) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ char s[4]; scanf("%s", s); if(s[0] == s[1]){ int count = 0; if(s[0] == s[2]) count ++; if(s[0] == s[3]) count ++; if(count == 0 && s[2] == s[3]){ printf("Yes"); }else{ printf("No"); } }else{ int count1 = 0; int count2 = 0; if(s[0] == s[2]) count1 ++; if(s[0] == s[3]) count1 ++; if(s[1] == s[2]) count2 ++; if(s[1] == s[3]) count2 ++; if(count1 == 1 && count2 == 1){ printf("Yes"); }else{ printf("No"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121395/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121395/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 %arrayidx6 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %arrayidx13 = getelementptr inbounds [4 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx13, align 1, !tbaa !5 br i1 %cmp, label %if.then, label %if.else32 if.then: ; preds = %entry %cmp8 = icmp ne i8 %0, %2 %cmp15 = icmp ne i8 %0, %3 %narrow.not = select i1 %cmp15, i1 %cmp8, i1 false %cmp26 = icmp eq i8 %2, %3 %or.cond87 = select i1 %narrow.not, i1 %cmp26, i1 false br label %if.end79 if.else32: ; preds = %entry %cmp37 = icmp eq i8 %0, %2 %cmp46 = icmp eq i8 %0, %3 %cmp55 = icmp eq i8 %1, %2 %cmp64 = icmp eq i8 %1, %3 %cmp69 = xor i1 %cmp37, %cmp46 %cmp72 = xor i1 %cmp55, %cmp64 %or.cond = and i1 %cmp69, %cmp72 br label %if.end79 if.end79: ; preds = %if.else32, %if.then %or.cond.sink = phi i1 [ %or.cond, %if.else32 ], [ %or.cond87, %if.then ] %.str.1..str.290 = select i1 %or.cond.sink, ptr @.str.1, ptr @.str.2 %call75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.290) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(){ int a[26] = {0}, ans = 0; char s[5]; scanf("%s", s); for(int i = 0; i < 4; ++i){ a[s[i] - 65]++; } for(int i = 0; i < 26; ++i){ if(a[i]) ans++; } if(ans == 2) puts("Yes"); else puts("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121438/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121438/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %a = alloca [26 x i32], align 16 %s = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %a) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %a, i8 0, i64 104, i1 false) call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 1, !tbaa !5 %conv = sext i8 %0 to i64 %sub = add nsw i64 %conv, -65 %arrayidx2 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %sub %1 = load i32, ptr %arrayidx2, align 4, !tbaa !8 %inc = add nsw i32 %1, 1 store i32 %inc, ptr %arrayidx2, align 4, !tbaa !8 %arrayidx.1 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 1 %2 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %conv.1 = sext i8 %2 to i64 %sub.1 = add nsw i64 %conv.1, -65 %arrayidx2.1 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %sub.1 %3 = load i32, ptr %arrayidx2.1, align 4, !tbaa !8 %inc.1 = add nsw i32 %3, 1 store i32 %inc.1, ptr %arrayidx2.1, align 4, !tbaa !8 %arrayidx.2 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 2 %4 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %conv.2 = sext i8 %4 to i64 %sub.2 = add nsw i64 %conv.2, -65 %arrayidx2.2 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %sub.2 %5 = load i32, ptr %arrayidx2.2, align 4, !tbaa !8 %inc.2 = add nsw i32 %5, 1 store i32 %inc.2, ptr %arrayidx2.2, align 4, !tbaa !8 %arrayidx.3 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 3 %6 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %conv.3 = sext i8 %6 to i64 %sub.3 = add nsw i64 %conv.3, -65 %arrayidx2.3 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %sub.3 %7 = load i32, ptr %arrayidx2.3, align 4, !tbaa !8 %inc.3 = add nsw i32 %7, 1 store i32 %inc.3, ptr %arrayidx2.3, align 4, !tbaa !8 %8 = load <16 x i32>, ptr %a, align 16, !tbaa !8 %9 = icmp ne <16 x i32> %8, zeroinitializer %arrayidx11.16 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 16 %10 = load <8 x i32>, ptr %arrayidx11.16, align 16, !tbaa !8 %11 = icmp ne <8 x i32> %10, zeroinitializer %arrayidx11.24 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 24 %12 = load i32, ptr %arrayidx11.24, align 16, !tbaa !8 %tobool.not.24 = icmp ne i32 %12, 0 %inc12.24 = zext i1 %tobool.not.24 to i32 %arrayidx11.25 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 25 %13 = load i32, ptr %arrayidx11.25, align 4, !tbaa !8 %tobool.not.25 = icmp ne i32 %13, 0 %inc12.25 = zext i1 %tobool.not.25 to i32 %14 = bitcast <16 x i1> %9 to i16 %15 = call i16 @llvm.ctpop.i16(i16 %14), !range !10 %16 = zext i16 %15 to i32 %17 = bitcast <8 x i1> %11 to i8 %18 = call i8 @llvm.ctpop.i8(i8 %17), !range !11 %19 = zext i8 %18 to i32 %op.rdx = add nuw nsw i32 %16, %19 %op.rdx32 = add nuw nsw i32 %op.rdx, %inc12.24 %op.rdx33 = add nuw nsw i32 %op.rdx32, %inc12.25 %cmp16 = icmp eq i32 %op.rdx33, 2 %.str.1..str.2 = select i1 %cmp16, ptr @.str.1, ptr @.str.2 %call20 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %s) #5 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i16 @llvm.ctpop.i16(i16) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i8 @llvm.ctpop.i8(i8) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = !{!9, !9, i64 0} !9 = !{!"int", !6, i64 0} !10 = !{i16 0, i16 17} !11 = !{i8 0, i8 9}
#include <stdio.h> int main(int argc, char **argv) { char s[5]; fgets(s, 5, stdin); int tbl[256] = {0}; int i; for (i = 0; i < 4; i++) { tbl[s[i]]++; } for (i = 0; i < 256; i++) { if (tbl[i] != 0 && tbl[i] != 2) { printf("No"); return 0; } } printf("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121496/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121496/source.c" target datalayout = "e-m:e-p270: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.1 = private unnamed_addr constant [4 x i8] c"Yes\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: %s = alloca [5 x i8], align 1 %tbl = alloca [256 x i32], align 16 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %s) #4 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %s, i32 noundef 5, ptr noundef %0) call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %tbl) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %tbl, i8 0, i64 1024, i1 false) %1 = load i8, ptr %s, align 1, !tbaa !9 %idxprom1 = sext i8 %1 to i64 %arrayidx2 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %idxprom1 %2 = load i32, ptr %arrayidx2, align 4, !tbaa !10 %inc = add nsw i32 %2, 1 store i32 %inc, ptr %arrayidx2, align 4, !tbaa !10 %arrayidx.1 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 1 %3 = load i8, ptr %arrayidx.1, align 1, !tbaa !9 %idxprom1.1 = sext i8 %3 to i64 %arrayidx2.1 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %idxprom1.1 %4 = load i32, ptr %arrayidx2.1, align 4, !tbaa !10 %inc.1 = add nsw i32 %4, 1 store i32 %inc.1, ptr %arrayidx2.1, align 4, !tbaa !10 %arrayidx.2 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 2 %5 = load i8, ptr %arrayidx.2, align 1, !tbaa !9 %idxprom1.2 = sext i8 %5 to i64 %arrayidx2.2 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %idxprom1.2 %6 = load i32, ptr %arrayidx2.2, align 4, !tbaa !10 %inc.2 = add nsw i32 %6, 1 store i32 %inc.2, ptr %arrayidx2.2, align 4, !tbaa !10 %arrayidx.3 = getelementptr inbounds [5 x i8], ptr %s, i64 0, i64 3 %7 = load i8, ptr %arrayidx.3, align 1, !tbaa !9 %idxprom1.3 = sext i8 %7 to i64 %arrayidx2.3 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %idxprom1.3 %8 = load i32, ptr %arrayidx2.3, align 4, !tbaa !10 %inc.3 = add nsw i32 %8, 1 store i32 %inc.3, ptr %arrayidx2.3, align 4, !tbaa !10 br label %for.body6 for.body6: ; preds = %for.inc14.7, %entry %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next.7, %for.inc14.7 ] %arrayidx8 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %indvars.iv %9 = load i32, ptr %arrayidx8, align 16, !tbaa !10 switch i32 %9, label %cleanup [ i32 0, label %for.inc14 i32 2, label %for.inc14 ] for.inc14: ; preds = %for.body6, %for.body6 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx8.1 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %indvars.iv.next %10 = load i32, ptr %arrayidx8.1, align 4, !tbaa !10 switch i32 %10, label %cleanup [ i32 0, label %for.inc14.1 i32 2, label %for.inc14.1 ] for.inc14.1: ; preds = %for.inc14, %for.inc14 %indvars.iv.next.1 = or i64 %indvars.iv, 2 %arrayidx8.2 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %indvars.iv.next.1 %11 = load i32, ptr %arrayidx8.2, align 8, !tbaa !10 switch i32 %11, label %cleanup [ i32 0, label %for.inc14.2 i32 2, label %for.inc14.2 ] for.inc14.2: ; preds = %for.inc14.1, %for.inc14.1 %indvars.iv.next.2 = or i64 %indvars.iv, 3 %arrayidx8.3 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %indvars.iv.next.2 %12 = load i32, ptr %arrayidx8.3, align 4, !tbaa !10 switch i32 %12, label %cleanup [ i32 0, label %for.inc14.3 i32 2, label %for.inc14.3 ] for.inc14.3: ; preds = %for.inc14.2, %for.inc14.2 %indvars.iv.next.3 = or i64 %indvars.iv, 4 %arrayidx8.4 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %indvars.iv.next.3 %13 = load i32, ptr %arrayidx8.4, align 16, !tbaa !10 switch i32 %13, label %cleanup [ i32 0, label %for.inc14.4 i32 2, label %for.inc14.4 ] for.inc14.4: ; preds = %for.inc14.3, %for.inc14.3 %indvars.iv.next.4 = or i64 %indvars.iv, 5 %arrayidx8.5 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %indvars.iv.next.4 %14 = load i32, ptr %arrayidx8.5, align 4, !tbaa !10 switch i32 %14, label %cleanup [ i32 0, label %for.inc14.5 i32 2, label %for.inc14.5 ] for.inc14.5: ; preds = %for.inc14.4, %for.inc14.4 %indvars.iv.next.5 = or i64 %indvars.iv, 6 %arrayidx8.6 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %indvars.iv.next.5 %15 = load i32, ptr %arrayidx8.6, align 8, !tbaa !10 switch i32 %15, label %cleanup [ i32 0, label %for.inc14.6 i32 2, label %for.inc14.6 ] for.inc14.6: ; preds = %for.inc14.5, %for.inc14.5 %indvars.iv.next.6 = or i64 %indvars.iv, 7 %arrayidx8.7 = getelementptr inbounds [256 x i32], ptr %tbl, i64 0, i64 %indvars.iv.next.6 %16 = load i32, ptr %arrayidx8.7, align 4, !tbaa !10 switch i32 %16, label %cleanup [ i32 0, label %for.inc14.7 i32 2, label %for.inc14.7 ] for.inc14.7: ; preds = %for.inc14.6, %for.inc14.6 %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8 %exitcond.not.7 = icmp eq i64 %indvars.iv.next.7, 256 br i1 %exitcond.not.7, label %cleanup, label %for.body6, !llvm.loop !12 cleanup: ; preds = %for.inc14.7, %for.inc14.6, %for.inc14.5, %for.inc14.4, %for.inc14.3, %for.inc14.2, %for.inc14.1, %for.inc14, %for.body6 %.str.1.sink = phi ptr [ @.str, %for.body6 ], [ @.str, %for.inc14 ], [ @.str, %for.inc14.1 ], [ @.str, %for.inc14.2 ], [ @.str, %for.inc14.3 ], [ @.str, %for.inc14.4 ], [ @.str, %for.inc14.5 ], [ @.str, %for.inc14.6 ], [ @.str.1, %for.inc14.7 ] %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %tbl) #4 call void @llvm.lifetime.end.p0(i64 5, 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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture 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: 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: 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 = !{!"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} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { char S[5]; scanf("%s",S); if(S[0]==S[1]&&S[2]==S[3]&&S[0]!=S[2]){ printf("Yes"); }else if(S[0]==S[2]&&S[1]==S[3]&&S[0]!=S[1]){ printf("Yes"); }else if(S[0]==S[3]&&S[1]==S[2]&&S[0]!=S[1]){ printf("Yes"); }else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121539/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121539/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %S) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load i8, ptr %S, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 %arrayidx4 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 2 %2 = load i8, ptr %arrayidx4, align 1, !tbaa !5 br i1 %cmp, label %land.lhs.true, label %if.else land.lhs.true: ; preds = %entry %arrayidx6 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 3 %3 = load i8, ptr %arrayidx6, align 1, !tbaa !5 %cmp8 = icmp ne i8 %2, %3 %cmp15.not = icmp eq i8 %0, %2 %or.cond = or i1 %cmp15.not, %cmp8 br i1 %or.cond, label %if.else, label %if.end66 if.else: ; preds = %entry, %land.lhs.true %cmp22 = icmp ne i8 %0, %2 %arrayidx27 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 3 %4 = load i8, ptr %arrayidx27, align 1, !tbaa !5 %cmp29 = icmp ne i8 %1, %4 %or.cond67 = or i1 %cmp, %cmp29 %or.cond71 = select i1 %cmp22, i1 true, i1 %or.cond67 br i1 %or.cond71, label %if.else40, label %if.end66 if.else40: ; preds = %if.else %cmp45 = icmp ne i8 %0, %4 %cmp52 = icmp ne i8 %1, %2 %5 = or i1 %cmp52, %cmp45 %or.cond69 = or i1 %cmp, %5 %.str.2..str.1 = select i1 %or.cond69, ptr @.str.2, ptr @.str.1 br label %if.end66 if.end66: ; preds = %if.else40, %if.else, %land.lhs.true %.str.1.sink = phi ptr [ @.str.1, %land.lhs.true ], [ @.str.1, %if.else ], [ %.str.2..str.1, %if.else40 ] %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %S) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int ca[256] = {}; int cnt = 0; char ch; for (int i = 0; i < 4; i++) { ch = getchar(); if (!ca[ch]) { cnt++; ca[ch] = 1; } } if (cnt == 2) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121582/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121582/source.c" target datalayout = "e-m:e-p270: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: %ca = alloca [256 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %ca) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %ca, i8 0, i64 1024, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %conv = zext i32 %call.i to i64 %sext = shl i64 %conv, 56 %idxprom = ashr exact i64 %sext, 56 %arrayidx = getelementptr inbounds [256 x i32], ptr %ca, i64 0, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !9 %tobool.not = icmp eq i32 %1, 0 %spec.store.select = tail call i32 @llvm.umax.i32(i32 %1, i32 1) store i32 %spec.store.select, ptr %arrayidx, align 4 %spec.select = zext i1 %tobool.not to i32 %2 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i.1 = tail call i32 @getc(ptr noundef %2) %conv.1 = zext i32 %call.i.1 to i64 %sext.1 = shl i64 %conv.1, 56 %idxprom.1 = ashr exact i64 %sext.1, 56 %arrayidx.1 = getelementptr inbounds [256 x i32], ptr %ca, i64 0, i64 %idxprom.1 %3 = load i32, ptr %arrayidx.1, align 4, !tbaa !9 %tobool.not.1 = icmp eq i32 %3, 0 br i1 %tobool.not.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %entry %inc.1 = select i1 %tobool.not, i32 2, i32 1 store i32 1, ptr %arrayidx.1, align 4, !tbaa !9 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %entry %cnt.1.1 = phi i32 [ %spec.select, %entry ], [ %inc.1, %if.then.1 ] %4 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i.2 = tail call i32 @getc(ptr noundef %4) %conv.2 = zext i32 %call.i.2 to i64 %sext.2 = shl i64 %conv.2, 56 %idxprom.2 = ashr exact i64 %sext.2, 56 %arrayidx.2 = getelementptr inbounds [256 x i32], ptr %ca, i64 0, i64 %idxprom.2 %5 = load i32, ptr %arrayidx.2, align 4, !tbaa !9 %tobool.not.2 = icmp eq i32 %5, 0 br i1 %tobool.not.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 %inc.2 = add nuw nsw i32 %cnt.1.1, 1 store i32 1, ptr %arrayidx.2, align 4, !tbaa !9 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %cnt.1.2 = phi i32 [ %cnt.1.1, %for.inc.1 ], [ %inc.2, %if.then.2 ] %6 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i.3 = tail call i32 @getc(ptr noundef %6) %conv.3 = zext i32 %call.i.3 to i64 %sext.3 = shl i64 %conv.3, 56 %idxprom.3 = ashr exact i64 %sext.3, 56 %arrayidx.3 = getelementptr inbounds [256 x i32], ptr %ca, i64 0, i64 %idxprom.3 %7 = load i32, ptr %arrayidx.3, align 4, !tbaa !9 %tobool.not.3 = icmp eq i32 %7, 0 %inc.3 = zext i1 %tobool.not.3 to i32 %spec.select16 = add nuw nsw i32 %cnt.1.2, %inc.3 %cmp4 = icmp eq i32 %spec.select16, 2 %str.2.str = select i1 %cmp4, ptr @str.2, ptr @str %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.2.str) call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %ca) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: 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 #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umax.i32(i32, i32) #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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() { char x; int i,j,n[26]={},flag=0; for(i=0;i<4;i++){ scanf("%c",&x); n[x-65]++; } for(i=0;i<26;i++){ if(n[i]==2){ for(j=i+1;j<26;j++){ if(n[j]==2){ flag=1; break; } } } } if(flag==1) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121632/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121632/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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: %x = alloca i8, align 1 %n = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %n) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %n, i8 0, i64 104, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i8, ptr %x, align 1, !tbaa !5 %conv = sext i8 %0 to i64 %sub = add nsw i64 %conv, -65 %arrayidx = getelementptr inbounds [26 x i32], ptr %n, i64 0, i64 %sub %1 = load i32, ptr %arrayidx, align 4, !tbaa !8 %inc = add nsw i32 %1, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !8 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %2 = load i8, ptr %x, align 1, !tbaa !5 %conv.1 = sext i8 %2 to i64 %sub.1 = add nsw i64 %conv.1, -65 %arrayidx.1 = getelementptr inbounds [26 x i32], ptr %n, i64 0, i64 %sub.1 %3 = load i32, ptr %arrayidx.1, align 4, !tbaa !8 %inc.1 = add nsw i32 %3, 1 store i32 %inc.1, ptr %arrayidx.1, align 4, !tbaa !8 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %4 = load i8, ptr %x, align 1, !tbaa !5 %conv.2 = sext i8 %4 to i64 %sub.2 = add nsw i64 %conv.2, -65 %arrayidx.2 = getelementptr inbounds [26 x i32], ptr %n, i64 0, i64 %sub.2 %5 = load i32, ptr %arrayidx.2, align 4, !tbaa !8 %inc.2 = add nsw i32 %5, 1 store i32 %inc.2, ptr %arrayidx.2, align 4, !tbaa !8 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %6 = load i8, ptr %x, align 1, !tbaa !5 %conv.3 = sext i8 %6 to i64 %sub.3 = add nsw i64 %conv.3, -65 %arrayidx.3 = getelementptr inbounds [26 x i32], ptr %n, i64 0, i64 %sub.3 %7 = load i32, ptr %arrayidx.3, align 4, !tbaa !8 %inc.3 = add nsw i32 %7, 1 store i32 %inc.3, ptr %arrayidx.3, align 4, !tbaa !8 br label %for.body5.outer for.body5.outer: ; preds = %for.inc23.thread, %entry %indvars.iv.ph = phi i64 [ %indvars.iv.next48, %for.inc23.thread ], [ 0, %entry ] %cmp26 = phi ptr [ @.str.1, %for.inc23.thread ], [ @.str.2, %entry ] br label %for.body5 for.body5: ; preds = %for.body5.outer, %for.inc23 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc23 ], [ %indvars.iv.ph, %for.body5.outer ] %arrayidx7 = getelementptr inbounds [26 x i32], ptr %n, i64 0, i64 %indvars.iv %8 = load i32, ptr %arrayidx7, align 4, !tbaa !8 %cmp8 = icmp eq i32 %8, 2 br i1 %cmp8, label %for.cond10, label %for.inc23 for.cond10: ; preds = %for.body5, %for.body13 %indvars.iv42 = phi i64 [ %indvars.iv.next43, %for.body13 ], [ %indvars.iv, %for.body5 ] %exitcond.not = icmp eq i64 %indvars.iv42, 25 br i1 %exitcond.not, label %for.inc23, label %for.body13 for.body13: ; preds = %for.cond10 %indvars.iv.next43 = add nuw nsw i64 %indvars.iv42, 1 %arrayidx15 = getelementptr inbounds [26 x i32], ptr %n, i64 0, i64 %indvars.iv.next43 %9 = load i32, ptr %arrayidx15, align 4, !tbaa !8 %cmp16 = icmp eq i32 %9, 2 br i1 %cmp16, label %for.inc23.thread, label %for.cond10, !llvm.loop !10 for.inc23: ; preds = %for.cond10, %for.body5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond46.not = icmp eq i64 %indvars.iv.next, 26 br i1 %exitcond46.not, label %if.end31, label %for.body5, !llvm.loop !12 for.inc23.thread: ; preds = %for.body13 %indvars.iv.next48 = add nuw nsw i64 %indvars.iv, 1 %exitcond46.not49 = icmp eq i64 %indvars.iv.next48, 26 br i1 %exitcond46.not49, label %if.end31, label %for.body5.outer, !llvm.loop !12 if.end31: ; preds = %for.inc23.thread, %for.inc23 %.str.2.sink = phi ptr [ %cmp26, %for.inc23 ], [ @.str.1, %for.inc23.thread ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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 = !{!"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}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> int main() { char a[5]; scanf("%s",a); int i,j,s,flag=0; for(i=0;i<4;i++) { s=0; for(j=i+1;j<4;j++) if(a[i]==a[j]) { s++; } if(s>1) { flag=-1; break; } if(s==1) flag++; } if(flag==2) printf("Yes"); else printf("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121683/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121683/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 { for.end: %a = alloca [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i8, ptr %a, align 1, !tbaa !5 %arrayidx5 = getelementptr inbounds [5 x i8], ptr %a, i64 0, i64 1 %1 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %cmp7 = icmp eq i8 %0, %1 %inc = zext i1 %cmp7 to i32 %arrayidx5.152 = getelementptr inbounds [5 x i8], ptr %a, i64 0, i64 2 %2 = load i8, ptr %arrayidx5.152, align 1, !tbaa !5 %cmp7.153 = icmp eq i8 %0, %2 %inc.154 = zext i1 %cmp7.153 to i32 %spec.select.1 = add nuw nsw i32 %inc, %inc.154 %arrayidx5.256 = getelementptr inbounds [5 x i8], ptr %a, i64 0, i64 3 %3 = load i8, ptr %arrayidx5.256, align 1, !tbaa !5 %cmp7.257 = icmp eq i8 %0, %3 %inc.258 = zext i1 %cmp7.257 to i32 %spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.258 %cmp10 = icmp ugt i32 %spec.select.2, 1 br i1 %cmp10, label %if.else, label %for.end.1 for.end.1: ; preds = %for.end %arrayidx.1 = getelementptr inbounds [5 x i8], ptr %a, i64 0, i64 1 %4 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %arrayidx5.1 = getelementptr inbounds [5 x i8], ptr %a, i64 0, i64 2 %5 = load i8, ptr %arrayidx5.1, align 1, !tbaa !5 %cmp7.1 = icmp eq i8 %4, %5 %arrayidx5.1.1 = getelementptr inbounds [5 x i8], ptr %a, i64 0, i64 3 %6 = load i8, ptr %arrayidx5.1.1, align 1, !tbaa !5 %cmp7.1.1 = icmp eq i8 %4, %6 %cmp10.1 = and i1 %cmp7.1, %cmp7.1.1 br i1 %cmp10.1, label %if.else, label %if.end13.3 if.end13.3: ; preds = %for.end.1 %cmp14 = icmp eq i32 %spec.select.2, 1 %inc17 = zext i1 %cmp14 to i32 %cmp14.1 = xor i1 %cmp7.1, %cmp7.1.1 %inc17.1 = zext i1 %cmp14.1 to i32 %spec.select36.1 = add nuw nsw i32 %inc17, %inc17.1 %arrayidx.2 = getelementptr inbounds [5 x i8], ptr %a, i64 0, i64 2 %7 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 %arrayidx5.2 = getelementptr inbounds [5 x i8], ptr %a, i64 0, i64 3 %8 = load i8, ptr %arrayidx5.2, align 1, !tbaa !5 %cmp7.2 = icmp eq i8 %7, %8 %inc17.2 = zext i1 %cmp7.2 to i32 %spec.select36.2 = add nuw nsw i32 %spec.select36.1, %inc17.2 %cmp22 = icmp eq i32 %spec.select36.2, 2 br i1 %cmp22, label %if.end27, label %if.else if.else: ; preds = %for.end, %for.end.1, %if.end13.3 br label %if.end27 if.end27: ; preds = %if.end13.3, %if.else %.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %if.end13.3 ] %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 5, 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #define ll long long int #define lim 100010 #define INF 1e9 #define MIN(x,y) ((x)<(y)?(x):(y)) #define MAX(x,y) ((x)<(y)?(y):(x)) #define ABS(x) ((x)>0?(x):-(x)) int main(void){ char S[5]; scanf("%s",S); char a=S[0],b=S[1],c=S[2],d=S[3]; bool ok=false; if(a==b && c==d && a!=c)ok=true; if(a==c && b==d && a!=d)ok=true; if(a==d && b==c && a!=b)ok=true; if(ok)printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121726/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121726/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8], align 1 call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %S) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load i8, ptr %S, align 1, !tbaa !5 %arrayidx1 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 1 %1 = load i8, ptr %arrayidx1, align 1, !tbaa !5 %arrayidx2 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 2 %2 = load i8, ptr %arrayidx2, align 1, !tbaa !5 %arrayidx3 = getelementptr inbounds [5 x i8], ptr %S, i64 0, i64 3 %3 = load i8, ptr %arrayidx3, align 1, !tbaa !5 %cmp = icmp eq i8 %0, %1 %cmp8 = icmp ne i8 %2, %3 %not.cmp = xor i1 %cmp, true %or.cond = select i1 %not.cmp, i1 true, i1 %cmp8 %cmp13.not = icmp eq i8 %0, %2 %or.cond65 = select i1 %or.cond, i1 true, i1 %cmp13.not %cmp22 = icmp ne i8 %1, %3 %not.cmp13.not = xor i1 %cmp13.not, true %or.cond66 = select i1 %not.cmp13.not, i1 true, i1 %cmp22 %cmp27.not = icmp eq i8 %0, %3 %or.cond67 = or i1 %cmp27.not, %or.cond66 %cmp38 = icmp ne i8 %1, %2 %not.cmp27.not = xor i1 %cmp27.not, true %or.cond68 = select i1 %not.cmp27.not, i1 true, i1 %cmp38 %or.cond69 = select i1 %or.cond68, i1 true, i1 %cmp %4 = select i1 %or.cond69, i1 %or.cond67, i1 false %5 = select i1 %4, i1 %or.cond65, i1 false %.str.2..str.1 = select i1 %5, ptr @.str.2, ptr @.str.1 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1) call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %S) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> #include <math.h> int b[1000001]; int max(int a,int b) { if (a>b) return a; return b; } int main() { int n; scanf("%d",&n); int tp,i; memset(b,0,sizeof(b)); for (i=1;i<=n;i++) { scanf("%d",&tp); int t=i-tp; if (t<=0) t=1; b[t]=max(i-1,b[i]); } int alive=0,nowend=0; for (i=1;i<=n;i++) { if (b[i]) { if (nowend<b[i]) nowend=b[i]; } if (i>nowend) alive++; } printf("%d\n",alive); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12177/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12177/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @b = dso_local local_unnamed_addr global [1000001 x i32] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: 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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %n = alloca i32, align 4 %tp = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tp) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000004) @b, i8 0, i64 4000004, i1 false) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp.not42 = icmp slt i32 %0, 1 br i1 %cmp.not42, label %for.end27, label %for.body for.cond7.preheader: ; preds = %for.body %cmp8.not44 = icmp slt i32 %8, 1 br i1 %cmp8.not44, label %for.end27, label %for.body9.preheader for.body9.preheader: ; preds = %for.cond7.preheader %1 = zext i32 %8 to i64 %xtraiter = and i64 %1, 1 %2 = icmp eq i32 %8, 1 br i1 %2, label %for.end27.loopexit.unr-lcssa, label %for.body9.preheader.new for.body9.preheader.new: ; preds = %for.body9.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tp) %3 = load i32, ptr %tp, align 4, !tbaa !5 %4 = trunc i64 %indvars.iv to i32 %sub = sub nsw i32 %4, %3 %spec.store.select = call i32 @llvm.smax.i32(i32 %sub, i32 1) %arrayidx = getelementptr inbounds [1000001 x i32], ptr @b, i64 0, i64 %indvars.iv %5 = load i32, ptr %arrayidx, align 4, !tbaa !5 %6 = trunc i64 %indvars.iv to i32 %7 = add i32 %6, -1 %a.b.i = call i32 @llvm.smax.i32(i32 %7, i32 %5) %idxprom5 = zext i32 %spec.store.select to i64 %arrayidx6 = getelementptr inbounds [1000001 x i32], ptr @b, i64 0, i64 %idxprom5 store i32 %a.b.i, ptr %arrayidx6, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %9 br i1 %cmp.not.not, label %for.body, label %for.cond7.preheader, !llvm.loop !9 for.body9: ; preds = %for.body9, %for.body9.preheader.new %indvars.iv52 = phi i64 [ 1, %for.body9.preheader.new ], [ %indvars.iv.next53.1, %for.body9 ] %nowend.047 = phi i32 [ 0, %for.body9.preheader.new ], [ %nowend.1.1, %for.body9 ] %alive.046 = phi i32 [ 0, %for.body9.preheader.new ], [ %alive.1.1, %for.body9 ] %niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.1, %for.body9 ] %arrayidx11 = getelementptr inbounds [1000001 x i32], ptr @b, i64 0, i64 %indvars.iv52 %10 = load i32, ptr %arrayidx11, align 4, !tbaa !5 %tobool.not = icmp ne i32 %10, 0 %cmp15 = icmp slt i32 %nowend.047, %10 %or.cond = and i1 %tobool.not, %cmp15 %nowend.1 = select i1 %or.cond, i32 %10, i32 %nowend.047 %11 = sext i32 %nowend.1 to i64 %cmp21 = icmp sgt i64 %indvars.iv52, %11 %inc23 = zext i1 %cmp21 to i32 %alive.1 = add nuw nsw i32 %alive.046, %inc23 %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %arrayidx11.1 = getelementptr inbounds [1000001 x i32], ptr @b, i64 0, i64 %indvars.iv.next53 %12 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5 %tobool.not.1 = icmp ne i32 %12, 0 %cmp15.1 = icmp slt i32 %nowend.1, %12 %or.cond.1 = and i1 %tobool.not.1, %cmp15.1 %nowend.1.1 = select i1 %or.cond.1, i32 %12, i32 %nowend.1 %13 = sext i32 %nowend.1.1 to i64 %cmp21.1 = icmp sge i64 %indvars.iv52, %13 %inc23.1 = zext i1 %cmp21.1 to i32 %alive.1.1 = add nuw nsw i32 %alive.1, %inc23.1 %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.end27.loopexit.unr-lcssa, label %for.body9, !llvm.loop !11 for.end27.loopexit.unr-lcssa: ; preds = %for.body9, %for.body9.preheader %alive.1.lcssa.ph = phi i32 [ undef, %for.body9.preheader ], [ %alive.1.1, %for.body9 ] %indvars.iv52.unr = phi i64 [ 1, %for.body9.preheader ], [ %indvars.iv.next53.1, %for.body9 ] %nowend.047.unr = phi i32 [ 0, %for.body9.preheader ], [ %nowend.1.1, %for.body9 ] %alive.046.unr = phi i32 [ 0, %for.body9.preheader ], [ %alive.1.1, %for.body9 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end27, label %for.body9.epil for.body9.epil: ; preds = %for.end27.loopexit.unr-lcssa %arrayidx11.epil = getelementptr inbounds [1000001 x i32], ptr @b, i64 0, i64 %indvars.iv52.unr %14 = load i32, ptr %arrayidx11.epil, align 4, !tbaa !5 %tobool.not.epil = icmp ne i32 %14, 0 %cmp15.epil = icmp slt i32 %nowend.047.unr, %14 %or.cond.epil = and i1 %tobool.not.epil, %cmp15.epil %nowend.1.epil = select i1 %or.cond.epil, i32 %14, i32 %nowend.047.unr %15 = sext i32 %nowend.1.epil to i64 %cmp21.epil = icmp sgt i64 %indvars.iv52.unr, %15 %inc23.epil = zext i1 %cmp21.epil to i32 %alive.1.epil = add nuw nsw i32 %alive.046.unr, %inc23.epil br label %for.end27 for.end27: ; preds = %for.body9.epil, %for.end27.loopexit.unr-lcssa, %entry, %for.cond7.preheader %alive.0.lcssa = phi i32 [ 0, %for.cond7.preheader ], [ 0, %entry ], [ %alive.1.lcssa.ph, %for.end27.loopexit.unr-lcssa ], [ %alive.1.epil, %for.body9.epil ] %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %alive.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tp) #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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 nounwind willreturn memory(argmem: write) } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> #define NMAX 1000000 int count[NMAX]; int max(int a, int b) { return a > b ? a : b; } int main() { int n, i, len, res; scanf("%d", &n); for (i = 0; i < n; ++i) { scanf("%d", &len); if (i > 0) { count[max(0, i - len)] += 1; count[i] -= 1; } } res = 0; for (i = 0; i < n; ++i) { if (i > 0) { count[i] += count[i - 1]; } if (count[i] <= 0) { res += 1; } } printf("%d\n", res); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12182/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12182/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @count = dso_local local_unnamed_addr global [1000000 x i32] zeroinitializer, align 16 @.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: %n = alloca i32, align 4 %len = 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 %len) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp40 = icmp sgt i32 %0, 0 br i1 %cmp40, label %for.inc.peel, label %for.end27 for.inc.peel: ; preds = %entry %call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %len) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp.peel = icmp sgt i32 %1, 1 br i1 %cmp.peel, label %for.inc, label %for.cond7.preheader for.cond7.preheader: ; preds = %for.inc, %for.inc.peel %.lcssa = phi i32 [ %1, %for.inc.peel ], [ %8, %for.inc ] %cmp842 = icmp sgt i32 %.lcssa, 0 br i1 %cmp842, label %if.end18.peel, label %for.end27 if.end18.peel: ; preds = %for.cond7.preheader %.pre = load i32, ptr @count, align 16, !tbaa !5 %cmp21.peel = icmp slt i32 %.pre, 1 %add23.peel = zext i1 %cmp21.peel to i32 %exitcond.peel.not = icmp eq i32 %.lcssa, 1 br i1 %exitcond.peel.not, label %for.end27, label %if.end18.ph if.end18.ph: ; preds = %if.end18.peel %wide.trip.count = zext i32 %.lcssa to i64 %load_initial = load i32, ptr @count, align 16 %2 = add nsw i64 %wide.trip.count, -1 %xtraiter = and i64 %2, 1 %3 = icmp eq i32 %.lcssa, 2 br i1 %3, label %for.end27.loopexit.unr-lcssa, label %if.end18.ph.new if.end18.ph.new: ; preds = %if.end18.ph %unroll_iter = and i64 %2, -2 br label %if.end18 for.inc: ; preds = %for.inc.peel, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 1, %for.inc.peel ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %len) %4 = load i32, ptr %len, align 4, !tbaa !5 %5 = trunc i64 %indvars.iv to i32 %sub = sub nsw i32 %5, %4 %cond.i = call i32 @llvm.smax.i32(i32 %sub, i32 0) %idxprom = zext i32 %cond.i to i64 %arrayidx = getelementptr inbounds [1000000 x i32], ptr @count, i64 0, i64 %idxprom %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %6, 1 store i32 %add, ptr %arrayidx, align 4, !tbaa !5 %arrayidx5 = getelementptr inbounds [1000000 x i32], ptr @count, i64 0, i64 %indvars.iv %7 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %sub6 = add nsw i32 %7, -1 store i32 %sub6, ptr %arrayidx5, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp, label %for.inc, label %for.cond7.preheader, !llvm.loop !9 if.end18: ; preds = %if.end18, %if.end18.ph.new %store_forwarded = phi i32 [ %load_initial, %if.end18.ph.new ], [ %add17.1, %if.end18 ] %indvars.iv49 = phi i64 [ 1, %if.end18.ph.new ], [ %indvars.iv.next50.1, %if.end18 ] %res.044 = phi i32 [ %add23.peel, %if.end18.ph.new ], [ %spec.select.1, %if.end18 ] %niter = phi i64 [ 0, %if.end18.ph.new ], [ %niter.next.1, %if.end18 ] %arrayidx16 = getelementptr inbounds [1000000 x i32], ptr @count, i64 0, i64 %indvars.iv49 %10 = load i32, ptr %arrayidx16, align 4, !tbaa !5 %add17 = add nsw i32 %10, %store_forwarded store i32 %add17, ptr %arrayidx16, align 4, !tbaa !5 %cmp21 = icmp slt i32 %add17, 1 %add23 = zext i1 %cmp21 to i32 %spec.select = add nuw nsw i32 %res.044, %add23 %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1 %arrayidx16.1 = getelementptr inbounds [1000000 x i32], ptr @count, i64 0, i64 %indvars.iv.next50 %11 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5 %add17.1 = add nsw i32 %11, %add17 store i32 %add17.1, ptr %arrayidx16.1, align 4, !tbaa !5 %cmp21.1 = icmp slt i32 %add17.1, 1 %add23.1 = zext i1 %cmp21.1 to i32 %spec.select.1 = add nuw nsw i32 %spec.select, %add23.1 %indvars.iv.next50.1 = add nuw nsw i64 %indvars.iv49, 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.end27.loopexit.unr-lcssa, label %if.end18, !llvm.loop !12 for.end27.loopexit.unr-lcssa: ; preds = %if.end18, %if.end18.ph %spec.select.lcssa.ph = phi i32 [ undef, %if.end18.ph ], [ %spec.select.1, %if.end18 ] %store_forwarded.unr = phi i32 [ %load_initial, %if.end18.ph ], [ %add17.1, %if.end18 ] %indvars.iv49.unr = phi i64 [ 1, %if.end18.ph ], [ %indvars.iv.next50.1, %if.end18 ] %res.044.unr = phi i32 [ %add23.peel, %if.end18.ph ], [ %spec.select.1, %if.end18 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end27, label %if.end18.epil if.end18.epil: ; preds = %for.end27.loopexit.unr-lcssa %arrayidx16.epil = getelementptr inbounds [1000000 x i32], ptr @count, i64 0, i64 %indvars.iv49.unr %12 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5 %add17.epil = add nsw i32 %12, %store_forwarded.unr store i32 %add17.epil, ptr %arrayidx16.epil, align 4, !tbaa !5 %cmp21.epil = icmp slt i32 %add17.epil, 1 %add23.epil = zext i1 %cmp21.epil to i32 %spec.select.epil = add nuw nsw i32 %res.044.unr, %add23.epil br label %for.end27 for.end27: ; preds = %if.end18.epil, %for.end27.loopexit.unr-lcssa, %entry, %if.end18.peel, %for.cond7.preheader %res.0.lcssa = phi i32 [ 0, %for.cond7.preheader ], [ %add23.peel, %if.end18.peel ], [ 0, %entry ], [ %spec.select.lcssa.ph, %for.end27.loopexit.unr-lcssa ], [ %spec.select.epil, %if.end18.epil ] %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %res.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %len) #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 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 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.peeled.count", i32 1} !12 = distinct !{!12, !10, !11}
#include<stdio.h> long long int gcd(long long int x, long long int y){ long long int t; while(y!=0){ t = x % y; x = y; y = t; } return x; } int main(int argc, char *argv[]){ long long int a,b; while(scanf("%lld %lld",&a,&b) != EOF){ printf("%lld %lld\n",gcd(a,b),a*b/gcd(a,b)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121863/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121863/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #0 { entry: %cmp.not4 = icmp eq i64 %y, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %x.addr.06 = phi i64 [ %y.addr.05, %while.body ], [ %x, %entry ] %y.addr.05 = phi i64 [ %rem, %while.body ], [ %y, %entry ] %rem = srem i64 %x.addr.06, %y.addr.05 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %x.addr.0.lcssa = phi i64 [ %x, %entry ], [ %y.addr.05, %while.body ] ret i64 %x.addr.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not17 = icmp eq i32 %call16, -1 br i1 %cmp.not17, label %while.end, label %while.body while.body: ; preds = %entry, %gcd.exit11 %0 = load i64, ptr %a, align 8, !tbaa !7 %1 = load i64, ptr %b, align 8, !tbaa !7 %cmp.not4.i = icmp eq i64 %1, 0 br i1 %cmp.not4.i, label %gcd.exit11, label %while.body.i while.body.i: ; preds = %while.body, %while.body.i %x.addr.06.i = phi i64 [ %y.addr.05.i, %while.body.i ], [ %0, %while.body ] %y.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %1, %while.body ] %rem.i = srem i64 %x.addr.06.i, %y.addr.05.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %while.body.i5, label %while.body.i, !llvm.loop !5 while.body.i5: ; preds = %while.body.i, %while.body.i5 %x.addr.06.i6 = phi i64 [ %y.addr.05.i7, %while.body.i5 ], [ %0, %while.body.i ] %y.addr.05.i7 = phi i64 [ %rem.i8, %while.body.i5 ], [ %1, %while.body.i ] %rem.i8 = srem i64 %x.addr.06.i6, %y.addr.05.i7 %cmp.not.i9 = icmp eq i64 %rem.i8, 0 br i1 %cmp.not.i9, label %gcd.exit11.loopexit, label %while.body.i5, !llvm.loop !5 gcd.exit11.loopexit: ; preds = %while.body.i5 %mul = mul nsw i64 %1, %0 br label %gcd.exit11 gcd.exit11: ; preds = %gcd.exit11.loopexit, %while.body %mul15 = phi i64 [ 0, %while.body ], [ %mul, %gcd.exit11.loopexit ] %x.addr.0.lcssa.i14 = phi i64 [ %0, %while.body ], [ %y.addr.05.i, %gcd.exit11.loopexit ] %x.addr.0.lcssa.i10 = phi i64 [ %0, %while.body ], [ %y.addr.05.i7, %gcd.exit11.loopexit ] %div = sdiv i64 %mul15, %x.addr.0.lcssa.i10 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %x.addr.0.lcssa.i14, i64 noundef %div) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %gcd.exit11, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"long long", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include <stdio.h> int main() { long long a, b, gcd, lcm, t, x, y; while((scanf("%lld %lld", &a, &b))!=EOF){ x=a; y=b; if(a==0) gcd=b; else if(b==0) gcd=b; else{ while(b!=0){ t=b; b=a%b; a=t; } gcd=a; } lcm=(x*y)/gcd; printf("%lld %lld\n",gcd,lcm); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121906/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121906/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not15 = icmp eq i32 %call14, -1 br i1 %cmp.not15, label %while.end10, label %while.body while.body: ; preds = %entry, %if.end8 %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp1 = icmp eq i64 %0, 0 br i1 %cmp1, label %if.end8, label %if.else if.else: ; preds = %while.body %cmp2 = icmp eq i64 %1, 0 br i1 %cmp2, label %if.end8, label %while.body7 while.body7: ; preds = %if.else, %while.body7 %2 = phi i64 [ %rem, %while.body7 ], [ %1, %if.else ] %3 = phi i64 [ %2, %while.body7 ], [ %0, %if.else ] %rem = srem i64 %3, %2 %cmp6.not = icmp eq i64 %rem, 0 br i1 %cmp6.not, label %while.end, label %while.body7, !llvm.loop !9 while.end: ; preds = %while.body7 store i64 %2, ptr %a, align 8, !tbaa !5 store i64 0, ptr %b, align 8, !tbaa !5 br label %if.end8 if.end8: ; preds = %if.else, %while.body, %while.end %gcd.0 = phi i64 [ %2, %while.end ], [ %1, %while.body ], [ 0, %if.else ] %mul = mul nsw i64 %1, %0 %div = sdiv i64 %mul, %gcd.0 %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %gcd.0, i64 noundef %div) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end10, label %while.body, !llvm.loop !11 while.end10: ; preds = %if.end8, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> #define max(a,b) (a>b?a:b) long long k[1000006]; int main(){ long long n; scanf("%lld",&n); for(int i=1;i<=n;i++)scanf("%lld",&k[i]); long long cnt = 0; long long left = 0; for(int i=n;i>=1;i--){ if(left!=0)cnt++, left--; left = max(k[i], left); } printf("%lld",n-cnt); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12195/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12195/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @k = dso_local global [1000006 x i64] zeroinitializer, align 16 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp.not33 = icmp slt i64 %0, 1 br i1 %cmp.not33, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.body, %entry %.lcssa = phi i64 [ %0, %entry ], [ %3, %for.body ] %conv4 = trunc i64 %.lcssa to i32 %cmp636 = icmp sgt i32 %conv4, 0 br i1 %cmp636, label %for.body9.preheader, label %for.cond.cleanup8 for.body9.preheader: ; preds = %for.cond.cleanup %1 = and i64 %.lcssa, 4294967295 %xtraiter = and i64 %.lcssa, 1 %2 = icmp eq i64 %1, 1 br i1 %2, label %for.cond.cleanup8.loopexit.unr-lcssa, label %for.body9.preheader.new for.body9.preheader.new: ; preds = %for.body9.preheader %unroll_iter = sub nsw i64 %1, %xtraiter br label %for.body9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [1000006 x i64], ptr @k, i64 0, i64 %indvars.iv %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %3 = load i64, ptr %n, align 8, !tbaa !5 %cmp.not = icmp slt i64 %3, %indvars.iv.next br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9 for.cond.cleanup8.loopexit.unr-lcssa.loopexit: ; preds = %for.body9 %4 = icmp ne i64 %cond.1, 0 %5 = zext i1 %4 to i64 br label %for.cond.cleanup8.loopexit.unr-lcssa for.cond.cleanup8.loopexit.unr-lcssa: ; preds = %for.cond.cleanup8.loopexit.unr-lcssa.loopexit, %for.body9.preheader %cnt.1.lcssa.ph = phi i64 [ undef, %for.body9.preheader ], [ %cnt.1.1, %for.cond.cleanup8.loopexit.unr-lcssa.loopexit ] %left.038.unr = phi i64 [ 0, %for.body9.preheader ], [ %5, %for.cond.cleanup8.loopexit.unr-lcssa.loopexit ] %cnt.037.unr = phi i64 [ 0, %for.body9.preheader ], [ %cnt.1.1, %for.cond.cleanup8.loopexit.unr-lcssa.loopexit ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 %cnt.1.epil = add nuw nsw i64 %cnt.037.unr, %left.038.unr %cnt.1.lcssa = select i1 %lcmp.mod.not, i64 %cnt.1.lcssa.ph, i64 %cnt.1.epil br label %for.cond.cleanup8 for.cond.cleanup8: ; preds = %for.cond.cleanup8.loopexit.unr-lcssa, %for.cond.cleanup %cnt.0.lcssa = phi i64 [ 0, %for.cond.cleanup ], [ %cnt.1.lcssa, %for.cond.cleanup8.loopexit.unr-lcssa ] %sub = sub nsw i64 %.lcssa, %cnt.0.lcssa %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %sub) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #4 ret i32 0 for.body9: ; preds = %for.body9, %for.body9.preheader.new %indvars.iv43 = phi i64 [ %1, %for.body9.preheader.new ], [ %indvars.iv.next44.1, %for.body9 ] %left.038 = phi i64 [ 0, %for.body9.preheader.new ], [ %cond.1, %for.body9 ] %cnt.037 = phi i64 [ 0, %for.body9.preheader.new ], [ %cnt.1.1, %for.body9 ] %niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.1, %for.body9 ] %cmp10.not = icmp ne i64 %left.038, 0 %inc12 = zext i1 %cmp10.not to i64 %cnt.1 = add nuw nsw i64 %cnt.037, %inc12 %left.1 = call i64 @llvm.usub.sat.i64(i64 %left.038, i64 1) %arrayidx14 = getelementptr inbounds [1000006 x i64], ptr @k, i64 0, i64 %indvars.iv43 %6 = load i64, ptr %arrayidx14, align 8, !tbaa !5 %cond = call i64 @llvm.smax.i64(i64 %6, i64 %left.1) %indvars.iv.next44 = add nsw i64 %indvars.iv43, -1 %cmp10.not.1 = icmp ne i64 %cond, 0 %inc12.1 = zext i1 %cmp10.not.1 to i64 %cnt.1.1 = add nuw nsw i64 %cnt.1, %inc12.1 %left.1.1 = call i64 @llvm.usub.sat.i64(i64 %cond, i64 1) %arrayidx14.1 = getelementptr inbounds [1000006 x i64], ptr @k, i64 0, i64 %indvars.iv.next44 %7 = load i64, ptr %arrayidx14.1, align 8, !tbaa !5 %cond.1 = call i64 @llvm.smax.i64(i64 %7, i64 %left.1.1) %indvars.iv.next44.1 = add nsw i64 %indvars.iv43, -2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1.not = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1.not, label %for.cond.cleanup8.loopexit.unr-lcssa.loopexit, label %for.body9, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.usub.sat.i64(i64, i64) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> void swap(long *a,long *b){ long tmp = *a; *a = *b; *b = tmp; } int main(void){ long a,b; while(scanf("%ld %ld",&a,&b)!= EOF){ if(a < b) swap(&a,&b); long r = a % b; long product = a * b; while(r != 0){ a = b; b = r; r = a % b; } printf("%ld %ld\n",b,product/b); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_121993/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_121993/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [8 x i8] c"%ld %ld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%ld %ld\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 %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 store i64 %1, ptr %a, align 8, !tbaa !5 store i64 %0, ptr %b, 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: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not14 = icmp eq i32 %call13, -1 br i1 %cmp.not14, label %while.end7, label %while.body while.body: ; preds = %entry, %while.end %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp1 = icmp slt i64 %0, %1 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %while.body store i64 %1, ptr %a, align 8, !tbaa !5 store i64 %0, ptr %b, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %2 = phi i64 [ %0, %if.then ], [ %1, %while.body ] %3 = phi i64 [ %1, %if.then ], [ %0, %while.body ] %rem = srem i64 %3, %2 %mul = mul nsw i64 %2, %3 %cmp3.not10 = icmp eq i64 %rem, 0 br i1 %cmp3.not10, label %while.end, label %while.body4 while.body4: ; preds = %if.end, %while.body4 %r.012 = phi i64 [ %rem5, %while.body4 ], [ %rem, %if.end ] %r.0911 = phi i64 [ %r.012, %while.body4 ], [ %2, %if.end ] %rem5 = srem i64 %r.0911, %r.012 %cmp3.not = icmp eq i64 %rem5, 0 br i1 %cmp3.not, label %while.cond2.while.end_crit_edge, label %while.body4, !llvm.loop !9 while.cond2.while.end_crit_edge: ; preds = %while.body4 store i64 %r.0911, ptr %a, align 8, !tbaa !5 store i64 %r.012, ptr %b, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.cond2.while.end_crit_edge, %if.end %4 = phi i64 [ %r.012, %while.cond2.while.end_crit_edge ], [ %2, %if.end ] %div = sdiv i64 %mul, %4 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %4, i64 noundef %div) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end7, label %while.body, !llvm.loop !11 while.end7: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: 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 = { 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 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="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 = !{!"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,b; int fora,forb; int tmp=1; int said,sais; int i; while(scanf("%d %d",&a,&b)!=EOF){ fora=a; forb=b; if(a<=b){ tmp=a; a=b; b=tmp; } tmp=a%b; while(tmp!=0){ a=b; b=tmp; tmp=a%b; } said=b; sais=(fora/b)*forb; printf("%d %d\n",said,sais); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122035/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122035/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call15 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not16 = icmp eq i32 %call15, -1 br i1 %cmp.not16, label %while.end7, label %while.body while.body: ; preds = %entry, %while.end %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %cmp1.not = icmp sgt i32 %0, %1 br i1 %cmp1.not, label %if.end, label %if.then if.then: ; preds = %while.body store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %2 = phi i32 [ %0, %if.then ], [ %1, %while.body ] %3 = phi i32 [ %1, %if.then ], [ %0, %while.body ] %rem = srem i32 %3, %2 %cmp3.not12 = icmp eq i32 %rem, 0 br i1 %cmp3.not12, label %while.end, label %while.body4 while.body4: ; preds = %if.end, %while.body4 %tmp.014 = phi i32 [ %rem5, %while.body4 ], [ %rem, %if.end ] %tmp.01113 = phi i32 [ %tmp.014, %while.body4 ], [ %2, %if.end ] %rem5 = srem i32 %tmp.01113, %tmp.014 %cmp3.not = icmp eq i32 %rem5, 0 br i1 %cmp3.not, label %while.cond2.while.end_crit_edge, label %while.body4, !llvm.loop !9 while.cond2.while.end_crit_edge: ; preds = %while.body4 store i32 %tmp.01113, ptr %a, align 4, !tbaa !5 store i32 %tmp.014, ptr %b, align 4, !tbaa !5 br label %while.end while.end: ; preds = %while.cond2.while.end_crit_edge, %if.end %4 = phi i32 [ %tmp.014, %while.cond2.while.end_crit_edge ], [ %2, %if.end ] %div = sdiv i32 %0, %4 %mul = mul nsw i32 %div, %1 %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4, i32 noundef %mul) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end7, label %while.body, !llvm.loop !11 while.end7: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void){ long long int a, b, temp, sum, GCD, LCM; while(scanf("%lld %lld",&a,&b) !=EOF) { if(a<b) { temp = a; a = b; b = temp; } sum = a * b; while( b != 0) { a = a % b; temp = a; a = b; b = temp; } printf("%lld %lld\n", a, sum/a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122079/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122079/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not12 = icmp eq i32 %call11, -1 br i1 %cmp.not12, label %while.end6, label %while.body while.body: ; preds = %entry, %while.end %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %cmp1 = icmp slt i64 %0, %1 br i1 %cmp1, label %if.then, label %if.end if.then: ; preds = %while.body store i64 %1, ptr %a, align 8, !tbaa !5 store i64 %0, ptr %b, align 8, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %2 = phi i64 [ %0, %if.then ], [ %1, %while.body ] %3 = phi i64 [ %1, %if.then ], [ %0, %while.body ] %mul = mul nsw i64 %2, %3 %cmp3.not10 = icmp eq i64 %2, 0 br i1 %cmp3.not10, label %while.end, label %while.body4 while.body4: ; preds = %if.end, %while.body4 %4 = phi i64 [ %rem, %while.body4 ], [ %2, %if.end ] %5 = phi i64 [ %4, %while.body4 ], [ %3, %if.end ] %rem = srem i64 %5, %4 %cmp3.not = icmp eq i64 %rem, 0 br i1 %cmp3.not, label %while.cond2.while.end_crit_edge, label %while.body4, !llvm.loop !9 while.cond2.while.end_crit_edge: ; preds = %while.body4 store i64 %4, ptr %a, align 8, !tbaa !5 store i64 0, ptr %b, align 8, !tbaa !5 br label %while.end while.end: ; preds = %while.cond2.while.end_crit_edge, %if.end %6 = phi i64 [ %4, %while.cond2.while.end_crit_edge ], [ %3, %if.end ] %div = sdiv i64 %mul, %6 %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %6, i64 noundef %div) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end6, label %while.body, !llvm.loop !11 while.end6: ; preds = %while.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void){ int x, y, q, r; long long int a,b,z; while(scanf("%lld %lld", &a, &b)!=EOF){ x = a; y = b; if(x < 0) x = -x; if(y < 0) y = -y; for(;;){ q = x/y; r = x - q*y; if(r == 0) break; x = y; y = r; } z=a*b/y; printf("%d %lld\n",y,z); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122121/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122121/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call28 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not29 = icmp eq i32 %call28, -1 br i1 %cmp.not29, label %while.end, label %while.body while.body: ; preds = %entry, %for.end %0 = load i64, ptr %a, align 8, !tbaa !5 %conv = trunc i64 %0 to i32 %1 = load i64, ptr %b, align 8, !tbaa !5 %conv1 = trunc i64 %1 to i32 %spec.select = call i32 @llvm.abs.i32(i32 %conv, i1 true) %y.0 = call i32 @llvm.abs.i32(i32 %conv1, i1 true) br label %for.cond for.cond: ; preds = %for.cond, %while.body %y.1 = phi i32 [ %y.0, %while.body ], [ %2, %for.cond ] %x.1 = phi i32 [ %spec.select, %while.body ], [ %y.1, %for.cond ] %x.1.fr = freeze i32 %x.1 %2 = srem i32 %x.1.fr, %y.1 %cmp10 = icmp eq i32 %2, 0 br i1 %cmp10, label %for.end, label %for.cond for.end: ; preds = %for.cond %mul14 = mul nsw i64 %1, %0 %conv15 = sext i32 %y.1 to i64 %div16 = sdiv i64 %mul14, %conv15 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %y.1, i64 noundef %div16) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> long long int gcd( long long int a , long long int b ){ long long int r; while((r = a % b)!=0){ a = b; b = r; } return b; } long long int lcm( long long int a , long long int b){ return a/gcd(a,b)*b; } int main(void){ long long int a , b; while(scanf("%lld %lld" , &a , &b)!=EOF){ printf("%lld %lld\n" , gcd(a,b) , lcm(a,b)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122172/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122172/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: br label %while.cond while.cond: ; preds = %while.cond, %entry %b.addr.0 = phi i64 [ %b, %entry ], [ %rem, %while.cond ] %a.addr.0 = phi i64 [ %a, %entry ], [ %b.addr.0, %while.cond ] %rem = srem i64 %a.addr.0, %b.addr.0 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !5 while.end: ; preds = %while.cond ret i64 %b.addr.0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %entry %b.addr.0.i = phi i64 [ %b, %entry ], [ %rem.i, %while.cond.i ] %a.addr.0.i = phi i64 [ %a, %entry ], [ %b.addr.0.i, %while.cond.i ] %rem.i = srem i64 %a.addr.0.i, %b.addr.0.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %gcd.exit, label %while.cond.i, !llvm.loop !5 gcd.exit: ; preds = %while.cond.i %div = sdiv i64 %a, %b.addr.0.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not5 = icmp eq i32 %call4, -1 br i1 %cmp.not5, label %while.end, label %while.body while.body: ; preds = %entry, %lcm.exit %0 = load i64, ptr %a, align 8, !tbaa !7 %1 = load i64, ptr %b, align 8, !tbaa !7 br label %while.cond.i while.cond.i: ; preds = %while.cond.i, %while.body %b.addr.0.i = phi i64 [ %1, %while.body ], [ %rem.i, %while.cond.i ] %a.addr.0.i = phi i64 [ %0, %while.body ], [ %b.addr.0.i, %while.cond.i ] %rem.i = srem i64 %a.addr.0.i, %b.addr.0.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %while.cond.i.i, label %while.cond.i, !llvm.loop !5 while.cond.i.i: ; preds = %while.cond.i, %while.cond.i.i %b.addr.0.i.i = phi i64 [ %rem.i.i, %while.cond.i.i ], [ %1, %while.cond.i ] %a.addr.0.i.i = phi i64 [ %b.addr.0.i.i, %while.cond.i.i ], [ %0, %while.cond.i ] %rem.i.i = srem i64 %a.addr.0.i.i, %b.addr.0.i.i %cmp.not.i.i = icmp eq i64 %rem.i.i, 0 br i1 %cmp.not.i.i, label %lcm.exit, label %while.cond.i.i, !llvm.loop !5 lcm.exit: ; preds = %while.cond.i.i %div.i = sdiv i64 %0, %b.addr.0.i.i %mul.i = mul nsw i64 %div.i, %1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %b.addr.0.i, i64 noundef %mul.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %lcm.exit, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"long long", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include <stdio.h> int gcd(int,int); int lcm(int,int); int main(){ int x,y; while(scanf("%d %d",&x,&y)>0){ printf("%d %d\n",gcd(x,y),lcm(x,y)); } return 0; } int gcd(int x,int y){ if(y==0)return x; if(x==0)return y; if(x>y)return gcd(y,x%y); else return gcd(x,y%x); } int lcm(int x,int y){ return x/gcd(x,y)*y; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122215/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122215/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 %y = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #4 %call12 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %cmp13 = icmp sgt i32 %call12, 0 br i1 %cmp13, label %while.body, label %while.end while.body: ; preds = %entry, %lcm.exit %0 = load i32, ptr %x, align 4, !tbaa !5 %1 = load i32, ptr %y, align 4, !tbaa !5 %cmp1925.i = icmp eq i32 %1, 0 br i1 %cmp1925.i, label %lcm.exit, label %if.end.lr.ph.i if.end.lr.ph.i: ; preds = %while.body, %if.then5.i %y.tr.ph27.i = phi i32 [ %rem.i, %if.then5.i ], [ %1, %while.body ] %x.tr.ph26.i = phi i32 [ %y.tr20.i, %if.then5.i ], [ %0, %while.body ] %cmp1.i = icmp eq i32 %x.tr.ph26.i, 0 br i1 %cmp1.i, label %gcd.exit, label %if.end.i if.end.i: ; preds = %if.end.lr.ph.i, %if.else.i %y.tr20.i = phi i32 [ %rem6.i, %if.else.i ], [ %y.tr.ph27.i, %if.end.lr.ph.i ] %cmp4.i = icmp sgt i32 %x.tr.ph26.i, %y.tr20.i br i1 %cmp4.i, label %if.then5.i, label %if.else.i if.then5.i: ; preds = %if.end.i %rem.i = srem i32 %x.tr.ph26.i, %y.tr20.i %cmp19.i = icmp eq i32 %rem.i, 0 br i1 %cmp19.i, label %gcd.exit, label %if.end.lr.ph.i if.else.i: ; preds = %if.end.i %rem6.i = srem i32 %y.tr20.i, %x.tr.ph26.i %cmp.i = icmp eq i32 %rem6.i, 0 br i1 %cmp.i, label %gcd.exit, label %if.end.i gcd.exit: ; preds = %if.end.lr.ph.i, %if.then5.i, %if.else.i %retval.0.i = phi i32 [ %x.tr.ph26.i, %if.else.i ], [ %y.tr.ph27.i, %if.end.lr.ph.i ], [ %y.tr20.i, %if.then5.i ] br label %if.end.lr.ph.i.i if.end.lr.ph.i.i: ; preds = %gcd.exit, %if.then5.i.i %y.tr.ph27.i.i = phi i32 [ %rem.i.i, %if.then5.i.i ], [ %1, %gcd.exit ] %x.tr.ph26.i.i = phi i32 [ %y.tr20.i.i, %if.then5.i.i ], [ %0, %gcd.exit ] %cmp1.i.i = icmp eq i32 %x.tr.ph26.i.i, 0 br i1 %cmp1.i.i, label %lcm.exit, label %if.end.i.i if.end.i.i: ; preds = %if.end.lr.ph.i.i, %if.else.i.i %y.tr20.i.i = phi i32 [ %rem6.i.i, %if.else.i.i ], [ %y.tr.ph27.i.i, %if.end.lr.ph.i.i ] %cmp4.i.i = icmp sgt i32 %x.tr.ph26.i.i, %y.tr20.i.i br i1 %cmp4.i.i, label %if.then5.i.i, label %if.else.i.i if.then5.i.i: ; preds = %if.end.i.i %rem.i.i = srem i32 %x.tr.ph26.i.i, %y.tr20.i.i %cmp19.i.i = icmp eq i32 %rem.i.i, 0 br i1 %cmp19.i.i, label %lcm.exit, label %if.end.lr.ph.i.i if.else.i.i: ; preds = %if.end.i.i %rem6.i.i = srem i32 %y.tr20.i.i, %x.tr.ph26.i.i %cmp.i.i = icmp eq i32 %rem6.i.i, 0 br i1 %cmp.i.i, label %lcm.exit, label %if.end.i.i lcm.exit: ; preds = %if.end.lr.ph.i.i, %if.then5.i.i, %if.else.i.i, %while.body %retval.0.i5 = phi i32 [ %0, %while.body ], [ %retval.0.i, %if.else.i.i ], [ %retval.0.i, %if.then5.i.i ], [ %retval.0.i, %if.end.lr.ph.i.i ] %retval.0.i.i = phi i32 [ %0, %while.body ], [ %x.tr.ph26.i.i, %if.else.i.i ], [ %y.tr.ph27.i.i, %if.end.lr.ph.i.i ], [ %y.tr20.i.i, %if.then5.i.i ] %div.i = sdiv i32 %0, %retval.0.i.i %mul.i = mul nsw i32 %div.i, %1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i5, i32 noundef %mul.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %y) %cmp = icmp sgt i32 %call, 0 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !9 while.end: ; preds = %lcm.exit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 { entry: %cmp1925 = icmp eq i32 %y, 0 br i1 %cmp1925, label %return, label %if.end.lr.ph if.end.lr.ph: ; preds = %entry, %if.then5 %y.tr.ph27 = phi i32 [ %rem, %if.then5 ], [ %y, %entry ] %x.tr.ph26 = phi i32 [ %y.tr20, %if.then5 ], [ %x, %entry ] %cmp1 = icmp eq i32 %x.tr.ph26, 0 br i1 %cmp1, label %return, label %if.end if.end: ; preds = %if.end.lr.ph, %if.else %y.tr20 = phi i32 [ %rem6, %if.else ], [ %y.tr.ph27, %if.end.lr.ph ] %cmp4 = icmp sgt i32 %x.tr.ph26, %y.tr20 br i1 %cmp4, label %if.then5, label %if.else if.then5: ; preds = %if.end %rem = srem i32 %x.tr.ph26, %y.tr20 %cmp19 = icmp eq i32 %rem, 0 br i1 %cmp19, label %return, label %if.end.lr.ph if.else: ; preds = %if.end %rem6 = srem i32 %y.tr20, %x.tr.ph26 %cmp = icmp eq i32 %rem6, 0 br i1 %cmp, label %return, label %if.end return: ; preds = %if.end.lr.ph, %if.then5, %if.else, %entry %retval.0 = phi i32 [ %x, %entry ], [ %x.tr.ph26, %if.else ], [ %y.tr20, %if.then5 ], [ %y.tr.ph27, %if.end.lr.ph ] ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 { entry: %cmp1925.i = icmp eq i32 %y, 0 br i1 %cmp1925.i, label %gcd.exit, label %if.end.lr.ph.i if.end.lr.ph.i: ; preds = %entry, %if.then5.i %y.tr.ph27.i = phi i32 [ %rem.i, %if.then5.i ], [ %y, %entry ] %x.tr.ph26.i = phi i32 [ %y.tr20.i, %if.then5.i ], [ %x, %entry ] %cmp1.i = icmp eq i32 %x.tr.ph26.i, 0 br i1 %cmp1.i, label %gcd.exit, label %if.end.i if.end.i: ; preds = %if.end.lr.ph.i, %if.else.i %y.tr20.i = phi i32 [ %rem6.i, %if.else.i ], [ %y.tr.ph27.i, %if.end.lr.ph.i ] %cmp4.i = icmp sgt i32 %x.tr.ph26.i, %y.tr20.i br i1 %cmp4.i, label %if.then5.i, label %if.else.i if.then5.i: ; preds = %if.end.i %rem.i = srem i32 %x.tr.ph26.i, %y.tr20.i %cmp19.i = icmp eq i32 %rem.i, 0 br i1 %cmp19.i, label %gcd.exit, label %if.end.lr.ph.i if.else.i: ; preds = %if.end.i %rem6.i = srem i32 %y.tr20.i, %x.tr.ph26.i %cmp.i = icmp eq i32 %rem6.i, 0 br i1 %cmp.i, label %gcd.exit, label %if.end.i gcd.exit: ; preds = %if.end.lr.ph.i, %if.then5.i, %if.else.i, %entry %retval.0.i = phi i32 [ %x, %entry ], [ %x.tr.ph26.i, %if.else.i ], [ %y.tr.ph27.i, %if.end.lr.ph.i ], [ %y.tr20.i, %if.then5.i ] %div = sdiv i32 %x, %retval.0.i %mul = mul nsw i32 %div, %y ret i32 %mul } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int gcd(int a,int b){ int t; if (b>a){ t=a; a=b; b=t; } while(b!=0){ t=b; b=a%b; a=t; } return a; } int lcm(int a,int b){ int t,inc=a,dst; if (b>a){ t=a; a=b; b=t; inc=a; } for(;;){ if(a%b==0){ dst=a; break; } a+=inc; } return dst; } int main(){ int a,b; while(scanf("%d %d",&a,&b)!=EOF){ printf("%d %d\n",gcd(a,b),lcm(a,b)); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122259/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122259/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %spec.select = tail call i32 @llvm.smax.i32(i32 %b, i32 %a) %spec.select10 = tail call i32 @llvm.smin.i32(i32 %b, i32 %a) %cmp1.not11 = icmp eq i32 %spec.select10, 0 br i1 %cmp1.not11, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %b.addr.113 = phi i32 [ %rem, %while.body ], [ %spec.select10, %entry ] %a.addr.112 = phi i32 [ %b.addr.113, %while.body ], [ %spec.select, %entry ] %rem = srem i32 %a.addr.112, %b.addr.113 %cmp1.not = icmp eq i32 %rem, 0 br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %a.addr.1.lcssa = phi i32 [ %spec.select, %entry ], [ %b.addr.113, %while.body ] ret i32 %a.addr.1.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 nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %spec.select = tail call i32 @llvm.smin.i32(i32 %b, i32 %a) %spec.select12 = tail call i32 @llvm.smax.i32(i32 %b, i32 %a) br label %for.cond for.cond: ; preds = %for.cond, %entry %a.addr.1 = phi i32 [ %spec.select12, %entry ], [ %add, %for.cond ] %rem = srem i32 %a.addr.1, %spec.select %cmp1 = icmp eq i32 %rem, 0 %add = add nsw i32 %a.addr.1, %spec.select12 br i1 %cmp1, label %if.then2, label %for.cond if.then2: ; preds = %for.cond ret i32 %a.addr.1 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not7 = icmp eq i32 %call6, -1 br i1 %cmp.not7, label %while.end, label %while.body while.body: ; preds = %entry, %lcm.exit %0 = load i32, ptr %a, align 4, !tbaa !7 %1 = load i32, ptr %b, align 4, !tbaa !7 %spec.select.i = call i32 @llvm.smax.i32(i32 %1, i32 %0) %spec.select10.i = call i32 @llvm.smin.i32(i32 %1, i32 %0) %cmp1.not11.i = icmp eq i32 %spec.select10.i, 0 br i1 %cmp1.not11.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %while.body, %while.body.i %b.addr.113.i = phi i32 [ %rem.i, %while.body.i ], [ %spec.select10.i, %while.body ] %a.addr.112.i = phi i32 [ %b.addr.113.i, %while.body.i ], [ %spec.select.i, %while.body ] %rem.i = srem i32 %a.addr.112.i, %b.addr.113.i %cmp1.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp1.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5 gcd.exit: ; preds = %while.body.i, %while.body %a.addr.1.lcssa.i = phi i32 [ %spec.select.i, %while.body ], [ %b.addr.113.i, %while.body.i ] br label %for.cond.i for.cond.i: ; preds = %for.cond.i, %gcd.exit %a.addr.1.i = phi i32 [ %spec.select.i, %gcd.exit ], [ %add.i, %for.cond.i ] %rem.i5 = srem i32 %a.addr.1.i, %spec.select10.i %cmp1.i = icmp eq i32 %rem.i5, 0 %add.i = add nsw i32 %a.addr.1.i, %spec.select.i br i1 %cmp1.i, label %lcm.exit, label %for.cond.i lcm.exit: ; preds = %for.cond.i %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %a.addr.1.lcssa.i, i32 noundef %a.addr.1.i) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !11 while.end: ; preds = %lcm.exit, %entry 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 attributes #0 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 = 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> long long GCD(long long a,long long b) { long long temp; while(b!=0) { temp=a%b; a=b; b=temp; } return a; } int main() { long long a,b,gcd,lcm; while(scanf("%lld%lld",&a,&b)==2) { gcd=GCD(a,b); lcm=(a/gcd)*(b/gcd)*gcd; printf("%lld %lld\n",gcd,lcm); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122301/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122301/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%lld%lld\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @GCD(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { 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 !5 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: 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 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp9 = icmp eq i32 %call8, 2 br i1 %cmp9, label %while.body, label %while.end while.body: ; preds = %entry, %GCD.exit %0 = load i64, ptr %a, align 8, !tbaa !7 %.fr = freeze i64 %0 %1 = load i64, ptr %b, align 8, !tbaa !7 %cmp.not4.i = icmp eq i64 %1, 0 br i1 %cmp.not4.i, label %GCD.exit, label %while.body.i while.body.i: ; preds = %while.body, %while.body.i %a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %.fr, %while.body ] %b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %1, %while.body ] %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 %GCD.exit, label %while.body.i, !llvm.loop !5 GCD.exit: ; preds = %while.body.i, %while.body %a.addr.0.lcssa.i = phi i64 [ %.fr, %while.body ], [ %b.addr.05.i, %while.body.i ] %div2 = sdiv i64 %1, %a.addr.0.lcssa.i %2 = srem i64 %.fr, %a.addr.0.lcssa.i %mul = sub nsw i64 %.fr, %2 %mul3 = mul i64 %mul, %div2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %a.addr.0.lcssa.i, i64 noundef %mul3) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp = icmp eq i32 %call, 2 br i1 %cmp, label %while.body, label %while.end, !llvm.loop !11 while.end: ; preds = %GCD.exit, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"long long", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6}
#include<stdio.h> int main(void){ int i,j,a[100]={},b[100]={},A[100]={},B[100]={},C[100]={},x,y; x=0; y=0; for(i=0;i<100;i++){ scanf("%d %d",&a[i],&b[i]); A[i]=a[i]; B[i]=b[i]; } for(i=0;i<100;i++){ if(a[i] == 0 && b[i] == 0){ y=i; break; } if(a[i] < b[i]){ x=a[i]; a[i]=b[i]; b[i]=x; } } i=0; while(1){ if(i==y){ break; } while(1){ if(i==y){ break; } a[i]=a[i]%b[i]; x=a[i]; a[i]=b[i]; b[i]=x; if(x == 0){ C[i]=a[i]; i++; } } } for(i=0;i<y;i++){ printf("%d %d\n",C[i],B[i]/C[i]*A[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122352/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122352/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [100 x i32], align 16 %b = alloca [100 x i32], align 16 %A = alloca [100 x i32], align 16 %B = alloca [100 x i32], align 16 %C = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %a, i8 0, i64 400, i1 false) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %b) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %b, i8 0, i64 400, i1 false) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %A, i8 0, i64 400, i1 false) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %B) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %B, i8 0, i64 400, i1 false) call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %C) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %C, i8 0, i64 400, i1 false) br label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ] %arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv %arrayidx2 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx, ptr noundef nonnull %arrayidx2) %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv store i32 %0, ptr %arrayidx6, align 4, !tbaa !5 %1 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %arrayidx10 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %indvars.iv store i32 %1, ptr %arrayidx10, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 100 br i1 %exitcond.not, label %for.body13, label %for.body, !llvm.loop !9 for.body13: ; preds = %for.body, %for.inc35 %indvars.iv133 = phi i64 [ %indvars.iv.next134, %for.inc35 ], [ 0, %for.body ] %arrayidx15 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv133 %2 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %cmp16 = icmp eq i32 %2, 0 %arrayidx18 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv133 %3 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %cmp19 = icmp eq i32 %3, 0 %or.cond = select i1 %cmp16, i1 %cmp19, i1 false br i1 %or.cond, label %for.end37, label %if.end if.end: ; preds = %for.body13 %cmp24 = icmp slt i32 %2, %3 br i1 %cmp24, label %if.then25, label %for.inc35 if.then25: ; preds = %if.end %arrayidx23 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv133 store i32 %3, ptr %arrayidx15, align 4, !tbaa !5 store i32 %2, ptr %arrayidx23, align 4, !tbaa !5 br label %for.inc35 for.inc35: ; preds = %if.end, %if.then25 %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %exitcond136.not = icmp eq i64 %indvars.iv.next134, 100 br i1 %exitcond136.not, label %for.end83, label %for.body13, !llvm.loop !11 for.end37: ; preds = %for.body13 %4 = trunc i64 %indvars.iv133 to i32 %cmp38128 = icmp eq i32 %4, 0 br i1 %cmp38128, label %for.end83, label %if.end45 for.cond69.preheader: ; preds = %if.end67 br i1 %cmp38128, label %for.end83, label %for.body71.preheader for.body71.preheader: ; preds = %for.cond69.preheader %wide.trip.count = and i64 %indvars.iv133, 4294967295 br label %for.body71 if.end45: ; preds = %for.end37, %if.end67 %i.3127 = phi i32 [ %i.4, %if.end67 ], [ 0, %for.end37 ] %idxprom46 = sext i32 %i.3127 to i64 %arrayidx47 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom46 %5 = load i32, ptr %arrayidx47, align 4, !tbaa !5 %arrayidx49 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %idxprom46 %6 = load i32, ptr %arrayidx49, align 4, !tbaa !5 %rem = srem i32 %5, %6 store i32 %6, ptr %arrayidx47, align 4, !tbaa !5 store i32 %rem, ptr %arrayidx49, align 4, !tbaa !5 %cmp60 = icmp eq i32 %rem, 0 br i1 %cmp60, label %if.then61, label %if.end67 if.then61: ; preds = %if.end45 %arrayidx65 = getelementptr inbounds [100 x i32], ptr %C, i64 0, i64 %idxprom46 store i32 %6, ptr %arrayidx65, align 4, !tbaa !5 %inc66 = add nsw i32 %i.3127, 1 br label %if.end67 if.end67: ; preds = %if.then61, %if.end45 %i.4 = phi i32 [ %inc66, %if.then61 ], [ %i.3127, %if.end45 ] %cmp43 = icmp eq i32 %i.4, %4 br i1 %cmp43, label %for.cond69.preheader, label %if.end45 for.body71: ; preds = %for.body71.preheader, %for.body71 %indvars.iv137 = phi i64 [ 0, %for.body71.preheader ], [ %indvars.iv.next138, %for.body71 ] %arrayidx73 = getelementptr inbounds [100 x i32], ptr %C, i64 0, i64 %indvars.iv137 %7 = load i32, ptr %arrayidx73, align 4, !tbaa !5 %arrayidx75 = getelementptr inbounds [100 x i32], ptr %B, i64 0, i64 %indvars.iv137 %8 = load i32, ptr %arrayidx75, align 4, !tbaa !5 %div = sdiv i32 %8, %7 %arrayidx79 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv137 %9 = load i32, ptr %arrayidx79, align 4, !tbaa !5 %mul = mul nsw i32 %9, %div %call80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7, i32 noundef %mul) %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1 %exitcond140.not = icmp eq i64 %indvars.iv.next138, %wide.trip.count br i1 %exitcond140.not, label %for.end83, label %for.body71, !llvm.loop !12 for.end83: ; preds = %for.inc35, %for.body71, %for.end37, %for.cond69.preheader call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %C) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %B) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #4 call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 400, 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include<stdio.h> long long Gcd(long long x,long long y); int main(void){ long long a,b,g,lcm; int i; while( scanf("%lld %lld",&a,&b) != EOF ){ g=Gcd(a,b); lcm=a*b/g; printf("%lld %lld\n",g,lcm); } return 0; } long long Gcd(long long x,long long y){ int i,j; long long tmp; if(y>=x){ tmp=x; x=y; y=tmp; } for(i=0;;i++){ x=x%y; tmp=x; x=y; y=tmp; if(y==0){ break; } } return (x); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122396/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122396/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [11 x i8] c"%lld %lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not5 = icmp eq i32 %call4, -1 br i1 %cmp.not5, label %while.end, label %while.body while.body: ; preds = %entry, %Gcd.exit %0 = load i64, ptr %a, align 8, !tbaa !5 %1 = load i64, ptr %b, align 8, !tbaa !5 %spec.select.i = call i64 @llvm.smin.i64(i64 %1, i64 %0) %spec.select13.i = call i64 @llvm.smax.i64(i64 %1, i64 %0) br label %for.cond.i for.cond.i: ; preds = %for.cond.i, %while.body %y.addr.1.i = phi i64 [ %spec.select.i, %while.body ], [ %rem.i, %for.cond.i ] %x.addr.1.i = phi i64 [ %spec.select13.i, %while.body ], [ %y.addr.1.i, %for.cond.i ] %rem.i = srem i64 %x.addr.1.i, %y.addr.1.i %cmp1.i = icmp eq i64 %rem.i, 0 br i1 %cmp1.i, label %Gcd.exit, label %for.cond.i Gcd.exit: ; preds = %for.cond.i %mul = mul nsw i64 %1, %0 %div = sdiv i64 %mul, %y.addr.1.i %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %y.addr.1.i, i64 noundef %div) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9 while.end: ; preds = %Gcd.exit, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i64 @Gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #3 { entry: %spec.select = tail call i64 @llvm.smin.i64(i64 %y, i64 %x) %spec.select13 = tail call i64 @llvm.smax.i64(i64 %y, i64 %x) br label %for.cond for.cond: ; preds = %for.cond, %entry %y.addr.1 = phi i64 [ %spec.select, %entry ], [ %rem, %for.cond ] %x.addr.1 = phi i64 [ %spec.select13, %entry ], [ %y.addr.1, %for.cond ] %rem = srem i64 %x.addr.1, %y.addr.1 %cmp1 = icmp eq i64 %rem, 0 br i1 %cmp1, label %for.end, label %for.cond for.end: ; preds = %for.cond ret i64 %y.addr.1 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { long a, b, i; while ((scanf("%ld%ld", &a, &b)) != EOF) { for (i = 1; i <= a; i++) { if (a%i) continue; if (!(b%(a/i))) { printf("%ld ", a/i); break; } } for (i = 1; i < 200000000; i++) if (!((a*i)%b)) { printf("%ld\n", a*i); break; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122446/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122446/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i64, align 8 %b = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 %call31 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not32 = icmp eq i32 %call31, -1 br i1 %cmp.not32, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end19 %0 = load i64, ptr %a, align 8, !tbaa !5 %cmp1.not28 = icmp slt i64 %0, 1 %.pre36 = load i64, ptr %b, align 8 br i1 %cmp1.not28, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.inc %i.029 = phi i64 [ %inc, %for.inc ], [ 1, %for.cond.preheader ] %rem = srem i64 %0, %i.029 %div = sdiv i64 %0, %i.029 %tobool.not = icmp eq i64 %rem, 0 br i1 %tobool.not, label %if.end, label %for.inc if.end: ; preds = %for.body %rem2 = srem i64 %.pre36, %div %tobool3.not = icmp eq i64 %rem2, 0 br i1 %tobool3.not, label %if.then4, label %for.inc if.then4: ; preds = %if.end %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %div) %.pre = load i64, ptr %a, align 8, !tbaa !5 %.pre35 = load i64, ptr %b, align 8, !tbaa !5 br label %for.end for.inc: ; preds = %if.end, %for.body %inc = add nuw i64 %i.029, 1 %exitcond.not = icmp eq i64 %i.029, %0 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9 for.end: ; preds = %for.inc, %for.cond.preheader, %if.then4 %1 = phi i64 [ %.pre36, %for.cond.preheader ], [ %.pre35, %if.then4 ], [ %.pre36, %for.inc ] %2 = phi i64 [ %0, %for.cond.preheader ], [ %.pre, %if.then4 ], [ %0, %for.inc ] br label %for.body10 for.cond8: ; preds = %for.body10 %inc18 = add nuw nsw i64 %i.130, 1 %exitcond34.not = icmp eq i64 %inc18, 200000000 br i1 %exitcond34.not, label %for.end19, label %for.body10.1, !llvm.loop !11 for.body10.1: ; preds = %for.cond8 %mul.1 = mul nsw i64 %2, %inc18 %rem11.1 = srem i64 %mul.1, %1 %tobool12.not.1 = icmp eq i64 %rem11.1, 0 br i1 %tobool12.not.1, label %if.then13, label %for.cond8.1 for.cond8.1: ; preds = %for.body10.1 %inc18.1 = add nuw nsw i64 %i.130, 2 br label %for.body10 for.body10: ; preds = %for.cond8.1, %for.end %i.130 = phi i64 [ 1, %for.end ], [ %inc18.1, %for.cond8.1 ] %mul = mul nsw i64 %2, %i.130 %rem11 = srem i64 %mul, %1 %tobool12.not = icmp eq i64 %rem11, 0 br i1 %tobool12.not, label %if.then13, label %for.cond8 if.then13: ; preds = %for.body10.1, %for.body10 %mul.lcssa = phi i64 [ %mul, %for.body10 ], [ %mul.1, %for.body10.1 ] %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %mul.lcssa) br label %for.end19 for.end19: ; preds = %for.cond8, %if.then13 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !12 while.end: ; preds = %for.end19, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10}
#include <stdio.h> #include <string.h> char arr[50][51]; int n, m; int check(char c, int i, int j, int oldi, int oldj) { int res; if(j + 1 < m && (i != oldi || j + 1 != oldj)) { if(arr[i][j + 1] == c && arr[i][j + 1] != '1' && arr[i][j + 1] != '2') { arr[i][j + 1] = '1'; res = check(c, i, j + 1, i, j); if(res == 1) return 1; } if(arr[i][j + 1] == '1') return 1; } if(i + 1 < n && (i + 1 != oldi || j != oldj)) { if(arr[i + 1][j] == c && arr[i + 1][j] != '1' && arr[i + 1][j] != '2') { arr[i + 1][j] = '1'; res = check(c, i + 1, j, i, j); if(res == 1) return 1; } if(arr[i + 1][j] == '1') return 1; } if(j - 1 >= 0 && (i != oldi || j - 1 != oldj)) { if(arr[i][j - 1] == c && arr[i][j - 1] != '1' && arr[i][j - 1] != '2') { arr[i][j - 1] = '1'; res = check(c, i, j - 1, i, j); if(res == 1) return 1; } if(arr[i][j - 1] == '1') return 1; } if(i - 1 >= 0 && (i - 1 != oldi || j != oldj)) { if(arr[i - 1][j] == c && arr[i - 1][j] != '1' && arr[i - 1][j] != '2') { arr[i - 1][j] = '1'; res = check(c, i - 1, j, i, j); if(res == 1) return 1; } if(arr[i - 1][j] == '1') return 1; } arr[i][j] = '2'; return 0; } int main() { int i, j, flag = 0, res; char c; scanf("%d", &n); scanf("%d", &m); for(i = 0;i < n;i++) scanf("%s", arr[i]); for(i = 0;i < n;i++) { for(j = 0;j < m;j++) { if(arr[i][j] != '2') { c = arr[i][j]; arr[i][j] = '1'; res = check(c, i, j, i, j); if(res) { printf("Yes"); flag = 1; break; } } } if(flag) break; } if(!flag) printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12249/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12249/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @m = dso_local global i32 0, align 4 @arr = dso_local global [50 x [51 x i8]] zeroinitializer, align 16 @n = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\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 nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @check(i8 noundef signext %c, i32 noundef %i, i32 noundef %j, i32 noundef %oldi, i32 noundef %oldj) local_unnamed_addr #0 { entry: %add = add nsw i32 %j, 1 %0 = load i32, ptr @m, align 4, !tbaa !5 %cmp = icmp slt i32 %add, %0 br i1 %cmp, label %land.lhs.true, label %if.end49 land.lhs.true: ; preds = %entry %cmp1.not = icmp eq i32 %i, %oldi %cmp3.not = icmp eq i32 %add, %oldj %or.cond = and i1 %cmp1.not, %cmp3.not br i1 %or.cond, label %if.end49, label %if.then if.then: ; preds = %land.lhs.true %idxprom = sext i32 %i to i64 %idxprom5 = sext i32 %add to i64 %arrayidx6 = getelementptr inbounds [50 x [51 x i8]], ptr @arr, i64 0, i64 %idxprom, i64 %idxprom5 %1 = load i8, ptr %arrayidx6, align 1, !tbaa !9 %.fr = freeze i8 %1 %cmp8 = icmp ne i8 %.fr, %c %.off = add i8 %.fr, -49 %switch = icmp ult i8 %.off, 2 %or.cond337 = or i1 %cmp8, %switch br i1 %or.cond337, label %if.end38, label %if.then28 if.then28: ; preds = %if.then store i8 49, ptr %arrayidx6, align 1, !tbaa !9 %call = tail call i32 @check(i8 noundef signext %c, i32 noundef %i, i32 noundef %add, i32 noundef %i, i32 noundef %j), !range !10 %cmp35.not = icmp eq i32 %call, 0 br i1 %cmp35.not, label %if.then28.if.end38_crit_edge, label %cleanup if.then28.if.end38_crit_edge: ; preds = %if.then28 %.pre = load i8, ptr %arrayidx6, align 1, !tbaa !9 br label %if.end38 if.end38: ; preds = %if.then28.if.end38_crit_edge, %if.then %2 = phi i8 [ %.pre, %if.then28.if.end38_crit_edge ], [ %.fr, %if.then ] %cmp45 = icmp eq i8 %2, 49 br i1 %cmp45, label %cleanup, label %if.end49 if.end49: ; preds = %land.lhs.true, %if.end38, %entry %add50 = add nsw i32 %i, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %cmp51 = icmp slt i32 %add50, %3 br i1 %cmp51, label %land.lhs.true53, label %if.end111 land.lhs.true53: ; preds = %if.end49 %cmp55.not = icmp eq i32 %add50, %oldi %cmp58.not = icmp eq i32 %j, %oldj %or.cond325 = and i1 %cmp55.not, %cmp58.not br i1 %or.cond325, label %if.end111, label %if.then60 if.then60: ; preds = %land.lhs.true53 %idxprom62 = sext i32 %add50 to i64 %idxprom64 = sext i32 %j to i64 %arrayidx65 = getelementptr inbounds [50 x [51 x i8]], ptr @arr, i64 0, i64 %idxprom62, i64 %idxprom64 %4 = load i8, ptr %arrayidx65, align 1, !tbaa !9 %.fr347 = freeze i8 %4 %cmp68 = icmp ne i8 %.fr347, %c %.off338 = add i8 %.fr347, -49 %switch339 = icmp ult i8 %.off338, 2 %or.cond340 = or i1 %cmp68, %switch339 br i1 %or.cond340, label %if.end100, label %if.then88 if.then88: ; preds = %if.then60 store i8 49, ptr %arrayidx65, align 1, !tbaa !9 %call95 = tail call i32 @check(i8 noundef signext %c, i32 noundef %add50, i32 noundef %j, i32 noundef %i, i32 noundef %j), !range !10 %cmp96.not = icmp eq i32 %call95, 0 br i1 %cmp96.not, label %if.then88.if.end100_crit_edge, label %cleanup if.then88.if.end100_crit_edge: ; preds = %if.then88 %.pre350 = load i8, ptr %arrayidx65, align 1, !tbaa !9 br label %if.end100 if.end100: ; preds = %if.then88.if.end100_crit_edge, %if.then60 %5 = phi i8 [ %.pre350, %if.then88.if.end100_crit_edge ], [ %.fr347, %if.then60 ] %cmp107 = icmp eq i8 %5, 49 br i1 %cmp107, label %cleanup, label %if.end111 if.end111: ; preds = %land.lhs.true53, %if.end100, %if.end49 %sub = add nsw i32 %j, -1 %cmp112 = icmp sgt i32 %j, 0 br i1 %cmp112, label %land.lhs.true114, label %if.end172 land.lhs.true114: ; preds = %if.end111 %cmp115.not = icmp eq i32 %i, %oldi %cmp119.not = icmp eq i32 %sub, %oldj %or.cond328 = select i1 %cmp115.not, i1 %cmp119.not, i1 false br i1 %or.cond328, label %if.end172, label %if.then121 if.then121: ; preds = %land.lhs.true114 %idxprom122 = sext i32 %i to i64 %idxprom125 = zext i32 %sub to i64 %arrayidx126 = getelementptr inbounds [50 x [51 x i8]], ptr @arr, i64 0, i64 %idxprom122, i64 %idxprom125 %6 = load i8, ptr %arrayidx126, align 1, !tbaa !9 %.fr348 = freeze i8 %6 %cmp129 = icmp ne i8 %.fr348, %c %.off341 = add i8 %.fr348, -49 %switch342 = icmp ult i8 %.off341, 2 %or.cond343 = or i1 %cmp129, %switch342 br i1 %or.cond343, label %if.end161, label %if.then149 if.then149: ; preds = %if.then121 store i8 49, ptr %arrayidx126, align 1, !tbaa !9 %call156 = tail call i32 @check(i8 noundef signext %c, i32 noundef %i, i32 noundef %sub, i32 noundef %i, i32 noundef %j), !range !10 %cmp157.not = icmp eq i32 %call156, 0 br i1 %cmp157.not, label %if.then149.if.end161_crit_edge, label %cleanup if.then149.if.end161_crit_edge: ; preds = %if.then149 %.pre351 = load i8, ptr %arrayidx126, align 1, !tbaa !9 br label %if.end161 if.end161: ; preds = %if.then149.if.end161_crit_edge, %if.then121 %7 = phi i8 [ %.pre351, %if.then149.if.end161_crit_edge ], [ %.fr348, %if.then121 ] %cmp168 = icmp eq i8 %7, 49 br i1 %cmp168, label %cleanup, label %if.end172 if.end172: ; preds = %land.lhs.true114, %if.end161, %if.end111 %sub173 = add nsw i32 %i, -1 %cmp174 = icmp sgt i32 %i, 0 br i1 %cmp174, label %land.lhs.true176, label %if.end234 land.lhs.true176: ; preds = %if.end172 %cmp178.not = icmp eq i32 %sub173, %oldi %cmp181.not = icmp eq i32 %j, %oldj %or.cond331 = and i1 %cmp178.not, %cmp181.not br i1 %or.cond331, label %if.end234, label %if.then183 if.then183: ; preds = %land.lhs.true176 %idxprom185 = zext i32 %sub173 to i64 %idxprom187 = sext i32 %j to i64 %arrayidx188 = getelementptr inbounds [50 x [51 x i8]], ptr @arr, i64 0, i64 %idxprom185, i64 %idxprom187 %8 = load i8, ptr %arrayidx188, align 1, !tbaa !9 %.fr349 = freeze i8 %8 %cmp191 = icmp ne i8 %.fr349, %c %.off344 = add i8 %.fr349, -49 %switch345 = icmp ult i8 %.off344, 2 %or.cond346 = or i1 %cmp191, %switch345 br i1 %or.cond346, label %if.end223, label %if.then211 if.then211: ; preds = %if.then183 store i8 49, ptr %arrayidx188, align 1, !tbaa !9 %call218 = tail call i32 @check(i8 noundef signext %c, i32 noundef %sub173, i32 noundef %j, i32 noundef %i, i32 noundef %j), !range !10 %cmp219.not = icmp eq i32 %call218, 0 br i1 %cmp219.not, label %if.then211.if.end223_crit_edge, label %cleanup if.then211.if.end223_crit_edge: ; preds = %if.then211 %.pre352 = load i8, ptr %arrayidx188, align 1, !tbaa !9 br label %if.end223 if.end223: ; preds = %if.then211.if.end223_crit_edge, %if.then183 %9 = phi i8 [ %.pre352, %if.then211.if.end223_crit_edge ], [ %.fr349, %if.then183 ] %cmp230 = icmp eq i8 %9, 49 br i1 %cmp230, label %cleanup, label %if.end234 if.end234: ; preds = %land.lhs.true176, %if.end223, %if.end172 %idxprom235 = sext i32 %i to i64 %idxprom237 = sext i32 %j to i64 %arrayidx238 = getelementptr inbounds [50 x [51 x i8]], ptr @arr, i64 0, i64 %idxprom235, i64 %idxprom237 store i8 50, ptr %arrayidx238, align 1, !tbaa !9 br label %cleanup cleanup: ; preds = %if.end223, %if.then211, %if.end161, %if.then149, %if.end100, %if.then88, %if.end38, %if.then28, %if.end234 %retval.0 = phi i32 [ 0, %if.end234 ], [ 1, %if.then28 ], [ 1, %if.end38 ], [ 1, %if.then88 ], [ 1, %if.end100 ], [ 1, %if.then149 ], [ 1, %if.end161 ], [ 1, %if.then211 ], [ 1, %if.end223 ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n) %call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @m) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp56 = icmp sgt i32 %0, 0 br i1 %cmp56, label %for.body, label %if.end39 for.cond3.preheader: ; preds = %for.body %cmp4.not60 = icmp sgt i32 %3, 0 %1 = load i32, ptr @m, align 4 %2 = icmp sgt i32 %1, 0 %or.cond = select i1 %cmp4.not60, i1 %2, i1 false br i1 %or.cond, label %for.cond6.preheader, label %if.end39 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [50 x [51 x i8]], ptr @arr, i64 0, i64 %indvars.iv %call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %3 = load i32, ptr @n, align 4, !tbaa !5 %4 = sext i32 %3 to i64 %cmp = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !11 for.cond6.preheader: ; preds = %for.cond3.preheader, %for.inc33 %5 = phi i32 [ %14, %for.inc33 ], [ %3, %for.cond3.preheader ] %6 = phi i32 [ %15, %for.inc33 ], [ %1, %for.cond3.preheader ] %7 = phi i32 [ %16, %for.inc33 ], [ %1, %for.cond3.preheader ] %indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.inc33 ], [ 0, %for.cond3.preheader ] %cmp7.not58 = icmp sgt i32 %7, 0 br i1 %cmp7.not58, label %for.body8.lr.ph, label %for.inc33 for.body8.lr.ph: ; preds = %for.cond6.preheader %8 = trunc i64 %indvars.iv67 to i32 br label %for.body8 for.body8: ; preds = %for.body8.lr.ph, %for.inc27 %9 = phi i32 [ %6, %for.body8.lr.ph ], [ %12, %for.inc27 ] %indvars.iv64 = phi i64 [ 0, %for.body8.lr.ph ], [ %indvars.iv.next65, %for.inc27 ] %arrayidx12 = getelementptr inbounds [50 x [51 x i8]], ptr @arr, i64 0, i64 %indvars.iv67, i64 %indvars.iv64 %10 = load i8, ptr %arrayidx12, align 1, !tbaa !9 %cmp13.not = icmp eq i8 %10, 50 br i1 %cmp13.not, label %for.inc27, label %if.then if.then: ; preds = %for.body8 store i8 49, ptr %arrayidx12, align 1, !tbaa !9 %11 = trunc i64 %indvars.iv64 to i32 %call23 = tail call i32 @check(i8 noundef signext %10, i32 noundef %8, i32 noundef %11, i32 noundef %8, i32 noundef %11), !range !10 %tobool.not = icmp eq i32 %call23, 0 br i1 %tobool.not, label %if.then.for.inc27_crit_edge, label %if.end39 if.then.for.inc27_crit_edge: ; preds = %if.then %.pre = load i32, ptr @m, align 4, !tbaa !5 br label %for.inc27 for.inc27: ; preds = %if.then.for.inc27_crit_edge, %for.body8 %12 = phi i32 [ %.pre, %if.then.for.inc27_crit_edge ], [ %9, %for.body8 ] %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1 %13 = sext i32 %12 to i64 %cmp7.not = icmp slt i64 %indvars.iv.next65, %13 br i1 %cmp7.not, label %for.body8, label %for.inc33.loopexit, !llvm.loop !13 for.inc33.loopexit: ; preds = %for.inc27 %.pre70 = load i32, ptr @n, align 4, !tbaa !5 br label %for.inc33 for.inc33: ; preds = %for.inc33.loopexit, %for.cond6.preheader %14 = phi i32 [ %.pre70, %for.inc33.loopexit ], [ %5, %for.cond6.preheader ] %15 = phi i32 [ %12, %for.inc33.loopexit ], [ %6, %for.cond6.preheader ] %16 = phi i32 [ %12, %for.inc33.loopexit ], [ %7, %for.cond6.preheader ] %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1 %17 = sext i32 %14 to i64 %cmp4.not = icmp slt i64 %indvars.iv.next68, %17 br i1 %cmp4.not, label %for.cond6.preheader, label %if.end39, !llvm.loop !14 if.end39: ; preds = %for.inc33, %if.then, %for.cond3.preheader, %entry %.str.2.sink = phi ptr [ @.str.3, %entry ], [ @.str.3, %for.cond3.preheader ], [ @.str.2, %if.then ], [ @.str.3, %for.inc33 ] %call25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 = !{i32 0, i32 2} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12, !15} !15 = !{!"llvm.loop.unswitch.partial.disable"}
#include<stdio.h> int main(){ int a,b; scanf("%d %d",&a,&b); printf("%d %d %f\n",a/b,a%b,(double)a/b); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122532/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122532/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int a, b; scanf("%d", &a); scanf("%d", &b); printf("%d %d %f\n", a/b, a%b, (double)a/b ); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122576/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122576/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv2 = sitofp i32 %1 to double %div3 = fdiv double %conv, %conv2 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main () { int a, b, d, r; double f; scanf("%d %d", &a, &b); d = a / b; r = a % b; f = (double) a / b; printf("%d %d %f\n", d, r, f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122626/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122626/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8] c"%d %d %f\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) 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 n,m,flag,i; scanf("%d%d",&n,&m); flag = 0; while(n--) { if(flag==0||flag==2) { for(i=0;i<m;i++) printf("%c",'#'); printf("\n"); } else if(flag==1) { for(i=0;i<m-1;i++) printf("%c",'.'); printf("#\n"); } else if(flag==3) { printf("#"); for(i=0;i<m-1;i++) printf("%c",'.'); printf("\n"); } flag+=1; flag=flag%4; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12267/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12267/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [2 x i8] c"#\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %dec53 = add nsw i32 %0, -1 store i32 %dec53, ptr %n, align 4, !tbaa !5 %tobool.not54 = icmp eq i32 %0, 0 br i1 %tobool.not54, label %while.end, label %while.body while.body: ; preds = %entry, %if.end29 %flag.055 = phi i32 [ %rem, %if.end29 ], [ 0, %entry ] %1 = and i32 %flag.055, -3 %or.cond = icmp eq i32 %1, 0 br i1 %or.cond, label %for.cond.preheader, label %if.else for.cond.preheader: ; preds = %while.body %2 = load i32, ptr %m, align 4, !tbaa !5 %cmp251 = icmp sgt i32 %2, 0 br i1 %cmp251, label %for.body, label %for.end for.body: ; preds = %for.cond.preheader, %for.body %i.052 = phi i32 [ %inc, %for.body ], [ 0, %for.cond.preheader ] %putchar44 = call i32 @putchar(i32 35) %inc = add nuw nsw i32 %i.052, 1 %3 = load i32, ptr %m, align 4, !tbaa !5 %cmp2 = icmp slt i32 %inc, %3 br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond.preheader %putchar43 = call i32 @putchar(i32 10) br label %if.end29 if.else: ; preds = %while.body switch i32 %flag.055, label %if.end29 [ i32 1, label %for.cond7.preheader i32 3, label %if.then17 ] for.cond7.preheader: ; preds = %if.else %4 = load i32, ptr %m, align 4, !tbaa !5 %cmp849 = icmp sgt i32 %4, 1 br i1 %cmp849, label %for.body9, label %for.end13 for.body9: ; preds = %for.cond7.preheader, %for.body9 %i.150 = phi i32 [ %inc12, %for.body9 ], [ 0, %for.cond7.preheader ] %putchar42 = call i32 @putchar(i32 46) %inc12 = add nuw nsw i32 %i.150, 1 %5 = load i32, ptr %m, align 4, !tbaa !5 %sub = add nsw i32 %5, -1 %cmp8 = icmp slt i32 %inc12, %sub br i1 %cmp8, label %for.body9, label %for.end13, !llvm.loop !11 for.end13: ; preds = %for.body9, %for.cond7.preheader %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end29 if.then17: ; preds = %if.else %putchar = call i32 @putchar(i32 35) %6 = load i32, ptr %m, align 4, !tbaa !5 %cmp2146 = icmp sgt i32 %6, 1 br i1 %cmp2146, label %for.body22, label %for.end26 for.body22: ; preds = %if.then17, %for.body22 %i.247 = phi i32 [ %inc25, %for.body22 ], [ 0, %if.then17 ] %putchar41 = call i32 @putchar(i32 46) %inc25 = add nuw nsw i32 %i.247, 1 %7 = load i32, ptr %m, align 4, !tbaa !5 %sub20 = add nsw i32 %7, -1 %cmp21 = icmp slt i32 %inc25, %sub20 br i1 %cmp21, label %for.body22, label %for.end26, !llvm.loop !12 for.end26: ; preds = %for.body22, %if.then17 %putchar40 = call i32 @putchar(i32 10) br label %if.end29 if.end29: ; preds = %if.else, %for.end13, %for.end26, %for.end %add = add nsw i32 %flag.055, 1 %rem = srem i32 %add, 4 %8 = load i32, ptr %n, align 4, !tbaa !5 %dec = add nsw i32 %8, -1 store i32 %dec, ptr %n, align 4, !tbaa !5 %tobool.not = icmp eq i32 %8, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !13 while.end: ; preds = %if.end29, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int main(){ int a,b,d,r; double f; scanf("%d %d",&a,&b); d=a/b; r=a%b; f=(double)a/b; printf("%d %d %f",d,r,f); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122712/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122712/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%d %d %f\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int a, b; int r, d; double f; scanf("%d %d", &a, &b); d = a / b; r = a % b; f = a * 1.0 / b; printf("%d %d %lf\n", d, r, f); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122756/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122756/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [11 x i8] c"%d %d %lf\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 %b = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 %div = sdiv i32 %0, %1 %rem = srem i32 %0, %1 %conv = sitofp i32 %0 to double %conv1 = sitofp i32 %1 to double %div2 = fdiv double %conv, %conv1 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div, i32 noundef %rem, double noundef %div2) 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 t; scanf("%d",&t); while(t--){ int n,x=0,y=0; scanf("%d",&n); long long int a[n],b[n]; for(int i=0;i<n;i++) scanf("%lld",&a[i]); for(int i=0;i<n;i++) scanf("%lld",&b[i]); if(a[0]==b[0]){ if(a[0]==1){ for(int i=1;i<n;i++){ if(a[i]==-1&&b[i]>=-1) {printf("YES\n"); y=1; break;} if(b[i]>=a[i]) continue; else {printf("NO\n"); y=1; break; } } if(y==0) printf("YES\n"); } if(a[0]==-1){ for(int i=1;i<n;i++){ if(a[i]==1&&b[i]<=1) {printf("YES\n"); y=1; break;} if(b[i]<=a[i]) continue; else {printf("NO\n"); y=1; break; } } if(y==0) printf("YES\n"); } if(a[0]==0){ int i=1; while(i<n&&a[i]==0){ if(a[i]==b[i]) i++; else{printf("NO\n"); x=1; break; } } if(x==0){ if(i==n) printf("YES\n"); else if(a[i]!=b[i]){printf("NO\n");} else{ if(a[i]==1){ for(int j=i+1;j<n;j++){ if(a[j]==-1&&b[j]>=-1) {printf("YES\n"); y=1; break;} if(b[j]>=a[j]) continue; else {printf("NO\n"); y=1; break;} } } if(a[i]==-1){ for(int j=i+1;j<n;j++){ if(a[j]==1&&b[j]<=1) {printf("YES\n"); y=1; break;} if(b[j]<=a[j]) continue; else {printf("NO\n"); y=1; break; } } } if(y==0) printf("YES\n"); } } } } else printf("NO\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1228/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1228/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @str.16 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.17 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i32, ptr %t, align 4, !tbaa !5 %dec268 = add nsw i32 %0, -1 store i32 %dec268, ptr %t, align 4, !tbaa !5 %tobool.not269 = icmp eq i32 %0, 0 br i1 %tobool.not269, label %while.end193, label %while.body while.body: ; preds = %entry, %if.end192 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %1 = load i32, ptr %n, align 4, !tbaa !5 %2 = zext i32 %1 to i64 %3 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %2, align 16 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = zext i32 %4 to i64 %vla2 = alloca i64, i64 %5, align 16 %cmp254 = icmp sgt i32 %4, 0 br i1 %cmp254, label %for.body, label %for.cond.cleanup7 for.cond5.preheader: ; preds = %for.body %cmp6256 = icmp sgt i32 %6, 0 br i1 %cmp6256, label %for.body8, label %for.cond.cleanup7 for.body: ; preds = %while.body, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %6 = load i32, ptr %n, align 4, !tbaa !5 %7 = sext i32 %6 to i64 %cmp = icmp slt i64 %indvars.iv.next, %7 br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !9 for.cond.cleanup7: ; preds = %for.body8, %while.body, %for.cond5.preheader %.lcssa = phi i32 [ %6, %for.cond5.preheader ], [ %4, %while.body ], [ %10, %for.body8 ] %8 = load i64, ptr %vla, align 16, !tbaa !11 %9 = load i64, ptr %vla2, align 16, !tbaa !11 %cmp17 = icmp eq i64 %8, %9 br i1 %cmp17, label %if.then, label %if.end192.sink.split for.body8: ; preds = %for.cond5.preheader, %for.body8 %indvars.iv272 = phi i64 [ %indvars.iv.next273, %for.body8 ], [ 0, %for.cond5.preheader ] %arrayidx10 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv272 %call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx10) %indvars.iv.next273 = add nuw nsw i64 %indvars.iv272, 1 %10 = load i32, ptr %n, align 4, !tbaa !5 %11 = sext i32 %10 to i64 %cmp6 = icmp slt i64 %indvars.iv.next273, %11 br i1 %cmp6, label %for.body8, label %for.cond.cleanup7, !llvm.loop !13 if.then: ; preds = %for.cond.cleanup7 %cmp19 = icmp eq i64 %8, 1 br i1 %cmp19, label %for.cond22.preheader, label %if.end48 for.cond22.preheader: ; preds = %if.then %cmp23.not258 = icmp sgt i32 %.lcssa, 1 br i1 %cmp23.not258, label %for.body25.preheader, label %if.end48thread-pre-split for.body25.preheader: ; preds = %for.cond22.preheader %wide.trip.count = zext i32 %.lcssa to i64 br label %for.body25 for.cond22: ; preds = %if.end %indvars.iv.next276 = add nuw nsw i64 %indvars.iv275, 1 %exitcond.not = icmp eq i64 %indvars.iv.next276, %wide.trip.count br i1 %exitcond.not, label %if.end48thread-pre-split, label %for.body25, !llvm.loop !14 for.body25: ; preds = %for.body25.preheader, %for.cond22 %indvars.iv275 = phi i64 [ 1, %for.body25.preheader ], [ %indvars.iv.next276, %for.cond22 ] %arrayidx27 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv275 %12 = load i64, ptr %arrayidx27, align 8, !tbaa !11 %cmp28 = icmp eq i64 %12, -1 %arrayidx30 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv275 %13 = load i64, ptr %arrayidx30, align 8, !tbaa !11 %cmp31 = icmp sgt i64 %13, -2 %or.cond = select i1 %cmp28, i1 %cmp31, i1 false br i1 %or.cond, label %if.end48thread-pre-split, label %if.end if.end: ; preds = %for.body25 %cmp38.not = icmp slt i64 %13, %12 br i1 %cmp38.not, label %if.end48thread-pre-split, label %for.cond22 if.end48thread-pre-split: ; preds = %for.cond22, %if.end, %for.body25, %for.cond22.preheader %str.6.sink = phi ptr [ @str.17, %for.cond22.preheader ], [ @str.17, %for.body25 ], [ @str.16, %if.end ], [ @str.17, %for.cond22 ] %y.1.ph = phi i32 [ 0, %for.cond22.preheader ], [ 1, %for.body25 ], [ 1, %if.end ], [ 0, %for.cond22 ] %puts235 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) %.pr = load i64, ptr %vla, align 16, !tbaa !11 br label %if.end48 if.end48: ; preds = %if.end48thread-pre-split, %if.then %14 = phi i64 [ %.pr, %if.end48thread-pre-split ], [ %8, %if.then ] %y.1 = phi i32 [ %y.1.ph, %if.end48thread-pre-split ], [ 0, %if.then ] %cmp50 = icmp eq i64 %14, -1 br i1 %cmp50, label %for.cond53.preheader, label %if.end83 for.cond53.preheader: ; preds = %if.end48 %15 = load i32, ptr %n, align 4, !tbaa !5 %cmp54260 = icmp sgt i32 %15, 1 br i1 %cmp54260, label %for.body56.preheader, label %cleanup77 for.body56.preheader: ; preds = %for.cond53.preheader %wide.trip.count281 = zext i32 %15 to i64 br label %for.body56 for.cond53: ; preds = %if.end66 %indvars.iv.next279 = add nuw nsw i64 %indvars.iv278, 1 %exitcond282.not = icmp eq i64 %indvars.iv.next279, %wide.trip.count281 br i1 %exitcond282.not, label %cleanup77, label %for.body56, !llvm.loop !15 for.body56: ; preds = %for.body56.preheader, %for.cond53 %indvars.iv278 = phi i64 [ 1, %for.body56.preheader ], [ %indvars.iv.next279, %for.cond53 ] %arrayidx58 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv278 %16 = load i64, ptr %arrayidx58, align 8, !tbaa !11 %cmp59 = icmp eq i64 %16, 1 %arrayidx62 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv278 %17 = load i64, ptr %arrayidx62, align 8, !tbaa !11 %cmp63 = icmp slt i64 %17, 2 %or.cond305 = select i1 %cmp59, i1 %cmp63, i1 false br i1 %or.cond305, label %if.end83.sink.split, label %if.end66 if.end66: ; preds = %for.body56 %cmp71.not = icmp sgt i64 %17, %16 br i1 %cmp71.not, label %if.end83.sink.split, label %for.cond53 cleanup77: ; preds = %for.cond53, %for.cond53.preheader %cmp79 = icmp eq i32 %y.1, 0 br i1 %cmp79, label %if.end83.sink.split, label %if.end83 if.end83.sink.split: ; preds = %if.end66, %for.body56, %cleanup77 %str.7.sink = phi ptr [ @str.17, %cleanup77 ], [ @str.17, %for.body56 ], [ @str.16, %if.end66 ] %y.3.ph = phi i32 [ 0, %cleanup77 ], [ 1, %for.body56 ], [ 1, %if.end66 ] %puts236 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.sink) br label %if.end83 if.end83: ; preds = %if.end83.sink.split, %cleanup77, %if.end48 %y.3 = phi i32 [ 1, %cleanup77 ], [ %y.1, %if.end48 ], [ %y.3.ph, %if.end83.sink.split ] %18 = load i64, ptr %vla, align 16, !tbaa !11 %cmp85 = icmp eq i64 %18, 0 br i1 %cmp85, label %while.cond88.preheader, label %if.end192 while.cond88.preheader: ; preds = %if.end83 %19 = load i32, ptr %n, align 4, !tbaa !5 %cmp89262 = icmp sgt i32 %19, 1 br i1 %cmp89262, label %land.rhs.preheader, label %if.then105 land.rhs.preheader: ; preds = %while.cond88.preheader %wide.trip.count286 = zext i32 %19 to i64 br label %land.rhs land.rhs: ; preds = %land.rhs.preheader, %if.then99 %indvars.iv283 = phi i64 [ 1, %land.rhs.preheader ], [ %indvars.iv.next284, %if.then99 ] %arrayidx91 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv283 %20 = load i64, ptr %arrayidx91, align 8, !tbaa !11 %cmp92 = icmp eq i64 %20, 0 br i1 %cmp92, label %while.body93, label %if.then105.loopexit while.body93: ; preds = %land.rhs %arrayidx97 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv283 %21 = load i64, ptr %arrayidx97, align 8, !tbaa !11 %cmp98 = icmp eq i64 %21, 0 br i1 %cmp98, label %if.then99, label %if.end192.sink.split if.then99: ; preds = %while.body93 %indvars.iv.next284 = add nuw nsw i64 %indvars.iv283, 1 %exitcond287.not = icmp eq i64 %indvars.iv.next284, %wide.trip.count286 br i1 %exitcond287.not, label %if.end192.sink.split, label %land.rhs, !llvm.loop !16 if.then105.loopexit: ; preds = %land.rhs %22 = trunc i64 %indvars.iv283 to i32 br label %if.then105 if.then105: ; preds = %if.then105.loopexit, %while.cond88.preheader %i87.0.lcssa = phi i32 [ 1, %while.cond88.preheader ], [ %22, %if.then105.loopexit ] %cmp106 = icmp eq i32 %i87.0.lcssa, %19 br i1 %cmp106, label %if.end192.sink.split, label %if.else109 if.else109: ; preds = %if.then105 %idxprom110 = zext i32 %i87.0.lcssa to i64 %arrayidx111 = getelementptr inbounds i64, ptr %vla, i64 %idxprom110 %23 = load i64, ptr %arrayidx111, align 8, !tbaa !11 %arrayidx113 = getelementptr inbounds i64, ptr %vla2, i64 %idxprom110 %24 = load i64, ptr %arrayidx113, align 8, !tbaa !11 %cmp114.not = icmp eq i64 %23, %24 br i1 %cmp114.not, label %if.else117, label %if.end192.sink.split if.else117: ; preds = %if.else109 %cmp120 = icmp eq i64 %23, 1 br i1 %cmp120, label %for.cond122, label %if.end148 for.cond122: ; preds = %if.else117, %if.end135 %indvars.iv288 = phi i64 [ %indvars.iv.next289, %if.end135 ], [ %idxprom110, %if.else117 ] %indvars.iv.next289 = add nuw nsw i64 %indvars.iv288, 1 %25 = trunc i64 %indvars.iv.next289 to i32 %cmp123 = icmp sgt i32 %19, %25 br i1 %cmp123, label %for.body125, label %if.end148 for.body125: ; preds = %for.cond122 %arrayidx127 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next289 %26 = load i64, ptr %arrayidx127, align 8, !tbaa !11 %cmp128 = icmp eq i64 %26, -1 %arrayidx131 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv.next289 %27 = load i64, ptr %arrayidx131, align 8, !tbaa !11 %cmp132 = icmp sgt i64 %27, -2 %or.cond306 = select i1 %cmp128, i1 %cmp132, i1 false br i1 %or.cond306, label %if.end148.sink.split, label %if.end135 if.end135: ; preds = %for.body125 %cmp140.not = icmp slt i64 %27, %26 br i1 %cmp140.not, label %if.end148.sink.split, label %for.cond122, !llvm.loop !17 if.end148.sink.split: ; preds = %if.end135, %for.body125 %str.12.sink = phi ptr [ @str.17, %for.body125 ], [ @str.16, %if.end135 ] %puts241 = call i32 @puts(ptr nonnull dereferenceable(1) %str.12.sink) br label %if.end148 if.end148: ; preds = %for.cond122, %if.end148.sink.split, %if.else117 %y.5 = phi i32 [ %y.3, %if.else117 ], [ 1, %if.end148.sink.split ], [ %y.3, %for.cond122 ] %28 = load i64, ptr %arrayidx111, align 8, !tbaa !11 %cmp151 = icmp eq i64 %28, -1 br i1 %cmp151, label %for.cond155.preheader, label %if.end181 for.cond155.preheader: ; preds = %if.end148 %29 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond155 for.cond155: ; preds = %for.cond155.preheader, %if.end168 %indvars.iv291 = phi i64 [ %idxprom110, %for.cond155.preheader ], [ %indvars.iv.next292, %if.end168 ] %indvars.iv.next292 = add nuw nsw i64 %indvars.iv291, 1 %30 = trunc i64 %indvars.iv.next292 to i32 %cmp156 = icmp sgt i32 %29, %30 br i1 %cmp156, label %for.body158, label %if.end181 for.body158: ; preds = %for.cond155 %arrayidx160 = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv.next292 %31 = load i64, ptr %arrayidx160, align 8, !tbaa !11 %cmp161 = icmp eq i64 %31, 1 %arrayidx164 = getelementptr inbounds i64, ptr %vla2, i64 %indvars.iv.next292 %32 = load i64, ptr %arrayidx164, align 8, !tbaa !11 %cmp165 = icmp slt i64 %32, 2 %or.cond307 = select i1 %cmp161, i1 %cmp165, i1 false br i1 %or.cond307, label %if.end192.sink.split, label %if.end168 if.end168: ; preds = %for.body158 %cmp173.not = icmp sgt i64 %32, %31 br i1 %cmp173.not, label %if.end192.sink.split, label %for.cond155, !llvm.loop !18 if.end181: ; preds = %for.cond155, %if.end148 %cmp182 = icmp eq i32 %y.5, 0 br i1 %cmp182, label %if.end192.sink.split, label %if.end192 if.end192.sink.split: ; preds = %if.then99, %while.body93, %if.end168, %for.body158, %for.cond.cleanup7, %if.end181, %if.else109, %if.then105 %str.13.sink = phi ptr [ @str.17, %if.then105 ], [ @str.16, %if.else109 ], [ @str.17, %if.end181 ], [ @str.16, %for.cond.cleanup7 ], [ @str.17, %for.body158 ], [ @str.16, %if.end168 ], [ @str.16, %while.body93 ], [ @str.17, %if.then99 ] %puts242 = call i32 @puts(ptr nonnull dereferenceable(1) %str.13.sink) br label %if.end192 if.end192: ; preds = %if.end192.sink.split, %if.end181, %if.end83 call void @llvm.stackrestore.p0(ptr %3) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 %33 = load i32, ptr %t, align 4, !tbaa !5 %dec = add nsw i32 %33, -1 store i32 %dec, ptr %t, align 4, !tbaa !5 %tobool.not = icmp eq i32 %33, 0 br i1 %tobool.not, label %while.end193, label %while.body, !llvm.loop !19 while.end193: ; preds = %if.end192, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"long long", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10}
#include <stdio.h> int main(){ int i = 0, j = 0, m = 0, n = 0; scanf("%d %d", &n, &m); for (i = 0; i < n; ++i){ if (i % 2 == 0){ for (j = 0; j < m; ++j){ putchar('#'); } putchar('\n'); } else if (i % 4 == 1 ){ for (j = 0; j < m - 1; ++j){ putchar('.'); } putchar('#'); putchar('\n'); } else if (i % 4 == 3){ putchar('#'); for (j = 0; j < m - 1; ++j){ putchar('.'); } putchar('\n'); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12285/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12285/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 store i32 0, ptr %m, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 store i32 0, ptr %n, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp62 = icmp sgt i32 %0, 0 br i1 %cmp62, label %for.body, label %for.end37 for.body: ; preds = %entry, %for.inc35 %i.063 = phi i32 [ %inc36, %for.inc35 ], [ 0, %entry ] %rem = and i32 %i.063, 1 %cmp1 = icmp eq i32 %rem, 0 br i1 %cmp1, label %for.cond2.preheader, label %if.else for.cond2.preheader: ; preds = %for.body %1 = load i32, ptr %m, align 4, !tbaa !5 %cmp360 = icmp sgt i32 %1, 0 br i1 %cmp360, label %for.body4, label %for.inc35.sink.split for.body4: ; preds = %for.cond2.preheader, %for.body4 %j.061 = phi i32 [ %inc, %for.body4 ], [ 0, %for.cond2.preheader ] %2 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i = call i32 @putc(i32 noundef 35, ptr noundef %2) %inc = add nuw nsw i32 %j.061, 1 %3 = load i32, ptr %m, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %3 br i1 %cmp3, label %for.body4, label %for.inc35.sink.split, !llvm.loop !11 if.else: ; preds = %for.body %rem7 = and i32 %i.063, 3 switch i32 %rem7, label %for.inc35 [ i32 1, label %for.cond10.preheader i32 3, label %if.then22 ] for.cond10.preheader: ; preds = %if.else %4 = load i32, ptr %m, align 4, !tbaa !5 %cmp1158 = icmp sgt i32 %4, 1 br i1 %cmp1158, label %for.body12, label %for.end16 for.body12: ; preds = %for.cond10.preheader, %for.body12 %j.159 = phi i32 [ %inc15, %for.body12 ], [ 0, %for.cond10.preheader ] %5 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i48 = call i32 @putc(i32 noundef 46, ptr noundef %5) %inc15 = add nuw nsw i32 %j.159, 1 %6 = load i32, ptr %m, align 4, !tbaa !5 %sub = add nsw i32 %6, -1 %cmp11 = icmp slt i32 %inc15, %sub br i1 %cmp11, label %for.body12, label %for.end16, !llvm.loop !13 for.end16: ; preds = %for.body12, %for.cond10.preheader %7 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i49 = call i32 @putc(i32 noundef 35, ptr noundef %7) br label %for.inc35.sink.split if.then22: ; preds = %if.else %8 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i51 = call i32 @putc(i32 noundef 35, ptr noundef %8) %9 = load i32, ptr %m, align 4, !tbaa !5 %cmp2655 = icmp sgt i32 %9, 1 br i1 %cmp2655, label %for.body27, label %for.inc35.sink.split for.body27: ; preds = %if.then22, %for.body27 %j.256 = phi i32 [ %inc30, %for.body27 ], [ 0, %if.then22 ] %10 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i52 = call i32 @putc(i32 noundef 46, ptr noundef %10) %inc30 = add nuw nsw i32 %j.256, 1 %11 = load i32, ptr %m, align 4, !tbaa !5 %sub25 = add nsw i32 %11, -1 %cmp26 = icmp slt i32 %inc30, %sub25 br i1 %cmp26, label %for.body27, label %for.inc35.sink.split, !llvm.loop !14 for.inc35.sink.split: ; preds = %for.body27, %for.body4, %if.then22, %for.cond2.preheader, %for.end16 %12 = load ptr, ptr @stdout, align 8, !tbaa !9 %call.i47 = call i32 @putc(i32 noundef 10, ptr noundef %12) br label %for.inc35 for.inc35: ; preds = %for.inc35.sink.split, %if.else %inc36 = add nuw nsw i32 %i.063, 1 %13 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc36, %13 br i1 %cmp, label %for.body, label %for.end37, !llvm.loop !15 for.end37: ; preds = %for.inc35, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"} !13 = distinct !{!13, !12} !14 = distinct !{!14, !12} !15 = distinct !{!15, !12}
#include <stdio.h> int main(){ int r=0; char s[20],a[]={"CODEFESTIVAL2016"}; scanf("%s",s); for(int i=0;i<16;i++)if(s[i]!=a[i])r++; printf("%d",r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122907/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122907/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [20 x i8], align 16 call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %s) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load <16 x i8>, ptr %s, align 16, !tbaa !5 %1 = icmp ne <16 x i8> %0, <i8 67, i8 79, i8 68, i8 69, i8 70, i8 69, i8 83, i8 84, i8 73, i8 86, i8 65, i8 76, i8 50, i8 48, i8 49, i8 54> %2 = bitcast <16 x i1> %1 to i16 %3 = call i16 @llvm.ctpop.i16(i16 %2), !range !8 %4 = zext i16 %3 to i32 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i16 @llvm.ctpop.i16(i16) #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 = !{i16 0, i16 17}
#include <stdio.h> #include <string.h> int main(void) { int i, c = 0; char s[17]; char t[17] = {"CODEFESTIVAL2016"}; scanf("%s", s); for (i = 0; i < 16; i++) { if (s[i] != t[i]) { s[i] = t[i]; c++; } } printf("%d\n", c); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122950/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122950/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [17 x i8], align 16 call void @llvm.lifetime.start.p0(i64 17, ptr nonnull %s) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp4.not = icmp eq i8 %0, 67 br i1 %cmp4.not, label %for.inc, label %if.then if.then: ; preds = %entry store i8 67, ptr %s, align 16, !tbaa !5 br label %for.inc for.inc: ; preds = %entry, %if.then %c.1 = phi i32 [ 1, %if.then ], [ 0, %entry ] %arrayidx.1 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 %cmp4.not.1 = icmp eq i8 %1, 79 br i1 %cmp4.not.1, label %for.inc.1, label %if.then.1 if.then.1: ; preds = %for.inc store i8 79, ptr %arrayidx.1, align 1, !tbaa !5 %inc.1 = add nuw nsw i32 %c.1, 1 br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %c.1.1 = phi i32 [ %inc.1, %if.then.1 ], [ %c.1, %for.inc ] %arrayidx.2 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx.2, align 2, !tbaa !5 %cmp4.not.2 = icmp eq i8 %2, 68 br i1 %cmp4.not.2, label %for.inc.2, label %if.then.2 if.then.2: ; preds = %for.inc.1 store i8 68, ptr %arrayidx.2, align 2, !tbaa !5 %inc.2 = add nuw nsw i32 %c.1.1, 1 br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 %c.1.2 = phi i32 [ %inc.2, %if.then.2 ], [ %c.1.1, %for.inc.1 ] %arrayidx.3 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 3 %3 = load i8, ptr %arrayidx.3, align 1, !tbaa !5 %cmp4.not.3 = icmp eq i8 %3, 69 br i1 %cmp4.not.3, label %for.inc.3, label %if.then.3 if.then.3: ; preds = %for.inc.2 store i8 69, ptr %arrayidx.3, align 1, !tbaa !5 %inc.3 = add nuw nsw i32 %c.1.2, 1 br label %for.inc.3 for.inc.3: ; preds = %if.then.3, %for.inc.2 %c.1.3 = phi i32 [ %inc.3, %if.then.3 ], [ %c.1.2, %for.inc.2 ] %arrayidx.4 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 4 %4 = load i8, ptr %arrayidx.4, align 4, !tbaa !5 %cmp4.not.4 = icmp eq i8 %4, 70 br i1 %cmp4.not.4, label %for.inc.4, label %if.then.4 if.then.4: ; preds = %for.inc.3 store i8 70, ptr %arrayidx.4, align 4, !tbaa !5 %inc.4 = add nuw nsw i32 %c.1.3, 1 br label %for.inc.4 for.inc.4: ; preds = %if.then.4, %for.inc.3 %c.1.4 = phi i32 [ %inc.4, %if.then.4 ], [ %c.1.3, %for.inc.3 ] %arrayidx.5 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 5 %5 = load i8, ptr %arrayidx.5, align 1, !tbaa !5 %cmp4.not.5 = icmp eq i8 %5, 69 br i1 %cmp4.not.5, label %for.inc.5, label %if.then.5 if.then.5: ; preds = %for.inc.4 store i8 69, ptr %arrayidx.5, align 1, !tbaa !5 %inc.5 = add nuw nsw i32 %c.1.4, 1 br label %for.inc.5 for.inc.5: ; preds = %if.then.5, %for.inc.4 %c.1.5 = phi i32 [ %inc.5, %if.then.5 ], [ %c.1.4, %for.inc.4 ] %arrayidx.6 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 6 %6 = load i8, ptr %arrayidx.6, align 2, !tbaa !5 %cmp4.not.6 = icmp eq i8 %6, 83 br i1 %cmp4.not.6, label %for.inc.6, label %if.then.6 if.then.6: ; preds = %for.inc.5 store i8 83, ptr %arrayidx.6, align 2, !tbaa !5 %inc.6 = add nuw nsw i32 %c.1.5, 1 br label %for.inc.6 for.inc.6: ; preds = %if.then.6, %for.inc.5 %c.1.6 = phi i32 [ %inc.6, %if.then.6 ], [ %c.1.5, %for.inc.5 ] %arrayidx.7 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 7 %7 = load i8, ptr %arrayidx.7, align 1, !tbaa !5 %cmp4.not.7 = icmp eq i8 %7, 84 br i1 %cmp4.not.7, label %for.inc.7, label %if.then.7 if.then.7: ; preds = %for.inc.6 store i8 84, ptr %arrayidx.7, align 1, !tbaa !5 %inc.7 = add nuw nsw i32 %c.1.6, 1 br label %for.inc.7 for.inc.7: ; preds = %if.then.7, %for.inc.6 %c.1.7 = phi i32 [ %inc.7, %if.then.7 ], [ %c.1.6, %for.inc.6 ] %arrayidx.8 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 8 %8 = load i8, ptr %arrayidx.8, align 8, !tbaa !5 %cmp4.not.8 = icmp eq i8 %8, 73 br i1 %cmp4.not.8, label %for.inc.8, label %if.then.8 if.then.8: ; preds = %for.inc.7 store i8 73, ptr %arrayidx.8, align 8, !tbaa !5 %inc.8 = add nuw nsw i32 %c.1.7, 1 br label %for.inc.8 for.inc.8: ; preds = %if.then.8, %for.inc.7 %c.1.8 = phi i32 [ %inc.8, %if.then.8 ], [ %c.1.7, %for.inc.7 ] %arrayidx.9 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 9 %9 = load i8, ptr %arrayidx.9, align 1, !tbaa !5 %cmp4.not.9 = icmp eq i8 %9, 86 br i1 %cmp4.not.9, label %for.inc.9, label %if.then.9 if.then.9: ; preds = %for.inc.8 store i8 86, ptr %arrayidx.9, align 1, !tbaa !5 %inc.9 = add nuw nsw i32 %c.1.8, 1 br label %for.inc.9 for.inc.9: ; preds = %if.then.9, %for.inc.8 %c.1.9 = phi i32 [ %inc.9, %if.then.9 ], [ %c.1.8, %for.inc.8 ] %arrayidx.10 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 10 %10 = load i8, ptr %arrayidx.10, align 2, !tbaa !5 %cmp4.not.10 = icmp eq i8 %10, 65 br i1 %cmp4.not.10, label %for.inc.10, label %if.then.10 if.then.10: ; preds = %for.inc.9 store i8 65, ptr %arrayidx.10, align 2, !tbaa !5 %inc.10 = add nuw nsw i32 %c.1.9, 1 br label %for.inc.10 for.inc.10: ; preds = %if.then.10, %for.inc.9 %c.1.10 = phi i32 [ %inc.10, %if.then.10 ], [ %c.1.9, %for.inc.9 ] %arrayidx.11 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 11 %11 = load i8, ptr %arrayidx.11, align 1, !tbaa !5 %cmp4.not.11 = icmp eq i8 %11, 76 br i1 %cmp4.not.11, label %for.inc.11, label %if.then.11 if.then.11: ; preds = %for.inc.10 store i8 76, ptr %arrayidx.11, align 1, !tbaa !5 %inc.11 = add nuw nsw i32 %c.1.10, 1 br label %for.inc.11 for.inc.11: ; preds = %if.then.11, %for.inc.10 %c.1.11 = phi i32 [ %inc.11, %if.then.11 ], [ %c.1.10, %for.inc.10 ] %arrayidx.12 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 12 %12 = load i8, ptr %arrayidx.12, align 4, !tbaa !5 %cmp4.not.12 = icmp eq i8 %12, 50 br i1 %cmp4.not.12, label %for.inc.12, label %if.then.12 if.then.12: ; preds = %for.inc.11 store i8 50, ptr %arrayidx.12, align 4, !tbaa !5 %inc.12 = add nuw nsw i32 %c.1.11, 1 br label %for.inc.12 for.inc.12: ; preds = %if.then.12, %for.inc.11 %c.1.12 = phi i32 [ %inc.12, %if.then.12 ], [ %c.1.11, %for.inc.11 ] %arrayidx.13 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 13 %13 = load i8, ptr %arrayidx.13, align 1, !tbaa !5 %cmp4.not.13 = icmp eq i8 %13, 48 br i1 %cmp4.not.13, label %for.inc.13, label %if.then.13 if.then.13: ; preds = %for.inc.12 store i8 48, ptr %arrayidx.13, align 1, !tbaa !5 %inc.13 = add nuw nsw i32 %c.1.12, 1 br label %for.inc.13 for.inc.13: ; preds = %if.then.13, %for.inc.12 %c.1.13 = phi i32 [ %inc.13, %if.then.13 ], [ %c.1.12, %for.inc.12 ] %arrayidx.14 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 14 %14 = load i8, ptr %arrayidx.14, align 2, !tbaa !5 %cmp4.not.14 = icmp eq i8 %14, 49 br i1 %cmp4.not.14, label %for.inc.14, label %if.then.14 if.then.14: ; preds = %for.inc.13 store i8 49, ptr %arrayidx.14, align 2, !tbaa !5 %inc.14 = add nuw nsw i32 %c.1.13, 1 br label %for.inc.14 for.inc.14: ; preds = %if.then.14, %for.inc.13 %c.1.14 = phi i32 [ %inc.14, %if.then.14 ], [ %c.1.13, %for.inc.13 ] %arrayidx.15 = getelementptr inbounds [17 x i8], ptr %s, i64 0, i64 15 %15 = load i8, ptr %arrayidx.15, align 1, !tbaa !5 %cmp4.not.15 = icmp eq i8 %15, 54 br i1 %cmp4.not.15, label %for.inc.15, label %if.then.15 if.then.15: ; preds = %for.inc.14 store i8 54, ptr %arrayidx.15, align 1, !tbaa !5 %inc.15 = add nuw nsw i32 %c.1.14, 1 br label %for.inc.15 for.inc.15: ; preds = %if.then.15, %for.inc.14 %c.1.15 = phi i32 [ %inc.15, %if.then.15 ], [ %c.1.14, %for.inc.14 ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %c.1.15) call void @llvm.lifetime.end.p0(i64 17, ptr nonnull %s) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main(void) { int n[4]; int sum=0; for(int i=0;i<4;i++){ scanf("%d",&n[i]); } int flag1=0,flag2=0,flag3=0,flag4=0; for(int i=0;i<4;i++){ if(n[i]==1)flag1++; if(n[i]==7)flag2++; if(n[i]==9)flag3++; if(n[i]==4)flag4++; } if(flag1==1&&flag2==1&&flag3==1&&flag4==1){ puts("YES"); }else{ puts("NO"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_122994/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_122994/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"YES\00", align 1 @.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca [4 x i32], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %arrayidx.1 = getelementptr inbounds [4 x i32], ptr %n, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [4 x i32], ptr %n, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [4 x i32], ptr %n, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %0 = load <4 x i32>, ptr %n, align 16 %1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> zeroinitializer %2 = icmp eq <4 x i32> %1, <i32 7, i32 1, i32 9, i32 4> %3 = zext <4 x i1> %2 to <4 x i32> %4 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 1, i32 1, i32 1, i32 1> %5 = icmp eq <4 x i32> %4, <i32 7, i32 1, i32 9, i32 4> %6 = zext <4 x i1> %5 to <4 x i32> %7 = add nuw nsw <4 x i32> %3, %6 %8 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 2, i32 2, i32 2, i32 2> %9 = icmp eq <4 x i32> %8, <i32 7, i32 1, i32 9, i32 4> %10 = zext <4 x i1> %9 to <4 x i32> %11 = add nuw nsw <4 x i32> %7, %10 %12 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 3, i32 3, i32 3, i32 3> %13 = icmp eq <4 x i32> %12, <i32 7, i32 1, i32 9, i32 4> %14 = zext <4 x i1> %13 to <4 x i32> %15 = add nuw nsw <4 x i32> %11, %14 %.fr = freeze <4 x i32> %15 %16 = icmp ne <4 x i32> %.fr, <i32 1, i32 1, i32 1, i32 1> %17 = bitcast <4 x i1> %16 to i4 %18 = icmp eq i4 %17, 0 %.str.1..str.2 = select i1 %18, ptr @.str.1, ptr @.str.2 %call39 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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() { int n[4],i,j,hold; for(i=0;i<4;i++){ scanf("%d",&n[i]); } for(i=3;i>0;i--){ for(j=0;j<i;j++){ if(n[j]>n[j+1]){ hold = n[j]; n[j] = n[j+1]; n[j+1] = hold; } } } if(n[0]==1 && n[1]==4 && n[2]==7 && n[3]==9 ) printf("YES\n"); else printf("NO\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123043/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123043/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"NO\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca [4 x i32], align 16 call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %n) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %arrayidx.1 = getelementptr inbounds [4 x i32], ptr %n, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1) %arrayidx.2 = getelementptr inbounds [4 x i32], ptr %n, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2) %arrayidx.3 = getelementptr inbounds [4 x i32], ptr %n, i64 0, i64 3 %call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3) %0 = load i32, ptr %n, align 16, !tbaa !5 %1 = load i32, ptr %arrayidx.1, align 4 %cmp11 = icmp sgt i32 %0, %1 br i1 %cmp11, label %if.then, label %for.inc22 if.then: ; preds = %entry store i32 %1, ptr %n, align 16, !tbaa !5 store i32 %0, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.inc22 for.inc22: ; preds = %entry, %if.then %2 = phi i32 [ %0, %entry ], [ %1, %if.then ] %3 = phi i32 [ %1, %entry ], [ %0, %if.then ] %4 = load i32, ptr %arrayidx.2, align 8 %cmp11.166 = icmp sgt i32 %3, %4 br i1 %cmp11.166, label %if.then.168, label %for.inc22.169 if.then.168: ; preds = %for.inc22 store i32 %4, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %3, ptr %arrayidx.2, align 8, !tbaa !5 br label %for.inc22.169 for.inc22.169: ; preds = %if.then.168, %for.inc22 %5 = phi i32 [ %4, %if.then.168 ], [ %3, %for.inc22 ] %6 = phi i32 [ %3, %if.then.168 ], [ %4, %for.inc22 ] %7 = load i32, ptr %arrayidx.3, align 4 %cmp11.271 = icmp sgt i32 %6, %7 br i1 %cmp11.271, label %if.then.273, label %for.inc22.274 if.then.273: ; preds = %for.inc22.169 store i32 %7, ptr %arrayidx.2, align 8, !tbaa !5 store i32 %6, ptr %arrayidx.3, align 4, !tbaa !5 br label %for.inc22.274 for.inc22.274: ; preds = %if.then.273, %for.inc22.169 %8 = phi i32 [ %6, %if.then.273 ], [ %7, %for.inc22.169 ] %9 = phi i32 [ %7, %if.then.273 ], [ %6, %for.inc22.169 ] %cmp11.1 = icmp sgt i32 %2, %5 br i1 %cmp11.1, label %if.then.1, label %for.inc22.1 if.then.1: ; preds = %for.inc22.274 store i32 %5, ptr %n, align 16, !tbaa !5 store i32 %2, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.inc22.1 for.inc22.1: ; preds = %if.then.1, %for.inc22.274 %10 = phi i32 [ %5, %if.then.1 ], [ %2, %for.inc22.274 ] %11 = phi i32 [ %2, %if.then.1 ], [ %5, %for.inc22.274 ] %cmp11.1.1 = icmp sgt i32 %11, %9 br i1 %cmp11.1.1, label %if.then.1.1, label %for.inc22.1.1 if.then.1.1: ; preds = %for.inc22.1 store i32 %9, ptr %arrayidx.1, align 4, !tbaa !5 store i32 %11, ptr %arrayidx.2, align 8, !tbaa !5 br label %for.inc22.1.1 for.inc22.1.1: ; preds = %if.then.1.1, %for.inc22.1 %12 = phi i32 [ %11, %if.then.1.1 ], [ %9, %for.inc22.1 ] %13 = phi i32 [ %9, %if.then.1.1 ], [ %11, %for.inc22.1 ] %cmp11.2 = icmp sgt i32 %10, %13 br i1 %cmp11.2, label %if.then.2, label %for.inc22.2 if.then.2: ; preds = %for.inc22.1.1 store i32 %13, ptr %n, align 16, !tbaa !5 store i32 %10, ptr %arrayidx.1, align 4, !tbaa !5 br label %for.inc22.2 for.inc22.2: ; preds = %if.then.2, %for.inc22.1.1 %14 = phi i32 [ %10, %if.then.2 ], [ %13, %for.inc22.1.1 ] %15 = phi i32 [ %13, %if.then.2 ], [ %10, %for.inc22.1.1 ] %cmp28 = icmp eq i32 %15, 1 %cmp30 = icmp eq i32 %14, 4 %or.cond = and i1 %cmp28, %cmp30 %cmp33 = icmp eq i32 %12, 7 %or.cond41 = and i1 %or.cond, %cmp33 %cmp36 = icmp eq i32 %8, 9 %or.cond42 = and i1 %or.cond41, %cmp36 %str.3.str = select i1 %or.cond42, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <float.h> #include <inttypes.h> #include <limits.h> #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <math.h> #ifdef __cplusplus #include <bits/stdc++.h> #endif #define getchar getchar_unlocked #define putchar putchar_unlocked int32_t nextint(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); bool s=false; if(c=='-'){s=true;c=getchar_unlocked();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; } int64_t nextlong(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); int s=0; if(c=='-'){s=1;c=getchar_unlocked();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; } uint32_t nextstr(char *s){ char c=getchar_unlocked(); while(c==' '||c=='\n') c=getchar_unlocked(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar_unlocked(); } *s='\0'; return len; } #define P 998244353 int a[3000]; int b[3001][3001]; int main(void){ int n=nextint(); int s=nextint(); for(int i=0; i<n; i++){ a[i]=nextint(); } b[0][0]=1; for(int i=0; i<=n; i++){ for(int j=s-a[i]+1; j<=s; j++){ b[i+1][j]=b[i][j]*2%P; } for(int j=s-a[i]; j>=0; --j){ b[i+1][j]=b[i][j]*2%P; b[i+1][j]%=P; b[i+1][j+a[i]]+=b[i][j]; b[i+1][j+a[i]]%=P; } } printf("%d\n", b[n][s]); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123087/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123087/source.c" target datalayout = "e-m:e-p270: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 [3000 x i32] zeroinitializer, align 16 @b = dso_local local_unnamed_addr global [3001 x [3001 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: 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) #4 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) #4 %.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) #4 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) #4 %.pre82 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit71 cond.false.i68: ; preds = %while.body25 %incdec.ptr.i69 = getelementptr inbounds i8, ptr %20, i64 1 store ptr %incdec.ptr.i69, ptr %_IO_read_ptr.i62, align 8, !tbaa !9 %22 = load i8, ptr %20, align 1, !tbaa !16 %conv3.i70 = zext i8 %22 to i32 br label %getchar_unlocked.exit71 getchar_unlocked.exit71: ; preds = %cond.true.i65, %cond.false.i68 %23 = phi ptr [ %.pre82, %cond.true.i65 ], [ %19, %cond.false.i68 ] %cond.i67 = phi i32 [ %call.i66, %cond.true.i65 ], [ %conv3.i70, %cond.false.i68 ] %sext40 = shl i32 %cond.i67, 24 %24 = add i32 %sext40, -788529153 %25 = icmp ult i32 %24, 184549375 br i1 %25, label %while.body25, label %while.end29, !llvm.loop !19 while.end29: ; preds = %getchar_unlocked.exit71, %if.end %x.0.lcssa = phi i32 [ 0, %if.end ], [ %sub, %getchar_unlocked.exit71 ] %sub31 = sub i32 0, %x.0.lcssa %cond = select i1 %cmp12, i32 %sub31, i32 %x.0.lcssa ret i32 %cond } ; Function Attrs: nounwind uwtable define dso_local 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) #4 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) #4 %.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) #4 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) #4 %.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) #4 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) #4 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) #4 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 i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 @nextint() %call1 = tail call i32 @nextint() %cmp113 = icmp sgt i32 %call, 0 br i1 %cmp113, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %call to i64 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry store i32 1, ptr @b, align 16, !tbaa !24 %cmp5.not119 = icmp slt i32 %call, 0 %.pre = sext i32 %call1 to i64 br i1 %cmp5.not119, label %for.cond.cleanup6, label %for.body7.preheader for.body7.preheader: ; preds = %for.cond.cleanup %0 = add nuw i32 %call, 1 %wide.trip.count134 = zext i32 %0 to i64 br label %for.body7 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %call2 = tail call i32 @nextint() %arrayidx = getelementptr inbounds [3000 x i32], ptr @a, i64 0, i64 %indvars.iv store i32 %call2, ptr %arrayidx, align 4, !tbaa !24 %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 !25 for.cond.cleanup6: ; preds = %for.cond.cleanup32, %for.cond.cleanup %idxprom78 = sext i32 %call to i64 %arrayidx81 = getelementptr inbounds [3001 x [3001 x i32]], ptr @b, i64 0, i64 %idxprom78, i64 %.pre %1 = load i32, ptr %arrayidx81, align 4, !tbaa !24 %call82 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1) ret i32 0 for.body7: ; preds = %for.body7.preheader, %for.cond.cleanup32 %indvars.iv129 = phi i64 [ 0, %for.body7.preheader ], [ %15, %for.cond.cleanup32 ] %2 = mul nuw nsw i64 %indvars.iv129, 12004 %gep186 = getelementptr i8, ptr getelementptr (i8, ptr @b, i64 12004), i64 %2 %gep187 = getelementptr i8, ptr getelementptr (i8, ptr @b, i64 12008), i64 %2 %scevgep156 = getelementptr i8, ptr @b, i64 %2 %gep188 = getelementptr i8, ptr getelementptr (i8, ptr @b, i64 4), i64 %2 %3 = mul nuw nsw i64 %indvars.iv129, 12004 %gep189 = getelementptr i8, ptr getelementptr (i8, ptr @b, i64 12004), i64 %3 %scevgep146 = getelementptr i8, ptr @b, i64 %3 %arrayidx9 = getelementptr inbounds [3000 x i32], ptr @a, i64 0, i64 %indvars.iv129 %4 = load i32, ptr %arrayidx9, align 4, !tbaa !24 %sub = sub i32 %call1, %4 %cmp11.not.not115 = icmp sgt i32 %4, 0 br i1 %cmp11.not.not115, label %for.body13.lr.ph, label %for.cond30.preheader for.body13.lr.ph: ; preds = %for.body7 %5 = add nuw nsw i64 %indvars.iv129, 1 %6 = sext i32 %sub to i64 %7 = add nsw i64 %6, 1 %smax = tail call i64 @llvm.smax.i64(i64 %7, i64 %.pre) %8 = sub i64 %smax, %6 %min.iters.check172 = icmp ult i64 %8, 4 br i1 %min.iters.check172, label %for.body13.preheader, label %vector.ph173 vector.ph173: ; preds = %for.body13.lr.ph %n.vec175 = and i64 %8, -4 %ind.end176 = add i64 %n.vec175, %6 br label %vector.body179 vector.body179: ; preds = %vector.body179, %vector.ph173 %index180 = phi i64 [ 0, %vector.ph173 ], [ %index.next183, %vector.body179 ] %offset.idx181 = add i64 %index180, %6 %9 = add nsw i64 %offset.idx181, 1 %10 = getelementptr inbounds [3001 x [3001 x i32]], ptr @b, i64 0, i64 %indvars.iv129, i64 %9 %wide.load182 = load <4 x i32>, ptr %10, align 4, !tbaa !24 %11 = shl nsw <4 x i32> %wide.load182, <i32 1, i32 1, i32 1, i32 1> %12 = srem <4 x i32> %11, <i32 998244353, i32 998244353, i32 998244353, i32 998244353> %13 = getelementptr inbounds [3001 x [3001 x i32]], ptr @b, i64 0, i64 %5, i64 %9 store <4 x i32> %12, ptr %13, align 4, !tbaa !24 %index.next183 = add nuw i64 %index180, 4 %14 = icmp eq i64 %index.next183, %n.vec175 br i1 %14, label %middle.block170, label %vector.body179, !llvm.loop !26 middle.block170: ; preds = %vector.body179 %cmp.n178 = icmp eq i64 %8, %n.vec175 br i1 %cmp.n178, label %for.cond30.preheader, label %for.body13.preheader for.body13.preheader: ; preds = %for.body13.lr.ph, %middle.block170 %indvars.iv122.ph = phi i64 [ %6, %for.body13.lr.ph ], [ %ind.end176, %middle.block170 ] br label %for.body13 for.cond30.preheader: ; preds = %for.body13, %middle.block170, %for.body7 %cmp31117 = icmp sgt i32 %sub, -1 %15 = add nuw nsw i64 %indvars.iv129, 1 br i1 %cmp31117, label %for.body33.lr.ph, label %for.cond.cleanup32 for.body33.lr.ph: ; preds = %for.cond30.preheader %16 = zext i32 %sub to i64 %17 = sext i32 %4 to i64 %18 = add nuw nsw i64 %16, 1 %min.iters.check = icmp ult i32 %sub, 27 br i1 %min.iters.check, label %for.body33.preheader, label %vector.scevcheck vector.scevcheck: ; preds = %for.body33.lr.ph %19 = shl nuw nsw i64 %16, 2 %scevgep138 = getelementptr i8, ptr %gep189, i64 %19 %mul139.neg = mul nsw i64 %16, -4 %20 = getelementptr i8, ptr %scevgep138, i64 %mul139.neg %21 = icmp ugt ptr %20, %scevgep138 %22 = add nsw i64 %17, %16 %23 = shl nsw i64 %22, 2 %scevgep142 = getelementptr i8, ptr %gep189, i64 %23 %mul143.neg = mul nsw i64 %16, -4 %24 = getelementptr i8, ptr %scevgep142, i64 %mul143.neg %25 = icmp ugt ptr %24, %scevgep142 %scevgep147 = getelementptr i8, ptr %scevgep146, i64 %19 %mul148.neg = mul nsw i64 %16, -4 %26 = getelementptr i8, ptr %scevgep147, i64 %mul148.neg %27 = icmp ugt ptr %26, %scevgep147 %28 = or i1 %21, %25 %29 = or i1 %28, %27 br i1 %29, label %for.body33.preheader, label %vector.memcheck vector.memcheck: ; preds = %vector.scevcheck %30 = shl nuw nsw i64 %16, 2 %scevgep153 = getelementptr i8, ptr %gep187, i64 %30 %31 = shl nsw i64 %17, 2 %scevgep154 = getelementptr i8, ptr %gep186, i64 %31 %32 = add nsw i64 %17, %16 %33 = shl nsw i64 %32, 2 %scevgep155 = getelementptr i8, ptr %gep187, i64 %33 %scevgep158 = getelementptr i8, ptr %gep188, i64 %30 %bound0 = icmp ult ptr %gep186, %scevgep155 %bound1 = icmp ult ptr %scevgep154, %scevgep153 %found.conflict = and i1 %bound0, %bound1 %bound0159 = icmp ult ptr %gep186, %scevgep158 %bound1160 = icmp ult ptr %scevgep156, %scevgep153 %found.conflict161 = and i1 %bound0159, %bound1160 %conflict.rdx = or i1 %found.conflict, %found.conflict161 %bound0162 = icmp ult ptr %scevgep154, %scevgep158 %bound1163 = icmp ult ptr %scevgep156, %scevgep155 %found.conflict164 = and i1 %bound0162, %bound1163 %conflict.rdx165 = or i1 %conflict.rdx, %found.conflict164 br i1 %conflict.rdx165, label %for.body33.preheader, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %18, 8589934588 %ind.end = sub nsw i64 %16, %n.vec br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %offset.idx = sub i64 %16, %index %34 = and i64 %offset.idx, 4294967295 %gep = getelementptr [3001 x [3001 x i32]], ptr getelementptr (i32, ptr @b, i64 -3), i64 0, i64 %indvars.iv129, i64 %34 %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !24, !alias.scope !29 %35 = shl nsw <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1> %36 = srem <4 x i32> %35, <i32 998244353, i32 998244353, i32 998244353, i32 998244353> %gep184 = getelementptr [3001 x [3001 x i32]], ptr getelementptr (i32, ptr @b, i64 -3), i64 0, i64 %15, i64 %34 store <4 x i32> %36, ptr %gep184, align 4, !tbaa !24, !alias.scope !32, !noalias !34 %37 = add nsw i64 %offset.idx, %17 %gep185 = getelementptr [3001 x [3001 x i32]], ptr getelementptr (i32, ptr @b, i64 -3), i64 0, i64 %15, i64 %37 %wide.load167 = load <4 x i32>, ptr %gep185, align 4, !tbaa !24, !alias.scope !36, !noalias !29 %38 = add nsw <4 x i32> %wide.load167, %wide.load %39 = srem <4 x i32> %38, <i32 998244353, i32 998244353, i32 998244353, i32 998244353> store <4 x i32> %39, ptr %gep185, align 4, !tbaa !24, !alias.scope !36, !noalias !29 %index.next = add nuw i64 %index, 4 %40 = icmp eq i64 %index.next, %n.vec br i1 %40, label %middle.block, label %vector.body, !llvm.loop !37 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %18, %n.vec br i1 %cmp.n, label %for.cond.cleanup32, label %for.body33.preheader for.body33.preheader: ; preds = %vector.memcheck, %vector.scevcheck, %for.body33.lr.ph, %middle.block %indvars.iv125.ph = phi i64 [ %16, %vector.memcheck ], [ %16, %vector.scevcheck ], [ %16, %for.body33.lr.ph ], [ %ind.end, %middle.block ] br label %for.body33 for.body13: ; preds = %for.body13.preheader, %for.body13 %indvars.iv122 = phi i64 [ %indvars.iv.next123, %for.body13 ], [ %indvars.iv122.ph, %for.body13.preheader ] %indvars.iv.next123 = add nsw i64 %indvars.iv122, 1 %arrayidx17 = getelementptr inbounds [3001 x [3001 x i32]], ptr @b, i64 0, i64 %indvars.iv129, i64 %indvars.iv.next123 %41 = load i32, ptr %arrayidx17, align 4, !tbaa !24 %mul = shl nsw i32 %41, 1 %rem = srem i32 %mul, 998244353 %arrayidx22 = getelementptr inbounds [3001 x [3001 x i32]], ptr @b, i64 0, i64 %5, i64 %indvars.iv.next123 store i32 %rem, ptr %arrayidx22, align 4, !tbaa !24 %cmp11.not.not = icmp slt i64 %indvars.iv.next123, %.pre br i1 %cmp11.not.not, label %for.body13, label %for.cond30.preheader, !llvm.loop !38 for.cond.cleanup32: ; preds = %for.body33, %middle.block, %for.cond30.preheader %exitcond135.not = icmp eq i64 %15, %wide.trip.count134 br i1 %exitcond135.not, label %for.cond.cleanup6, label %for.body7, !llvm.loop !39 for.body33: ; preds = %for.body33.preheader, %for.body33 %indvars.iv125 = phi i64 [ %indvars.iv.next126, %for.body33 ], [ %indvars.iv125.ph, %for.body33.preheader ] %idxprom36 = and i64 %indvars.iv125, 4294967295 %arrayidx37 = getelementptr inbounds [3001 x [3001 x i32]], ptr @b, i64 0, i64 %indvars.iv129, i64 %idxprom36 %42 = load i32, ptr %arrayidx37, align 4, !tbaa !24 %mul38 = shl nsw i32 %42, 1 %rem39 = srem i32 %mul38, 998244353 %arrayidx44 = getelementptr inbounds [3001 x [3001 x i32]], ptr @b, i64 0, i64 %15, i64 %idxprom36 store i32 %rem39, ptr %arrayidx44, align 4, !tbaa !24 %43 = add nsw i64 %indvars.iv125, %17 %arrayidx62 = getelementptr inbounds [3001 x [3001 x i32]], ptr @b, i64 0, i64 %15, i64 %43 %44 = load i32, ptr %arrayidx62, align 4, !tbaa !24 %add63 = add nsw i32 %44, %42 %rem72 = srem i32 %add63, 998244353 store i32 %rem72, ptr %arrayidx62, align 4, !tbaa !24 %indvars.iv.next126 = add nsw i64 %indvars.iv125, -1 %cmp31.not = icmp eq i64 %indvars.iv125, 0 br i1 %cmp31.not, label %for.cond.cleanup32, label %for.body33, !llvm.loop !40 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 declare i32 @__uflow(ptr noundef) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #3 attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !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 = !{!11, !11, i64 0} !25 = distinct !{!25, !18} !26 = distinct !{!26, !18, !27, !28} !27 = !{!"llvm.loop.isvectorized", i32 1} !28 = !{!"llvm.loop.unroll.runtime.disable"} !29 = !{!30} !30 = distinct !{!30, !31} !31 = distinct !{!31, !"LVerDomain"} !32 = !{!33} !33 = distinct !{!33, !31} !34 = !{!35, !30} !35 = distinct !{!35, !31} !36 = !{!35} !37 = distinct !{!37, !18, !27, !28} !38 = distinct !{!38, !18, !28, !27} !39 = distinct !{!39, !18} !40 = distinct !{!40, !18, !27}
#include<stdio.h> int main() { int i,j,m,n; while(scanf("%d%d",&m,&n)==2) { for(i=1;i<=m;i++) { if((i%2)==1) { for(j=1;j<=n;j++) printf("#"); } else if((i%2)==0&&(i%4)!=0) { for(j=1;j<=n-1;j++) printf("."); printf("#"); } else { printf("#"); for(j=1;j<=n-1;j++) printf("."); } printf("\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_12313/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_12313/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 %call58 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n) %cmp59 = icmp eq i32 %call58, 2 br i1 %cmp59, label %for.cond.preheader, label %while.end while.cond.loopexit: ; preds = %if.end30, %for.cond.preheader %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n) %cmp = icmp eq i32 %call, 2 br i1 %cmp, label %for.cond.preheader, label %while.end, !llvm.loop !5 for.cond.preheader: ; preds = %entry, %while.cond.loopexit %0 = load i32, ptr %m, align 4, !tbaa !7 %cmp1.not56 = icmp slt i32 %0, 1 br i1 %cmp1.not56, label %while.cond.loopexit, label %for.body for.body: ; preds = %for.cond.preheader, %if.end30 %i.057 = phi i32 [ %inc33, %if.end30 ], [ 1, %for.cond.preheader ] %rem = and i32 %i.057, 1 %cmp2.not = icmp eq i32 %rem, 0 br i1 %cmp2.not, label %land.lhs.true, label %for.cond3.preheader for.cond3.preheader: ; preds = %for.body %1 = load i32, ptr %n, align 4, !tbaa !7 %cmp4.not50 = icmp slt i32 %1, 1 br i1 %cmp4.not50, label %if.end30, label %for.body5 for.body5: ; preds = %for.cond3.preheader, %for.body5 %j.051 = phi i32 [ %inc, %for.body5 ], [ 1, %for.cond3.preheader ] %putchar48 = call i32 @putchar(i32 35) %inc = add nuw nsw i32 %j.051, 1 %2 = load i32, ptr %n, align 4, !tbaa !7 %cmp4.not.not = icmp slt i32 %j.051, %2 br i1 %cmp4.not.not, label %for.body5, label %if.end30, !llvm.loop !11 land.lhs.true: ; preds = %for.body %rem9 = and i32 %i.057, 3 %cmp10.not = icmp eq i32 %rem9, 0 br i1 %cmp10.not, label %if.else20, label %for.cond12.preheader for.cond12.preheader: ; preds = %land.lhs.true %3 = load i32, ptr %n, align 4, !tbaa !7 %cmp13.not.not52 = icmp sgt i32 %3, 1 br i1 %cmp13.not.not52, label %for.body14, label %for.end18 for.body14: ; preds = %for.cond12.preheader, %for.body14 %j.153 = phi i32 [ %inc17, %for.body14 ], [ 1, %for.cond12.preheader ] %putchar46 = call i32 @putchar(i32 46) %inc17 = add nuw nsw i32 %j.153, 1 %4 = load i32, ptr %n, align 4, !tbaa !7 %cmp13.not.not = icmp slt i32 %inc17, %4 br i1 %cmp13.not.not, label %for.body14, label %for.end18, !llvm.loop !12 for.end18: ; preds = %for.body14, %for.cond12.preheader %putchar45 = call i32 @putchar(i32 35) br label %if.end30 if.else20: ; preds = %land.lhs.true %putchar = call i32 @putchar(i32 35) %5 = load i32, ptr %n, align 4, !tbaa !7 %cmp24.not.not54 = icmp sgt i32 %5, 1 br i1 %cmp24.not.not54, label %for.body25, label %if.end30 for.body25: ; preds = %if.else20, %for.body25 %j.255 = phi i32 [ %inc28, %for.body25 ], [ 1, %if.else20 ] %putchar44 = call i32 @putchar(i32 46) %inc28 = add nuw nsw i32 %j.255, 1 %6 = load i32, ptr %n, align 4, !tbaa !7 %cmp24.not.not = icmp slt i32 %inc28, %6 br i1 %cmp24.not.not, label %for.body25, label %if.end30, !llvm.loop !13 if.end30: ; preds = %for.body5, %for.body25, %for.cond3.preheader, %if.else20, %for.end18 %putchar47 = call i32 @putchar(i32 10) %inc33 = add nuw nsw i32 %i.057, 1 %7 = load i32, ptr %m, align 4, !tbaa !7 %cmp1.not.not = icmp slt i32 %i.057, %7 br i1 %cmp1.not.not, label %for.body, label %while.cond.loopexit, !llvm.loop !14 while.end: ; preds = %while.cond.loopexit, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"int", !9, i64 0} !9 = !{!"omnipotent char", !10, i64 0} !10 = !{!"Simple C/C++ TBAA"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6} !13 = distinct !{!13, !6} !14 = distinct !{!14, !6}
#include <stdio.h> #include <string.h> int main(void){ char S[1001],T[1001]; scanf("%s",S); scanf("%s",T); int count, i, j, S_len, T_len, min; S_len = strlen(S); T_len = strlen(T); min = T_len; for(i=0; i<=(S_len-T_len); i++){ count = 0; for(j=0; j<T_len; j++){ if(T[j] != S[j+i]) count++; } if(min>count){ min = count; } } printf("%d",min); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123180/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123180/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [1001 x i8], align 16 %T = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %S) #5 call void @llvm.lifetime.start.p0(i64 1001, 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 %call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %T) #6 %conv7 = trunc i64 %call6 to i32 %cmp.not42 = icmp sge i32 %conv, %conv7 %cmp1039 = icmp sgt i32 %conv7, 0 %or.cond = and i1 %cmp.not42, %cmp1039 br i1 %or.cond, label %for.cond9.preheader.us.preheader, label %for.end26 for.cond9.preheader.us.preheader: ; preds = %entry %0 = add i64 %call4, 1 %1 = sub i64 %0, %call6 %wide.trip.count52 = and i64 %1, 4294967295 %wide.trip.count = and i64 %call6, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 %n.mod.vf = and i64 %call6, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf %cmp.n = icmp eq i64 %n.mod.vf, 0 br label %for.cond9.preheader.us for.cond9.preheader.us: ; preds = %for.cond9.preheader.us.preheader, %for.cond9.for.end_crit_edge.us %indvars.iv49 = phi i64 [ 0, %for.cond9.preheader.us.preheader ], [ %indvars.iv.next50, %for.cond9.for.end_crit_edge.us ] %min.044.us = phi i32 [ %conv7, %for.cond9.preheader.us.preheader ], [ %spec.select38.us, %for.cond9.for.end_crit_edge.us ] br i1 %min.iters.check, label %for.body12.us.preheader, label %vector.body vector.body: ; preds = %for.cond9.preheader.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond9.preheader.us ] %vec.phi = phi <4 x i32> [ %11, %vector.body ], [ zeroinitializer, %for.cond9.preheader.us ] %vec.phi54 = phi <4 x i32> [ %12, %vector.body ], [ zeroinitializer, %for.cond9.preheader.us ] %2 = getelementptr inbounds [1001 x i8], ptr %T, i64 0, i64 %index %wide.load = load <4 x i8>, ptr %2, align 8, !tbaa !5 %3 = getelementptr inbounds i8, ptr %2, i64 4 %wide.load55 = load <4 x i8>, ptr %3, align 4, !tbaa !5 %4 = add nuw nsw i64 %index, %indvars.iv49 %5 = getelementptr inbounds [1001 x i8], ptr %S, i64 0, i64 %4 %wide.load56 = load <4 x i8>, ptr %5, align 1, !tbaa !5 %6 = getelementptr inbounds i8, ptr %5, i64 4 %wide.load57 = load <4 x i8>, ptr %6, align 1, !tbaa !5 %7 = icmp ne <4 x i8> %wide.load, %wide.load56 %8 = icmp ne <4 x i8> %wide.load55, %wide.load57 %9 = zext <4 x i1> %7 to <4 x i32> %10 = zext <4 x i1> %8 to <4 x i32> %11 = add <4 x i32> %vec.phi, %9 %12 = add <4 x i32> %vec.phi54, %10 %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %12, %11 %14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond9.for.end_crit_edge.us, label %for.body12.us.preheader for.body12.us.preheader: ; preds = %for.cond9.preheader.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond9.preheader.us ], [ %n.vec, %middle.block ] %count.041.us.ph = phi i32 [ 0, %for.cond9.preheader.us ], [ %14, %middle.block ] br label %for.body12.us for.body12.us: ; preds = %for.body12.us.preheader, %for.body12.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body12.us ], [ %indvars.iv.ph, %for.body12.us.preheader ] %count.041.us = phi i32 [ %spec.select.us, %for.body12.us ], [ %count.041.us.ph, %for.body12.us.preheader ] %arrayidx.us = getelementptr inbounds [1001 x i8], ptr %T, i64 0, i64 %indvars.iv %15 = load i8, ptr %arrayidx.us, align 1, !tbaa !5 %16 = add nuw nsw i64 %indvars.iv, %indvars.iv49 %arrayidx15.us = getelementptr inbounds [1001 x i8], ptr %S, i64 0, i64 %16 %17 = load i8, ptr %arrayidx15.us, align 1, !tbaa !5 %cmp17.not.us = icmp ne i8 %15, %17 %inc.us = zext i1 %cmp17.not.us to i32 %spec.select.us = add nuw nsw i32 %count.041.us, %inc.us %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.cond9.for.end_crit_edge.us, label %for.body12.us, !llvm.loop !12 for.cond9.for.end_crit_edge.us: ; preds = %for.body12.us, %middle.block %spec.select.us.lcssa = phi i32 [ %14, %middle.block ], [ %spec.select.us, %for.body12.us ] %spec.select38.us = call i32 @llvm.smin.i32(i32 %min.044.us, i32 %spec.select.us.lcssa) %indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1 %exitcond53.not = icmp eq i64 %indvars.iv.next50, %wide.trip.count52 br i1 %exitcond53.not, label %for.end26, label %for.cond9.preheader.us, !llvm.loop !13 for.end26: ; preds = %for.cond9.for.end_crit_edge.us, %entry %min.0.lcssa = phi i32 [ %conv7, %entry ], [ %spec.select38.us, %for.cond9.for.end_crit_edge.us ] %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %min.0.lcssa) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %T) #5 call void @llvm.lifetime.end.p0(i64 1001, 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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} !13 = distinct !{!13, !9}
#include <stdio.h> #include <string.h> int main(){ char s[1001], t[1001]; scanf("%s %s", s, t); int max = 0; for(int i = 0; i < strlen(s) - strlen(t) + 1; ++i){ int cnt = 0; for(int j = 0; j < strlen(t); ++j){ if(s[i+j] == t[j]) cnt++; } if(max < cnt) max = cnt; } printf("%d\n", (int)strlen(t) - max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123223/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123223/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1 @.str.1 = private unnamed_addr constant [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 [1001 x i8], align 16 %t = alloca [1001 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1001, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 1001, 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 %call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #6 %sub = add i64 %call3, 1 %cmp48.not = icmp eq i64 %sub, %call5 %cmp1144.not = icmp eq i64 %call5, 0 %or.cond = or i1 %cmp48.not, %cmp1144.not br i1 %or.cond, label %for.cond.cleanup, label %for.cond7.preheader.us.preheader for.cond7.preheader.us.preheader: ; preds = %entry %add = sub i64 %sub, %call5 %umax = call i64 @llvm.umax.i64(i64 %add, i64 1) %min.iters.check = icmp ult i64 %call5, 8 %n.vec = and i64 %call5, -8 %cmp.n = icmp eq i64 %call5, %n.vec br label %for.cond7.preheader.us for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.cond7.for.cond.cleanup13_crit_edge.us %indvars.iv57 = phi i64 [ 0, %for.cond7.preheader.us.preheader ], [ %indvars.iv.next58, %for.cond7.for.cond.cleanup13_crit_edge.us ] %max.049.us = phi i32 [ 0, %for.cond7.preheader.us.preheader ], [ %spec.select.us, %for.cond7.for.cond.cleanup13_crit_edge.us ] br i1 %min.iters.check, label %for.body14.us.preheader, label %vector.body vector.body: ; preds = %for.cond7.preheader.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond7.preheader.us ] %vec.phi = phi <4 x i32> [ %9, %vector.body ], [ zeroinitializer, %for.cond7.preheader.us ] %vec.phi64 = phi <4 x i32> [ %10, %vector.body ], [ zeroinitializer, %for.cond7.preheader.us ] %0 = add nuw nsw i64 %index, %indvars.iv57 %1 = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %0 %wide.load = load <4 x i8>, ptr %1, align 1, !tbaa !5 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load65 = load <4 x i8>, ptr %2, align 1, !tbaa !5 %3 = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %index %wide.load66 = load <4 x i8>, ptr %3, align 8, !tbaa !5 %4 = getelementptr inbounds i8, ptr %3, i64 4 %wide.load67 = load <4 x i8>, ptr %4, align 4, !tbaa !5 %5 = icmp eq <4 x i8> %wide.load, %wide.load66 %6 = icmp eq <4 x i8> %wide.load65, %wide.load67 %7 = zext <4 x i1> %5 to <4 x i32> %8 = zext <4 x i1> %6 to <4 x i32> %9 = add <4 x i32> %vec.phi, %7 %10 = add <4 x i32> %vec.phi64, %8 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %10, %9 %12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond7.for.cond.cleanup13_crit_edge.us, label %for.body14.us.preheader for.body14.us.preheader: ; preds = %for.cond7.preheader.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond7.preheader.us ], [ %n.vec, %middle.block ] %cnt.045.us.ph = phi i32 [ 0, %for.cond7.preheader.us ], [ %12, %middle.block ] br label %for.body14.us for.body14.us: ; preds = %for.body14.us.preheader, %for.body14.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body14.us ], [ %indvars.iv.ph, %for.body14.us.preheader ] %cnt.045.us = phi i32 [ %spec.select43.us, %for.body14.us ], [ %cnt.045.us.ph, %for.body14.us.preheader ] %13 = add nuw nsw i64 %indvars.iv, %indvars.iv57 %arrayidx.us = getelementptr inbounds [1001 x i8], ptr %s, i64 0, i64 %13 %14 = load i8, ptr %arrayidx.us, align 1, !tbaa !5 %arrayidx18.us = getelementptr inbounds [1001 x i8], ptr %t, i64 0, i64 %indvars.iv %15 = load i8, ptr %arrayidx18.us, align 1, !tbaa !5 %cmp20.us = icmp eq i8 %14, %15 %inc.us = zext i1 %cmp20.us to i32 %spec.select43.us = add nuw nsw i32 %cnt.045.us, %inc.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call5 br i1 %exitcond.not, label %for.cond7.for.cond.cleanup13_crit_edge.us, label %for.body14.us, !llvm.loop !12 for.cond7.for.cond.cleanup13_crit_edge.us: ; preds = %for.body14.us, %middle.block %spec.select43.us.lcssa = phi i32 [ %12, %middle.block ], [ %spec.select43.us, %for.body14.us ] %spec.select.us = call i32 @llvm.smax.i32(i32 %max.049.us, i32 %spec.select43.us.lcssa) %indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1 %exitcond60.not = icmp eq i64 %indvars.iv.next58, %umax br i1 %exitcond60.not, label %for.cond.cleanup, label %for.cond7.preheader.us, !llvm.loop !13 for.cond.cleanup: ; preds = %for.cond7.for.cond.cleanup13_crit_edge.us, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select.us, %for.cond7.for.cond.cleanup13_crit_edge.us ] %conv32 = trunc i64 %call5 to i32 %sub33 = sub nsw i32 %conv32, %max.0.lcssa %call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub33) call void @llvm.lifetime.end.p0(i64 1001, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 1001, 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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} !13 = distinct !{!13, !9}
#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define true 1 #define false 0 #define MAX 1000000 typedef long long ll; typedef unsigned char Uchar; int main(void){ char a[1005],b[1005]; scanf("%s %s",a,b); int i,j; int n1=0,n2=0; int ans = MAX; for(i=0;i<strlen(a)-strlen(b)+1;i++){ //printf("%d",i); for(j=0;j<strlen(b);j++){ if(a[i+j] == b[j]){ n1++; }else{ n2++; } } if(ans > n2){ ans = n2; } n1 = 0; n2 = 0; } if(ans == MAX){ printf("%d",(int)strlen(b)); }else printf("%d",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123274/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123274/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1 @.str.1 = private unnamed_addr constant [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 [1005 x i8], align 16 %b = alloca [1005 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1005, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 1005, ptr nonnull %b) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %a) #6 %call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %b) #6 %sub = add i64 %call3, 1 %cmp53.not = icmp eq i64 %sub, %call5 br i1 %cmp53.not, label %if.then32, label %for.cond7.preheader.lr.ph for.cond7.preheader.lr.ph: ; preds = %entry %add = sub i64 %sub, %call5 %cmp1149.not = icmp eq i64 %call5, 0 %umax69 = call i64 @llvm.umax.i64(i64 %add, i64 1) br i1 %cmp1149.not, label %if.end39, label %for.cond7.preheader.us.preheader for.cond7.preheader.us.preheader: ; preds = %for.cond7.preheader.lr.ph %min.iters.check = icmp ult i64 %call5, 8 %n.vec = and i64 %call5, -8 %cmp.n = icmp eq i64 %call5, %n.vec br label %for.cond7.preheader.us for.cond7.preheader.us: ; preds = %for.cond7.preheader.us.preheader, %for.cond7.for.end_crit_edge.us %indvars.iv62 = phi i64 [ %indvars.iv.next63, %for.cond7.for.end_crit_edge.us ], [ 0, %for.cond7.preheader.us.preheader ] %ans.055.us = phi i32 [ %spec.select.us, %for.cond7.for.end_crit_edge.us ], [ 1000000, %for.cond7.preheader.us.preheader ] br i1 %min.iters.check, label %for.body13.us.preheader, label %vector.body vector.body: ; preds = %for.cond7.preheader.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond7.preheader.us ] %vec.phi = phi <4 x i32> [ %9, %vector.body ], [ zeroinitializer, %for.cond7.preheader.us ] %vec.phi77 = phi <4 x i32> [ %10, %vector.body ], [ zeroinitializer, %for.cond7.preheader.us ] %0 = add nuw nsw i64 %index, %indvars.iv62 %1 = getelementptr inbounds [1005 x i8], ptr %a, i64 0, i64 %0 %wide.load = load <4 x i8>, ptr %1, align 1, !tbaa !5 %2 = getelementptr inbounds i8, ptr %1, i64 4 %wide.load78 = load <4 x i8>, ptr %2, align 1, !tbaa !5 %3 = getelementptr inbounds [1005 x i8], ptr %b, i64 0, i64 %index %wide.load79 = load <4 x i8>, ptr %3, align 8, !tbaa !5 %4 = getelementptr inbounds i8, ptr %3, i64 4 %wide.load80 = load <4 x i8>, ptr %4, align 4, !tbaa !5 %5 = icmp ne <4 x i8> %wide.load, %wide.load79 %6 = icmp ne <4 x i8> %wide.load78, %wide.load80 %7 = zext <4 x i1> %5 to <4 x i32> %8 = zext <4 x i1> %6 to <4 x i32> %9 = add <4 x i32> %vec.phi, %7 %10 = add <4 x i32> %vec.phi77, %8 %index.next = add nuw i64 %index, 8 %11 = icmp eq i64 %index.next, %n.vec br i1 %11, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %10, %9 %12 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond7.for.end_crit_edge.us, label %for.body13.us.preheader for.body13.us.preheader: ; preds = %for.cond7.preheader.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond7.preheader.us ], [ %n.vec, %middle.block ] %n2.151.us.ph = phi i32 [ 0, %for.cond7.preheader.us ], [ %12, %middle.block ] br label %for.body13.us for.body13.us: ; preds = %for.body13.us.preheader, %for.body13.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body13.us ], [ %indvars.iv.ph, %for.body13.us.preheader ] %n2.151.us = phi i32 [ %n2.2.us, %for.body13.us ], [ %n2.151.us.ph, %for.body13.us.preheader ] %13 = add nuw nsw i64 %indvars.iv, %indvars.iv62 %arrayidx.us = getelementptr inbounds [1005 x i8], ptr %a, i64 0, i64 %13 %14 = load i8, ptr %arrayidx.us, align 1, !tbaa !5 %arrayidx17.us = getelementptr inbounds [1005 x i8], ptr %b, i64 0, i64 %indvars.iv %15 = load i8, ptr %arrayidx17.us, align 1, !tbaa !5 %cmp19.us = icmp ne i8 %14, %15 %inc21.us = zext i1 %cmp19.us to i32 %n2.2.us = add nuw nsw i32 %n2.151.us, %inc21.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %call5 br i1 %exitcond.not, label %for.cond7.for.end_crit_edge.us, label %for.body13.us, !llvm.loop !12 for.cond7.for.end_crit_edge.us: ; preds = %for.body13.us, %middle.block %n2.2.us.lcssa = phi i32 [ %12, %middle.block ], [ %n2.2.us, %for.body13.us ] %spec.select.us = call i32 @llvm.smin.i32(i32 %ans.055.us, i32 %n2.2.us.lcssa) %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1 %exitcond65.not = icmp eq i64 %indvars.iv.next63, %umax69 br i1 %exitcond65.not, label %for.end29, label %for.cond7.preheader.us, !llvm.loop !13 for.end29: ; preds = %for.cond7.for.end_crit_edge.us %cmp30 = icmp eq i32 %spec.select.us, 1000000 br i1 %cmp30, label %if.then32, label %if.end39 if.then32: ; preds = %entry, %for.end29 %conv35 = trunc i64 %call5 to i32 br label %if.end39 if.end39: ; preds = %for.cond7.preheader.lr.ph, %for.end29, %if.then32 %ans.0.lcssa76.sink = phi i32 [ %conv35, %if.then32 ], [ %spec.select.us, %for.end29 ], [ 0, %for.cond7.preheader.lr.ph ] %call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa76.sink) call void @llvm.lifetime.end.p0(i64 1005, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 1005, 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 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: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.umax.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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} !13 = distinct !{!13, !9}
#include<stdio.h> #include<string.h> int main() { int s_length, t_length, consist_char_num = 0, answer = 0; char s[1000]; char t[1000]; scanf("%s", s); scanf("%s", t); s_length = strlen(s); t_length = strlen(t); for (int i = 0; i<(s_length - t_length + 1); i++) { int current_consist_char_num = 0; for (int j = 0; j<t_length; j++) { if (s[i+j] == t[j]) { current_consist_char_num ++; } } if (current_consist_char_num > consist_char_num) { consist_char_num = current_consist_char_num; } } answer = t_length - consist_char_num; printf("%d", answer); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123324/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123324/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [1000 x i8], align 16 %t = alloca [1000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 1000, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 1000, 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 %call6 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #6 %conv7 = trunc i64 %call6 to i32 %cmp.not45 = icmp sge i32 %conv, %conv7 %cmp1042 = icmp sgt i32 %conv7, 0 %or.cond = and i1 %cmp.not45, %cmp1042 br i1 %or.cond, label %for.cond9.preheader.us.preheader, label %for.cond.cleanup for.cond9.preheader.us.preheader: ; preds = %entry %0 = add i64 %call4, 1 %1 = sub i64 %0, %call6 %wide.trip.count55 = and i64 %1, 4294967295 %wide.trip.count = and i64 %call6, 4294967295 %min.iters.check = icmp ult i64 %wide.trip.count, 8 %n.mod.vf = and i64 %call6, 7 %n.vec = sub nsw i64 %wide.trip.count, %n.mod.vf %cmp.n = icmp eq i64 %n.mod.vf, 0 br label %for.cond9.preheader.us for.cond9.preheader.us: ; preds = %for.cond9.preheader.us.preheader, %for.cond9.for.cond.cleanup12_crit_edge.us %indvars.iv52 = phi i64 [ 0, %for.cond9.preheader.us.preheader ], [ %indvars.iv.next53, %for.cond9.for.cond.cleanup12_crit_edge.us ] %consist_char_num.046.us = phi i32 [ 0, %for.cond9.preheader.us.preheader ], [ %spec.select.us, %for.cond9.for.cond.cleanup12_crit_edge.us ] br i1 %min.iters.check, label %for.body13.us.preheader, label %vector.body vector.body: ; preds = %for.cond9.preheader.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond9.preheader.us ] %vec.phi = phi <4 x i32> [ %11, %vector.body ], [ zeroinitializer, %for.cond9.preheader.us ] %vec.phi57 = phi <4 x i32> [ %12, %vector.body ], [ zeroinitializer, %for.cond9.preheader.us ] %2 = add nuw nsw i64 %index, %indvars.iv52 %3 = getelementptr inbounds [1000 x i8], ptr %s, i64 0, i64 %2 %wide.load = load <4 x i8>, ptr %3, align 1, !tbaa !5 %4 = getelementptr inbounds i8, ptr %3, i64 4 %wide.load58 = load <4 x i8>, ptr %4, align 1, !tbaa !5 %5 = getelementptr inbounds [1000 x i8], ptr %t, i64 0, i64 %index %wide.load59 = load <4 x i8>, ptr %5, align 8, !tbaa !5 %6 = getelementptr inbounds i8, ptr %5, i64 4 %wide.load60 = load <4 x i8>, ptr %6, align 4, !tbaa !5 %7 = icmp eq <4 x i8> %wide.load, %wide.load59 %8 = icmp eq <4 x i8> %wide.load58, %wide.load60 %9 = zext <4 x i1> %7 to <4 x i32> %10 = zext <4 x i1> %8 to <4 x i32> %11 = add <4 x i32> %vec.phi, %9 %12 = add <4 x i32> %vec.phi57, %10 %index.next = add nuw i64 %index, 8 %13 = icmp eq i64 %index.next, %n.vec br i1 %13, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %12, %11 %14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond9.for.cond.cleanup12_crit_edge.us, label %for.body13.us.preheader for.body13.us.preheader: ; preds = %for.cond9.preheader.us, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.cond9.preheader.us ], [ %n.vec, %middle.block ] %current_consist_char_num.043.us.ph = phi i32 [ 0, %for.cond9.preheader.us ], [ %14, %middle.block ] br label %for.body13.us for.body13.us: ; preds = %for.body13.us.preheader, %for.body13.us %indvars.iv = phi i64 [ %indvars.iv.next, %for.body13.us ], [ %indvars.iv.ph, %for.body13.us.preheader ] %current_consist_char_num.043.us = phi i32 [ %spec.select41.us, %for.body13.us ], [ %current_consist_char_num.043.us.ph, %for.body13.us.preheader ] %15 = add nuw nsw i64 %indvars.iv, %indvars.iv52 %arrayidx.us = getelementptr inbounds [1000 x i8], ptr %s, i64 0, i64 %15 %16 = load i8, ptr %arrayidx.us, align 1, !tbaa !5 %arrayidx17.us = getelementptr inbounds [1000 x i8], ptr %t, i64 0, i64 %indvars.iv %17 = load i8, ptr %arrayidx17.us, align 1, !tbaa !5 %cmp19.us = icmp eq i8 %16, %17 %inc.us = zext i1 %cmp19.us to i32 %spec.select41.us = add nuw nsw i32 %current_consist_char_num.043.us, %inc.us %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.cond9.for.cond.cleanup12_crit_edge.us, label %for.body13.us, !llvm.loop !12 for.cond9.for.cond.cleanup12_crit_edge.us: ; preds = %for.body13.us, %middle.block %spec.select41.us.lcssa = phi i32 [ %14, %middle.block ], [ %spec.select41.us, %for.body13.us ] %spec.select.us = call i32 @llvm.smax.i32(i32 %spec.select41.us.lcssa, i32 %consist_char_num.046.us) %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1 %exitcond56.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count55 br i1 %exitcond56.not, label %for.cond.cleanup, label %for.cond9.preheader.us, !llvm.loop !13 for.cond.cleanup: ; preds = %for.cond9.for.cond.cleanup12_crit_edge.us, %entry %consist_char_num.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select.us, %for.cond9.for.cond.cleanup12_crit_edge.us ] %sub29 = sub nsw i32 %conv7, %consist_char_num.0.lcssa %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub29) call void @llvm.lifetime.end.p0(i64 1000, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 1000, 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress 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} !13 = distinct !{!13, !9}
#include <stdio.h> #include <string.h> int main(void) { char str[100]; scanf("%s", str); for(int i = 0; i < strlen(str); i++){ printf("%c", 'x'); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123382/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123382/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %char0 = load i8, ptr %str, align 16 %cmp7.not = icmp eq i8 %char0, 0 br i1 %cmp7.not, label %for.cond.cleanup, label %for.body for.cond.cleanup: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %str) #5 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %putchar = call i32 @putchar(i32 120) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !5 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<string.h> int main(void){ int i; char str[100]; scanf("%s",str); for(i=0;i<strlen(str);i++){ printf("x"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123425/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123425/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [100 x i8], align 16 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %str) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %str) %char0 = load i8, ptr %str, align 16 %cmp7.not = icmp eq i8 %char0, 0 br i1 %cmp7.not, label %for.end, label %for.body for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %putchar = call i32 @putchar(i32 120) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %call2 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %str) #6 %cmp = icmp ugt i64 %call2, %indvars.iv.next br i1 %cmp, label %for.body, label %for.end, !llvm.loop !5 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 100, 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) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { char s[100]; int i = 0; scanf("%s", s); while (s[i] != '\0') { printf("x"); i++; } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_123469/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_123469/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [100 x i8], align 16 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 %s) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not6 = icmp eq i8 %0, 0 br i1 %cmp.not6, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %putchar5 = call i32 @putchar(i32 120) %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 = icmp eq i8 %1, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !8 while.end: ; preds = %while.body, %entry %putchar = call i32 @putchar(i32 10) 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 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"}