Source_Code
stringlengths
69
484k
IR_Original
stringlengths
2.05k
17.9M
#include<stdio.h> int main() { int f[2000]={},k,n; int i,j,x,max=0; long time=0; scanf("%d%d",&n,&k); for(i=0;i<n;i++) { scanf("%d",&x); f[x-2]++; if(x>max) max=x; } max-=2; int bal=0; for(i=max;i>=0;i--) { if(!f[i]) continue; if(f[i]>bal) { f[i]-=bal; bal=0; } else { bal-=f[i]; f[i]=0; continue; } x=f[i]; j=(x/k)+1; bal=f[i]%k; if(bal==0) j--; else bal=(k-bal); time+=(j*2*(i+1)); // printf("\nAfter iteration for floor %d, time = %ld\n",(i+2),time); } printf("%ld\n",time); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15332/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15332/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [5 x i8] c"%ld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %f = alloca [2000 x i32], align 16 %k = alloca i32, align 4 %n = alloca i32, align 4 %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %f) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) %f, i8 0, i64 8000, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp61 = icmp sgt i32 %0, 0 br i1 %cmp61, label %for.body, label %for.end39 for.body: ; preds = %entry, %for.body %max.063 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %i.062 = phi i32 [ %inc3, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x) %1 = load i32, ptr %x, align 4, !tbaa !5 %sub = add nsw i32 %1, -2 %idxprom = sext i32 %sub to i64 %arrayidx = getelementptr inbounds [2000 x i32], ptr %f, 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 %spec.select = call i32 @llvm.smax.i32(i32 %1, i32 %max.063) %inc3 = add nuw nsw i32 %i.062, 1 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc3, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp664 = icmp sgt i32 %spec.select, 1 br i1 %cmp664, label %for.body7.lr.ph, label %for.end39 for.body7.lr.ph: ; preds = %for.end %sub4 = add nsw i32 %spec.select, -2 %4 = load i32, ptr %k, align 4 %5 = zext i32 %sub4 to i64 br label %for.body7 for.body7: ; preds = %for.body7.lr.ph, %for.inc37 %indvars.iv = phi i64 [ %5, %for.body7.lr.ph ], [ %indvars.iv.next, %for.inc37 ] %bal.067 = phi i32 [ 0, %for.body7.lr.ph ], [ %bal.2, %for.inc37 ] %time.066 = phi i64 [ 0, %for.body7.lr.ph ], [ %time.1, %for.inc37 ] %arrayidx9 = getelementptr inbounds [2000 x i32], ptr %f, i64 0, i64 %indvars.iv %6 = load i32, ptr %arrayidx9, align 4, !tbaa !5 %tobool.not = icmp eq i32 %6, 0 br i1 %tobool.not, label %for.inc37, label %if.end11 if.end11: ; preds = %for.body7 %cmp14 = icmp sgt i32 %6, %bal.067 br i1 %cmp14, label %if.then15, label %if.else if.then15: ; preds = %if.end11 %sub18 = sub nsw i32 %6, %bal.067 store i32 %sub18, ptr %arrayidx9, align 4, !tbaa !5 store i32 %sub18, ptr %x, align 4, !tbaa !5 %div = sdiv i32 %sub18, %4 %rem = srem i32 %sub18, %4 %cmp29 = icmp ne i32 %rem, 0 %sub32 = sub nsw i32 %4, %rem %add = zext i1 %cmp29 to i32 %j.0 = add nsw i32 %div, %add %bal.1 = select i1 %cmp29, i32 %sub32, i32 0 %7 = trunc i64 %indvars.iv to i32 %add34 = shl i32 %7, 1 %mul = add i32 %add34, 2 %mul35 = mul i32 %mul, %j.0 %conv = sext i32 %mul35 to i64 %add36 = add nsw i64 %time.066, %conv br label %for.inc37 if.else: ; preds = %if.end11 %sub21 = sub nsw i32 %bal.067, %6 store i32 0, ptr %arrayidx9, align 4, !tbaa !5 br label %for.inc37 for.inc37: ; preds = %for.body7, %if.then15, %if.else %time.1 = phi i64 [ %add36, %if.then15 ], [ %time.066, %if.else ], [ %time.066, %for.body7 ] %bal.2 = phi i32 [ %bal.1, %if.then15 ], [ %sub21, %if.else ], [ %bal.067, %for.body7 ] %indvars.iv.next = add nsw i64 %indvars.iv, -1 %cmp6 = icmp sgt i64 %indvars.iv, 0 br i1 %cmp6, label %for.body7, label %for.end39, !llvm.loop !11 for.end39: ; preds = %for.inc37, %entry, %for.end %time.0.lcssa = phi i64 [ 0, %for.end ], [ 0, %entry ], [ %time.1, %for.inc37 ] %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %time.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5 call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %f) #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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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}
// // main.c // 28 // // Created by x14005xx on 2016/05/27. // Copyright (c) 2016??´ Isikawa yuuki. All rights reserved. // #include <stdio.h> int main(int argc, const char * argv[]) { int num=0,n[1001],i,j=0,x=0; for(i=0;i<1001;i++){ n[i]=0; } scanf("%d",&num); for(i=0;i<num;i++){ scanf("%d",&n[i]); } //quick for(i=0;i<num;i++){ for(j=i+1;j<num;j++){ if(n[i] > n[j]){ x = n[i]; n[i] = n[j]; n[j] = x; } } } for(i=0;i<num-1;i++){ printf("%d ",n[i]); } printf("%d\n",n[num-1]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153363/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153363/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %num = alloca i32, align 4 %n = alloca [1001 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4 store i32 0, ptr %num, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %n) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4004) %n, i8 0, i64 4004, i1 false), !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num) %0 = load i32, ptr %num, align 4, !tbaa !5 %cmp268 = icmp sgt i32 %0, 0 br i1 %cmp268, label %for.body3, label %for.cond35.preheader.for.end43_crit_edge for.cond10.preheader: ; preds = %for.body3 %cmp1172 = icmp sgt i32 %2, 0 br i1 %cmp1172, label %for.body12.preheader, label %for.cond35.preheader.for.end43_crit_edge for.body12.preheader: ; preds = %for.cond10.preheader %1 = zext i32 %2 to i64 %wide.trip.count90 = zext i32 %2 to i64 br label %for.body12 for.body3: ; preds = %entry, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %entry ] %arrayidx5 = getelementptr inbounds [1001 x i32], ptr %n, 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 %2 = load i32, ptr %num, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp2, label %for.body3, label %for.cond10.preheader, !llvm.loop !9 for.cond10.loopexit: ; preds = %for.inc29, %for.body12 %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1 %exitcond91.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count90 br i1 %exitcond91.not, label %for.cond35.preheader, label %for.body12, !llvm.loop !11 for.cond35.preheader: ; preds = %for.cond10.loopexit %cmp3675 = icmp sgt i32 %2, 1 br i1 %cmp3675, label %for.body37, label %for.cond35.preheader.for.end43_crit_edge for.cond35.preheader.for.end43_crit_edge: ; preds = %entry, %for.cond10.preheader, %for.cond35.preheader %4 = phi i32 [ %2, %for.cond35.preheader ], [ %2, %for.cond10.preheader ], [ %0, %entry ] %sub74 = add nsw i32 %4, -1 %.pre = sext i32 %sub74 to i64 br label %for.end43 for.body12: ; preds = %for.body12.preheader, %for.cond10.loopexit %indvars.iv87 = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next88, %for.cond10.loopexit ] %indvars.iv82 = phi i64 [ 1, %for.body12.preheader ], [ %indvars.iv.next83, %for.cond10.loopexit ] %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1 %cmp1470 = icmp ult i64 %indvars.iv.next88, %1 br i1 %cmp1470, label %for.body15.lr.ph, label %for.cond10.loopexit for.body15.lr.ph: ; preds = %for.body12 %arrayidx17 = getelementptr inbounds [1001 x i32], ptr %n, i64 0, i64 %indvars.iv87 br label %for.body15 for.body15: ; preds = %for.body15.lr.ph, %for.inc29 %indvars.iv84 = phi i64 [ %indvars.iv82, %for.body15.lr.ph ], [ %indvars.iv.next85, %for.inc29 ] %5 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %arrayidx19 = getelementptr inbounds [1001 x i32], ptr %n, i64 0, i64 %indvars.iv84 %6 = load i32, ptr %arrayidx19, align 4, !tbaa !5 %cmp20 = icmp sgt i32 %5, %6 br i1 %cmp20, label %if.then, label %for.inc29 if.then: ; preds = %for.body15 store i32 %6, ptr %arrayidx17, align 4, !tbaa !5 store i32 %5, ptr %arrayidx19, align 4, !tbaa !5 br label %for.inc29 for.inc29: ; preds = %for.body15, %if.then %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1 %exitcond.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count90 br i1 %exitcond.not, label %for.cond10.loopexit, label %for.body15, !llvm.loop !12 for.body37: ; preds = %for.cond35.preheader, %for.body37 %indvars.iv92 = phi i64 [ %indvars.iv.next93, %for.body37 ], [ 0, %for.cond35.preheader ] %arrayidx39 = getelementptr inbounds [1001 x i32], ptr %n, i64 0, i64 %indvars.iv92 %7 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7) %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1 %8 = load i32, ptr %num, align 4, !tbaa !5 %sub = add nsw i32 %8, -1 %9 = sext i32 %sub to i64 %cmp36 = icmp slt i64 %indvars.iv.next93, %9 br i1 %cmp36, label %for.body37, label %for.end43, !llvm.loop !13 for.end43: ; preds = %for.body37, %for.cond35.preheader.for.end43_crit_edge %idxprom45.pre-phi = phi i64 [ %.pre, %for.cond35.preheader.for.end43_crit_edge ], [ %9, %for.body37 ] %arrayidx46 = getelementptr inbounds [1001 x i32], ptr %n, i64 0, i64 %idxprom45.pre-phi %10 = load i32, ptr %arrayidx46, align 4, !tbaa !5 %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10) call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, 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: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10}
#include <stdio.h> int mysort(int val[],int n); int minidxarray(int data[], int from, int to); int main() { int n,i,val[1000]; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&val[i]); } mysort(val,n); for(i=0;i<n-1;i++){ printf("%d ",val[i]); } printf("%d\n",val[n-1]); return 0; } int mysort(int data[], int n){ int i; for(i=0;i<n;i++){ int minidx = minidxarray(data,i,n); int work = data[i]; data[i] = data[minidx]; data[minidx]=work; } return 0; } int minidxarray(int data[],int from,int to){ int i; int result = from; for(i=from;i<to;i++){ if(data[i]<data[result]){ result = i; } } return result; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153406/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153406/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %val = alloca [1000 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %val) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp21 = icmp sgt i32 %0, 0 br i1 %cmp21, label %for.body, label %mysort.exit.for.end11_crit_edge for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [1000 x i32], ptr %val, 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 %cmp17.i = icmp sgt i32 %1, 0 br i1 %cmp17.i, label %for.body.preheader.i.lr.ph.i, label %mysort.exit.for.end11_crit_edge for.body.preheader.i.lr.ph.i: ; preds = %for.end %wide.trip.count.i.i = zext i32 %1 to i64 br label %for.body.preheader.i.i for.body.preheader.i.i: ; preds = %minidxarray.exit.i, %for.body.preheader.i.lr.ph.i %indvars.iv.i = phi i64 [ 0, %for.body.preheader.i.lr.ph.i ], [ %indvars.iv.next.i, %minidxarray.exit.i ] %3 = trunc i64 %indvars.iv.i to i32 br label %for.body.i.i for.body.i.i: ; preds = %for.body.i.i, %for.body.preheader.i.i %indvars.iv.i.i = phi i64 [ %indvars.iv.i, %for.body.preheader.i.i ], [ %indvars.iv.next.i.i, %for.body.i.i ] %result.012.i.i = phi i32 [ %3, %for.body.preheader.i.i ], [ %spec.select.i.i, %for.body.i.i ] %arrayidx.i.i = getelementptr inbounds i32, ptr %val, i64 %indvars.iv.i.i %4 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5 %idxprom1.i.i = sext i32 %result.012.i.i to i64 %arrayidx2.i.i = getelementptr inbounds i32, ptr %val, i64 %idxprom1.i.i %5 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5 %cmp3.i.i = icmp slt i32 %4, %5 %6 = trunc i64 %indvars.iv.i.i to i32 %spec.select.i.i = select i1 %cmp3.i.i, i32 %6, i32 %result.012.i.i %indvars.iv.next.i.i = add nuw nsw i64 %indvars.iv.i.i, 1 %exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %wide.trip.count.i.i br i1 %exitcond.not.i.i, label %minidxarray.exit.i, label %for.body.i.i, !llvm.loop !11 minidxarray.exit.i: ; preds = %for.body.i.i %arrayidx.i = getelementptr inbounds i32, ptr %val, i64 %indvars.iv.i %7 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %idxprom1.i = sext i32 %spec.select.i.i to i64 %arrayidx2.i = getelementptr inbounds i32, ptr %val, i64 %idxprom1.i %8 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 store i32 %8, ptr %arrayidx.i, align 4, !tbaa !5 store i32 %7, ptr %arrayidx2.i, align 4, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i.i br i1 %exitcond.not.i, label %mysort.exit, label %for.body.preheader.i.i, !llvm.loop !12 mysort.exit: ; preds = %minidxarray.exit.i %cmp424 = icmp sgt i32 %1, 1 br i1 %cmp424, label %for.body5, label %mysort.exit.for.end11_crit_edge mysort.exit.for.end11_crit_edge: ; preds = %entry, %for.end, %mysort.exit %9 = phi i32 [ %1, %mysort.exit ], [ %1, %for.end ], [ %0, %entry ] %sub23 = add nsw i32 %9, -1 %.pre = sext i32 %sub23 to i64 br label %for.end11 for.body5: ; preds = %mysort.exit, %for.body5 %indvars.iv30 = phi i64 [ %indvars.iv.next31, %for.body5 ], [ 0, %mysort.exit ] %arrayidx7 = getelementptr inbounds [1000 x i32], ptr %val, i64 0, i64 %indvars.iv30 %10 = load i32, ptr %arrayidx7, align 4, !tbaa !5 %call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10) %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1 %11 = load i32, ptr %n, align 4, !tbaa !5 %sub = add nsw i32 %11, -1 %12 = sext i32 %sub to i64 %cmp4 = icmp slt i64 %indvars.iv.next31, %12 br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !13 for.end11: ; preds = %for.body5, %mysort.exit.for.end11_crit_edge %idxprom13.pre-phi = phi i64 [ %.pre, %mysort.exit.for.end11_crit_edge ], [ %12, %for.body5 ] %arrayidx14 = getelementptr inbounds [1000 x i32], ptr %val, i64 0, i64 %idxprom13.pre-phi %13 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13) call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %val) #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 norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @mysort(ptr nocapture noundef %data, i32 noundef %n) local_unnamed_addr #3 { entry: %cmp17 = icmp sgt i32 %n, 0 br i1 %cmp17, label %for.body.preheader.i.lr.ph, label %for.end for.body.preheader.i.lr.ph: ; preds = %entry %wide.trip.count.i = zext i32 %n to i64 %wide.trip.count = zext i32 %n to i64 br label %for.body.preheader.i for.body.preheader.i: ; preds = %for.body.preheader.i.lr.ph, %minidxarray.exit %indvars.iv = phi i64 [ 0, %for.body.preheader.i.lr.ph ], [ %indvars.iv.next, %minidxarray.exit ] %0 = trunc i64 %indvars.iv to i32 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i %indvars.iv.i = phi i64 [ %indvars.iv, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ] %result.012.i = phi i32 [ %0, %for.body.preheader.i ], [ %spec.select.i, %for.body.i ] %arrayidx.i = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.i %1 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %idxprom1.i = sext i32 %result.012.i to i64 %arrayidx2.i = getelementptr inbounds i32, ptr %data, i64 %idxprom1.i %2 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5 %cmp3.i = icmp slt i32 %1, %2 %3 = trunc i64 %indvars.iv.i to i32 %spec.select.i = select i1 %cmp3.i, i32 %3, i32 %result.012.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 %minidxarray.exit, label %for.body.i, !llvm.loop !11 minidxarray.exit: ; preds = %for.body.i %arrayidx = getelementptr inbounds i32, ptr %data, i64 %indvars.iv %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom1 = sext i32 %spec.select.i to i64 %arrayidx2 = getelementptr inbounds i32, ptr %data, i64 %idxprom1 %5 = load i32, ptr %arrayidx2, align 4, !tbaa !5 store i32 %5, ptr %arrayidx, align 4, !tbaa !5 store i32 %4, ptr %arrayidx2, align 4, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.end, label %for.body.preheader.i, !llvm.loop !12 for.end: ; preds = %minidxarray.exit, %entry ret i32 0 } ; 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 norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @minidxarray(ptr nocapture noundef readonly %data, i32 noundef %from, i32 noundef %to) local_unnamed_addr #4 { entry: %cmp10 = icmp slt i32 %from, %to br i1 %cmp10, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %0 = sext i32 %from to i64 %wide.trip.count = sext i32 %to to i64 %1 = sub nsw i64 %wide.trip.count, %0 %2 = xor i64 %0, -1 %3 = add nsw i64 %2, %wide.trip.count %xtraiter = and i64 %1, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader, %for.body.prol %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %for.body.prol ], [ %0, %for.body.preheader ] %result.012.prol = phi i32 [ %spec.select.prol, %for.body.prol ], [ %from, %for.body.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body.prol ], [ 0, %for.body.preheader ] %arrayidx.prol = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.prol %4 = load i32, ptr %arrayidx.prol, align 4, !tbaa !5 %idxprom1.prol = sext i32 %result.012.prol to i64 %arrayidx2.prol = getelementptr inbounds i32, ptr %data, i64 %idxprom1.prol %5 = load i32, ptr %arrayidx2.prol, align 4, !tbaa !5 %cmp3.prol = icmp slt i32 %4, %5 %6 = trunc i64 %indvars.iv.prol to i32 %spec.select.prol = select i1 %cmp3.prol, i32 %6, i32 %result.012.prol %indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, 1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !14 for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader %spec.select.lcssa.unr = phi i32 [ undef, %for.body.preheader ], [ %spec.select.prol, %for.body.prol ] %indvars.iv.unr = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next.prol, %for.body.prol ] %result.012.unr = phi i32 [ %from, %for.body.preheader ], [ %spec.select.prol, %for.body.prol ] %7 = icmp ult i64 %3, 3 br i1 %7, label %for.end, label %for.body 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 ] %result.012 = phi i32 [ %spec.select.3, %for.body ], [ %result.012.unr, %for.body.prol.loopexit ] %arrayidx = getelementptr inbounds i32, ptr %data, i64 %indvars.iv %8 = load i32, ptr %arrayidx, align 4, !tbaa !5 %idxprom1 = sext i32 %result.012 to i64 %arrayidx2 = getelementptr inbounds i32, ptr %data, i64 %idxprom1 %9 = load i32, ptr %arrayidx2, align 4, !tbaa !5 %cmp3 = icmp slt i32 %8, %9 %10 = trunc i64 %indvars.iv to i32 %spec.select = select i1 %cmp3, i32 %10, i32 %result.012 %indvars.iv.next = add nsw i64 %indvars.iv, 1 %arrayidx.1 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.next %11 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %idxprom1.1 = sext i32 %spec.select to i64 %arrayidx2.1 = getelementptr inbounds i32, ptr %data, i64 %idxprom1.1 %12 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5 %cmp3.1 = icmp slt i32 %11, %12 %13 = trunc i64 %indvars.iv.next to i32 %spec.select.1 = select i1 %cmp3.1, i32 %13, i32 %spec.select %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2 %arrayidx.2 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.next.1 %14 = load i32, ptr %arrayidx.2, align 4, !tbaa !5 %idxprom1.2 = sext i32 %spec.select.1 to i64 %arrayidx2.2 = getelementptr inbounds i32, ptr %data, i64 %idxprom1.2 %15 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5 %cmp3.2 = icmp slt i32 %14, %15 %16 = trunc i64 %indvars.iv.next.1 to i32 %spec.select.2 = select i1 %cmp3.2, i32 %16, i32 %spec.select.1 %indvars.iv.next.2 = add nsw i64 %indvars.iv, 3 %arrayidx.3 = getelementptr inbounds i32, ptr %data, i64 %indvars.iv.next.2 %17 = load i32, ptr %arrayidx.3, align 4, !tbaa !5 %idxprom1.3 = sext i32 %spec.select.2 to i64 %arrayidx2.3 = getelementptr inbounds i32, ptr %data, i64 %idxprom1.3 %18 = load i32, ptr %arrayidx2.3, align 4, !tbaa !5 %cmp3.3 = icmp slt i32 %17, %18 %19 = trunc i64 %indvars.iv.next.2 to i32 %spec.select.3 = select i1 %cmp3.3, i32 %19, i32 %spec.select.2 %indvars.iv.next.3 = add nsw i64 %indvars.iv, 4 %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count br i1 %exitcond.not.3, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body.prol.loopexit, %for.body, %entry %result.0.lcssa = phi i32 [ %from, %entry ], [ %spec.select.lcssa.unr, %for.body.prol.loopexit ], [ %spec.select.3, %for.body ] ret i32 %result.0.lcssa } attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> int main() { int n,t,m,i,j; scanf("%d",&n); if(n%2==1) printf("%d %d\n",9,n-9); else printf("%d %d\n",4,n-4); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15345/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15345/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = and i32 %0, -2147483647 %cmp = icmp eq i32 %1, 1 %. = select i1 %cmp, i32 -9, i32 -4 %.5 = select i1 %cmp, i32 9, i32 4 %sub2 = add nsw i32 %0, %. %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.5, i32 noundef %sub2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { int n; scanf("%d",&n); int a[n],i,j,temp; for (i=0;i<n;i++) scanf("%d",&a[i]); for(i=0;i<n-1;i++){ for(j=0;j<n-1-i;j++){ if(a[j]>a[j+1]){ temp=a[j]; a[j]=a[j+1]; a[j+1]=temp; } } } for(i=0;i<n;i++){ if(i)printf(" "); printf("%d",a[i]); } printf("\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153493/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153493/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca i32, i64 %1, align 16 %3 = load i32, ptr %n, align 4, !tbaa !5 %cmp62 = icmp sgt i32 %3, 0 br i1 %cmp62, label %for.body, label %for.end42 for.cond2.preheader: ; preds = %for.body %sub = add i32 %4, -1 %cmp366 = icmp sgt i32 %4, 1 br i1 %cmp366, label %for.cond5.preheader.preheader, label %for.cond31.preheader for.cond5.preheader.preheader: ; preds = %for.cond2.preheader %invariant.gep = getelementptr i32, ptr %vla, i64 1 br label %for.cond5.preheader for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %5 = sext i32 %4 to i64 %cmp = icmp slt i64 %indvars.iv.next, %5 br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %for.cond5.preheader.preheader, %for.inc28 %indvars.iv75 = phi i32 [ %indvars.iv.next76, %for.inc28 ], [ %sub, %for.cond5.preheader.preheader ] %i.167 = phi i32 [ %inc29, %for.inc28 ], [ 0, %for.cond5.preheader.preheader ] %6 = zext i32 %indvars.iv75 to i64 %7 = xor i32 %i.167, -1 %sub7 = add i32 %4, %7 %cmp864 = icmp sgt i32 %sub7, 0 br i1 %cmp864, label %for.body9.preheader, label %for.inc28 for.body9.preheader: ; preds = %for.cond5.preheader %.pre = load i32, ptr %vla, align 16, !tbaa !5 %xtraiter = and i64 %6, 1 %8 = icmp eq i32 %indvars.iv75, 1 br i1 %8, label %for.inc28.loopexit.unr-lcssa, label %for.body9.preheader.new for.body9.preheader.new: ; preds = %for.body9.preheader %unroll_iter = and i64 %6, 4294967294 br label %for.body9 for.cond31.preheader: ; preds = %for.inc28, %for.cond2.preheader %cmp3268 = icmp sgt i32 %4, 0 br i1 %cmp3268, label %if.end36.peel, label %for.end42 if.end36.peel: ; preds = %for.cond31.preheader %.pre82 = load i32, ptr %vla, align 16, !tbaa !5 %call39.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre82) %9 = load i32, ptr %n, align 4, !tbaa !5 %cmp32.peel = icmp sgt i32 %9, 1 br i1 %cmp32.peel, label %if.end36, label %for.end42 for.body9: ; preds = %for.inc25.1, %for.body9.preheader.new %10 = phi i32 [ %.pre, %for.body9.preheader.new ], [ %14, %for.inc25.1 ] %indvars.iv72 = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next73.1, %for.inc25.1 ] %niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.1, %for.inc25.1 ] %indvars.iv.next73 = or i64 %indvars.iv72, 1 %arrayidx13 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next73 %11 = load i32, ptr %arrayidx13, align 4, !tbaa !5 %cmp14 = icmp sgt i32 %10, %11 br i1 %cmp14, label %if.then, label %for.inc25 if.then: ; preds = %for.body9 %arrayidx11 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv72 store i32 %11, ptr %arrayidx11, align 8, !tbaa !5 store i32 %10, ptr %arrayidx13, align 4, !tbaa !5 br label %for.inc25 for.inc25: ; preds = %for.body9, %if.then %12 = phi i32 [ %11, %for.body9 ], [ %10, %if.then ] %indvars.iv.next73.1 = add nuw nsw i64 %indvars.iv72, 2 %arrayidx13.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next73.1 %13 = load i32, ptr %arrayidx13.1, align 8, !tbaa !5 %cmp14.1 = icmp sgt i32 %12, %13 br i1 %cmp14.1, label %if.then.1, label %for.inc25.1 if.then.1: ; preds = %for.inc25 %arrayidx11.1 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.next73 store i32 %13, ptr %arrayidx11.1, align 4, !tbaa !5 store i32 %12, ptr %arrayidx13.1, align 8, !tbaa !5 br label %for.inc25.1 for.inc25.1: ; preds = %if.then.1, %for.inc25 %14 = phi i32 [ %13, %for.inc25 ], [ %12, %if.then.1 ] %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.inc28.loopexit.unr-lcssa, label %for.body9, !llvm.loop !11 for.inc28.loopexit.unr-lcssa: ; preds = %for.inc25.1, %for.body9.preheader %.unr = phi i32 [ %.pre, %for.body9.preheader ], [ %14, %for.inc25.1 ] %indvars.iv72.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next73.1, %for.inc25.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.inc28, label %for.body9.epil for.body9.epil: ; preds = %for.inc28.loopexit.unr-lcssa %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv72.unr %15 = load i32, ptr %gep, align 4, !tbaa !5 %cmp14.epil = icmp sgt i32 %.unr, %15 br i1 %cmp14.epil, label %if.then.epil, label %for.inc28 if.then.epil: ; preds = %for.body9.epil %arrayidx11.epil = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv72.unr store i32 %15, ptr %arrayidx11.epil, align 4, !tbaa !5 store i32 %.unr, ptr %gep, align 4, !tbaa !5 br label %for.inc28 for.inc28: ; preds = %for.inc28.loopexit.unr-lcssa, %if.then.epil, %for.body9.epil, %for.cond5.preheader %inc29 = add nuw nsw i32 %i.167, 1 %indvars.iv.next76 = add i32 %indvars.iv75, -1 %exitcond77.not = icmp eq i32 %inc29, %sub br i1 %exitcond77.not, label %for.cond31.preheader, label %for.cond5.preheader, !llvm.loop !12 if.end36: ; preds = %if.end36.peel, %if.end36 %indvars.iv78 = phi i64 [ %indvars.iv.next79, %if.end36 ], [ 1, %if.end36.peel ] %putchar61 = call i32 @putchar(i32 32) %arrayidx38 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv78 %16 = load i32, ptr %arrayidx38, align 4, !tbaa !5 %call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16) %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1 %17 = load i32, ptr %n, align 4, !tbaa !5 %18 = sext i32 %17 to i64 %cmp32 = icmp slt i64 %indvars.iv.next79, %18 br i1 %cmp32, label %if.end36, label %for.end42, !llvm.loop !13 for.end42: ; preds = %if.end36, %entry, %if.end36.peel, %for.cond31.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) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14} !14 = !{!"llvm.loop.peeled.count", i32 1}
#include <stdio.h> int main(void) { int F,a; scanf("%d",&F); a=(F-30)/2; printf("%d\n",a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153543/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153543/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %F = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %F) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %F) %0 = load i32, ptr %F, align 4, !tbaa !5 %sub = add nsw i32 %0, -30 %div = sdiv i32 %sub, 2 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %F) #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 f,a; scanf("%d", &f); f-=30; a=f/2; printf("%d\n", a); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153587/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153587/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %f = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %f) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %f) %0 = load i32, ptr %f, align 4, !tbaa !5 %sub = add nsw i32 %0, -30 store i32 %sub, ptr %f, align 4, !tbaa !5 %div = sdiv i32 %sub, 2 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %f) #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"}
// Aizu Vol-6 0631: Point Card // 2017.9.4 bal4u@uu #include <stdio.h> int main() { int m, n, i, a, b, min, ans; scanf("%d%d", &n, &m); for (ans = 0, min = n + n, i = 0; i < m; i++) { scanf("%d%d", &a, &b); if (a < n) { ans += n - a; if (a < min) min = a; } } if (ans > 0) ans -= n - min; printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153644/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153644/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %m = alloca i32, align 4 %n = alloca i32, align 4 %a = alloca i32, align 4 %b = 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 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 %n, ptr noundef nonnull %m) %0 = load i32, ptr %m, align 4, !tbaa !5 %cmp19 = icmp sgt i32 %0, 0 br i1 %cmp19, label %for.body.preheader, label %for.end.thread for.body.preheader: ; preds = %entry %1 = load i32, ptr %n, align 4 %add = shl nsw i32 %1, 1 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %ans.022 = phi i32 [ %ans.1, %for.body ], [ 0, %for.body.preheader ] %min.021 = phi i32 [ %min.1, %for.body ], [ %add, %for.body.preheader ] %i.020 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %2 = load i32, ptr %a, align 4, !tbaa !5 %3 = load i32, ptr %n, align 4 %cmp2 = icmp slt i32 %2, %3 %sub = sub nsw i32 %3, %2 %spec.select = call i32 @llvm.smin.i32(i32 %2, i32 %min.021) %min.1 = select i1 %cmp2, i32 %spec.select, i32 %min.021 %add3 = select i1 %cmp2, i32 %sub, i32 0 %add3.fr = freeze i32 %add3 %ans.1 = add i32 %add3.fr, %ans.022 %inc = add nuw nsw i32 %i.020, 1 %4 = load i32, ptr %m, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp7 = icmp sgt i32 %ans.1, 0 %sub9.neg = sub i32 %min.1, %3 %spec.select30 = select i1 %cmp7, i32 %sub9.neg, i32 0 %5 = add i32 %spec.select30, %ans.1 br label %for.end.thread for.end.thread: ; preds = %for.end, %entry %ans.2 = phi i32 [ 0, %entry ], [ %5, %for.end ] %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdlib.h> struct element_tag { long long v; struct element_tag *prev; struct element_tag *next; }; typedef struct element_tag element; struct list_tag { struct element_tag *first; struct element_tag *last; }; typedef struct list_tag list; void pushback(struct list_tag *l, long long x) { if (l->first == NULL) { struct element_tag *t = malloc(sizeof(element)); t->v = x; t->next = NULL; t->prev = NULL; l->first = t; l->last = t; return; } element *t = malloc(sizeof(element)); t->v = x; l->last->next = t; t->prev = l->last; t->next = NULL; l->last = t; } void pushfront(list *l, long long x) { if (l->first == NULL) { element *t = malloc(sizeof(element)); t->v = x; t->next = NULL; t->prev = NULL; l->first = t; l->last = t; return; } element *t = malloc(sizeof(element)); t->v = x; l->first->prev = t; t->next = l->first; t->prev = NULL; l->first = t; } void popback(list *l) { if (l->first == NULL) { return; } if (l->last->prev == NULL) { free(l->last); l->first = NULL; l->last = NULL; return; } l->last->prev->next = NULL; element *t = l->last; l->last = t->prev; free(t); } void popfront(list *l) { if (l->first == NULL) { return; } if (l->last->prev == NULL) { free(l->last); l->first = NULL; l->last = NULL; return; } l->first->next->prev = NULL; element *t = l->first; l->first = t->next; free(t); } void popall(list *l) { while (1) { popback(l); if (l->first == NULL) { break; } } } int main(int argc, char const *argv[]) { //list ls; list ls = {NULL,NULL}; // ls に初期値を設定しました。 int n; scanf("%d", &n); for (int i = 0; i < n; i++) { long long a; scanf("%lld", &a); if (i % 2 == 0) { pushback(&ls, a); } else { pushfront(&ls, a); } } if (n % 2 == 0) { while (1) { if (ls.first == NULL) { break; } //printf("%lld", ls.first->v); printf("%lld ", ls.first->v); // space を追加しました。 popfront(&ls); } } else { while (1) { if (ls.first == NULL) { break; } //printf("%lld", ls.last->v); printf("%lld ", ls.last->v); // space を追加しました。 popback(&ls); } } printf("\n"); // 改行出力を追加しました。 return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153688/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153688/source.c" target datalayout = "e-m:e-p270: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.element_tag = type { i64, ptr, ptr } %struct.list_tag = type { ptr, ptr } @.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: mustprogress nofree nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: readwrite) uwtable define dso_local void @pushback(ptr nocapture noundef %l, i64 noundef %x) local_unnamed_addr #0 { entry: %0 = load ptr, ptr %l, align 8, !tbaa !5 %cmp = icmp eq ptr %0, null %call = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #9 store i64 %x, ptr %call, align 8, !tbaa !10 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %prev = getelementptr inbounds %struct.element_tag, ptr %call, i64 0, i32 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %prev, i8 0, i64 16, i1 false) store ptr %call, ptr %l, align 8, !tbaa !5 %last = getelementptr inbounds %struct.list_tag, ptr %l, i64 0, i32 1 br label %return if.end: ; preds = %entry %last5 = getelementptr inbounds %struct.list_tag, ptr %l, i64 0, i32 1 %1 = load ptr, ptr %last5, align 8, !tbaa !13 %next6 = getelementptr inbounds %struct.element_tag, ptr %1, i64 0, i32 2 store ptr %call, ptr %next6, align 8, !tbaa !14 %prev8 = getelementptr inbounds %struct.element_tag, ptr %call, i64 0, i32 1 store ptr %1, ptr %prev8, align 8, !tbaa !15 %next9 = getelementptr inbounds %struct.element_tag, ptr %call, i64 0, i32 2 store ptr null, ptr %next9, align 8, !tbaa !14 br label %return return: ; preds = %if.end, %if.then %last5.sink = phi ptr [ %last5, %if.end ], [ %last, %if.then ] store ptr %call, ptr %last5.sink, align 8, !tbaa !13 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: readwrite) uwtable define dso_local void @pushfront(ptr nocapture noundef %l, i64 noundef %x) local_unnamed_addr #0 { entry: %0 = load ptr, ptr %l, align 8, !tbaa !5 %cmp = icmp eq ptr %0, null %call = tail call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #9 store i64 %x, ptr %call, align 8, !tbaa !10 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %prev = getelementptr inbounds %struct.element_tag, ptr %call, i64 0, i32 1 %last = getelementptr inbounds %struct.list_tag, ptr %l, i64 0, i32 1 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %prev, i8 0, i64 16, i1 false) store ptr %call, ptr %last, align 8, !tbaa !13 br label %return if.end: ; preds = %entry %prev6 = getelementptr inbounds %struct.element_tag, ptr %0, i64 0, i32 1 store ptr %call, ptr %prev6, align 8, !tbaa !15 %next8 = getelementptr inbounds %struct.element_tag, ptr %call, i64 0, i32 2 store ptr %0, ptr %next8, align 8, !tbaa !14 %prev9 = getelementptr inbounds %struct.element_tag, ptr %call, i64 0, i32 1 store ptr null, ptr %prev9, align 8, !tbaa !15 br label %return return: ; preds = %if.end, %if.then store ptr %call, ptr %l, align 8 ret void } ; Function Attrs: mustprogress nounwind willreturn uwtable define dso_local void @popback(ptr nocapture noundef %l) local_unnamed_addr #3 { entry: %0 = load ptr, ptr %l, align 8, !tbaa !5 %cmp = icmp eq ptr %0, null br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %last = getelementptr inbounds %struct.list_tag, ptr %l, i64 0, i32 1 %1 = load ptr, ptr %last, align 8, !tbaa !13 %prev = getelementptr inbounds %struct.element_tag, ptr %1, i64 0, i32 1 %2 = load ptr, ptr %prev, align 8, !tbaa !15 %cmp1 = icmp eq ptr %2, null br i1 %cmp1, label %if.then2, label %if.end6 if.then2: ; preds = %if.end tail call void @free(ptr noundef nonnull %1) #10 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %l, i8 0, i64 16, i1 false) br label %return if.end6: ; preds = %if.end %next = getelementptr inbounds %struct.element_tag, ptr %2, i64 0, i32 2 store ptr null, ptr %next, align 8, !tbaa !14 store ptr %2, ptr %last, align 8, !tbaa !13 tail call void @free(ptr noundef nonnull %1) #10 br label %return return: ; preds = %entry, %if.end6, %if.then2 ret void } ; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nounwind willreturn uwtable define dso_local void @popfront(ptr nocapture noundef %l) local_unnamed_addr #3 { entry: %0 = load ptr, ptr %l, align 8, !tbaa !5 %cmp = icmp eq ptr %0, null br i1 %cmp, label %return, label %if.end if.end: ; preds = %entry %last = getelementptr inbounds %struct.list_tag, ptr %l, i64 0, i32 1 %1 = load ptr, ptr %last, align 8, !tbaa !13 %prev = getelementptr inbounds %struct.element_tag, ptr %1, i64 0, i32 1 %2 = load ptr, ptr %prev, align 8, !tbaa !15 %cmp1 = icmp eq ptr %2, null br i1 %cmp1, label %if.then2, label %if.end6 if.then2: ; preds = %if.end tail call void @free(ptr noundef nonnull %1) #10 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %l, i8 0, i64 16, i1 false) br label %return if.end6: ; preds = %if.end %next = getelementptr inbounds %struct.element_tag, ptr %0, i64 0, i32 2 %3 = load ptr, ptr %next, align 8, !tbaa !14 %prev8 = getelementptr inbounds %struct.element_tag, ptr %3, i64 0, i32 1 store ptr null, ptr %prev8, align 8, !tbaa !15 store ptr %3, ptr %l, align 8, !tbaa !5 tail call void @free(ptr noundef nonnull %0) #10 br label %return return: ; preds = %entry, %if.end6, %if.then2 ret void } ; Function Attrs: nounwind uwtable define dso_local void @popall(ptr nocapture noundef %l) local_unnamed_addr #5 { entry: %.pr = load ptr, ptr %l, align 8, !tbaa !5 %0 = icmp eq ptr %.pr, null br i1 %0, label %popback.exit, label %if.end.i if.end.i: ; preds = %popback.exit, %entry %last.i = getelementptr inbounds %struct.list_tag, ptr %l, i64 0, i32 1 %1 = load ptr, ptr %last.i, align 8, !tbaa !13 %prev.i = getelementptr inbounds %struct.element_tag, ptr %1, i64 0, i32 1 %2 = load ptr, ptr %prev.i, align 8, !tbaa !15 %cmp1.i = icmp eq ptr %2, null br i1 %cmp1.i, label %if.then2.i, label %if.end6.i if.then2.i: ; preds = %if.end.i tail call void @free(ptr noundef nonnull %1) #10 tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %l, i8 0, i64 16, i1 false) br label %popback.exit if.end6.i: ; preds = %if.end.i %next.i = getelementptr inbounds %struct.element_tag, ptr %2, i64 0, i32 2 store ptr null, ptr %next.i, align 8, !tbaa !14 store ptr %2, ptr %last.i, align 8, !tbaa !13 tail call void @free(ptr noundef nonnull %1) #10 %.pr2.pre = load ptr, ptr %l, align 8, !tbaa !5 br label %popback.exit popback.exit: ; preds = %entry, %if.end6.i, %if.then2.i %3 = phi ptr [ null, %if.then2.i ], [ %.pr2.pre, %if.end6.i ], [ null, %entry ] %cmp = icmp eq ptr %3, null br i1 %cmp, label %while.end, label %if.end.i while.end: ; preds = %popback.exit ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #5 { entry: %n = alloca i32, align 4 %a = alloca i64, align 8 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 !16 %cmp58 = icmp sgt i32 %0, 0 br i1 %cmp58, label %for.body, label %if.end21 for.cond.cleanup: ; preds = %if.end %1 = and i32 %5, 1 %cmp4 = icmp eq i32 %1, 0 br i1 %cmp4, label %if.end.i33.preheader, label %if.end.i38.preheader if.end.i38.preheader: ; preds = %for.cond.cleanup %2 = load i64, ptr %ls.sroa.14.2, align 8, !tbaa !10 %call1992 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %2) %prev.i4093 = getelementptr inbounds %struct.element_tag, ptr %ls.sroa.14.2, i64 0, i32 1 %3 = load ptr, ptr %prev.i4093, align 8, !tbaa !15 %cmp1.i4194 = icmp eq ptr %3, null br i1 %cmp1.i4194, label %if.end21.sink.split, label %popback.exit if.end.i33.preheader: ; preds = %for.cond.cleanup %prev.i35 = getelementptr inbounds %struct.element_tag, ptr %ls.sroa.14.2, i64 0, i32 1 br label %if.end.i33 for.body: ; preds = %entry, %if.end %i.061 = phi i32 [ %inc, %if.end ], [ 0, %entry ] %ls.sroa.14.060 = phi ptr [ %ls.sroa.14.2, %if.end ], [ null, %entry ] %ls.sroa.0.059 = phi ptr [ %ls.sroa.0.2, %if.end ], [ null, %entry ] call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #10 %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a) %rem = and i32 %i.061, 1 %cmp2 = icmp eq i32 %rem, 0 %4 = load i64, ptr %a, align 8, !tbaa !18 %cmp.i = icmp eq ptr %ls.sroa.0.059, null %call.i = call noalias dereferenceable_or_null(24) ptr @malloc(i64 noundef 24) #9 store i64 %4, ptr %call.i, align 8, !tbaa !10 br i1 %cmp2, label %if.then, label %if.else if.then: ; preds = %for.body br i1 %cmp.i, label %if.then.i, label %if.end.i if.then.i: ; preds = %if.then %prev.i = getelementptr inbounds %struct.element_tag, ptr %call.i, i64 0, i32 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %prev.i, i8 0, i64 16, i1 false) br label %if.end if.end.i: ; preds = %if.then %next6.i = getelementptr inbounds %struct.element_tag, ptr %ls.sroa.14.060, i64 0, i32 2 store ptr %call.i, ptr %next6.i, align 8, !tbaa !14 %prev8.i = getelementptr inbounds %struct.element_tag, ptr %call.i, i64 0, i32 1 store ptr %ls.sroa.14.060, ptr %prev8.i, align 8, !tbaa !15 %next9.i = getelementptr inbounds %struct.element_tag, ptr %call.i, i64 0, i32 2 store ptr null, ptr %next9.i, align 8, !tbaa !14 br label %if.end if.else: ; preds = %for.body br i1 %cmp.i, label %if.then.i29, label %if.end.i28 if.then.i29: ; preds = %if.else %prev.i30 = getelementptr inbounds %struct.element_tag, ptr %call.i, i64 0, i32 1 call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %prev.i30, i8 0, i64 16, i1 false) br label %if.end if.end.i28: ; preds = %if.else %prev6.i = getelementptr inbounds %struct.element_tag, ptr %ls.sroa.0.059, i64 0, i32 1 store ptr %call.i, ptr %prev6.i, align 8, !tbaa !15 %next8.i = getelementptr inbounds %struct.element_tag, ptr %call.i, i64 0, i32 2 store ptr %ls.sroa.0.059, ptr %next8.i, align 8, !tbaa !14 %prev9.i = getelementptr inbounds %struct.element_tag, ptr %call.i, i64 0, i32 1 store ptr null, ptr %prev9.i, align 8, !tbaa !15 br label %if.end if.end: ; preds = %if.end.i28, %if.then.i29, %if.end.i, %if.then.i %ls.sroa.0.2 = phi ptr [ %call.i, %if.then.i ], [ %ls.sroa.0.059, %if.end.i ], [ %call.i, %if.then.i29 ], [ %call.i, %if.end.i28 ] %ls.sroa.14.2 = phi ptr [ %call.i, %if.then.i ], [ %call.i, %if.end.i ], [ %call.i, %if.then.i29 ], [ %ls.sroa.14.060, %if.end.i28 ] call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #10 %inc = add nuw nsw i32 %i.061, 1 %5 = load i32, ptr %n, align 4, !tbaa !16 %cmp = icmp slt i32 %inc, %5 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !19 if.end.i33: ; preds = %if.end.i33.preheader, %popfront.exit %ls.sroa.0.368 = phi ptr [ %8, %popfront.exit ], [ %ls.sroa.0.2, %if.end.i33.preheader ] %6 = load i64, ptr %ls.sroa.0.368, align 8, !tbaa !10 %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %6) %7 = load ptr, ptr %prev.i35, align 8, !tbaa !15 %cmp1.i = icmp eq ptr %7, null br i1 %cmp1.i, label %if.end21.sink.split, label %popfront.exit popfront.exit: ; preds = %if.end.i33 %next.i = getelementptr inbounds %struct.element_tag, ptr %ls.sroa.0.368, i64 0, i32 2 %8 = load ptr, ptr %next.i, align 8, !tbaa !14 %prev8.i36 = getelementptr inbounds %struct.element_tag, ptr %8, i64 0, i32 1 store ptr null, ptr %prev8.i36, align 8, !tbaa !15 call void @free(ptr noundef nonnull %ls.sroa.0.368) #10 %cmp6 = icmp eq ptr %8, null br i1 %cmp6, label %if.end21, label %if.end.i33 popback.exit: ; preds = %if.end.i38.preheader, %popback.exit %9 = phi ptr [ %11, %popback.exit ], [ %3, %if.end.i38.preheader ] %ls.sroa.14.56695 = phi ptr [ %9, %popback.exit ], [ %ls.sroa.14.2, %if.end.i38.preheader ] %next.i43 = getelementptr inbounds %struct.element_tag, ptr %9, i64 0, i32 2 store ptr null, ptr %next.i43, align 8, !tbaa !14 call void @free(ptr noundef nonnull %ls.sroa.14.56695) #10 %10 = load i64, ptr %9, align 8, !tbaa !10 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %10) %prev.i40 = getelementptr inbounds %struct.element_tag, ptr %9, i64 0, i32 1 %11 = load ptr, ptr %prev.i40, align 8, !tbaa !15 %cmp1.i41 = icmp eq ptr %11, null br i1 %cmp1.i41, label %if.end21.sink.split, label %popback.exit if.end21.sink.split: ; preds = %popback.exit, %if.end.i33, %if.end.i38.preheader %ls.sroa.14.2.lcssa.sink = phi ptr [ %ls.sroa.14.2, %if.end.i38.preheader ], [ %ls.sroa.14.2, %if.end.i33 ], [ %9, %popback.exit ] call void @free(ptr noundef nonnull %ls.sroa.14.2.lcssa.sink) #10 br label %if.end21 if.end21: ; preds = %popfront.exit, %if.end21.sink.split, %entry %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #10 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #8 attributes #0 = { mustprogress nofree nounwind willreturn memory(write, argmem: readwrite, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind } attributes #9 = { nounwind allocsize(0) } attributes #10 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 0} !6 = !{!"list_tag", !7, i64 0, !7, i64 8} !7 = !{!"any pointer", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!11, !12, i64 0} !11 = !{!"element_tag", !12, i64 0, !7, i64 8, !7, i64 16} !12 = !{!"long long", !8, i64 0} !13 = !{!6, !7, i64 8} !14 = !{!11, !7, i64 16} !15 = !{!11, !7, i64 8} !16 = !{!17, !17, i64 0} !17 = !{!"int", !8, i64 0} !18 = !{!12, !12, i64 0} !19 = distinct !{!19, !20} !20 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <malloc.h> int main() { long *a = (long int*)malloc(300000 * sizeof(long int)); long *b = (long int*)malloc(300000 * sizeof(long int)); int n,i,j; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%ld",&a[i]); } for(j=0,i=n-1;i>=0;i=i-2) { b[j]=a[i]; j++; } if(n%2==0) { for(i=i+1;i<n;i=i+2) { b[j]=a[i]; j++; } } else { for(i=i+3;i<n;i=i+2) { b[j]=a[i]; j++; } } for(j=0;j<n;j++) { printf("%ld ",b[j]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153730/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153730/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%ld\00", align 1 @.str.2 = 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 i32, align 4 %call = tail call noalias dereferenceable_or_null(2400000) ptr @malloc(i64 noundef 2400000) #4 %call1 = tail call noalias dereferenceable_or_null(2400000) ptr @malloc(i64 noundef 2400000) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp76 = icmp sgt i32 %0, 0 br i1 %cmp76, label %for.body, label %for.end.thread for.end.thread: ; preds = %entry %sub114 = add nsw i32 %0, -1 br label %for.end14 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds i64, ptr %call, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, 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 %sub = add nsw i32 %1, -1 %cmp578 = icmp sgt i32 %1, 0 br i1 %cmp578, label %for.body6, label %for.end14 for.body6: ; preds = %for.end, %for.body6 %indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.body6 ], [ 0, %for.end ] %i.179 = phi i32 [ %sub13, %for.body6 ], [ %sub, %for.end ] %idxprom7 = zext i32 %i.179 to i64 %arrayidx8 = getelementptr inbounds i64, ptr %call, i64 %idxprom7 %3 = load i64, ptr %arrayidx8, align 8, !tbaa !11 %arrayidx10 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv94 store i64 %3, ptr %arrayidx10, align 8, !tbaa !11 %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %sub13 = add nsw i32 %i.179, -2 %cmp5 = icmp ugt i32 %i.179, 1 br i1 %cmp5, label %for.body6, label %for.end14.loopexit, !llvm.loop !13 for.end14.loopexit: ; preds = %for.body6 %4 = and i64 %indvars.iv.next95, 4294967295 br label %for.end14 for.end14: ; preds = %for.end.thread, %for.end14.loopexit, %for.end %cmp578116 = phi i1 [ false, %for.end ], [ %cmp578, %for.end14.loopexit ], [ false, %for.end.thread ] %5 = phi i32 [ %1, %for.end ], [ %1, %for.end14.loopexit ], [ %0, %for.end.thread ] %i.1.lcssa = phi i32 [ %sub, %for.end ], [ %sub13, %for.end14.loopexit ], [ %sub114, %for.end.thread ] %j.0.lcssa = phi i64 [ 0, %for.end ], [ %4, %for.end14.loopexit ], [ 0, %for.end.thread ] %6 = and i32 %5, 1 %cmp15 = icmp eq i32 %6, 0 br i1 %cmp15, label %if.then, label %if.else if.then: ; preds = %for.end14 %add = add nsw i32 %i.1.lcssa, 1 %cmp1786 = icmp slt i32 %add, %5 br i1 %cmp1786, label %for.body18.preheader, label %if.end for.body18.preheader: ; preds = %if.then %7 = sext i32 %add to i64 %8 = sext i32 %5 to i64 %9 = xor i64 %7, -1 %10 = add nsw i64 %9, %8 %min.iters.check126 = icmp ult i64 %10, 8 br i1 %min.iters.check126, label %for.body18.preheader143, label %vector.ph127 vector.ph127: ; preds = %for.body18.preheader %11 = lshr i64 %10, 1 %12 = add nuw i64 %11, 1 %n.mod.vf128 = and i64 %12, 3 %13 = icmp eq i64 %n.mod.vf128, 0 %14 = select i1 %13, i64 4, i64 %n.mod.vf128 %n.vec129 = sub i64 %12, %14 %15 = shl i64 %n.vec129, 1 %ind.end130 = add i64 %15, %7 %ind.end132 = add i64 %j.0.lcssa, %n.vec129 %invariant.gep146 = getelementptr i64, ptr %call, i64 4 %16 = getelementptr i64, ptr %call1, i64 %j.0.lcssa br label %vector.body134 vector.body134: ; preds = %vector.body134, %vector.ph127 %index135 = phi i64 [ 0, %vector.ph127 ], [ %index.next142, %vector.body134 ] %17 = shl i64 %index135, 1 %offset.idx137 = add i64 %17, %7 %18 = getelementptr inbounds i64, ptr %call, i64 %offset.idx137 %gep147 = getelementptr i64, ptr %invariant.gep146, i64 %offset.idx137 %wide.vec138 = load <4 x i64>, ptr %18, align 8, !tbaa !11 %wide.vec139 = load <4 x i64>, ptr %gep147, align 8, !tbaa !11 %strided.vec140 = shufflevector <4 x i64> %wide.vec138, <4 x i64> poison, <2 x i32> <i32 0, i32 2> %strided.vec141 = shufflevector <4 x i64> %wide.vec139, <4 x i64> poison, <2 x i32> <i32 0, i32 2> %19 = getelementptr i64, ptr %16, i64 %index135 store <2 x i64> %strided.vec140, ptr %19, align 8, !tbaa !11 %20 = getelementptr inbounds i64, ptr %19, i64 2 store <2 x i64> %strided.vec141, ptr %20, align 8, !tbaa !11 %index.next142 = add nuw i64 %index135, 4 %21 = icmp eq i64 %index.next142, %n.vec129 br i1 %21, label %for.body18.preheader143, label %vector.body134, !llvm.loop !14 for.body18.preheader143: ; preds = %vector.body134, %for.body18.preheader %indvars.iv106.ph = phi i64 [ %7, %for.body18.preheader ], [ %ind.end130, %vector.body134 ] %indvars.iv104.ph = phi i64 [ %j.0.lcssa, %for.body18.preheader ], [ %ind.end132, %vector.body134 ] br label %for.body18 for.body18: ; preds = %for.body18.preheader143, %for.body18 %indvars.iv106 = phi i64 [ %indvars.iv.next107, %for.body18 ], [ %indvars.iv106.ph, %for.body18.preheader143 ] %indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.body18 ], [ %indvars.iv104.ph, %for.body18.preheader143 ] %arrayidx20 = getelementptr inbounds i64, ptr %call, i64 %indvars.iv106 %22 = load i64, ptr %arrayidx20, align 8, !tbaa !11 %arrayidx22 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv104 store i64 %22, ptr %arrayidx22, align 8, !tbaa !11 %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %indvars.iv.next107 = add nsw i64 %indvars.iv106, 2 %cmp17 = icmp slt i64 %indvars.iv.next107, %8 br i1 %cmp17, label %for.body18, label %if.end, !llvm.loop !17 if.else: ; preds = %for.end14 %add27 = add nsw i32 %i.1.lcssa, 3 %cmp2983 = icmp slt i32 %add27, %5 br i1 %cmp2983, label %for.body30.preheader, label %if.end for.body30.preheader: ; preds = %if.else %23 = sext i32 %add27 to i64 %24 = sext i32 %5 to i64 %25 = xor i64 %23, -1 %26 = add nsw i64 %25, %24 %min.iters.check = icmp ult i64 %26, 8 br i1 %min.iters.check, label %for.body30.preheader144, label %vector.ph vector.ph: ; preds = %for.body30.preheader %27 = lshr i64 %26, 1 %28 = add nuw i64 %27, 1 %n.mod.vf = and i64 %28, 3 %29 = icmp eq i64 %n.mod.vf, 0 %30 = select i1 %29, i64 4, i64 %n.mod.vf %n.vec = sub i64 %28, %30 %31 = shl i64 %n.vec, 1 %ind.end = add i64 %31, %23 %ind.end119 = add i64 %j.0.lcssa, %n.vec %invariant.gep = getelementptr i64, ptr %call, i64 4 %32 = getelementptr i64, ptr %call1, i64 %j.0.lcssa br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %33 = shl i64 %index, 1 %offset.idx121 = add i64 %33, %23 %34 = getelementptr inbounds i64, ptr %call, i64 %offset.idx121 %gep = getelementptr i64, ptr %invariant.gep, i64 %offset.idx121 %wide.vec = load <4 x i64>, ptr %34, align 8, !tbaa !11 %wide.vec122 = load <4 x i64>, ptr %gep, align 8, !tbaa !11 %strided.vec = shufflevector <4 x i64> %wide.vec, <4 x i64> poison, <2 x i32> <i32 0, i32 2> %strided.vec123 = shufflevector <4 x i64> %wide.vec122, <4 x i64> poison, <2 x i32> <i32 0, i32 2> %35 = getelementptr i64, ptr %32, i64 %index store <2 x i64> %strided.vec, ptr %35, align 8, !tbaa !11 %36 = getelementptr inbounds i64, ptr %35, i64 2 store <2 x i64> %strided.vec123, ptr %36, align 8, !tbaa !11 %index.next = add nuw i64 %index, 4 %37 = icmp eq i64 %index.next, %n.vec br i1 %37, label %for.body30.preheader144, label %vector.body, !llvm.loop !18 for.body30.preheader144: ; preds = %vector.body, %for.body30.preheader %indvars.iv99.ph = phi i64 [ %23, %for.body30.preheader ], [ %ind.end, %vector.body ] %indvars.iv97.ph = phi i64 [ %j.0.lcssa, %for.body30.preheader ], [ %ind.end119, %vector.body ] br label %for.body30 for.body30: ; preds = %for.body30.preheader144, %for.body30 %indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.body30 ], [ %indvars.iv99.ph, %for.body30.preheader144 ] %indvars.iv97 = phi i64 [ %indvars.iv.next98, %for.body30 ], [ %indvars.iv97.ph, %for.body30.preheader144 ] %arrayidx32 = getelementptr inbounds i64, ptr %call, i64 %indvars.iv99 %38 = load i64, ptr %arrayidx32, align 8, !tbaa !11 %arrayidx34 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv97 store i64 %38, ptr %arrayidx34, align 8, !tbaa !11 %indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1 %indvars.iv.next100 = add nsw i64 %indvars.iv99, 2 %cmp29 = icmp slt i64 %indvars.iv.next100, %24 br i1 %cmp29, label %for.body30, label %if.end, !llvm.loop !19 if.end: ; preds = %for.body30, %for.body18, %if.else, %if.then br i1 %cmp578116, label %for.body41, label %for.end47 for.body41: ; preds = %if.end, %for.body41 %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.body41 ], [ 0, %if.end ] %arrayidx43 = getelementptr inbounds i64, ptr %call1, i64 %indvars.iv111 %39 = load i64, ptr %arrayidx43, align 8, !tbaa !11 %call44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %39) %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %40 = load i32, ptr %n, align 4, !tbaa !5 %41 = sext i32 %40 to i64 %cmp40 = icmp slt i64 %indvars.iv.next112, %41 br i1 %cmp40, label %for.body41, label %for.end47, !llvm.loop !20 for.end47: ; preds = %for.body41, %if.end 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nofree 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind allocsize(0) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!12, !12, i64 0} !12 = !{!"long", !7, i64 0} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !15, !16} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = !{!"llvm.loop.unroll.runtime.disable"} !17 = distinct !{!17, !10, !16, !15} !18 = distinct !{!18, !10, !15, !16} !19 = distinct !{!19, !10, !16, !15} !20 = distinct !{!20, !10}
#include <stdio.h> int main(void) { int no,d1,d2,i,ii,mno,md; while(scanf("%d",&ii), ii != 0){ md = 0; for(i = 1;i <= ii;i++){ scanf("%d%d%d",&no,&d1,&d2); if (md <(d1 + d2)){ md =(d1 + d2); mno = no; } } printf("%d %d\n",mno,md); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153817/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153817/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %no = alloca i32, align 4 %d1 = alloca i32, align 4 %d2 = alloca i32, align 4 %ii = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %no) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ii) #4 %call14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ii) %0 = load i32, ptr %ii, align 4, !tbaa !5 %cmp.not15 = icmp eq i32 %0, 0 br i1 %cmp.not15, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %1 = phi i32 [ %6, %for.end ], [ %0, %entry ] %mno.016 = phi i32 [ %mno.1.lcssa, %for.end ], [ undef, %entry ] %cmp1.not9 = icmp slt i32 %1, 1 br i1 %cmp1.not9, label %for.end, label %for.body for.body: ; preds = %for.cond.preheader, %for.body %md.012 = phi i32 [ %spec.select8, %for.body ], [ 0, %for.cond.preheader ] %mno.111 = phi i32 [ %spec.select, %for.body ], [ %mno.016, %for.cond.preheader ] %i.010 = phi i32 [ %inc, %for.body ], [ 1, %for.cond.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %no, ptr noundef nonnull %d1, ptr noundef nonnull %d2) %2 = load i32, ptr %d1, align 4, !tbaa !5 %3 = load i32, ptr %d2, align 4, !tbaa !5 %add = add nsw i32 %3, %2 %cmp3 = icmp slt i32 %md.012, %add %4 = load i32, ptr %no, align 4 %spec.select = select i1 %cmp3, i32 %4, i32 %mno.111 %spec.select8 = call i32 @llvm.smax.i32(i32 %md.012, i32 %add) %inc = add nuw nsw i32 %i.010, 1 %5 = load i32, ptr %ii, align 4, !tbaa !5 %cmp1.not.not = icmp slt i32 %i.010, %5 br i1 %cmp1.not.not, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %for.cond.preheader %mno.1.lcssa = phi i32 [ %mno.016, %for.cond.preheader ], [ %spec.select, %for.body ] %md.0.lcssa = phi i32 [ 0, %for.cond.preheader ], [ %spec.select8, %for.body ] %call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %mno.1.lcssa, i32 noundef %md.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ii) %6 = load i32, ptr %ii, align 4, !tbaa !5 %cmp.not = icmp eq i32 %6, 0 br i1 %cmp.not, label %while.end, label %for.cond.preheader, !llvm.loop !11 while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ii) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d1) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %no) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int n,p[10000],d[10001],d1,d2; int i,max; while(1) { scanf("%d",&n); if(n==0) { break; } d[0]=0; max=0; for(i=1;i<n+1;i++) { scanf("%d %d %d",&p[i],&d1,&d2); d[i]=d1+d2; if(d[i]>d[max]) { max=i; } } printf("%d %d\n",p[max],d[max]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153875/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153875/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.2 = private unnamed_addr constant [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: %n = alloca i32, align 4 %p = alloca [10000 x i32], align 16 %d = alloca [10001 x i32], align 16 %d1 = alloca i32, align 4 %d2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %p) #3 call void @llvm.lifetime.start.p0(i64 40004, ptr nonnull %d) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d1) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d2) #3 %call29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp30 = icmp eq i32 %0, 0 br i1 %cmp30, label %while.end, label %if.end if.end: ; preds = %entry, %for.end %1 = phi i32 [ %10, %for.end ], [ %0, %entry ] store i32 0, ptr %d, align 16, !tbaa !5 %cmp1.not26 = icmp slt i32 %1, 1 br i1 %cmp1.not26, label %for.end, label %for.body for.body: ; preds = %if.end, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %if.end ] %max.028 = phi i32 [ %spec.select, %for.body ], [ 0, %if.end ] %arrayidx2 = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 %indvars.iv %call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx2, ptr noundef nonnull %d1, ptr noundef nonnull %d2) %2 = load i32, ptr %d1, align 4, !tbaa !5 %3 = load i32, ptr %d2, align 4, !tbaa !5 %add4 = add nsw i32 %3, %2 %arrayidx6 = getelementptr inbounds [10001 x i32], ptr %d, i64 0, i64 %indvars.iv store i32 %add4, ptr %arrayidx6, align 4, !tbaa !5 %idxprom9 = sext i32 %max.028 to i64 %arrayidx10 = getelementptr inbounds [10001 x i32], ptr %d, i64 0, i64 %idxprom9 %4 = load i32, ptr %arrayidx10, align 4, !tbaa !5 %cmp11 = icmp sgt i32 %add4, %4 %5 = trunc i64 %indvars.iv to i32 %spec.select = select i1 %cmp11, i32 %5, i32 %max.028 %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 %cmp1.not.not = icmp slt i64 %indvars.iv, %7 br i1 %cmp1.not.not, label %for.body, label %for.end.loopexit, !llvm.loop !9 for.end.loopexit: ; preds = %for.body %idxprom14.phi.trans.insert = sext i32 %spec.select to i64 %arrayidx17.phi.trans.insert = getelementptr inbounds [10001 x i32], ptr %d, i64 0, i64 %idxprom14.phi.trans.insert %.pre = load i32, ptr %arrayidx17.phi.trans.insert, align 4, !tbaa !5 br label %for.end for.end: ; preds = %if.end, %for.end.loopexit %8 = phi i32 [ %.pre, %for.end.loopexit ], [ 0, %if.end ] %max.0.lcssa = phi i32 [ %spec.select, %for.end.loopexit ], [ 0, %if.end ] %idxprom14 = sext i32 %max.0.lcssa to i64 %arrayidx15 = getelementptr inbounds [10000 x i32], ptr %p, i64 0, i64 %idxprom14 %9 = load i32, ptr %arrayidx15, align 4, !tbaa !5 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9, i32 noundef %8) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %10 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %10, 0 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %for.end, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d2) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d1) #3 call void @llvm.lifetime.end.p0(i64 40004, ptr nonnull %d) #3 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %p) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void) { char s[6]; scanf("%s",s); for(int i=0;i<3;i++){ if(s[i]=='1'){ s[i]='9'; }else if(s[i]=='9'){ s[i]='1'; } } printf("%s\n",s); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153918/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153918/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8], align 1 call void @llvm.lifetime.start.p0(i64 6, 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 switch i8 %0, label %for.inc [ i8 49, label %if.then i8 57, label %if.then10 ] if.then: ; preds = %entry store i8 57, ptr %s, align 1, !tbaa !5 br label %for.inc if.then10: ; preds = %entry store i8 49, ptr %s, align 1, !tbaa !5 br label %for.inc for.inc: ; preds = %entry, %if.then, %if.then10 %arrayidx.1 = getelementptr inbounds [6 x i8], ptr %s, i64 0, i64 1 %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %1, label %for.inc.1 [ i8 49, label %if.then.1 i8 57, label %for.inc.1.sink.split ] if.then.1: ; preds = %for.inc br label %for.inc.1.sink.split for.inc.1.sink.split: ; preds = %for.inc, %if.then.1 %.sink = phi i8 [ 57, %if.then.1 ], [ 49, %for.inc ] store i8 %.sink, ptr %arrayidx.1, align 1, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %for.inc.1.sink.split, %for.inc %arrayidx.2 = getelementptr inbounds [6 x i8], ptr %s, i64 0, i64 2 %2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 switch i8 %2, label %for.inc.2 [ i8 49, label %if.then.2 i8 57, label %for.inc.2.sink.split ] if.then.2: ; preds = %for.inc.1 br label %for.inc.2.sink.split for.inc.2.sink.split: ; preds = %for.inc.1, %if.then.2 %.sink23 = phi i8 [ 57, %if.then.2 ], [ 49, %for.inc.1 ] store i8 %.sink23, ptr %arrayidx.2, align 1, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %for.inc.2.sink.split, %for.inc.1 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %s) call void @llvm.lifetime.end.p0(i64 6, 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"}
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> int main(void) { int a, b, c,d; scanf("%d",&a); b = (a / 10)%10; c = a / 100; a = a % 10; if (a == 9)a = a - 8; else if (a == 1)a = a + 8; if (b == 9)b = b - 8; else if (b == 1)b = b + 8; if (c == 9) c = c - 8; else if (c == 1) c = c + 8; d = 100 * c + 10 * b + a; printf("%d", d); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_153961/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_153961/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i32, ptr %a, align 4, !tbaa !5 %.fr = freeze i32 %0 %div = sdiv i32 %.fr, 10 %rem = srem i32 %div, 10 %rem2 = srem i32 %.fr, 10 store i32 %rem2, ptr %a, align 4, !tbaa !5 switch i32 %rem2, label %if.end5 [ i32 9, label %if.then i32 1, label %if.then4 ] if.then: ; preds = %entry store i32 1, ptr %a, align 4, !tbaa !5 br label %if.end5 if.then4: ; preds = %entry store i32 9, ptr %a, align 4, !tbaa !5 br label %if.end5 if.end5: ; preds = %entry, %if.then4, %if.then %1 = phi i32 [ %rem2, %entry ], [ 9, %if.then4 ], [ 1, %if.then ] switch i32 %rem, label %if.end14.fold.split [ i32 9, label %if.end14 i32 1, label %if.then11 ] if.then11: ; preds = %if.end5 br label %if.end14 if.end14.fold.split: ; preds = %if.end5 %2 = mul nsw i32 %rem, 10 br label %if.end14 if.end14: ; preds = %if.end5, %if.end14.fold.split, %if.then11 %b.0 = phi i32 [ 90, %if.then11 ], [ 10, %if.end5 ], [ %2, %if.end14.fold.split ] %.off = add i32 %.fr, -900 %cmp15 = icmp ult i32 %.off, 100 %.off36 = add i32 %.fr, -100 %cmp19 = icmp ult i32 %.off36, 100 %3 = srem i32 %.fr, 100 %4 = sub nsw i32 %.fr, %3 %5 = select i1 %cmp19, i32 900, i32 %4 %mul = select i1 %cmp15, i32 100, i32 %5 %add25 = add nsw i32 %b.0, %mul %add26 = add nsw i32 %add25, %1 %call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add26) 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() { char n[4]; scanf("%s",n); for (int i = 0; i < 3; i++) { if (n[i] == '1') { n[i] = '9'; continue; } if (n[i] == '9') { n[i] = '1'; continue; } } printf("%s\n",n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154003/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154003/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %n = alloca [4 x i8], align 1 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 i8, ptr %n, align 1, !tbaa !5 switch i8 %0, label %for.inc [ i8 49, label %if.then i8 57, label %if.then10 ] if.then: ; preds = %entry store i8 57, ptr %n, align 1, !tbaa !5 br label %for.inc if.then10: ; preds = %entry store i8 49, ptr %n, align 1, !tbaa !5 br label %for.inc for.inc: ; preds = %entry, %if.then10, %if.then %arrayidx.1 = getelementptr inbounds [4 x i8], ptr %n, i64 0, i64 1 %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !5 switch i8 %1, label %for.inc.1 [ i8 49, label %if.then.1 i8 57, label %for.inc.1.sink.split ] if.then.1: ; preds = %for.inc br label %for.inc.1.sink.split for.inc.1.sink.split: ; preds = %for.inc, %if.then.1 %.sink = phi i8 [ 57, %if.then.1 ], [ 49, %for.inc ] store i8 %.sink, ptr %arrayidx.1, align 1, !tbaa !5 br label %for.inc.1 for.inc.1: ; preds = %for.inc.1.sink.split, %for.inc %arrayidx.2 = getelementptr inbounds [4 x i8], ptr %n, i64 0, i64 2 %2 = load i8, ptr %arrayidx.2, align 1, !tbaa !5 switch i8 %2, label %for.inc.2 [ i8 49, label %if.then.2 i8 57, label %for.inc.2.sink.split ] if.then.2: ; preds = %for.inc.1 br label %for.inc.2.sink.split for.inc.2.sink.split: ; preds = %for.inc.1, %if.then.2 %.sink23 = phi i8 [ 57, %if.then.2 ], [ 49, %for.inc.1 ] store i8 %.sink23, ptr %arrayidx.2, align 1, !tbaa !5 br label %for.inc.2 for.inc.2: ; preds = %for.inc.2.sink.split, %for.inc.1 %puts = call i32 @puts(ptr nonnull dereferenceable(1) %n) 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 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
// This file is a "Hello, world!" in C++ language by GCC for wandbox.#include <stdio.h> #include <stdio.h> int main(){ int n; scanf("%d¥n", &n); if(n>=111 && n<= 999){ if(n%10 == 1){ n+=8; } else { n-=8; } if(n/10%10 == 1){ n+=80; } else { n-=80; } if(n/100%10 == 1){ n+=800; } else { n-=800; } } printf("%d", n); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154047/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154047/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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\C2\A5n\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 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 %1 = add i32 %0, -111 %or.cond = icmp ult i32 %1, 889 br i1 %or.cond, label %if.then, label %if.end19 if.then: ; preds = %entry %rem.lhs.trunc = trunc i32 %0 to i16 %rem22 = urem i16 %rem.lhs.trunc, 10 %cmp2 = icmp eq i16 %rem22, 1 %storemerge.v = select i1 %cmp2, i32 8, i32 -8 %storemerge = add nsw i32 %storemerge.v, %0 %div23.lhs.trunc = trunc i32 %storemerge to i16 %div2324 = udiv i16 %div23.lhs.trunc, 10 %rem425.lhs.trunc = trunc i16 %div2324 to i8 %rem42526 = urem i8 %rem425.lhs.trunc, 10 %cmp5 = icmp eq i8 %rem42526, 1 %storemerge21.v = select i1 %cmp5, i32 80, i32 -80 %storemerge21 = add nsw i32 %storemerge21.v, %storemerge %storemerge21.fr = freeze i32 %storemerge21 %div1127.lhs.trunc = trunc i32 %storemerge21.fr to i16 %div112728 = udiv i16 %div1127.lhs.trunc, 100 %div1127.zext = zext i16 %div112728 to i32 %rem1229.urem = add nsw i32 %div1127.zext, -10 %rem1229.cmp = icmp ult i16 %div1127.lhs.trunc, 1000 %rem1229 = select i1 %rem1229.cmp, i32 %div1127.zext, i32 %rem1229.urem %cmp13 = icmp eq i32 %rem1229, 1 br i1 %cmp13, label %if.then14, label %if.else16 if.then14: ; preds = %if.then %add15 = add nuw nsw i32 %storemerge21.fr, 800 store i32 %add15, ptr %n, align 4, !tbaa !5 br label %if.end19 if.else16: ; preds = %if.then %sub17 = add nsw i32 %storemerge21.fr, -800 store i32 %sub17, ptr %n, align 4, !tbaa !5 br label %if.end19 if.end19: ; preds = %if.then14, %if.else16, %entry %2 = phi i32 [ %add15, %if.then14 ], [ %sub17, %if.else16 ], [ %0, %entry ] %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %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"}
#include <stdio.h>; int main() { int n; scanf("%d",&n); int ans[3]; for (int i = 0; i < 3; i++) { if (n % 10 == 1) { ans[i] = 9; } else if (n % 10 == 9) { ans[i] = 1; } else { ans[i] = n % 10; } n=n / 10; } printf("%d", ans[0] + ans[1] * 10+ans[2]*100); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154098/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154098/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %n.promoted = load i32, ptr %n, align 4, !tbaa !5 %rem = srem i32 %n.promoted, 10 %div = sdiv i32 %n.promoted, 10 switch i32 %rem, label %if.else7 [ i32 1, label %if.end11 i32 9, label %if.then4 ] if.then4: ; preds = %entry br label %if.end11 if.else7: ; preds = %entry br label %if.end11 if.end11: ; preds = %entry, %if.then4, %if.else7 %ans.sroa.0.0 = phi i32 [ %rem, %if.else7 ], [ 1, %if.then4 ], [ 9, %entry ] %rem.1 = srem i32 %div, 10 switch i32 %rem.1, label %if.else7.1 [ i32 1, label %if.then.1 i32 9, label %if.end11.1 ] if.then.1: ; preds = %if.end11 br label %if.end11.1 if.else7.1: ; preds = %if.end11 %0 = mul nsw i32 %rem.1, 10 br label %if.end11.1 if.end11.1: ; preds = %if.end11, %if.else7.1, %if.then.1 %ans.sroa.6.0 = phi i32 [ %0, %if.else7.1 ], [ 90, %if.then.1 ], [ 10, %if.end11 ] %div.1 = sdiv i32 %n.promoted, 100 %rem.2 = srem i32 %div.1, 10 switch i32 %rem.2, label %if.else7.2 [ i32 1, label %if.then.2 i32 9, label %if.end11.2 ] if.then.2: ; preds = %if.end11.1 br label %if.end11.2 if.else7.2: ; preds = %if.end11.1 %1 = mul nsw i32 %rem.2, 100 br label %if.end11.2 if.end11.2: ; preds = %if.end11.1, %if.else7.2, %if.then.2 %ans.sroa.10.0 = phi i32 [ %1, %if.else7.2 ], [ 900, %if.then.2 ], [ 100, %if.end11.1 ] %div.2 = sdiv i32 %n.promoted, 1000 store i32 %div.2, ptr %n, align 4, !tbaa !5 %add = add nsw i32 %ans.sroa.6.0, %ans.sroa.0.0 %add16 = add nsw i32 %add, %ans.sroa.10.0 %call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %add16) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
/* 結果: */ #define _USE_MATH_DEFINES #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <limits.h> #include <stdbool.h> #define inf (INT_MAX-1) #define INF 9223372036854775807 #define PI 3.14159265358979323846; #define EPS 1e-10 #define sq(n) ((n)*(n)) #define rep(i,n) for(i=0;i<n;i++) #define rev(i,n) for(i=n-1;i>=0;i--) /* #define sort(a,n) qsort(a,n,sizeof(TYPE),cmp) #define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r) */ #define chsort(s,n) qsort(s,n,sizeof(char),cmp) #define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r) #define TYPE long long #define ll long long #define MEMSET(a) memset(a,0,sizeof(a)) #define MEMSET_U(a) memset(a,-1,sizeof(a)) const int mod = (int)1e09 + 7; //#define DEBUG1 //#define DEBUG2 //#define DEBUGF #define DUMMY int in(void) { int i; scanf("%d", &i); return i; } long long llin(void) { long long i; scanf("%lld", &i); return i; } double din(void) { double i; scanf("%lf", &i); return i; } void chin(char s[]) { scanf("%s", s); } void print(int a) { printf("%d\n", a); } void llprint(long long a) { printf("%lld\n", a); } void dprint(double a) { printf("%.10f\n", a); } void print2(int a, int b) { printf("%d %d\n", a, b); } int Max(int a, int b) { if (a>b) { return a; }return b; } int Min(int a, int b) { if (a<b) { return a; }return b; } long long llmax(long long a, long long b) { return a > b ? a : b; } long long llmin(long long a, long long b) { return a < b ? a : b; } double dmax(double a, double b) { return a > b ? a : b; } double dmin(double a, double b) { return a < b ? a : b; } //long long llmax(long long a, long long b) { return a > b ? a : b; } //long long llmin(long long a, long long b) { return a < b ? a : b; } //double dmax(double a, double b) { return a > b ? a : b; } int cmp(const void *a, const void *b) { return *(TYPE *)a - *(TYPE *)b; } int cmp_r(const void *a, const void *b) { return *(TYPE *)b - *(TYPE *)a; } int char_cmp(const void *a, const void *b) { return strcmp((char *)a, (char *)b); } int char_cmp_r(const void *a, const void *b) { return strcmp((char *)b, (char *)a); } void swap(int *a, int *b) { int t = *a; *a = *b; *b = t; } int main() { char N[4]; char ans[4]; scanf("%s", &N); for (int i = 0; i < 4; i++) { if (N[i] == '1') { printf("%c",'9'); } else if(N[i] == '9'){ printf("%c", '1'); } } printf("\n"); #ifdef DEBUGF getch(); #endif return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154140/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154140/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @mod = dso_local local_unnamed_addr constant i32 1000000007, align 4 @.str = private unnamed_addr constant [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 [4 x i8] c"%lf\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.4 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @.str.5 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.6 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1 @.str.7 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @in() local_unnamed_addr #0 { entry: %i = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %i) %0 = load i32, ptr %i, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #11 ret i32 %0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i64 @llin() local_unnamed_addr #0 { entry: %i = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %i) %0 = load i64, ptr %i, align 8, !tbaa !9 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11 ret i64 %0 } ; Function Attrs: nofree nounwind uwtable define dso_local double @din() local_unnamed_addr #0 { entry: %i = alloca double, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i) %0 = load double, ptr %i, align 8, !tbaa !11 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #11 ret double %0 } ; Function Attrs: nofree nounwind uwtable define dso_local void @chin(ptr noundef %s) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef %s) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print(i32 noundef %a) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %a) ret void } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind uwtable define dso_local void @llprint(i64 noundef %a) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i64 noundef %a) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @dprint(double noundef %a) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, double noundef %a) ret void } ; Function Attrs: nofree nounwind uwtable define dso_local void @print2(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %a, i32 noundef %b) ret void } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @Max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @Min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dmax(double noundef %a, double noundef %b) local_unnamed_addr #4 { entry: %cmp = fcmp ogt double %a, %b %cond = select i1 %cmp, double %a, double %b ret double %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dmin(double noundef %a, double noundef %b) local_unnamed_addr #4 { entry: %cmp = fcmp olt double %a, %b %cond = select i1 %cmp, double %a, double %b ret double %cond } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i64, ptr %a, align 8, !tbaa !9 %1 = load i64, ptr %b, align 8, !tbaa !9 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %0 = load i64, ptr %b, align 8, !tbaa !9 %1 = load i64, ptr %a, align 8, !tbaa !9 %sub = sub nsw i64 %0, %1 %conv = trunc i64 %sub to i32 ret i32 %conv } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @char_cmp(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #12 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #7 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @char_cmp_r(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #6 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #12 ret i32 %call } ; 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 #8 { entry: %0 = load i32, ptr %a, align 4, !tbaa !5 %1 = load i32, ptr %b, align 4, !tbaa !5 store i32 %1, ptr %a, align 4, !tbaa !5 store i32 %0, ptr %b, align 4, !tbaa !5 ret void } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca [4 x i8], align 1 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %N) %0 = load i8, ptr %N, align 1, !tbaa !13 switch i8 %0, label %for.inc [ i8 49, label %for.inc.sink.split i8 57, label %if.then9 ] if.then9: ; preds = %entry br label %for.inc.sink.split for.inc.sink.split: ; preds = %entry, %if.then9 %.sink = phi i32 [ 49, %if.then9 ], [ 57, %entry ] %putchar17 = call i32 @putchar(i32 %.sink) br label %for.inc for.inc: ; preds = %for.inc.sink.split, %entry %arrayidx.1 = getelementptr inbounds [4 x i8], ptr %N, i64 0, i64 1 %1 = load i8, ptr %arrayidx.1, align 1, !tbaa !13 switch i8 %1, label %for.inc.1 [ i8 49, label %if.then.1 i8 57, label %for.inc.1.sink.split ] if.then.1: ; preds = %for.inc br label %for.inc.1.sink.split for.inc.1.sink.split: ; preds = %for.inc, %if.then.1 %.sink20 = phi i32 [ 57, %if.then.1 ], [ 49, %for.inc ] %putchar17.1 = call i32 @putchar(i32 %.sink20) br label %for.inc.1 for.inc.1: ; preds = %for.inc.1.sink.split, %for.inc %arrayidx.2 = getelementptr inbounds [4 x i8], ptr %N, i64 0, i64 2 %2 = load i8, ptr %arrayidx.2, align 1, !tbaa !13 switch i8 %2, label %for.inc.2 [ i8 49, label %if.then.2 i8 57, label %for.inc.2.sink.split ] if.then.2: ; preds = %for.inc.1 br label %for.inc.2.sink.split for.inc.2.sink.split: ; preds = %for.inc.1, %if.then.2 %.sink21 = phi i32 [ 57, %if.then.2 ], [ 49, %for.inc.1 ] %putchar17.2 = call i32 @putchar(i32 %.sink21) br label %for.inc.2 for.inc.2: ; preds = %for.inc.2.sink.split, %for.inc.1 %arrayidx.3 = getelementptr inbounds [4 x i8], ptr %N, i64 0, i64 3 %3 = load i8, ptr %arrayidx.3, align 1, !tbaa !13 switch i8 %3, label %for.inc.3 [ i8 49, label %if.then.3 i8 57, label %for.inc.3.sink.split ] if.then.3: ; preds = %for.inc.2 br label %for.inc.3.sink.split for.inc.3.sink.split: ; preds = %for.inc.2, %if.then.3 %.sink22 = phi i32 [ 57, %if.then.3 ], [ 49, %for.inc.2 ] %putchar17.3 = call i32 @putchar(i32 %.sink22) br label %for.inc.3 for.inc.3: ; preds = %for.inc.3.sink.split, %for.inc.2 %putchar = call i32 @putchar(i32 10) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #11 ret i32 0 } ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #9 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #10 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #9 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { 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 #5 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { 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 #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nofree nounwind } attributes #11 = { nounwind } attributes #12 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"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 = !{!12, !12, i64 0} !12 = !{!"double", !7, i64 0} !13 = !{!7, !7, i64 0}
#include <stdio.h> #include <ctype.h> #define debug int main(int argv, char *argc[]){ char buf, print[2]={0}; int x, num[26]={0}; for(buf=getchar();!(EOF == buf); buf=getchar()){ if(isalpha(buf)){ num[tolower(buf)-'a']++; } } for(x=0; 26 > x; x++){ print[0] = 'a'+x; printf("%s : %d\n", print, num[x]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154342/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154342/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%s : %d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argv, ptr nocapture noundef readnone %argc) local_unnamed_addr #0 { entry: %print = alloca [2 x i8], align 2 %num = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %print) #5 store i16 97, ptr %print, align 2 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %num) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %num, i8 0, i64 104, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %sext32 = shl i32 %call.i, 24 %cmp.not33 = icmp eq i32 %sext32, -16777216 br i1 %cmp.not33, label %for.cond14.preheader, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %call3 = tail call ptr @__ctype_b_loc() #6 br label %for.body for.cond14.preheader.loopexit: ; preds = %for.inc %.pre = load i32, ptr %num, align 16, !tbaa !9 %arrayidx21.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 1 %.pre37 = load i32, ptr %arrayidx21.1.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 2 %.pre38 = load i32, ptr %arrayidx21.2.phi.trans.insert, align 8, !tbaa !9 %arrayidx21.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 3 %.pre39 = load i32, ptr %arrayidx21.3.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 4 %.pre40 = load i32, ptr %arrayidx21.4.phi.trans.insert, align 16, !tbaa !9 %arrayidx21.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 5 %.pre41 = load i32, ptr %arrayidx21.5.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 6 %.pre42 = load i32, ptr %arrayidx21.6.phi.trans.insert, align 8, !tbaa !9 %arrayidx21.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 7 %.pre43 = load i32, ptr %arrayidx21.7.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 8 %.pre44 = load i32, ptr %arrayidx21.8.phi.trans.insert, align 16, !tbaa !9 %arrayidx21.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 9 %.pre45 = load i32, ptr %arrayidx21.9.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 10 %.pre46 = load i32, ptr %arrayidx21.10.phi.trans.insert, align 8, !tbaa !9 %arrayidx21.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 11 %.pre47 = load i32, ptr %arrayidx21.11.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 12 %.pre48 = load i32, ptr %arrayidx21.12.phi.trans.insert, align 16, !tbaa !9 %arrayidx21.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 13 %.pre49 = load i32, ptr %arrayidx21.13.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 14 %.pre50 = load i32, ptr %arrayidx21.14.phi.trans.insert, align 8, !tbaa !9 %arrayidx21.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 15 %.pre51 = load i32, ptr %arrayidx21.15.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 16 %.pre52 = load i32, ptr %arrayidx21.16.phi.trans.insert, align 16, !tbaa !9 %arrayidx21.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 17 %.pre53 = load i32, ptr %arrayidx21.17.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 18 %.pre54 = load i32, ptr %arrayidx21.18.phi.trans.insert, align 8, !tbaa !9 %arrayidx21.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 19 %.pre55 = load i32, ptr %arrayidx21.19.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 20 %.pre56 = load i32, ptr %arrayidx21.20.phi.trans.insert, align 16, !tbaa !9 %arrayidx21.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 21 %.pre57 = load i32, ptr %arrayidx21.21.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 22 %.pre58 = load i32, ptr %arrayidx21.22.phi.trans.insert, align 8, !tbaa !9 %arrayidx21.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 23 %.pre59 = load i32, ptr %arrayidx21.23.phi.trans.insert, align 4, !tbaa !9 %arrayidx21.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 24 %.pre60 = load i32, ptr %arrayidx21.24.phi.trans.insert, align 16, !tbaa !9 br label %for.cond14.preheader for.cond14.preheader: ; preds = %for.cond14.preheader.loopexit, %entry %1 = phi i32 [ %.pre60, %for.cond14.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre59, %for.cond14.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre58, %for.cond14.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre57, %for.cond14.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre56, %for.cond14.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre55, %for.cond14.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre54, %for.cond14.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre53, %for.cond14.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre52, %for.cond14.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre51, %for.cond14.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre50, %for.cond14.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre49, %for.cond14.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre48, %for.cond14.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre47, %for.cond14.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre46, %for.cond14.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre45, %for.cond14.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre44, %for.cond14.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre43, %for.cond14.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre42, %for.cond14.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre41, %for.cond14.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre40, %for.cond14.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre39, %for.cond14.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre38, %for.cond14.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre37, %for.cond14.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre, %for.cond14.preheader.loopexit ], [ 0, %entry ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %25) store i8 98, ptr %print, align 2, !tbaa !11 %call22.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %24) store i8 99, ptr %print, align 2, !tbaa !11 %call22.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %23) store i8 100, ptr %print, align 2, !tbaa !11 %call22.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %22) store i8 101, ptr %print, align 2, !tbaa !11 %call22.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %21) store i8 102, ptr %print, align 2, !tbaa !11 %call22.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %20) store i8 103, ptr %print, align 2, !tbaa !11 %call22.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %19) store i8 104, ptr %print, align 2, !tbaa !11 %call22.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %18) store i8 105, ptr %print, align 2, !tbaa !11 %call22.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %17) store i8 106, ptr %print, align 2, !tbaa !11 %call22.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %16) store i8 107, ptr %print, align 2, !tbaa !11 %call22.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %15) store i8 108, ptr %print, align 2, !tbaa !11 %call22.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %14) store i8 109, ptr %print, align 2, !tbaa !11 %call22.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %13) store i8 110, ptr %print, align 2, !tbaa !11 %call22.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %12) store i8 111, ptr %print, align 2, !tbaa !11 %call22.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %11) store i8 112, ptr %print, align 2, !tbaa !11 %call22.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %10) store i8 113, ptr %print, align 2, !tbaa !11 %call22.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %9) store i8 114, ptr %print, align 2, !tbaa !11 %call22.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %8) store i8 115, ptr %print, align 2, !tbaa !11 %call22.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %7) store i8 116, ptr %print, align 2, !tbaa !11 %call22.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %6) store i8 117, ptr %print, align 2, !tbaa !11 %call22.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %5) store i8 118, ptr %print, align 2, !tbaa !11 %call22.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %4) store i8 119, ptr %print, align 2, !tbaa !11 %call22.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %3) store i8 120, ptr %print, align 2, !tbaa !11 %call22.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %2) store i8 121, ptr %print, align 2, !tbaa !11 %call22.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %1) store i8 122, ptr %print, align 2, !tbaa !11 %arrayidx21.25 = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 25 %26 = load i32, ptr %arrayidx21.25, align 4, !tbaa !9 %call22.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull %print, i32 noundef %26) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %num) #5 call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %print) #5 ret i32 0 for.body: ; preds = %for.body.lr.ph, %for.inc %sext34 = phi i32 [ %sext32, %for.body.lr.ph ], [ %sext, %for.inc ] %conv1 = ashr exact i32 %sext34, 24 %27 = load ptr, ptr %call3, align 8, !tbaa !5 %idxprom = sext i32 %conv1 to i64 %arrayidx = getelementptr inbounds i16, ptr %27, i64 %idxprom %28 = load i16, ptr %arrayidx, align 2, !tbaa !12 %29 = and i16 %28, 1024 %tobool.not = icmp eq i16 %29, 0 br i1 %tobool.not, label %for.inc, label %if.then if.then: ; preds = %for.body %call6 = tail call ptr @__ctype_tolower_loc() #6 %30 = load ptr, ptr %call6, align 8, !tbaa !5 %arrayidx9 = getelementptr inbounds i32, ptr %30, i64 %idxprom %31 = load i32, ptr %arrayidx9, align 4, !tbaa !9 %sub = add nsw i32 %31, -97 %idxprom10 = sext i32 %sub to i64 %arrayidx11 = getelementptr inbounds [26 x i32], ptr %num, i64 0, i64 %idxprom10 %32 = load i32, ptr %arrayidx11, align 4, !tbaa !9 %inc = add nsw i32 %32, 1 store i32 %inc, ptr %arrayidx11, align 4, !tbaa !9 br label %for.inc for.inc: ; preds = %for.body, %if.then %33 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i31 = tail call i32 @getc(ptr noundef %33) %sext = shl i32 %call.i31, 24 %cmp.not = icmp eq i32 %sext, -16777216 br i1 %cmp.not, label %for.cond14.preheader.loopexit, label %for.body, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = !{!7, !7, i64 0} !12 = !{!13, !13, i64 0} !13 = !{!"short", !7, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include <string.h> int main() { int i,j=0, len, a[26]; char s[1200]; for(i = 0; i < 26; i++) { a[i] = 0; } while(scanf("%c", &s[j])==1) j++; len = j; for(i = 0; i < len; i++) { if((s[i] >= 'A' && s[i] <= 'Z') || (s[i] >= 'a' && s[i] <= 'z')) { if(s[i] >= 'A' && s[i] <= 'Z') { s[i] += (int)'a' - (int)'A'; } a[(int)s[i]-'a'] += 1; } } for(i = 0; i < 26; i++) { printf("%c : %d\n", (char)('a'+i),a[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154393/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154393/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\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 [1200 x i8], align 16 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 1200, ptr nonnull %s) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %a, i8 0, i64 104, i1 false), !tbaa !5 br label %while.cond while.cond: ; preds = %entry, %while.cond %indvars.iv96 = phi i32 [ 0, %entry ], [ %indvars.iv.next97, %while.cond ] %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %while.cond ] %arrayidx2 = getelementptr inbounds [1200 x i8], ptr %s, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx2) %cmp3 = icmp eq i32 %call, 1 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next97 = add nuw i32 %indvars.iv96, 1 br i1 %cmp3, label %while.cond, label %for.cond5.preheader, !llvm.loop !9 for.cond5.preheader: ; preds = %while.cond %0 = and i64 %indvars.iv, 4294967295 %cmp688.not = icmp eq i64 %0, 0 br i1 %cmp688.not, label %for.cond54.preheader, label %for.body7.preheader for.body7.preheader: ; preds = %for.cond5.preheader %wide.trip.count = zext i32 %indvars.iv96 to i64 br label %for.body7 for.cond54.preheader.loopexit: ; preds = %for.inc51 %.pre = load i32, ptr %a, align 16, !tbaa !5 %arrayidx62.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 1 %.pre103 = load i32, ptr %arrayidx62.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 2 %.pre104 = load i32, ptr %arrayidx62.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx62.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 3 %.pre105 = load i32, ptr %arrayidx62.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 4 %.pre106 = load i32, ptr %arrayidx62.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx62.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 5 %.pre107 = load i32, ptr %arrayidx62.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 6 %.pre108 = load i32, ptr %arrayidx62.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx62.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 7 %.pre109 = load i32, ptr %arrayidx62.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 8 %.pre110 = load i32, ptr %arrayidx62.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx62.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 9 %.pre111 = load i32, ptr %arrayidx62.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 10 %.pre112 = load i32, ptr %arrayidx62.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx62.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 11 %.pre113 = load i32, ptr %arrayidx62.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 12 %.pre114 = load i32, ptr %arrayidx62.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx62.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 13 %.pre115 = load i32, ptr %arrayidx62.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 14 %.pre116 = load i32, ptr %arrayidx62.14.phi.trans.insert, align 8, !tbaa !5 %arrayidx62.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 15 %.pre117 = load i32, ptr %arrayidx62.15.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 16 %.pre118 = load i32, ptr %arrayidx62.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx62.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 17 %.pre119 = load i32, ptr %arrayidx62.17.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 18 %.pre120 = load i32, ptr %arrayidx62.18.phi.trans.insert, align 8, !tbaa !5 %arrayidx62.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 19 %.pre121 = load i32, ptr %arrayidx62.19.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 20 %.pre122 = load i32, ptr %arrayidx62.20.phi.trans.insert, align 16, !tbaa !5 %arrayidx62.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 21 %.pre123 = load i32, ptr %arrayidx62.21.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 22 %.pre124 = load i32, ptr %arrayidx62.22.phi.trans.insert, align 8, !tbaa !5 %arrayidx62.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 23 %.pre125 = load i32, ptr %arrayidx62.23.phi.trans.insert, align 4, !tbaa !5 %arrayidx62.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 24 %.pre126 = load i32, ptr %arrayidx62.24.phi.trans.insert, align 16, !tbaa !5 %arrayidx62.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 25 %.pre127 = load i32, ptr %arrayidx62.25.phi.trans.insert, align 4, !tbaa !5 br label %for.cond54.preheader for.cond54.preheader: ; preds = %for.cond54.preheader.loopexit, %for.cond5.preheader %1 = phi i32 [ %.pre127, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %2 = phi i32 [ %.pre126, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %3 = phi i32 [ %.pre125, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %4 = phi i32 [ %.pre124, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %5 = phi i32 [ %.pre123, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %6 = phi i32 [ %.pre122, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %7 = phi i32 [ %.pre121, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %8 = phi i32 [ %.pre120, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %9 = phi i32 [ %.pre119, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %10 = phi i32 [ %.pre118, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %11 = phi i32 [ %.pre117, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %12 = phi i32 [ %.pre116, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %13 = phi i32 [ %.pre115, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %14 = phi i32 [ %.pre114, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %15 = phi i32 [ %.pre113, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %16 = phi i32 [ %.pre112, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %17 = phi i32 [ %.pre111, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %18 = phi i32 [ %.pre110, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %19 = phi i32 [ %.pre109, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %20 = phi i32 [ %.pre108, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %21 = phi i32 [ %.pre107, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %22 = phi i32 [ %.pre106, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %23 = phi i32 [ %.pre105, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %24 = phi i32 [ %.pre104, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %25 = phi i32 [ %.pre103, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %26 = phi i32 [ %.pre, %for.cond54.preheader.loopexit ], [ 0, %for.cond5.preheader ] %call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %26) %call63.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %25) %call63.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %24) %call63.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %23) %call63.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %22) %call63.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %21) %call63.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %20) %call63.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %19) %call63.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %18) %call63.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %17) %call63.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %16) %call63.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %15) %call63.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %14) %call63.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %13) %call63.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %12) %call63.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %11) %call63.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %10) %call63.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %9) %call63.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %8) %call63.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %7) %call63.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %6) %call63.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %5) %call63.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %4) %call63.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %3) %call63.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %2) %call63.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 1200, ptr nonnull %s) #4 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %a) #4 ret i32 0 for.body7: ; preds = %for.body7.preheader, %for.inc51 %indvars.iv93 = phi i64 [ 0, %for.body7.preheader ], [ %indvars.iv.next94, %for.inc51 ] %arrayidx9 = getelementptr inbounds [1200 x i8], ptr %s, i64 0, i64 %indvars.iv93 %27 = load i8, ptr %arrayidx9, align 1, !tbaa !11 %28 = add i8 %27, -65 %or.cond = icmp ult i8 %28, 26 br i1 %or.cond, label %if.then39, label %lor.lhs.false lor.lhs.false: ; preds = %for.body7 %29 = add i8 %27, -97 %or.cond85 = icmp ult i8 %29, 26 br i1 %or.cond85, label %if.end, label %for.inc51 if.then39: ; preds = %for.body7 %add = add nuw nsw i8 %27, 32 store i8 %add, ptr %arrayidx9, align 1, !tbaa !11 br label %if.end if.end: ; preds = %lor.lhs.false, %if.then39 %30 = phi i8 [ %27, %lor.lhs.false ], [ %add, %if.then39 ] %conv46 = zext i8 %30 to i64 %sub = add nsw i64 %conv46, -97 %arrayidx48 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %sub %31 = load i32, ptr %arrayidx48, align 4, !tbaa !5 %add49 = add nsw i32 %31, 1 store i32 %add49, ptr %arrayidx48, align 4, !tbaa !5 br label %for.inc51 for.inc51: ; preds = %lor.lhs.false, %if.end %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1 %exitcond.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count br i1 %exitcond.not, label %for.cond54.preheader.loopexit, label %for.body7, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !10}
#include <stdio.h> int main(void) { int i; int a[26] = {0}; char x[1201]; while ( scanf("%s", x) != EOF){ for (i=0; x[i]!='\0'; i++) { if ('a'<=x[i] && x[i]<='z') { a[x[i]-'a']++; } if ('A'<=x[i] && x[i]<='Z') { a[x[i]-'A']++; } } } for(i=0; i<26; i++){ printf("%c : %d\n", i+'a', a[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154443/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154443/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\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 %x = alloca [1201 x i8], align 16 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %a) #4 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 1201, ptr nonnull %x) #4 %call68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %cmp.not69 = icmp eq i32 %call68, -1 br i1 %cmp.not69, label %for.cond39.preheader, label %for.cond.preheader while.cond.loopexit: ; preds = %for.inc, %for.cond.preheader %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond39.preheader.loopexit, label %for.cond.preheader, !llvm.loop !5 for.cond.preheader: ; preds = %entry, %while.cond.loopexit %0 = load i8, ptr %x, align 16, !tbaa !7 %cmp1.not65 = icmp eq i8 %0, 0 br i1 %cmp1.not65, label %while.cond.loopexit, label %for.body for.cond39.preheader.loopexit: ; preds = %while.cond.loopexit %.pre = load i32, ptr %a, align 16, !tbaa !10 %arrayidx44.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 1 %.pre75 = load i32, ptr %arrayidx44.1.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 2 %.pre76 = load i32, ptr %arrayidx44.2.phi.trans.insert, align 8, !tbaa !10 %arrayidx44.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 3 %.pre77 = load i32, ptr %arrayidx44.3.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 4 %.pre78 = load i32, ptr %arrayidx44.4.phi.trans.insert, align 16, !tbaa !10 %arrayidx44.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 5 %.pre79 = load i32, ptr %arrayidx44.5.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 6 %.pre80 = load i32, ptr %arrayidx44.6.phi.trans.insert, align 8, !tbaa !10 %arrayidx44.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 7 %.pre81 = load i32, ptr %arrayidx44.7.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 8 %.pre82 = load i32, ptr %arrayidx44.8.phi.trans.insert, align 16, !tbaa !10 %arrayidx44.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 9 %.pre83 = load i32, ptr %arrayidx44.9.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 10 %.pre84 = load i32, ptr %arrayidx44.10.phi.trans.insert, align 8, !tbaa !10 %arrayidx44.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 11 %.pre85 = load i32, ptr %arrayidx44.11.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 12 %.pre86 = load i32, ptr %arrayidx44.12.phi.trans.insert, align 16, !tbaa !10 %arrayidx44.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 13 %.pre87 = load i32, ptr %arrayidx44.13.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 14 %.pre88 = load i32, ptr %arrayidx44.14.phi.trans.insert, align 8, !tbaa !10 %arrayidx44.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 15 %.pre89 = load i32, ptr %arrayidx44.15.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 16 %.pre90 = load i32, ptr %arrayidx44.16.phi.trans.insert, align 16, !tbaa !10 %arrayidx44.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 17 %.pre91 = load i32, ptr %arrayidx44.17.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 18 %.pre92 = load i32, ptr %arrayidx44.18.phi.trans.insert, align 8, !tbaa !10 %arrayidx44.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 19 %.pre93 = load i32, ptr %arrayidx44.19.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 20 %.pre94 = load i32, ptr %arrayidx44.20.phi.trans.insert, align 16, !tbaa !10 %arrayidx44.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 21 %.pre95 = load i32, ptr %arrayidx44.21.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 22 %.pre96 = load i32, ptr %arrayidx44.22.phi.trans.insert, align 8, !tbaa !10 %arrayidx44.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 23 %.pre97 = load i32, ptr %arrayidx44.23.phi.trans.insert, align 4, !tbaa !10 %arrayidx44.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 24 %.pre98 = load i32, ptr %arrayidx44.24.phi.trans.insert, align 16, !tbaa !10 %arrayidx44.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 25 %.pre99 = load i32, ptr %arrayidx44.25.phi.trans.insert, align 4, !tbaa !10 br label %for.cond39.preheader for.cond39.preheader: ; preds = %for.cond39.preheader.loopexit, %entry %1 = phi i32 [ %.pre99, %for.cond39.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre98, %for.cond39.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre97, %for.cond39.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre96, %for.cond39.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre95, %for.cond39.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre94, %for.cond39.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre93, %for.cond39.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre92, %for.cond39.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre91, %for.cond39.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre90, %for.cond39.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre89, %for.cond39.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre88, %for.cond39.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre87, %for.cond39.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre86, %for.cond39.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre85, %for.cond39.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre84, %for.cond39.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre83, %for.cond39.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre82, %for.cond39.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre81, %for.cond39.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre80, %for.cond39.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre79, %for.cond39.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre78, %for.cond39.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre77, %for.cond39.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre76, %for.cond39.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre75, %for.cond39.preheader.loopexit ], [ 0, %entry ] %26 = phi i32 [ %.pre, %for.cond39.preheader.loopexit ], [ 0, %entry ] %call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %26) %call45.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %25) %call45.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %24) %call45.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %23) %call45.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %22) %call45.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %21) %call45.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %20) %call45.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %19) %call45.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %18) %call45.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %17) %call45.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %16) %call45.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %15) %call45.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %14) %call45.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %13) %call45.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %12) %call45.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %11) %call45.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %10) %call45.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %9) %call45.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %8) %call45.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %7) %call45.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %6) %call45.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %5) %call45.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %4) %call45.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %3) %call45.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %2) %call45.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 1201, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %a) #4 ret i32 0 for.body: ; preds = %for.cond.preheader, %for.inc %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %for.cond.preheader ] %27 = phi i8 [ %31, %for.inc ], [ %0, %for.cond.preheader ] %conv67 = sext i8 %27 to i64 %28 = add i8 %27, -97 %or.cond = icmp ult i8 %28, 26 br i1 %or.cond, label %for.inc.sink.split, label %if.end if.end: ; preds = %for.body %29 = add i8 %27, -65 %or.cond60 = icmp ult i8 %29, 26 br i1 %or.cond60, label %for.inc.sink.split, label %for.inc for.inc.sink.split: ; preds = %if.end, %for.body %.sink = phi i64 [ 4294967199, %for.body ], [ 4294967231, %if.end ] %sub33 = add nsw i64 %.sink, %conv67 %idxprom34 = and i64 %sub33, 4294967295 %arrayidx35 = getelementptr inbounds [26 x i32], ptr %a, i64 0, i64 %idxprom34 %30 = load i32, ptr %arrayidx35, align 4, !tbaa !10 %inc = add nsw i32 %30, 1 store i32 %inc, ptr %arrayidx35, align 4, !tbaa !10 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %if.end %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx = getelementptr inbounds [1201 x i8], ptr %x, i64 0, i64 %indvars.iv.next %31 = load i8, ptr %arrayidx, align 1, !tbaa !7 %cmp1.not = icmp eq i8 %31, 0 br i1 %cmp1.not, label %while.cond.loopexit, label %for.body, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!11, !11, i64 0} !11 = !{!"int", !8, i64 0} !12 = distinct !{!12, !6}
#include <stdio.h> #include <ctype.h> #define N 26 #define S 32 int main(void) { int i; int c[N]={0}; char ch; while(scanf("%c", &ch) != EOF){ if(isalpha(ch)){ c[(ch-'A')%S]++; } } for(i=0; i<N; i++){ printf("%c : %d\n", 'a'+i, c[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154487/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154487/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca [26 x i32], align 16 %ch = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %c) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %c, i8 0, i64 104, i1 false) call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #5 %call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not17 = icmp eq i32 %call16, -1 br i1 %cmp.not17, label %for.cond.preheader, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %call1 = tail call ptr @__ctype_b_loc() #6 br label %while.body for.cond.preheader.loopexit: ; preds = %if.end %.pre = load i32, ptr %c, align 16, !tbaa !5 %arrayidx9.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 1 %.pre21 = load i32, ptr %arrayidx9.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 2 %.pre22 = load i32, ptr %arrayidx9.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx9.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 3 %.pre23 = load i32, ptr %arrayidx9.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 4 %.pre24 = load i32, ptr %arrayidx9.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx9.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 5 %.pre25 = load i32, ptr %arrayidx9.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 6 %.pre26 = load i32, ptr %arrayidx9.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx9.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 7 %.pre27 = load i32, ptr %arrayidx9.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 8 %.pre28 = load i32, ptr %arrayidx9.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx9.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 9 %.pre29 = load i32, ptr %arrayidx9.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 10 %.pre30 = load i32, ptr %arrayidx9.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx9.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 11 %.pre31 = load i32, ptr %arrayidx9.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 12 %.pre32 = load i32, ptr %arrayidx9.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx9.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 13 %.pre33 = load i32, ptr %arrayidx9.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 14 %.pre34 = load i32, ptr %arrayidx9.14.phi.trans.insert, align 8, !tbaa !5 %arrayidx9.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 15 %.pre35 = load i32, ptr %arrayidx9.15.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 16 %.pre36 = load i32, ptr %arrayidx9.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx9.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 17 %.pre37 = load i32, ptr %arrayidx9.17.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 18 %.pre38 = load i32, ptr %arrayidx9.18.phi.trans.insert, align 8, !tbaa !5 %arrayidx9.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 19 %.pre39 = load i32, ptr %arrayidx9.19.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 20 %.pre40 = load i32, ptr %arrayidx9.20.phi.trans.insert, align 16, !tbaa !5 %arrayidx9.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 21 %.pre41 = load i32, ptr %arrayidx9.21.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 22 %.pre42 = load i32, ptr %arrayidx9.22.phi.trans.insert, align 8, !tbaa !5 %arrayidx9.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 23 %.pre43 = load i32, ptr %arrayidx9.23.phi.trans.insert, align 4, !tbaa !5 %arrayidx9.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 24 %.pre44 = load i32, ptr %arrayidx9.24.phi.trans.insert, align 16, !tbaa !5 %arrayidx9.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 25 %.pre45 = load i32, ptr %arrayidx9.25.phi.trans.insert, align 4, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %0 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre35, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre34, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre33, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre32, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre31, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre30, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre29, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre28, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre27, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre26, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre25, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre24, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre23, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre22, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre21, %for.cond.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25) %call10.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24) %call10.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23) %call10.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22) %call10.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21) %call10.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20) %call10.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19) %call10.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18) %call10.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17) %call10.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16) %call10.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15) %call10.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14) %call10.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13) %call10.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12) %call10.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11) %call10.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10) %call10.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9) %call10.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8) %call10.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7) %call10.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6) %call10.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5) %call10.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4) %call10.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3) %call10.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2) %call10.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1) %call10.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #5 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %c) #5 ret i32 0 while.body: ; preds = %while.body.lr.ph, %if.end %26 = load ptr, ptr %call1, align 8, !tbaa !9 %27 = load i8, ptr %ch, align 1, !tbaa !11 %idxprom = sext i8 %27 to i64 %arrayidx = getelementptr inbounds i16, ptr %26, i64 %idxprom %28 = load i16, ptr %arrayidx, align 2, !tbaa !12 %29 = and i16 %28, 1024 %tobool.not = icmp eq i16 %29, 0 br i1 %tobool.not, label %if.end, label %if.then if.then: ; preds = %while.body %conv = sext i8 %27 to i16 %sub = add nsw i16 %conv, -65 %rem15 = srem i16 %sub, 32 %idxprom4 = sext i16 %rem15 to i64 %arrayidx5 = getelementptr inbounds [26 x i32], ptr %c, i64 0, i64 %idxprom4 %30 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %inc = add nsw i32 %30, 1 store i32 %inc, ptr %arrayidx5, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %while.body %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = !{!7, !7, i64 0} !12 = !{!13, !13, i64 0} !13 = !{!"short", !7, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { long max,t,a,b,c,n,s; scanf("%ld",&t); while(t--) { scanf("%ld%ld%ld%ld",&a,&b,&c,&n); max=0; if (a>max) max=a; if (b>max) max=b; if (c>max) max=c; s=3*max-a-b-c; n=n-s; if (n<0) { printf("NO\n"); continue; } if (n%3==0) printf("YES\n"); else printf("NO\n"); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15453/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15453/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [13 x i8] c"%ld%ld%ld%ld\00", align 1 @str.4 = private unnamed_addr constant [4 x i8] c"YES\00", align 1 @str.5 = private unnamed_addr constant [3 x i8] c"NO\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %t = alloca i64, align 8 %a = alloca i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %t) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #5 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t) %0 = load i64, ptr %t, align 8, !tbaa !5 %dec27 = add nsw i64 %0, -1 store i64 %dec27, ptr %t, align 8, !tbaa !5 %tobool.not28 = icmp eq i64 %0, 0 br i1 %tobool.not28, label %while.end, label %while.body while.body: ; preds = %entry, %while.cond.backedge %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c, ptr noundef nonnull %n) %1 = load i64, ptr %a, align 8, !tbaa !5 %2 = load i64, ptr %b, align 8, !tbaa !5 %spec.select = call i64 @llvm.smax.i64(i64 %1, i64 %2) %3 = load i64, ptr %c, align 8, !tbaa !5 %max.1 = call i64 @llvm.smax.i64(i64 %spec.select, i64 %3) %max.2 = call i64 @llvm.smax.i64(i64 %max.1, i64 0) %mul.neg = mul i64 %max.2, -3 %4 = add i64 %2, %1 %5 = add i64 %4, %3 %6 = load i64, ptr %n, align 8, !tbaa !5 %sub9.neg = add i64 %5, %6 %sub10 = add i64 %sub9.neg, %mul.neg store i64 %sub10, ptr %n, align 8, !tbaa !5 %cmp11 = icmp slt i64 %sub10, 0 br i1 %cmp11, label %while.cond.backedge, label %if.end14 while.cond.backedge: ; preds = %while.body, %if.end14 %str.4.sink = phi ptr [ %str.4.str, %if.end14 ], [ @str.5, %while.body ] %puts25 = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.sink) %7 = load i64, ptr %t, align 8, !tbaa !5 %dec = add nsw i64 %7, -1 store i64 %dec, ptr %t, align 8, !tbaa !5 %tobool.not = icmp eq i64 %7, 0 br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9 if.end14: ; preds = %while.body %rem = urem i64 %sub10, 3 %cmp15 = icmp eq i64 %rem, 0 %str.4.str = select i1 %cmp15, ptr @str.4, ptr @str.5 br label %while.cond.backedge while.end: ; preds = %while.cond.backedge, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #5 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 %t) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int c,i,j,s,k,out[26]; for(i=0;i<26;i++) out[i]=0; while((c=getchar())!=EOF){ for(j='a',k='A',s=0;j<='z';j++,k++,s++){ if(j==c || k==c) out[s]+=1; } } for(i='a',j=0;j<26;i++,j++) printf("%c : %d\n",i,out[j]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154573/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154573/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c : %d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i40 = tail call i32 @getc(ptr noundef %0) %cmp1.not41 = icmp eq i32 %call.i40, -1 br i1 %cmp1.not41, label %for.cond14.preheader, label %vector.ph vector.ph: ; preds = %entry, %vector.ph %out.sroa.0.0 = phi i32 [ %out.sroa.0.1, %vector.ph ], [ 0, %entry ] %out.sroa.6.0 = phi i32 [ %out.sroa.6.1, %vector.ph ], [ 0, %entry ] %out.sroa.9.0 = phi i32 [ %out.sroa.9.1, %vector.ph ], [ 0, %entry ] %out.sroa.12.0 = phi i32 [ %out.sroa.12.1, %vector.ph ], [ 0, %entry ] %out.sroa.15.0 = phi i32 [ %out.sroa.15.1, %vector.ph ], [ 0, %entry ] %out.sroa.18.0 = phi i32 [ %out.sroa.18.1, %vector.ph ], [ 0, %entry ] %out.sroa.21.0 = phi i32 [ %out.sroa.21.1, %vector.ph ], [ 0, %entry ] %out.sroa.24.0 = phi i32 [ %out.sroa.24.1, %vector.ph ], [ 0, %entry ] %out.sroa.27.0 = phi i32 [ %out.sroa.27.1, %vector.ph ], [ 0, %entry ] %out.sroa.30.0 = phi i32 [ %out.sroa.30.1, %vector.ph ], [ 0, %entry ] %out.sroa.33.0 = phi i32 [ %out.sroa.33.1, %vector.ph ], [ 0, %entry ] %out.sroa.36.0 = phi i32 [ %out.sroa.36.1, %vector.ph ], [ 0, %entry ] %out.sroa.39.0 = phi i32 [ %out.sroa.39.1, %vector.ph ], [ 0, %entry ] %out.sroa.42.0 = phi i32 [ %out.sroa.42.1, %vector.ph ], [ 0, %entry ] %out.sroa.45.0 = phi i32 [ %out.sroa.45.1, %vector.ph ], [ 0, %entry ] %out.sroa.48.0 = phi i32 [ %out.sroa.48.1, %vector.ph ], [ 0, %entry ] %out.sroa.51.0 = phi i32 [ %out.sroa.51.1, %vector.ph ], [ 0, %entry ] %out.sroa.54.0 = phi i32 [ %out.sroa.54.1, %vector.ph ], [ 0, %entry ] %out.sroa.57.0 = phi i32 [ %out.sroa.57.1, %vector.ph ], [ 0, %entry ] %out.sroa.60.0 = phi i32 [ %out.sroa.60.1, %vector.ph ], [ 0, %entry ] %out.sroa.63.0 = phi i32 [ %out.sroa.63.1, %vector.ph ], [ 0, %entry ] %out.sroa.66.0 = phi i32 [ %out.sroa.66.1, %vector.ph ], [ 0, %entry ] %out.sroa.69.0 = phi i32 [ %out.sroa.69.1, %vector.ph ], [ 0, %entry ] %out.sroa.72.0 = phi i32 [ %out.sroa.72.1, %vector.ph ], [ 0, %entry ] %out.sroa.75.0 = phi i32 [ %out.sroa.75.1, %vector.ph ], [ 0, %entry ] %out.sroa.78.0 = phi i32 [ %out.sroa.78.1, %vector.ph ], [ 0, %entry ] %call.i42 = phi i32 [ %call.i, %vector.ph ], [ %call.i40, %entry ] %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %call.i42, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer %1 = icmp eq <4 x i32> %broadcast.splat, <i32 97, i32 98, i32 99, i32 100> %2 = icmp eq <4 x i32> %broadcast.splat, <i32 65, i32 66, i32 67, i32 68> %3 = or <4 x i1> %1, %2 %4 = extractelement <4 x i1> %3, i64 0 %5 = add nsw i32 %out.sroa.0.0, 1 %out.sroa.0.1 = select i1 %4, i32 %5, i32 %out.sroa.0.0 %6 = extractelement <4 x i1> %3, i64 1 %7 = add nsw i32 %out.sroa.6.0, 1 %out.sroa.6.1 = select i1 %6, i32 %7, i32 %out.sroa.6.0 %8 = extractelement <4 x i1> %3, i64 2 %9 = add nsw i32 %out.sroa.9.0, 1 %out.sroa.9.1 = select i1 %8, i32 %9, i32 %out.sroa.9.0 %10 = extractelement <4 x i1> %3, i64 3 %11 = add nsw i32 %out.sroa.12.0, 1 %out.sroa.12.1 = select i1 %10, i32 %11, i32 %out.sroa.12.0 %12 = icmp eq <4 x i32> %broadcast.splat, <i32 101, i32 102, i32 103, i32 104> %13 = icmp eq <4 x i32> %broadcast.splat, <i32 69, i32 70, i32 71, i32 72> %14 = or <4 x i1> %12, %13 %15 = extractelement <4 x i1> %14, i64 0 %16 = add nsw i32 %out.sroa.15.0, 1 %out.sroa.15.1 = select i1 %15, i32 %16, i32 %out.sroa.15.0 %17 = extractelement <4 x i1> %14, i64 1 %18 = add nsw i32 %out.sroa.18.0, 1 %out.sroa.18.1 = select i1 %17, i32 %18, i32 %out.sroa.18.0 %19 = extractelement <4 x i1> %14, i64 2 %20 = add nsw i32 %out.sroa.21.0, 1 %out.sroa.21.1 = select i1 %19, i32 %20, i32 %out.sroa.21.0 %21 = extractelement <4 x i1> %14, i64 3 %22 = add nsw i32 %out.sroa.24.0, 1 %out.sroa.24.1 = select i1 %21, i32 %22, i32 %out.sroa.24.0 %23 = icmp eq <4 x i32> %broadcast.splat, <i32 105, i32 106, i32 107, i32 108> %24 = icmp eq <4 x i32> %broadcast.splat, <i32 73, i32 74, i32 75, i32 76> %25 = or <4 x i1> %23, %24 %26 = extractelement <4 x i1> %25, i64 0 %27 = add nsw i32 %out.sroa.27.0, 1 %out.sroa.27.1 = select i1 %26, i32 %27, i32 %out.sroa.27.0 %28 = extractelement <4 x i1> %25, i64 1 %29 = add nsw i32 %out.sroa.30.0, 1 %out.sroa.30.1 = select i1 %28, i32 %29, i32 %out.sroa.30.0 %30 = extractelement <4 x i1> %25, i64 2 %31 = add nsw i32 %out.sroa.33.0, 1 %out.sroa.33.1 = select i1 %30, i32 %31, i32 %out.sroa.33.0 %32 = extractelement <4 x i1> %25, i64 3 %33 = add nsw i32 %out.sroa.36.0, 1 %out.sroa.36.1 = select i1 %32, i32 %33, i32 %out.sroa.36.0 %34 = icmp eq <4 x i32> %broadcast.splat, <i32 109, i32 110, i32 111, i32 112> %35 = icmp eq <4 x i32> %broadcast.splat, <i32 77, i32 78, i32 79, i32 80> %36 = or <4 x i1> %34, %35 %37 = extractelement <4 x i1> %36, i64 0 %38 = add nsw i32 %out.sroa.39.0, 1 %out.sroa.39.1 = select i1 %37, i32 %38, i32 %out.sroa.39.0 %39 = extractelement <4 x i1> %36, i64 1 %40 = add nsw i32 %out.sroa.42.0, 1 %out.sroa.42.1 = select i1 %39, i32 %40, i32 %out.sroa.42.0 %41 = extractelement <4 x i1> %36, i64 2 %42 = add nsw i32 %out.sroa.45.0, 1 %out.sroa.45.1 = select i1 %41, i32 %42, i32 %out.sroa.45.0 %43 = extractelement <4 x i1> %36, i64 3 %44 = add nsw i32 %out.sroa.48.0, 1 %out.sroa.48.1 = select i1 %43, i32 %44, i32 %out.sroa.48.0 %45 = icmp eq <4 x i32> %broadcast.splat, <i32 113, i32 114, i32 115, i32 116> %46 = icmp eq <4 x i32> %broadcast.splat, <i32 81, i32 82, i32 83, i32 84> %47 = or <4 x i1> %45, %46 %48 = extractelement <4 x i1> %47, i64 0 %49 = add nsw i32 %out.sroa.51.0, 1 %out.sroa.51.1 = select i1 %48, i32 %49, i32 %out.sroa.51.0 %50 = extractelement <4 x i1> %47, i64 1 %51 = add nsw i32 %out.sroa.54.0, 1 %out.sroa.54.1 = select i1 %50, i32 %51, i32 %out.sroa.54.0 %52 = extractelement <4 x i1> %47, i64 2 %53 = add nsw i32 %out.sroa.57.0, 1 %out.sroa.57.1 = select i1 %52, i32 %53, i32 %out.sroa.57.0 %54 = extractelement <4 x i1> %47, i64 3 %55 = add nsw i32 %out.sroa.60.0, 1 %out.sroa.60.1 = select i1 %54, i32 %55, i32 %out.sroa.60.0 %56 = icmp eq <4 x i32> %broadcast.splat, <i32 117, i32 118, i32 119, i32 120> %57 = icmp eq <4 x i32> %broadcast.splat, <i32 85, i32 86, i32 87, i32 88> %58 = or <4 x i1> %56, %57 %59 = extractelement <4 x i1> %58, i64 0 %60 = add nsw i32 %out.sroa.63.0, 1 %out.sroa.63.1 = select i1 %59, i32 %60, i32 %out.sroa.63.0 %61 = extractelement <4 x i1> %58, i64 1 %62 = add nsw i32 %out.sroa.66.0, 1 %out.sroa.66.1 = select i1 %61, i32 %62, i32 %out.sroa.66.0 %63 = extractelement <4 x i1> %58, i64 2 %64 = add nsw i32 %out.sroa.69.0, 1 %out.sroa.69.1 = select i1 %63, i32 %64, i32 %out.sroa.69.0 %65 = extractelement <4 x i1> %58, i64 3 %66 = add nsw i32 %out.sroa.72.0, 1 %out.sroa.72.1 = select i1 %65, i32 %66, i32 %out.sroa.72.0 %67 = and i32 %call.i42, -33 %or.cond = icmp eq i32 %67, 89 %add = add nsw i32 %out.sroa.75.0, 1 %out.sroa.75.1 = select i1 %or.cond, i32 %add, i32 %out.sroa.75.0 %68 = and i32 %call.i42, -33 %or.cond.1 = icmp eq i32 %68, 90 %add.1 = add nsw i32 %out.sroa.78.0, 1 %out.sroa.78.1 = select i1 %or.cond.1, i32 %add.1, i32 %out.sroa.78.0 %69 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %69) %cmp1.not = icmp eq i32 %call.i, -1 br i1 %cmp1.not, label %for.cond14.preheader, label %vector.ph, !llvm.loop !9 for.cond14.preheader: ; preds = %vector.ph, %entry %70 = phi i32 [ 0, %entry ], [ %out.sroa.78.1, %vector.ph ] %71 = phi i32 [ 0, %entry ], [ %out.sroa.75.1, %vector.ph ] %72 = phi i32 [ 0, %entry ], [ %out.sroa.72.1, %vector.ph ] %73 = phi i32 [ 0, %entry ], [ %out.sroa.69.1, %vector.ph ] %74 = phi i32 [ 0, %entry ], [ %out.sroa.66.1, %vector.ph ] %75 = phi i32 [ 0, %entry ], [ %out.sroa.63.1, %vector.ph ] %76 = phi i32 [ 0, %entry ], [ %out.sroa.60.1, %vector.ph ] %77 = phi i32 [ 0, %entry ], [ %out.sroa.57.1, %vector.ph ] %78 = phi i32 [ 0, %entry ], [ %out.sroa.54.1, %vector.ph ] %79 = phi i32 [ 0, %entry ], [ %out.sroa.51.1, %vector.ph ] %80 = phi i32 [ 0, %entry ], [ %out.sroa.48.1, %vector.ph ] %81 = phi i32 [ 0, %entry ], [ %out.sroa.45.1, %vector.ph ] %82 = phi i32 [ 0, %entry ], [ %out.sroa.42.1, %vector.ph ] %83 = phi i32 [ 0, %entry ], [ %out.sroa.39.1, %vector.ph ] %84 = phi i32 [ 0, %entry ], [ %out.sroa.36.1, %vector.ph ] %85 = phi i32 [ 0, %entry ], [ %out.sroa.33.1, %vector.ph ] %86 = phi i32 [ 0, %entry ], [ %out.sroa.30.1, %vector.ph ] %87 = phi i32 [ 0, %entry ], [ %out.sroa.27.1, %vector.ph ] %88 = phi i32 [ 0, %entry ], [ %out.sroa.24.1, %vector.ph ] %89 = phi i32 [ 0, %entry ], [ %out.sroa.21.1, %vector.ph ] %90 = phi i32 [ 0, %entry ], [ %out.sroa.18.1, %vector.ph ] %91 = phi i32 [ 0, %entry ], [ %out.sroa.15.1, %vector.ph ] %92 = phi i32 [ 0, %entry ], [ %out.sroa.12.1, %vector.ph ] %93 = phi i32 [ 0, %entry ], [ %out.sroa.9.1, %vector.ph ] %94 = phi i32 [ 0, %entry ], [ %out.sroa.6.1, %vector.ph ] %95 = phi i32 [ 0, %entry ], [ %out.sroa.0.1, %vector.ph ] %call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %95) %call19.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %94) %call19.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %93) %call19.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %92) %call19.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %91) %call19.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %90) %call19.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %89) %call19.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %88) %call19.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %87) %call19.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %86) %call19.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %85) %call19.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %84) %call19.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %83) %call19.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %82) %call19.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %81) %call19.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %80) %call19.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %79) %call19.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %78) %call19.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %77) %call19.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %76) %call19.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %75) %call19.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %74) %call19.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %73) %call19.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %72) %call19.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %71) %call19.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %70) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<ctype.h> int main(void) { int moji; int count[26]={0}; while( (moji=getchar())!=EOF ) { if(isupper(moji)) moji = tolower(moji); count[moji-'a']++; } for(int i=0;i<26;i++) { printf("%c : %d\n", 'a' + i, count[i]); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154630/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154630/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c : %d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %count = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %count) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %count, i8 0, i64 104, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i31 = tail call i32 @getc(ptr noundef %0) %cmp.not32 = icmp eq i32 %call.i31, -1 br i1 %cmp.not32, label %for.cond.preheader, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %call1 = tail call ptr @__ctype_b_loc() #6 br label %while.body for.cond.preheader.loopexit: ; preds = %if.end11 %.pre = load i32, ptr %count, align 16, !tbaa !9 %arrayidx17.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 1 %.pre37 = load i32, ptr %arrayidx17.1.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 2 %.pre38 = load i32, ptr %arrayidx17.2.phi.trans.insert, align 8, !tbaa !9 %arrayidx17.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 3 %.pre39 = load i32, ptr %arrayidx17.3.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 4 %.pre40 = load i32, ptr %arrayidx17.4.phi.trans.insert, align 16, !tbaa !9 %arrayidx17.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 5 %.pre41 = load i32, ptr %arrayidx17.5.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 6 %.pre42 = load i32, ptr %arrayidx17.6.phi.trans.insert, align 8, !tbaa !9 %arrayidx17.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 7 %.pre43 = load i32, ptr %arrayidx17.7.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 8 %.pre44 = load i32, ptr %arrayidx17.8.phi.trans.insert, align 16, !tbaa !9 %arrayidx17.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 9 %.pre45 = load i32, ptr %arrayidx17.9.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 10 %.pre46 = load i32, ptr %arrayidx17.10.phi.trans.insert, align 8, !tbaa !9 %arrayidx17.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 11 %.pre47 = load i32, ptr %arrayidx17.11.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 12 %.pre48 = load i32, ptr %arrayidx17.12.phi.trans.insert, align 16, !tbaa !9 %arrayidx17.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 13 %.pre49 = load i32, ptr %arrayidx17.13.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 14 %.pre50 = load i32, ptr %arrayidx17.14.phi.trans.insert, align 8, !tbaa !9 %arrayidx17.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 15 %.pre51 = load i32, ptr %arrayidx17.15.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 16 %.pre52 = load i32, ptr %arrayidx17.16.phi.trans.insert, align 16, !tbaa !9 %arrayidx17.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 17 %.pre53 = load i32, ptr %arrayidx17.17.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 18 %.pre54 = load i32, ptr %arrayidx17.18.phi.trans.insert, align 8, !tbaa !9 %arrayidx17.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 19 %.pre55 = load i32, ptr %arrayidx17.19.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 20 %.pre56 = load i32, ptr %arrayidx17.20.phi.trans.insert, align 16, !tbaa !9 %arrayidx17.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 21 %.pre57 = load i32, ptr %arrayidx17.21.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 22 %.pre58 = load i32, ptr %arrayidx17.22.phi.trans.insert, align 8, !tbaa !9 %arrayidx17.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 23 %.pre59 = load i32, ptr %arrayidx17.23.phi.trans.insert, align 4, !tbaa !9 %arrayidx17.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 24 %.pre60 = load i32, ptr %arrayidx17.24.phi.trans.insert, align 16, !tbaa !9 %arrayidx17.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 25 %.pre61 = load i32, ptr %arrayidx17.25.phi.trans.insert, align 4, !tbaa !9 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %1 = phi i32 [ %.pre61, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ] %26 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] %call18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %26) %call18.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %25) %call18.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %24) %call18.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %23) %call18.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %22) %call18.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %21) %call18.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %20) %call18.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %19) %call18.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %18) %call18.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %17) %call18.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %16) %call18.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %15) %call18.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %14) %call18.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %13) %call18.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %12) %call18.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %11) %call18.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %10) %call18.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %9) %call18.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %8) %call18.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %7) %call18.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %6) %call18.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %5) %call18.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %4) %call18.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %3) %call18.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %2) %call18.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %1) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %count) #5 ret i32 0 while.body: ; preds = %while.body.lr.ph, %if.end11 %call.i33 = phi i32 [ %call.i31, %while.body.lr.ph ], [ %call.i, %if.end11 ] %27 = load ptr, ptr %call1, align 8, !tbaa !5 %idxprom = sext i32 %call.i33 to i64 %arrayidx = getelementptr inbounds i16, ptr %27, i64 %idxprom %28 = load i16, ptr %arrayidx, align 2, !tbaa !11 %29 = and i16 %28, 256 %tobool.not = icmp ne i16 %29, 0 %30 = add i32 %call.i33, 128 %or.cond.i = icmp ult i32 %30, 384 %or.cond = and i1 %tobool.not, %or.cond.i br i1 %or.cond, label %if.end11.sink.split, label %if.end11 if.end11.sink.split: ; preds = %while.body %call.i30 = tail call ptr @__ctype_tolower_loc() #6 %31 = load ptr, ptr %call.i30, align 8, !tbaa !5 %arrayidx.i = getelementptr inbounds i32, ptr %31, i64 %idxprom %32 = load i32, ptr %arrayidx.i, align 4, !tbaa !9 br label %if.end11 if.end11: ; preds = %if.end11.sink.split, %while.body %moji.0 = phi i32 [ %call.i33, %while.body ], [ %32, %if.end11.sink.split ] %sub = add nsw i32 %moji.0, -97 %idxprom12 = sext i32 %sub to i64 %arrayidx13 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 %idxprom12 %33 = load i32, ptr %arrayidx13, align 4, !tbaa !9 %inc = add nsw i32 %33, 1 store i32 %inc, ptr %arrayidx13, align 4, !tbaa !9 %34 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %34) %cmp.not = icmp eq i32 %call.i, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !13 } ; 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 nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = !{!12, !12, i64 0} !12 = !{!"short", !7, i64 0} !13 = distinct !{!13, !14} !14 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int count[26]={},num,i; char ch; while(scanf("%c",&ch)!=EOF) { if(ch>='A' && ch<='Z') { num=ch-'A'; count[num]++; } else if(ch>='a' && ch<='z') { num=ch-'a'; count[num]++; } } for(i=97;i<=122;i++) { printf("%c : %d\n",i,count[i-97]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154674/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154674/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %count = alloca [26 x i32], align 16 %ch = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %count) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %count, i8 0, i64 104, i1 false) call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #4 %call33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not34 = icmp eq i32 %call33, -1 br i1 %cmp.not34, label %for.cond.preheader, label %while.body for.cond.preheader.loopexit: ; preds = %if.end20 %.pre = load i32, ptr %count, align 16, !tbaa !5 %arrayidx25.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 1 %.pre38 = load i32, ptr %arrayidx25.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 2 %.pre39 = load i32, ptr %arrayidx25.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 3 %.pre40 = load i32, ptr %arrayidx25.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 4 %.pre41 = load i32, ptr %arrayidx25.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 5 %.pre42 = load i32, ptr %arrayidx25.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 6 %.pre43 = load i32, ptr %arrayidx25.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 7 %.pre44 = load i32, ptr %arrayidx25.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 8 %.pre45 = load i32, ptr %arrayidx25.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 9 %.pre46 = load i32, ptr %arrayidx25.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 10 %.pre47 = load i32, ptr %arrayidx25.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 11 %.pre48 = load i32, ptr %arrayidx25.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 12 %.pre49 = load i32, ptr %arrayidx25.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 13 %.pre50 = load i32, ptr %arrayidx25.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 14 %.pre51 = load i32, ptr %arrayidx25.14.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 15 %.pre52 = load i32, ptr %arrayidx25.15.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 16 %.pre53 = load i32, ptr %arrayidx25.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 17 %.pre54 = load i32, ptr %arrayidx25.17.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 18 %.pre55 = load i32, ptr %arrayidx25.18.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 19 %.pre56 = load i32, ptr %arrayidx25.19.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 20 %.pre57 = load i32, ptr %arrayidx25.20.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 21 %.pre58 = load i32, ptr %arrayidx25.21.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 22 %.pre59 = load i32, ptr %arrayidx25.22.phi.trans.insert, align 8, !tbaa !5 %arrayidx25.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 23 %.pre60 = load i32, ptr %arrayidx25.23.phi.trans.insert, align 4, !tbaa !5 %arrayidx25.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 24 %.pre61 = load i32, ptr %arrayidx25.24.phi.trans.insert, align 16, !tbaa !5 %arrayidx25.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 25 %.pre62 = load i32, ptr %arrayidx25.25.phi.trans.insert, align 4, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %0 = phi i32 [ %.pre62, %for.cond.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre61, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre60, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre59, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre58, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre57, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] %call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25) %call26.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24) %call26.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23) %call26.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22) %call26.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21) %call26.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20) %call26.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19) %call26.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18) %call26.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17) %call26.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16) %call26.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15) %call26.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14) %call26.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13) %call26.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12) %call26.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11) %call26.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10) %call26.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9) %call26.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8) %call26.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7) %call26.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6) %call26.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5) %call26.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4) %call26.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3) %call26.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2) %call26.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1) %call26.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #4 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %count) #4 ret i32 0 while.body: ; preds = %entry, %if.end20 %26 = load i8, ptr %ch, align 1 %conv = sext i8 %26 to i64 %27 = add i8 %26, -65 %or.cond = icmp ult i8 %27, 26 br i1 %or.cond, label %if.end20.sink.split, label %if.else if.else: ; preds = %while.body %28 = add i8 %26, -97 %or.cond28 = icmp ult i8 %28, 26 br i1 %or.cond28, label %if.end20.sink.split, label %if.end20 if.end20.sink.split: ; preds = %if.else, %while.body %.sink = phi i64 [ 4294967231, %while.body ], [ 4294967199, %if.else ] %sub = add nsw i64 %.sink, %conv %idxprom = and i64 %sub, 4294967295 %arrayidx = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 %idxprom %29 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc19 = add nsw i32 %29, 1 store i32 %inc19, ptr %arrayidx, align 4, !tbaa !5 br label %if.end20 if.end20: ; preds = %if.end20.sink.split, %if.else %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree 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"}
#include <stdio.h> #include <ctype.h> int main(){ int count[26]={0}; char ch; int i, num; while(scanf("%c", &ch)!=EOF){ if(islower(ch)){ num=ch-'a'; }else if(isupper(ch)){ num=ch-'A'; }else{ continue; } count[num]++; } for(i=0;i<26;i++){ printf("%c : %d\n", 'a'+i, count[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154717/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154717/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %count = alloca [26 x i32], align 16 %ch = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %count) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %count, i8 0, i64 104, i1 false) call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #5 %call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not28 = icmp eq i32 %call27, -1 br i1 %cmp.not28, label %for.cond.preheader, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %call1 = tail call ptr @__ctype_b_loc() #6 br label %while.body for.cond.preheader.loopexit: ; preds = %while.cond.backedge %.pre = load i32, ptr %count, align 16, !tbaa !5 %arrayidx21.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 1 %.pre32 = load i32, ptr %arrayidx21.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 2 %.pre33 = load i32, ptr %arrayidx21.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx21.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 3 %.pre34 = load i32, ptr %arrayidx21.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 4 %.pre35 = load i32, ptr %arrayidx21.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx21.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 5 %.pre36 = load i32, ptr %arrayidx21.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 6 %.pre37 = load i32, ptr %arrayidx21.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx21.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 7 %.pre38 = load i32, ptr %arrayidx21.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 8 %.pre39 = load i32, ptr %arrayidx21.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx21.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 9 %.pre40 = load i32, ptr %arrayidx21.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 10 %.pre41 = load i32, ptr %arrayidx21.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx21.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 11 %.pre42 = load i32, ptr %arrayidx21.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 12 %.pre43 = load i32, ptr %arrayidx21.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx21.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 13 %.pre44 = load i32, ptr %arrayidx21.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 14 %.pre45 = load i32, ptr %arrayidx21.14.phi.trans.insert, align 8, !tbaa !5 %arrayidx21.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 15 %.pre46 = load i32, ptr %arrayidx21.15.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 16 %.pre47 = load i32, ptr %arrayidx21.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx21.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 17 %.pre48 = load i32, ptr %arrayidx21.17.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 18 %.pre49 = load i32, ptr %arrayidx21.18.phi.trans.insert, align 8, !tbaa !5 %arrayidx21.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 19 %.pre50 = load i32, ptr %arrayidx21.19.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 20 %.pre51 = load i32, ptr %arrayidx21.20.phi.trans.insert, align 16, !tbaa !5 %arrayidx21.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 21 %.pre52 = load i32, ptr %arrayidx21.21.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 22 %.pre53 = load i32, ptr %arrayidx21.22.phi.trans.insert, align 8, !tbaa !5 %arrayidx21.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 23 %.pre54 = load i32, ptr %arrayidx21.23.phi.trans.insert, align 4, !tbaa !5 %arrayidx21.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 24 %.pre55 = load i32, ptr %arrayidx21.24.phi.trans.insert, align 16, !tbaa !5 %arrayidx21.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 25 %.pre56 = load i32, ptr %arrayidx21.25.phi.trans.insert, align 4, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %0 = phi i32 [ %.pre56, %for.cond.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre55, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre54, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre53, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre52, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre51, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre50, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre35, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre34, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre33, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre32, %for.cond.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] %call22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25) %call22.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24) %call22.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23) %call22.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22) %call22.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21) %call22.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20) %call22.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19) %call22.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18) %call22.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17) %call22.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16) %call22.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15) %call22.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14) %call22.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13) %call22.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12) %call22.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11) %call22.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10) %call22.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9) %call22.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8) %call22.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7) %call22.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6) %call22.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5) %call22.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4) %call22.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3) %call22.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2) %call22.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1) %call22.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #5 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %count) #5 ret i32 0 while.body: ; preds = %while.body.lr.ph, %while.cond.backedge %26 = load ptr, ptr %call1, align 8, !tbaa !9 %27 = load i8, ptr %ch, align 1, !tbaa !11 %conv = sext i8 %27 to i64 %idxprom = sext i8 %27 to i64 %arrayidx = getelementptr inbounds i16, ptr %26, i64 %idxprom %28 = load i16, ptr %arrayidx, align 2, !tbaa !12 %conv2 = zext i16 %28 to i32 %and = and i32 %conv2, 512 %tobool.not = icmp eq i32 %and, 0 br i1 %tobool.not, label %if.else, label %if.end15 if.else: ; preds = %while.body %and9 = and i32 %conv2, 256 %tobool10.not = icmp eq i32 %and9, 0 br i1 %tobool10.not, label %while.cond.backedge, label %if.end15 if.end15: ; preds = %if.else, %while.body %.sink = phi i64 [ -97, %while.body ], [ -65, %if.else ] %sub13 = add nsw i64 %.sink, %conv %arrayidx17 = getelementptr inbounds [26 x i32], ptr %count, i64 0, i64 %sub13 %29 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %inc = add nsw i32 %29, 1 store i32 %inc, ptr %arrayidx17, align 4, !tbaa !5 br label %while.cond.backedge while.cond.backedge: ; preds = %if.end15, %if.else %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !14 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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 nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"any pointer", !7, i64 0} !11 = !{!7, !7, i64 0} !12 = !{!13, !13, i64 0} !13 = !{!"short", !7, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int i; char in; int alph_in_sma; int alph_in_cap; /*small and capital*/ int cnt[26]; char alph_ord[26]; /*alphabet in order; for output*/ /*alph_ord[26] = {a, b, c, ... , z}*/ alph_ord[0] = 'a'; for (i = 1; i < 26; i++){ alph_ord[i] = alph_ord[i - 1] + 1; } /*initialize*/ for (i = 0; i < 26; i++){ cnt[i] = 0; } /*input*/ while ((scanf("%c", &in)) != EOF){ /*alph_in_sma = 0, 1, 2, ... , 25; a = 0, z = 25*/ alph_in_sma = in - 'a'; /*alph_in_cap = 0, 1, 2, ... , 25; A = 0, Z = 25*/ alph_in_cap = in - 'A'; /*if alphabet*/ if (alph_in_sma >= 0 && alph_in_sma <= 25){ cnt[alph_in_sma]++; } if (alph_in_cap >= 0 && alph_in_cap <= 25){ cnt[alph_in_cap]++; } } /*output*/ for (i = 0; i < 26; i++){ printf("%c : %d\n", alph_ord[i], cnt[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154768/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154768/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %in = alloca i8, align 1 %cnt = alloca [26 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %in) #4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %cnt) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %cnt, i8 0, i64 104, i1 false), !tbaa !5 %call68 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %cmp14.not69 = icmp eq i32 %call68, -1 br i1 %cmp14.not69, label %for.cond37.preheader, label %while.body for.cond37.preheader.loopexit: ; preds = %if.end36 %.pre = load i32, ptr %cnt, align 16, !tbaa !5 %arrayidx45.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 1 %.pre100 = load i32, ptr %arrayidx45.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 2 %.pre101 = load i32, ptr %arrayidx45.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx45.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 3 %.pre102 = load i32, ptr %arrayidx45.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 4 %.pre103 = load i32, ptr %arrayidx45.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx45.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 5 %.pre104 = load i32, ptr %arrayidx45.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 6 %.pre105 = load i32, ptr %arrayidx45.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx45.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 7 %.pre106 = load i32, ptr %arrayidx45.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 8 %.pre107 = load i32, ptr %arrayidx45.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx45.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 9 %.pre108 = load i32, ptr %arrayidx45.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 10 %.pre109 = load i32, ptr %arrayidx45.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx45.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 11 %.pre110 = load i32, ptr %arrayidx45.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 12 %.pre111 = load i32, ptr %arrayidx45.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx45.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 13 %.pre112 = load i32, ptr %arrayidx45.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 14 %.pre113 = load i32, ptr %arrayidx45.14.phi.trans.insert, align 8, !tbaa !5 %arrayidx45.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 15 %.pre114 = load i32, ptr %arrayidx45.15.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 16 %.pre115 = load i32, ptr %arrayidx45.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx45.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 17 %.pre116 = load i32, ptr %arrayidx45.17.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 18 %.pre117 = load i32, ptr %arrayidx45.18.phi.trans.insert, align 8, !tbaa !5 %arrayidx45.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 19 %.pre118 = load i32, ptr %arrayidx45.19.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 20 %.pre119 = load i32, ptr %arrayidx45.20.phi.trans.insert, align 16, !tbaa !5 %arrayidx45.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 21 %.pre120 = load i32, ptr %arrayidx45.21.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 22 %.pre121 = load i32, ptr %arrayidx45.22.phi.trans.insert, align 8, !tbaa !5 %arrayidx45.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 23 %.pre122 = load i32, ptr %arrayidx45.23.phi.trans.insert, align 4, !tbaa !5 %arrayidx45.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 24 %.pre123 = load i32, ptr %arrayidx45.24.phi.trans.insert, align 16, !tbaa !5 %arrayidx45.25.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 25 %.pre124 = load i32, ptr %arrayidx45.25.phi.trans.insert, align 4, !tbaa !5 br label %for.cond37.preheader for.cond37.preheader: ; preds = %for.cond37.preheader.loopexit, %entry %0 = phi i32 [ %.pre124, %for.cond37.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre123, %for.cond37.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre122, %for.cond37.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre121, %for.cond37.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre120, %for.cond37.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre119, %for.cond37.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre118, %for.cond37.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre117, %for.cond37.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre116, %for.cond37.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre115, %for.cond37.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre114, %for.cond37.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre113, %for.cond37.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre112, %for.cond37.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre111, %for.cond37.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre110, %for.cond37.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre109, %for.cond37.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre108, %for.cond37.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre107, %for.cond37.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre106, %for.cond37.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre105, %for.cond37.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre104, %for.cond37.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre103, %for.cond37.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre102, %for.cond37.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre101, %for.cond37.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre100, %for.cond37.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre, %for.cond37.preheader.loopexit ], [ 0, %entry ] %call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %25) %call46.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %24) %call46.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %23) %call46.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %22) %call46.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %21) %call46.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %20) %call46.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %19) %call46.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %18) %call46.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %17) %call46.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %16) %call46.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %15) %call46.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %14) %call46.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %13) %call46.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %12) %call46.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %11) %call46.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %10) %call46.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %9) %call46.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %8) %call46.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %7) %call46.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %6) %call46.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %5) %call46.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %4) %call46.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %3) %call46.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %2) %call46.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %1) %call46.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %0) call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %cnt) #4 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %in) #4 ret i32 0 while.body: ; preds = %entry, %if.end36 %26 = load i8, ptr %in, align 1, !tbaa !9 %conv16 = sext i8 %26 to i32 %27 = add i8 %26, -97 %or.cond = icmp ult i8 %27, 26 br i1 %or.cond, label %if.end.thread, label %if.end if.end.thread: ; preds = %while.body %sub17 = add nsw i32 %conv16, -97 br label %if.end36.sink.split if.end: ; preds = %while.body %sub19 = add nsw i32 %conv16, -65 %28 = add i8 %26, -65 %or.cond50 = icmp ult i8 %28, 26 br i1 %or.cond50, label %if.end36.sink.split, label %if.end36 if.end36.sink.split: ; preds = %if.end, %if.end.thread %sub19.sink = phi i32 [ %sub17, %if.end.thread ], [ %sub19, %if.end ] %idxprom33 = zext i32 %sub19.sink to i64 %arrayidx34 = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 %idxprom33 %29 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %inc26 = add nsw i32 %29, 1 store i32 %inc26, ptr %arrayidx34, align 4, !tbaa !5 br label %if.end36 if.end36: ; preds = %if.end36.sink.split, %if.end %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %in) %cmp14.not = icmp eq i32 %call, -1 br i1 %cmp14.not, label %for.cond37.preheader.loopexit, label %while.body, !llvm.loop !10 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdio.h> int main() { int x, alph[26] = {0}, i; char c; for (i = 0; i < 1200; i++) { scanf("%c", &c); if (c >= 'A' && c <= 'Z') { x = c - 'A'; alph[x]++; } else if (c >= 'a' && c <= 'z') { x = c - 'a'; alph[x]++; } } for (i = 0; i < 26; i++) { printf("%c : %d\n", 'a' + i, alph[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154810/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154810/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %alph = alloca [26 x i32], align 16 %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %alph) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %alph, i8 0, i64 104, i1 false) call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4 br label %for.body for.body: ; preds = %entry, %for.inc %i.039 = phi i32 [ 0, %entry ], [ %inc21, %for.inc ] %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1 %conv = sext i8 %0 to i64 %1 = add i8 %0, -65 %or.cond = icmp ult i8 %1, 26 br i1 %or.cond, label %for.inc.sink.split, label %if.else if.else: ; preds = %for.body %2 = add i8 %0, -97 %or.cond32 = icmp ult i8 %2, 26 br i1 %or.cond32, label %for.inc.sink.split, label %for.inc for.inc.sink.split: ; preds = %if.else, %for.body %.sink = phi i64 [ 4294967231, %for.body ], [ 4294967199, %if.else ] %sub16 = add nsw i64 %.sink, %conv %idxprom17 = and i64 %sub16, 4294967295 %arrayidx18 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 %idxprom17 %3 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %inc = add nsw i32 %3, 1 store i32 %inc, ptr %arrayidx18, align 4, !tbaa !5 br label %for.inc for.inc: ; preds = %for.inc.sink.split, %if.else %inc21 = add nuw nsw i32 %i.039, 1 %exitcond.not = icmp eq i32 %inc21, 1200 br i1 %exitcond.not, label %for.body25.preheader, label %for.body, !llvm.loop !9 for.body25.preheader: ; preds = %for.inc %4 = load i32, ptr %alph, align 16, !tbaa !5 %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %4) %arrayidx27.1 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 1 %5 = load i32, ptr %arrayidx27.1, align 4, !tbaa !5 %call28.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %5) %arrayidx27.2 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 2 %6 = load i32, ptr %arrayidx27.2, align 8, !tbaa !5 %call28.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %6) %arrayidx27.3 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 3 %7 = load i32, ptr %arrayidx27.3, align 4, !tbaa !5 %call28.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %7) %arrayidx27.4 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 4 %8 = load i32, ptr %arrayidx27.4, align 16, !tbaa !5 %call28.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %8) %arrayidx27.5 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 5 %9 = load i32, ptr %arrayidx27.5, align 4, !tbaa !5 %call28.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %9) %arrayidx27.6 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 6 %10 = load i32, ptr %arrayidx27.6, align 8, !tbaa !5 %call28.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %10) %arrayidx27.7 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 7 %11 = load i32, ptr %arrayidx27.7, align 4, !tbaa !5 %call28.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %11) %arrayidx27.8 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 8 %12 = load i32, ptr %arrayidx27.8, align 16, !tbaa !5 %call28.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %12) %arrayidx27.9 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 9 %13 = load i32, ptr %arrayidx27.9, align 4, !tbaa !5 %call28.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %13) %arrayidx27.10 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 10 %14 = load i32, ptr %arrayidx27.10, align 8, !tbaa !5 %call28.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %14) %arrayidx27.11 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 11 %15 = load i32, ptr %arrayidx27.11, align 4, !tbaa !5 %call28.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %15) %arrayidx27.12 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 12 %16 = load i32, ptr %arrayidx27.12, align 16, !tbaa !5 %call28.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %16) %arrayidx27.13 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 13 %17 = load i32, ptr %arrayidx27.13, align 4, !tbaa !5 %call28.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %17) %arrayidx27.14 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 14 %18 = load i32, ptr %arrayidx27.14, align 8, !tbaa !5 %call28.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %18) %arrayidx27.15 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 15 %19 = load i32, ptr %arrayidx27.15, align 4, !tbaa !5 %call28.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %19) %arrayidx27.16 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 16 %20 = load i32, ptr %arrayidx27.16, align 16, !tbaa !5 %call28.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %20) %arrayidx27.17 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 17 %21 = load i32, ptr %arrayidx27.17, align 4, !tbaa !5 %call28.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %21) %arrayidx27.18 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 18 %22 = load i32, ptr %arrayidx27.18, align 8, !tbaa !5 %call28.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %22) %arrayidx27.19 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 19 %23 = load i32, ptr %arrayidx27.19, align 4, !tbaa !5 %call28.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %23) %arrayidx27.20 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 20 %24 = load i32, ptr %arrayidx27.20, align 16, !tbaa !5 %call28.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %24) %arrayidx27.21 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 21 %25 = load i32, ptr %arrayidx27.21, align 4, !tbaa !5 %call28.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %25) %arrayidx27.22 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 22 %26 = load i32, ptr %arrayidx27.22, align 8, !tbaa !5 %call28.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %26) %arrayidx27.23 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 23 %27 = load i32, ptr %arrayidx27.23, align 4, !tbaa !5 %call28.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %27) %arrayidx27.24 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 24 %28 = load i32, ptr %arrayidx27.24, align 16, !tbaa !5 %call28.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %28) %arrayidx27.25 = getelementptr inbounds [26 x i32], ptr %alph, i64 0, i64 25 %29 = load i32, ptr %arrayidx27.25, align 4, !tbaa !5 %call28.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %29) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %alph) #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"}
#include<stdio.h> #include<ctype.h> int main(void){ int i,ascii = 0x61; char x; int counter[25] = {0}; while(scanf("%c",&x) != EOF) { for(i = 0;i < 26;i++) { if(isupper(x)) x = tolower(x); if((int)x == i+ascii) counter[i]++; } } for(i = 0;i < 26;i++) { printf("%c : %d\n",i+ascii,counter[i]); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154854/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154854/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i8, align 1 %counter = alloca [25 x i32], align 16 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 100, ptr nonnull %counter) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100) %counter, i8 0, i64 100, i1 false) %call37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %cmp.not38 = icmp eq i32 %call37, -1 br i1 %cmp.not38, label %for.cond17.preheader, label %for.cond.preheader.lr.ph for.cond.preheader.lr.ph: ; preds = %entry %call2 = tail call ptr @__ctype_b_loc() #6 br label %for.cond.preheader while.cond.loopexit: ; preds = %for.inc %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond17.preheader.loopexit, label %for.cond.preheader, !llvm.loop !5 for.cond.preheader: ; preds = %for.cond.preheader.lr.ph, %while.cond.loopexit %x.promoted = load i8, ptr %x, align 1, !tbaa !7 %.pre = load ptr, ptr %call2, align 8, !tbaa !10 br label %for.body for.cond17.preheader.loopexit: ; preds = %while.cond.loopexit %.pre46 = load i32, ptr %counter, align 16, !tbaa !12 %arrayidx23.1.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 1 %.pre47 = load i32, ptr %arrayidx23.1.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.2.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 2 %.pre48 = load i32, ptr %arrayidx23.2.phi.trans.insert, align 8, !tbaa !12 %arrayidx23.3.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 3 %.pre49 = load i32, ptr %arrayidx23.3.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.4.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 4 %.pre50 = load i32, ptr %arrayidx23.4.phi.trans.insert, align 16, !tbaa !12 %arrayidx23.5.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 5 %.pre51 = load i32, ptr %arrayidx23.5.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.6.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 6 %.pre52 = load i32, ptr %arrayidx23.6.phi.trans.insert, align 8, !tbaa !12 %arrayidx23.7.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 7 %.pre53 = load i32, ptr %arrayidx23.7.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.8.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 8 %.pre54 = load i32, ptr %arrayidx23.8.phi.trans.insert, align 16, !tbaa !12 %arrayidx23.9.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 9 %.pre55 = load i32, ptr %arrayidx23.9.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.10.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 10 %.pre56 = load i32, ptr %arrayidx23.10.phi.trans.insert, align 8, !tbaa !12 %arrayidx23.11.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 11 %.pre57 = load i32, ptr %arrayidx23.11.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.12.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 12 %.pre58 = load i32, ptr %arrayidx23.12.phi.trans.insert, align 16, !tbaa !12 %arrayidx23.13.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 13 %.pre59 = load i32, ptr %arrayidx23.13.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.14.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 14 %.pre60 = load i32, ptr %arrayidx23.14.phi.trans.insert, align 8, !tbaa !12 %arrayidx23.15.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 15 %.pre61 = load i32, ptr %arrayidx23.15.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.16.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 16 %.pre62 = load i32, ptr %arrayidx23.16.phi.trans.insert, align 16, !tbaa !12 %arrayidx23.17.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 17 %.pre63 = load i32, ptr %arrayidx23.17.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.18.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 18 %.pre64 = load i32, ptr %arrayidx23.18.phi.trans.insert, align 8, !tbaa !12 %arrayidx23.19.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 19 %.pre65 = load i32, ptr %arrayidx23.19.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.20.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 20 %.pre66 = load i32, ptr %arrayidx23.20.phi.trans.insert, align 16, !tbaa !12 %arrayidx23.21.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 21 %.pre67 = load i32, ptr %arrayidx23.21.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.22.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 22 %.pre68 = load i32, ptr %arrayidx23.22.phi.trans.insert, align 8, !tbaa !12 %arrayidx23.23.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 23 %.pre69 = load i32, ptr %arrayidx23.23.phi.trans.insert, align 4, !tbaa !12 %arrayidx23.24.phi.trans.insert = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 24 %.pre70 = load i32, ptr %arrayidx23.24.phi.trans.insert, align 16, !tbaa !12 br label %for.cond17.preheader for.cond17.preheader: ; preds = %for.cond17.preheader.loopexit, %entry %0 = phi i32 [ %.pre70, %for.cond17.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre69, %for.cond17.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre68, %for.cond17.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre67, %for.cond17.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre66, %for.cond17.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre65, %for.cond17.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre64, %for.cond17.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre63, %for.cond17.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre62, %for.cond17.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre61, %for.cond17.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre60, %for.cond17.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre59, %for.cond17.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre58, %for.cond17.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre57, %for.cond17.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre56, %for.cond17.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre55, %for.cond17.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre54, %for.cond17.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre53, %for.cond17.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre52, %for.cond17.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre51, %for.cond17.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre50, %for.cond17.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre49, %for.cond17.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre48, %for.cond17.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre47, %for.cond17.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre46, %for.cond17.preheader.loopexit ], [ 0, %entry ] %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %24) %call24.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %23) %call24.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %22) %call24.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %21) %call24.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %20) %call24.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %19) %call24.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %18) %call24.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %17) %call24.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %16) %call24.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %15) %call24.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %14) %call24.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %13) %call24.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %12) %call24.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %11) %call24.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %10) %call24.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %9) %call24.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %8) %call24.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %7) %call24.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %6) %call24.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %5) %call24.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %4) %call24.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %3) %call24.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %2) %call24.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %1) %call24.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %0) %arrayidx23.25 = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 25 %25 = load i32, ptr %arrayidx23.25, align 4, !tbaa !12 %call24.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %25) call void @llvm.lifetime.end.p0(i64 100, ptr nonnull %counter) #5 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %x) #5 ret i32 0 for.body: ; preds = %for.cond.preheader, %for.inc %indvars.iv = phi i64 [ 0, %for.cond.preheader ], [ %indvars.iv.next, %for.inc ] %26 = phi i8 [ %x.promoted, %for.cond.preheader ], [ %31, %for.inc ] %idxprom = sext i8 %26 to i64 %arrayidx = getelementptr inbounds i16, ptr %.pre, i64 %idxprom %27 = load i16, ptr %arrayidx, align 2, !tbaa !14 %28 = and i16 %27, 256 %tobool.not = icmp eq i16 %28, 0 br i1 %tobool.not, label %if.end, label %if.then if.then: ; preds = %for.body %call4 = tail call ptr @__ctype_tolower_loc() #6 %29 = load ptr, ptr %call4, align 8, !tbaa !10 %arrayidx7 = getelementptr inbounds i32, ptr %29, i64 %idxprom %30 = load i32, ptr %arrayidx7, align 4, !tbaa !12 %conv8 = trunc i32 %30 to i8 store i8 %conv8, ptr %x, align 1, !tbaa !7 br label %if.end if.end: ; preds = %if.then, %for.body %31 = phi i8 [ %conv8, %if.then ], [ %26, %for.body ] %conv9 = sext i8 %31 to i64 %32 = add nuw nsw i64 %indvars.iv, 97 %33 = and i64 %conv9, 4294967295 %cmp10 = icmp eq i64 %32, %33 br i1 %cmp10, label %if.then12, label %for.inc if.then12: ; preds = %if.end %arrayidx14 = getelementptr inbounds [25 x i32], ptr %counter, i64 0, i64 %indvars.iv %34 = load i32, ptr %arrayidx14, align 4, !tbaa !12 %inc = add nsw i32 %34, 1 store i32 %inc, ptr %arrayidx14, align 4, !tbaa !12 br label %for.inc for.inc: ; preds = %if.end, %if.then12 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, 26 br i1 %exitcond.not, label %while.cond.loopexit, label %for.body, !llvm.loop !16 } ; 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 nosync nounwind willreturn memory(none) declare ptr @__ctype_b_loc() local_unnamed_addr #4 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) declare ptr @__ctype_tolower_loc() 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 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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 nosync nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { nounwind willreturn memory(none) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!11, !11, i64 0} !11 = !{!"any pointer", !8, i64 0} !12 = !{!13, !13, i64 0} !13 = !{!"int", !8, i64 0} !14 = !{!15, !15, i64 0} !15 = !{!"short", !8, i64 0} !16 = distinct !{!16, !6}
#include<stdio.h> int main() { int X[128]={0}; char c; for(;~(c=getchar());X[c]++); for(c=97;c<123;c++) printf("%c : %d\n",c,X[c]+X[c-32]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154898/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154898/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%c : %d\0A\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %X = alloca [128 x i32], align 16 call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %X) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(512) %X, i8 0, i64 512, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i21 = tail call i32 @getc(ptr noundef %0) %sext.mask22 = and i32 %call.i21, 255 %tobool.not23 = icmp eq i32 %sext.mask22, 255 br i1 %tobool.not23, label %for.cond2.preheader, label %for.inc for.cond2.preheader.loopexit: ; preds = %for.inc %arrayidx8.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 97 %.pre = load i32, ptr %arrayidx8.phi.trans.insert, align 4, !tbaa !9 %arrayidx11.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 65 %.pre27 = load i32, ptr %arrayidx11.phi.trans.insert, align 4, !tbaa !9 %arrayidx8.1.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 98 %.pre28 = load i32, ptr %arrayidx8.1.phi.trans.insert, align 8, !tbaa !9 %arrayidx11.1.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 66 %.pre29 = load i32, ptr %arrayidx11.1.phi.trans.insert, align 8, !tbaa !9 %arrayidx8.2.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 99 %.pre30 = load i32, ptr %arrayidx8.2.phi.trans.insert, align 4, !tbaa !9 %arrayidx11.2.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 67 %.pre31 = load i32, ptr %arrayidx11.2.phi.trans.insert, align 4, !tbaa !9 %arrayidx8.3.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 100 %.pre32 = load i32, ptr %arrayidx8.3.phi.trans.insert, align 16, !tbaa !9 %arrayidx11.3.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 68 %.pre33 = load i32, ptr %arrayidx11.3.phi.trans.insert, align 16, !tbaa !9 %arrayidx8.4.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 101 %.pre34 = load i32, ptr %arrayidx8.4.phi.trans.insert, align 4, !tbaa !9 %arrayidx11.4.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 69 %.pre35 = load i32, ptr %arrayidx11.4.phi.trans.insert, align 4, !tbaa !9 %arrayidx8.5.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 102 %.pre36 = load i32, ptr %arrayidx8.5.phi.trans.insert, align 8, !tbaa !9 %arrayidx11.5.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 70 %.pre37 = load i32, ptr %arrayidx11.5.phi.trans.insert, align 8, !tbaa !9 %arrayidx8.6.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 103 %.pre38 = load i32, ptr %arrayidx8.6.phi.trans.insert, align 4, !tbaa !9 %arrayidx11.6.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 71 %.pre39 = load i32, ptr %arrayidx11.6.phi.trans.insert, align 4, !tbaa !9 %arrayidx8.7.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 104 %.pre40 = load i32, ptr %arrayidx8.7.phi.trans.insert, align 16, !tbaa !9 %arrayidx11.7.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 72 %.pre41 = load i32, ptr %arrayidx11.7.phi.trans.insert, align 16, !tbaa !9 %arrayidx8.8.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 105 %.pre42 = load i32, ptr %arrayidx8.8.phi.trans.insert, align 4, !tbaa !9 %arrayidx11.8.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 73 %.pre43 = load i32, ptr %arrayidx11.8.phi.trans.insert, align 4, !tbaa !9 %arrayidx8.9.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 106 %.pre44 = load i32, ptr %arrayidx8.9.phi.trans.insert, align 8, !tbaa !9 %arrayidx11.9.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 74 %.pre45 = load i32, ptr %arrayidx11.9.phi.trans.insert, align 8, !tbaa !9 %arrayidx8.10.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 107 %.pre46 = load i32, ptr %arrayidx8.10.phi.trans.insert, align 4, !tbaa !9 %arrayidx11.10.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 75 %.pre47 = load i32, ptr %arrayidx11.10.phi.trans.insert, align 4, !tbaa !9 %arrayidx8.11.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 108 %.pre48 = load i32, ptr %arrayidx8.11.phi.trans.insert, align 16, !tbaa !9 %arrayidx11.11.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 76 %.pre49 = load i32, ptr %arrayidx11.11.phi.trans.insert, align 16, !tbaa !9 %arrayidx8.12.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 109 %.pre50 = load i32, ptr %arrayidx8.12.phi.trans.insert, align 4, !tbaa !9 %arrayidx11.12.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 77 %.pre51 = load i32, ptr %arrayidx11.12.phi.trans.insert, align 4, !tbaa !9 %arrayidx8.13.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 110 %.pre52 = load i32, ptr %arrayidx8.13.phi.trans.insert, align 8, !tbaa !9 %arrayidx11.13.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 78 %.pre53 = load i32, ptr %arrayidx11.13.phi.trans.insert, align 8, !tbaa !9 %arrayidx8.14.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 111 %.pre54 = load i32, ptr %arrayidx8.14.phi.trans.insert, align 4, !tbaa !9 %arrayidx11.14.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 79 %.pre55 = load i32, ptr %arrayidx11.14.phi.trans.insert, align 4, !tbaa !9 %arrayidx8.15.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 112 %.pre56 = load i32, ptr %arrayidx8.15.phi.trans.insert, align 16, !tbaa !9 %arrayidx11.15.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 80 %.pre57 = load i32, ptr %arrayidx11.15.phi.trans.insert, align 16, !tbaa !9 %arrayidx8.16.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 113 %.pre58 = load i32, ptr %arrayidx8.16.phi.trans.insert, align 4, !tbaa !9 %arrayidx11.16.phi.trans.insert = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 81 %.pre59 = load i32, ptr %arrayidx11.16.phi.trans.insert, align 4, !tbaa !9 %1 = add nsw i32 %.pre27, %.pre br label %for.cond2.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.loopexit, %entry %2 = phi i32 [ %.pre59, %for.cond2.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre58, %for.cond2.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre57, %for.cond2.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre56, %for.cond2.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre55, %for.cond2.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre54, %for.cond2.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre53, %for.cond2.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre52, %for.cond2.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre51, %for.cond2.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre50, %for.cond2.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre49, %for.cond2.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre48, %for.cond2.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre47, %for.cond2.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre46, %for.cond2.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre45, %for.cond2.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre44, %for.cond2.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre43, %for.cond2.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre42, %for.cond2.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre41, %for.cond2.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre40, %for.cond2.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre39, %for.cond2.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre38, %for.cond2.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre37, %for.cond2.preheader.loopexit ], [ 0, %entry ] %25 = phi i32 [ %.pre36, %for.cond2.preheader.loopexit ], [ 0, %entry ] %26 = phi i32 [ %.pre35, %for.cond2.preheader.loopexit ], [ 0, %entry ] %27 = phi i32 [ %.pre34, %for.cond2.preheader.loopexit ], [ 0, %entry ] %28 = phi i32 [ %.pre33, %for.cond2.preheader.loopexit ], [ 0, %entry ] %29 = phi i32 [ %.pre32, %for.cond2.preheader.loopexit ], [ 0, %entry ] %30 = phi i32 [ %.pre31, %for.cond2.preheader.loopexit ], [ 0, %entry ] %31 = phi i32 [ %.pre30, %for.cond2.preheader.loopexit ], [ 0, %entry ] %32 = phi i32 [ %.pre29, %for.cond2.preheader.loopexit ], [ 0, %entry ] %33 = phi i32 [ %.pre28, %for.cond2.preheader.loopexit ], [ 0, %entry ] %add = phi i32 [ %1, %for.cond2.preheader.loopexit ], [ 0, %entry ] %call12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 97, i32 noundef %add) %add.1 = add nsw i32 %32, %33 %call12.1 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 98, i32 noundef %add.1) %add.2 = add nsw i32 %30, %31 %call12.2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 99, i32 noundef %add.2) %add.3 = add nsw i32 %28, %29 %call12.3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 100, i32 noundef %add.3) %add.4 = add nsw i32 %26, %27 %call12.4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 101, i32 noundef %add.4) %add.5 = add nsw i32 %24, %25 %call12.5 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 102, i32 noundef %add.5) %add.6 = add nsw i32 %22, %23 %call12.6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 103, i32 noundef %add.6) %add.7 = add nsw i32 %20, %21 %call12.7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 104, i32 noundef %add.7) %add.8 = add nsw i32 %18, %19 %call12.8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 105, i32 noundef %add.8) %add.9 = add nsw i32 %16, %17 %call12.9 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 106, i32 noundef %add.9) %add.10 = add nsw i32 %14, %15 %call12.10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 107, i32 noundef %add.10) %add.11 = add nsw i32 %12, %13 %call12.11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 108, i32 noundef %add.11) %add.12 = add nsw i32 %10, %11 %call12.12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 109, i32 noundef %add.12) %add.13 = add nsw i32 %8, %9 %call12.13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 110, i32 noundef %add.13) %add.14 = add nsw i32 %6, %7 %call12.14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 111, i32 noundef %add.14) %add.15 = add nsw i32 %4, %5 %call12.15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 112, i32 noundef %add.15) %add.16 = add nsw i32 %2, %3 %call12.16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 113, i32 noundef %add.16) %arrayidx8.17 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 114 %34 = load i32, ptr %arrayidx8.17, align 8, !tbaa !9 %arrayidx11.17 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 82 %35 = load i32, ptr %arrayidx11.17, align 8, !tbaa !9 %add.17 = add nsw i32 %35, %34 %call12.17 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 114, i32 noundef %add.17) %arrayidx8.18 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 115 %36 = load i32, ptr %arrayidx8.18, align 4, !tbaa !9 %arrayidx11.18 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 83 %37 = load i32, ptr %arrayidx11.18, align 4, !tbaa !9 %add.18 = add nsw i32 %37, %36 %call12.18 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 115, i32 noundef %add.18) %arrayidx8.19 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 116 %38 = load i32, ptr %arrayidx8.19, align 16, !tbaa !9 %arrayidx11.19 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 84 %39 = load i32, ptr %arrayidx11.19, align 16, !tbaa !9 %add.19 = add nsw i32 %39, %38 %call12.19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 116, i32 noundef %add.19) %arrayidx8.20 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 117 %40 = load i32, ptr %arrayidx8.20, align 4, !tbaa !9 %arrayidx11.20 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 85 %41 = load i32, ptr %arrayidx11.20, align 4, !tbaa !9 %add.20 = add nsw i32 %41, %40 %call12.20 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 117, i32 noundef %add.20) %arrayidx8.21 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 118 %42 = load i32, ptr %arrayidx8.21, align 8, !tbaa !9 %arrayidx11.21 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 86 %43 = load i32, ptr %arrayidx11.21, align 8, !tbaa !9 %add.21 = add nsw i32 %43, %42 %call12.21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 118, i32 noundef %add.21) %arrayidx8.22 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 119 %44 = load i32, ptr %arrayidx8.22, align 4, !tbaa !9 %arrayidx11.22 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 87 %45 = load i32, ptr %arrayidx11.22, align 4, !tbaa !9 %add.22 = add nsw i32 %45, %44 %call12.22 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 119, i32 noundef %add.22) %arrayidx8.23 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 120 %46 = load i32, ptr %arrayidx8.23, align 16, !tbaa !9 %arrayidx11.23 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 88 %47 = load i32, ptr %arrayidx11.23, align 16, !tbaa !9 %add.23 = add nsw i32 %47, %46 %call12.23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 120, i32 noundef %add.23) %arrayidx8.24 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 121 %48 = load i32, ptr %arrayidx8.24, align 4, !tbaa !9 %arrayidx11.24 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 89 %49 = load i32, ptr %arrayidx11.24, align 4, !tbaa !9 %add.24 = add nsw i32 %49, %48 %call12.24 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 121, i32 noundef %add.24) %arrayidx8.25 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 122 %50 = load i32, ptr %arrayidx8.25, align 8, !tbaa !9 %arrayidx11.25 = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 90 %51 = load i32, ptr %arrayidx11.25, align 8, !tbaa !9 %add.25 = add nsw i32 %51, %50 %call12.25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef 122, i32 noundef %add.25) call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %X) #4 ret i32 0 for.inc: ; preds = %entry, %for.inc %call.i24 = phi i32 [ %call.i, %for.inc ], [ %call.i21, %entry ] %conv = zext i32 %call.i24 to i64 %sext = shl i64 %conv, 56 %idxprom = ashr exact i64 %sext, 56 %arrayidx = getelementptr inbounds [128 x i32], ptr %X, i64 0, i64 %idxprom %52 = load i32, ptr %arrayidx, align 4, !tbaa !9 %inc = add nsw i32 %52, 1 store i32 %inc, ptr %arrayidx, align 4, !tbaa !9 %53 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %53) %sext.mask = and i32 %call.i, 255 %tobool.not = icmp eq i32 %sext.mask, 255 br i1 %tobool.not, label %for.cond2.preheader.loopexit, label %for.inc, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture 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 = { 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!10, !10, i64 0} !10 = !{!"int", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int cnt[26]={0},i,ch; while(scanf("%c",&ch)!=EOF){ if(97<=ch && ch<=122){ cnt[ch-97]++; } else if(65<=ch && ch<=90){ cnt[ch-65]++; } } for(i=0;i<26;i++){ ch=97+i; printf("%c : %d\n",ch,cnt[i]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154940/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154940/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %cnt = alloca [26 x i32], align 16 %ch = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 104, ptr nonnull %cnt) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(104) %cnt, i8 0, i64 104, i1 false) call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %ch) #4 %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not22 = icmp eq i32 %call21, -1 br i1 %cmp.not22, label %for.cond.preheader, label %while.body for.cond.preheader.loopexit: ; preds = %if.end11 %.pre = load i32, ptr %cnt, align 16, !tbaa !5 %arrayidx14.1.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 1 %.pre26 = load i32, ptr %arrayidx14.1.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.2.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 2 %.pre27 = load i32, ptr %arrayidx14.2.phi.trans.insert, align 8, !tbaa !5 %arrayidx14.3.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 3 %.pre28 = load i32, ptr %arrayidx14.3.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.4.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 4 %.pre29 = load i32, ptr %arrayidx14.4.phi.trans.insert, align 16, !tbaa !5 %arrayidx14.5.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 5 %.pre30 = load i32, ptr %arrayidx14.5.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.6.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 6 %.pre31 = load i32, ptr %arrayidx14.6.phi.trans.insert, align 8, !tbaa !5 %arrayidx14.7.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 7 %.pre32 = load i32, ptr %arrayidx14.7.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.8.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 8 %.pre33 = load i32, ptr %arrayidx14.8.phi.trans.insert, align 16, !tbaa !5 %arrayidx14.9.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 9 %.pre34 = load i32, ptr %arrayidx14.9.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.10.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 10 %.pre35 = load i32, ptr %arrayidx14.10.phi.trans.insert, align 8, !tbaa !5 %arrayidx14.11.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 11 %.pre36 = load i32, ptr %arrayidx14.11.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.12.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 12 %.pre37 = load i32, ptr %arrayidx14.12.phi.trans.insert, align 16, !tbaa !5 %arrayidx14.13.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 13 %.pre38 = load i32, ptr %arrayidx14.13.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.14.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 14 %.pre39 = load i32, ptr %arrayidx14.14.phi.trans.insert, align 8, !tbaa !5 %arrayidx14.15.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 15 %.pre40 = load i32, ptr %arrayidx14.15.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.16.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 16 %.pre41 = load i32, ptr %arrayidx14.16.phi.trans.insert, align 16, !tbaa !5 %arrayidx14.17.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 17 %.pre42 = load i32, ptr %arrayidx14.17.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.18.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 18 %.pre43 = load i32, ptr %arrayidx14.18.phi.trans.insert, align 8, !tbaa !5 %arrayidx14.19.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 19 %.pre44 = load i32, ptr %arrayidx14.19.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.20.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 20 %.pre45 = load i32, ptr %arrayidx14.20.phi.trans.insert, align 16, !tbaa !5 %arrayidx14.21.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 21 %.pre46 = load i32, ptr %arrayidx14.21.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.22.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 22 %.pre47 = load i32, ptr %arrayidx14.22.phi.trans.insert, align 8, !tbaa !5 %arrayidx14.23.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 23 %.pre48 = load i32, ptr %arrayidx14.23.phi.trans.insert, align 4, !tbaa !5 %arrayidx14.24.phi.trans.insert = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 24 %.pre49 = load i32, ptr %arrayidx14.24.phi.trans.insert, align 16, !tbaa !5 br label %for.cond.preheader for.cond.preheader: ; preds = %for.cond.preheader.loopexit, %entry %0 = phi i32 [ %.pre49, %for.cond.preheader.loopexit ], [ 0, %entry ] %1 = phi i32 [ %.pre48, %for.cond.preheader.loopexit ], [ 0, %entry ] %2 = phi i32 [ %.pre47, %for.cond.preheader.loopexit ], [ 0, %entry ] %3 = phi i32 [ %.pre46, %for.cond.preheader.loopexit ], [ 0, %entry ] %4 = phi i32 [ %.pre45, %for.cond.preheader.loopexit ], [ 0, %entry ] %5 = phi i32 [ %.pre44, %for.cond.preheader.loopexit ], [ 0, %entry ] %6 = phi i32 [ %.pre43, %for.cond.preheader.loopexit ], [ 0, %entry ] %7 = phi i32 [ %.pre42, %for.cond.preheader.loopexit ], [ 0, %entry ] %8 = phi i32 [ %.pre41, %for.cond.preheader.loopexit ], [ 0, %entry ] %9 = phi i32 [ %.pre40, %for.cond.preheader.loopexit ], [ 0, %entry ] %10 = phi i32 [ %.pre39, %for.cond.preheader.loopexit ], [ 0, %entry ] %11 = phi i32 [ %.pre38, %for.cond.preheader.loopexit ], [ 0, %entry ] %12 = phi i32 [ %.pre37, %for.cond.preheader.loopexit ], [ 0, %entry ] %13 = phi i32 [ %.pre36, %for.cond.preheader.loopexit ], [ 0, %entry ] %14 = phi i32 [ %.pre35, %for.cond.preheader.loopexit ], [ 0, %entry ] %15 = phi i32 [ %.pre34, %for.cond.preheader.loopexit ], [ 0, %entry ] %16 = phi i32 [ %.pre33, %for.cond.preheader.loopexit ], [ 0, %entry ] %17 = phi i32 [ %.pre32, %for.cond.preheader.loopexit ], [ 0, %entry ] %18 = phi i32 [ %.pre31, %for.cond.preheader.loopexit ], [ 0, %entry ] %19 = phi i32 [ %.pre30, %for.cond.preheader.loopexit ], [ 0, %entry ] %20 = phi i32 [ %.pre29, %for.cond.preheader.loopexit ], [ 0, %entry ] %21 = phi i32 [ %.pre28, %for.cond.preheader.loopexit ], [ 0, %entry ] %22 = phi i32 [ %.pre27, %for.cond.preheader.loopexit ], [ 0, %entry ] %23 = phi i32 [ %.pre26, %for.cond.preheader.loopexit ], [ 0, %entry ] %24 = phi i32 [ %.pre, %for.cond.preheader.loopexit ], [ 0, %entry ] store i32 97, ptr %ch, align 4, !tbaa !5 %call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 97, i32 noundef %24) store i32 98, ptr %ch, align 4, !tbaa !5 %call15.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 98, i32 noundef %23) store i32 99, ptr %ch, align 4, !tbaa !5 %call15.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 99, i32 noundef %22) store i32 100, ptr %ch, align 4, !tbaa !5 %call15.3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 100, i32 noundef %21) store i32 101, ptr %ch, align 4, !tbaa !5 %call15.4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 101, i32 noundef %20) store i32 102, ptr %ch, align 4, !tbaa !5 %call15.5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 102, i32 noundef %19) store i32 103, ptr %ch, align 4, !tbaa !5 %call15.6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 103, i32 noundef %18) store i32 104, ptr %ch, align 4, !tbaa !5 %call15.7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 104, i32 noundef %17) store i32 105, ptr %ch, align 4, !tbaa !5 %call15.8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 105, i32 noundef %16) store i32 106, ptr %ch, align 4, !tbaa !5 %call15.9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 106, i32 noundef %15) store i32 107, ptr %ch, align 4, !tbaa !5 %call15.10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 107, i32 noundef %14) store i32 108, ptr %ch, align 4, !tbaa !5 %call15.11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 108, i32 noundef %13) store i32 109, ptr %ch, align 4, !tbaa !5 %call15.12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 109, i32 noundef %12) store i32 110, ptr %ch, align 4, !tbaa !5 %call15.13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 110, i32 noundef %11) store i32 111, ptr %ch, align 4, !tbaa !5 %call15.14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 111, i32 noundef %10) store i32 112, ptr %ch, align 4, !tbaa !5 %call15.15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 112, i32 noundef %9) store i32 113, ptr %ch, align 4, !tbaa !5 %call15.16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 113, i32 noundef %8) store i32 114, ptr %ch, align 4, !tbaa !5 %call15.17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 114, i32 noundef %7) store i32 115, ptr %ch, align 4, !tbaa !5 %call15.18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 115, i32 noundef %6) store i32 116, ptr %ch, align 4, !tbaa !5 %call15.19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 116, i32 noundef %5) store i32 117, ptr %ch, align 4, !tbaa !5 %call15.20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 117, i32 noundef %4) store i32 118, ptr %ch, align 4, !tbaa !5 %call15.21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 118, i32 noundef %3) store i32 119, ptr %ch, align 4, !tbaa !5 %call15.22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 119, i32 noundef %2) store i32 120, ptr %ch, align 4, !tbaa !5 %call15.23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 120, i32 noundef %1) store i32 121, ptr %ch, align 4, !tbaa !5 %call15.24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 121, i32 noundef %0) store i32 122, ptr %ch, align 4, !tbaa !5 %arrayidx14.25 = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 25 %25 = load i32, ptr %arrayidx14.25, align 4, !tbaa !5 %call15.25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 122, i32 noundef %25) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %ch) #4 call void @llvm.lifetime.end.p0(i64 104, ptr nonnull %cnt) #4 ret i32 0 while.body: ; preds = %entry, %if.end11 %26 = load i32, ptr %ch, align 4 %27 = add i32 %26, -97 %or.cond = icmp ult i32 %27, 26 br i1 %or.cond, label %if.end11.sink.split, label %if.else if.else: ; preds = %while.body %28 = add i32 %26, -65 %or.cond17 = icmp ult i32 %28, 26 br i1 %or.cond17, label %if.end11.sink.split, label %if.end11 if.end11.sink.split: ; preds = %if.else, %while.body %.sink = phi i32 [ %27, %while.body ], [ %28, %if.else ] %idxprom = zext i32 %.sink to i64 %arrayidx = getelementptr inbounds [26 x i32], ptr %cnt, i64 0, i64 %idxprom %29 = load i32, ptr %arrayidx, align 4, !tbaa !5 %inc10 = add nsw i32 %29, 1 store i32 %inc10, ptr %arrayidx, align 4, !tbaa !5 br label %if.end11 if.end11: ; preds = %if.end11.sink.split, %if.else %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch) %cmp.not = icmp eq i32 %call, -1 br i1 %cmp.not, label %for.cond.preheader.loopexit, label %while.body, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree 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"}
#include<stdio.h> int main() { char a[10000],c; int cont=0,j=0; while(scanf("%c",&a[j])!=EOF){ j++; } a[j]=0; for(int i=0;i<26;i++){ j=0; cont =0; while(a[j]!=0){ if('a'+i==a[j]||'A'+i==a[j]){ cont++; } j++; } printf("%c : %d\n",'a'+i,cont); } }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_154984/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_154984/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [9 x i8] c"%c : %d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [10000 x i8], align 16 call void @llvm.lifetime.start.p0(i64 10000, ptr nonnull %a) #3 br label %while.cond while.cond: ; preds = %while.cond, %entry %indvars.iv = phi i64 [ %indvars.iv.next, %while.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [10000 x i8], ptr %a, i64 0, i64 %indvars.iv %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %cmp.not = icmp eq i32 %call, -1 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp.not, label %while.end, label %while.cond, !llvm.loop !5 while.end: ; preds = %while.cond store i8 0, ptr %arrayidx, align 1, !tbaa !7 br label %while.cond4.preheader while.cond4.preheader: ; preds = %while.end, %while.end23 %i.041 = phi i32 [ 0, %while.end ], [ %inc26, %while.end23 ] %0 = load i8, ptr %a, align 16, !tbaa !7 %cmp7.not38 = icmp eq i8 %0, 0 %.pre = add nuw nsw i32 %i.041, 97 br i1 %cmp7.not38, label %while.end23, label %while.body9.lr.ph while.body9.lr.ph: ; preds = %while.cond4.preheader %add15 = add nuw nsw i32 %i.041, 65 br label %while.body9 for.cond.cleanup: ; preds = %while.end23 call void @llvm.lifetime.end.p0(i64 10000, ptr nonnull %a) #3 ret i32 0 while.body9: ; preds = %while.body9.lr.ph, %while.body9 %indvars.iv43 = phi i64 [ 0, %while.body9.lr.ph ], [ %indvars.iv.next44, %while.body9 ] %1 = phi i8 [ %0, %while.body9.lr.ph ], [ %2, %while.body9 ] %cont.039 = phi i32 [ 0, %while.body9.lr.ph ], [ %cont.1, %while.body9 ] %conv = sext i8 %1 to i32 %cmp13 = icmp eq i32 %.pre, %conv %cmp19 = icmp eq i32 %add15, %conv %or.cond = select i1 %cmp13, i1 true, i1 %cmp19 %inc21 = zext i1 %or.cond to i32 %cont.1 = add nuw nsw i32 %cont.039, %inc21 %indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1 %arrayidx6 = getelementptr inbounds [10000 x i8], ptr %a, i64 0, i64 %indvars.iv.next44 %2 = load i8, ptr %arrayidx6, align 1, !tbaa !7 %cmp7.not = icmp eq i8 %2, 0 br i1 %cmp7.not, label %while.end23, label %while.body9, !llvm.loop !10 while.end23: ; preds = %while.body9, %while.cond4.preheader %cont.0.lcssa = phi i32 [ 0, %while.cond4.preheader ], [ %cont.1, %while.body9 ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre, i32 noundef %cont.0.lcssa) %inc26 = add nuw nsw i32 %i.041, 1 %exitcond.not = icmp eq i32 %inc26, 26 br i1 %exitcond.not, label %for.cond.cleanup, label %while.cond4.preheader, !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: 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 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = distinct !{!10, !6} !11 = distinct !{!11, !6}
#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; // //} //D - Road to Millionaire //static ll a[81]; //int main(void) { // int n,i; // ll c=1000,ans=1000,tmp,cnt=0; // // scanf("%d", &n); // // for(i=0;i<n;i++) // scanf("%lld", &a[i]); // // tmp = 210; // for (i = 0; i < n; i++) { // if (tmp == a[i]) continue; // // if (tmp < a[i]) {//売り // if (a[i] < a[i + 1])continue; // c += cnt * a[i]; // tmp = a[i]; // ans = _max(c, ans); // printf("<S>i:%d a[i]:%lld ans:%lld \n",i, a[i], ans); // } // else { //買い // if (a[i] > a[i + 1])continue; // cnt = c / a[i]; // c = c % a[i]; // tmp = a[i]; // printf("<B>i:%d a[i]:%lld %lld\n", i,a[i],c); // // } // } // printf("%lld\n",ans); // return 0; //} // //ABC 043 C-いっしょ //int main(void) { // int n; // int a[101]; // // scanf("%d", &n); // for (int i = 0; i < n; i++) scanf("%d", &a[i]); // // qsort(a, n, sizeof(int), i_asort); // // int tmp,tmp1; // tmp = (a[n - 1] - a[0]) / 2+ a[0]; // tmp1 = tmp + (a[n - 1] - a[0]) % 2; // if (tmp1 == tmp)tmp1 = 0; // // int ans=0,ans1=0; // for (int i = 0; i < n; i++) { // ans += (a[i] - tmp) * (a[i] - tmp); // if(tmp1) // ans1 += (a[i] - tmp1) * (a[i] - tmp1); // } // if(tmp1) ans=_min(ans, ans1); // printf("%d\n", ans); //} // int main(void) { int n; int l[11],tmp=0; scanf("%d", &n); for (int i = 0; i < n; i++) { scanf("%d", &l[i]); tmp += l[i]; } qsort(l, n, sizeof(int), i_dsort); tmp -= l[0]; (tmp > l[0]) ? puts("Yes\n") : puts("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155033/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155033/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\0A\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"No\0A\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) #14 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #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) #14 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) #15 %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) #15 %conv.i = trunc i64 %call.i to i32 call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %tmp) #15 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) #14 %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 %l = alloca [11 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #15 call void @llvm.lifetime.start.p0(i64 44, ptr nonnull %l) #15 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %0, 0 br i1 %cmp15, label %for.body, label %entry.for.cond.cleanup_crit_edge entry.for.cond.cleanup_crit_edge: ; preds = %entry %.pre = sext i32 %0 to i64 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry.for.cond.cleanup_crit_edge %conv.pre-phi = phi i64 [ %.pre, %entry.for.cond.cleanup_crit_edge ], [ %4, %for.body ] %tmp.0.lcssa = phi i32 [ 0, %entry.for.cond.cleanup_crit_edge ], [ %add, %for.body ] call void @qsort(ptr noundef nonnull %l, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @i_dsort) #15 %1 = load i32, ptr %l, align 16, !tbaa !5 %sub = sub nsw i32 %tmp.0.lcssa, %1 %cmp6 = icmp sgt i32 %sub, %1 %.str.1..str.2 = select i1 %cmp6, ptr @.str.1, ptr @.str.2 %call9 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 44, ptr nonnull %l) #15 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #15 ret i32 0 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %tmp.016 = phi i32 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [11 x i32], ptr %l, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %2, %tmp.016 %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.cond.cleanup, !llvm.loop !14 } ; 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 @puts(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 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 = { nounwind willreturn memory(read) } attributes #15 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!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}
#include <stdio.h> int main() { int n, l, max = 0, sum = 0; scanf("%d", &n); for (int i = 0; i < n; i++){ scanf("%d", &l); sum += l; if (max < l) { max = l; } } printf("%s", sum - max > max ? "Yes" : "No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155077/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155077/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"Yes\00", align 1 @.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %l = 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 %l) #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.cond.cleanup for.cond.cleanup: ; preds = %for.body, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa %cmp3 = icmp sgt i32 %sub, %max.0.lcssa %cond = select i1 %cmp3, ptr @.str.2, ptr @.str.3 %call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %cond) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 for.body: ; preds = %entry, %for.body %i.012 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %sum.011 = phi i32 [ %add, %for.body ], [ 0, %entry ] %max.010 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l) %1 = load i32, ptr %l, align 4, !tbaa !5 %add = add nsw i32 %1, %sum.011 %spec.select = call i32 @llvm.smax.i32(i32 %max.010, i32 %1) %inc = add nuw nsw i32 %i.012, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %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 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) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #define N 100 int main(){ int n,l[N],max=0,sum=0,i,j; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&l[i]); sum += l[i]; } for(j=0;j<n;j++){ if(max<=l[j]) max = l[j]; } if(max<sum-max) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155127/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155127/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %l = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %l) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp29 = icmp sgt i32 %0, 0 br i1 %cmp29, label %for.body, label %for.end14 for.cond4.preheader: ; preds = %for.body %cmp533 = icmp sgt i32 %8, 0 br i1 %cmp533, label %for.body6.preheader, label %for.end14 for.body6.preheader: ; preds = %for.cond4.preheader %wide.trip.count = zext i32 %8 to i64 %min.iters.check = icmp ult i32 %8, 8 br i1 %min.iters.check, label %for.body6.preheader48, label %vector.ph vector.ph: ; preds = %for.body6.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ] %1 = getelementptr inbounds [100 x i32], ptr %l, i64 0, i64 %index %wide.load = load <4 x i32>, ptr %1, align 16, !tbaa !5 %2 = getelementptr inbounds i32, ptr %1, i64 4 %wide.load47 = load <4 x i32>, ptr %2, align 16, !tbaa !5 %3 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi, <4 x i32> %wide.load) %4 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi46, <4 x i32> %wide.load47) %index.next = add nuw i64 %index, 8 %5 = icmp eq i64 %index.next, %n.vec br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %3, <4 x i32> %4) %6 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end14, label %for.body6.preheader48 for.body6.preheader48: ; preds = %for.body6.preheader, %middle.block %indvars.iv39.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ] %max.034.ph = phi i32 [ 0, %for.body6.preheader ], [ %6, %middle.block ] br label %for.body6 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.030 = phi i32 [ %add, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %l, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %7 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %7, %sum.030 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13 for.body6: ; preds = %for.body6.preheader48, %for.body6 %indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body6 ], [ %indvars.iv39.ph, %for.body6.preheader48 ] %max.034 = phi i32 [ %spec.select, %for.body6 ], [ %max.034.ph, %for.body6.preheader48 ] %arrayidx8 = getelementptr inbounds [100 x i32], ptr %l, i64 0, i64 %indvars.iv39 %10 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %max.034, i32 %10) %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1 %exitcond.not = icmp eq i64 %indvars.iv.next40, %wide.trip.count br i1 %exitcond.not, label %for.end14, label %for.body6, !llvm.loop !14 for.end14: ; preds = %for.body6, %middle.block, %entry, %for.cond4.preheader %sum.0.lcssa45 = phi i32 [ %add, %for.cond4.preheader ], [ 0, %entry ], [ %add, %middle.block ], [ %add, %for.body6 ] %max.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %entry ], [ %6, %middle.block ], [ %spec.select, %for.body6 ] %sub = sub nsw i32 %sum.0.lcssa45, %max.0.lcssa %cmp15 = icmp slt i32 %max.0.lcssa, %sub %.str.1..str.2 = select i1 %cmp15, ptr @.str.1, ptr @.str.2 %call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12, !11}
#include <stdio.h> #include <stdlib.h> #define NEW(p,n) {p = malloc(n * sizeof(p[0]));} typedef int* vector; vector make_vector(int n) { vector v; NEW(v,n); for(int i = 0; i < n; i++) { v[i] = 0; } return v; } int max(int n, vector v) { int ret = 0; for(int i = 0; i < n; i++) { if (v[i] > ret) ret = v[i]; } return ret; } int sum(int n, vector v) { int ret = 0; for(int i = 0; i < n; i++) { ret += v[i]; } return ret; } int main() { int N; vector L; scanf("%d",&N); L = make_vector(N); for(int i = 0; i < N; i++) { int tmp = 0; scanf("%d",&tmp); L[i] = tmp; } if (max(N,L) < sum(N,L) - max(N,L)) { printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155170/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155170/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: mustprogress nofree nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) uwtable define dso_local noalias ptr @make_vector(i32 noundef %n) local_unnamed_addr #0 { entry: %conv = sext i32 %n to i64 %mul = shl nsw i64 %conv, 2 %call = tail call noalias ptr @malloc(i64 noundef %mul) #10 %cmp6 = icmp sgt i32 %n, 0 br i1 %cmp6, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %0 = zext i32 %n to i64 %1 = shl nuw nsw i64 %0, 2 tail call void @llvm.memset.p0.i64(ptr align 4 %call, i8 0, i64 %1, i1 false), !tbaa !5 br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body.preheader, %entry ret ptr %call } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nosync nounwind memory(argmem: read) uwtable define dso_local i32 @max(i32 noundef %n, ptr nocapture noundef readonly %v) local_unnamed_addr #3 { entry: %cmp9 = icmp sgt i32 %n, 0 br i1 %cmp9, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader15, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ] %vec.phi13 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i32, ptr %v, i64 %index %wide.load = load <4 x i32>, ptr %0, align 4, !tbaa !5 %1 = getelementptr inbounds i32, ptr %0, i64 4 %wide.load14 = load <4 x i32>, ptr %1, align 4, !tbaa !5 %2 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi) %3 = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load14, <4 x i32> %vec.phi13) %index.next = add nuw i64 %index, 8 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %rdx.minmax = tail call <4 x i32> @llvm.smax.v4i32(<4 x i32> %2, <4 x i32> %3) %5 = tail call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader15 for.body.preheader15: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %ret.010.ph = phi i32 [ 0, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %ret.0.lcssa = phi i32 [ 0, %entry ], [ %5, %middle.block ], [ %spec.select, %for.body ] ret i32 %ret.0.lcssa for.body: ; preds = %for.body.preheader15, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader15 ] %ret.010 = phi i32 [ %spec.select, %for.body ], [ %ret.010.ph, %for.body.preheader15 ] %arrayidx = getelementptr inbounds i32, ptr %v, i64 %indvars.iv %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %spec.select = tail call i32 @llvm.smax.i32(i32 %6, i32 %ret.010) %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 !13 } ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @sum(i32 noundef %n, ptr nocapture noundef readonly %v) local_unnamed_addr #4 { entry: %cmp4 = icmp sgt i32 %n, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 %min.iters.check = icmp ult i32 %n, 8 br i1 %min.iters.check, label %for.body.preheader10, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i64 %wide.trip.count, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %2, %vector.body ] %vec.phi8 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ] %0 = getelementptr inbounds i32, ptr %v, i64 %index %wide.load = load <4 x i32>, ptr %0, align 4, !tbaa !5 %1 = getelementptr inbounds i32, ptr %0, i64 4 %wide.load9 = load <4 x i32>, ptr %1, align 4, !tbaa !5 %2 = add <4 x i32> %wide.load, %vec.phi %3 = add <4 x i32> %wide.load9, %vec.phi8 %index.next = add nuw i64 %index, 8 %4 = icmp eq i64 %index.next, %n.vec br i1 %4, label %middle.block, label %vector.body, !llvm.loop !14 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %3, %2 %5 = tail call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.cond.cleanup, label %for.body.preheader10 for.body.preheader10: ; preds = %for.body.preheader, %middle.block %indvars.iv.ph = phi i64 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] %ret.05.ph = phi i32 [ 0, %for.body.preheader ], [ %5, %middle.block ] br label %for.body for.cond.cleanup: ; preds = %for.body, %middle.block, %entry %ret.0.lcssa = phi i32 [ 0, %entry ], [ %5, %middle.block ], [ %add, %for.body ] ret i32 %ret.0.lcssa for.body: ; preds = %for.body.preheader10, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader10 ] %ret.05 = phi i32 [ %add, %for.body ], [ %ret.05.ph, %for.body.preheader10 ] %arrayidx = getelementptr inbounds i32, ptr %v, i64 %indvars.iv %6 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %6, %ret.05 %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 !15 } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #5 { entry: %N = alloca i32, align 4 %tmp = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %conv.i = sext i32 %0 to i64 %mul.i = shl nsw i64 %conv.i, 2 %call.i = call noalias ptr @malloc(i64 noundef %mul.i) #10 %cmp6.i = icmp sgt i32 %0, 0 br i1 %cmp6.i, label %for.body.preheader, label %if.else for.body.preheader: ; preds = %entry %1 = zext i32 %0 to i64 %2 = shl nuw nsw i64 %1, 2 call void @llvm.memset.p0.i64(ptr align 4 %call.i, i8 0, i64 %2, i1 false), !tbaa !5 br label %for.body for.cond.cleanup: ; preds = %for.body %cmp9.i = icmp sgt i32 %26, 0 br i1 %cmp9.i, label %for.body.preheader.i15, label %if.else for.body.preheader.i15: ; preds = %for.cond.cleanup %wide.trip.count.i = zext i32 %26 to i64 %min.iters.check = icmp ult i32 %26, 8 br i1 %min.iters.check, label %for.body.i.preheader, label %vector.ph vector.ph: ; preds = %for.body.preheader.i15 %n.vec = and i64 %wide.trip.count.i, 4294967288 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ] %vec.phi51 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %6, %vector.body ] %3 = getelementptr inbounds i32, ptr %call.i, i64 %index %wide.load = load <4 x i32>, ptr %3, align 4, !tbaa !5 %4 = getelementptr inbounds i32, ptr %3, i64 4 %wide.load52 = load <4 x i32>, ptr %4, align 4, !tbaa !5 %5 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi) %6 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load52, <4 x i32> %vec.phi51) %index.next = add nuw i64 %index, 8 %7 = icmp eq i64 %index.next, %n.vec br i1 %7, label %middle.block, label %vector.body, !llvm.loop !16 middle.block: ; preds = %vector.body %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %5, <4 x i32> %6) %8 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count.i br i1 %cmp.n, label %for.body.preheader.i17, label %for.body.i.preheader for.body.i.preheader: ; preds = %for.body.preheader.i15, %middle.block %indvars.iv.i.ph = phi i64 [ 0, %for.body.preheader.i15 ], [ %n.vec, %middle.block ] %ret.010.i.ph = phi i32 [ 0, %for.body.preheader.i15 ], [ %8, %middle.block ] br label %for.body.i for.body.i: ; preds = %for.body.i.preheader, %for.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv.i.ph, %for.body.i.preheader ] %ret.010.i = phi i32 [ %spec.select.i, %for.body.i ], [ %ret.010.i.ph, %for.body.i.preheader ] %arrayidx.i = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.i %9 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %spec.select.i = call i32 @llvm.smax.i32(i32 %9, i32 %ret.010.i) %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i br i1 %exitcond.not.i, label %for.body.preheader.i17, label %for.body.i, !llvm.loop !17 for.body.preheader.i17: ; preds = %for.body.i, %middle.block %spec.select.i.lcssa = phi i32 [ %8, %middle.block ], [ %spec.select.i, %for.body.i ] %min.iters.check55 = icmp ult i32 %26, 8 br i1 %min.iters.check55, label %for.body.i19.preheader, label %vector.ph56 vector.ph56: ; preds = %for.body.preheader.i17 %n.vec58 = and i64 %wide.trip.count.i, 4294967288 br label %vector.body61 vector.body61: ; preds = %vector.body61, %vector.ph56 %index62 = phi i64 [ 0, %vector.ph56 ], [ %index.next67, %vector.body61 ] %vec.phi63 = phi <4 x i32> [ zeroinitializer, %vector.ph56 ], [ %12, %vector.body61 ] %vec.phi64 = phi <4 x i32> [ zeroinitializer, %vector.ph56 ], [ %13, %vector.body61 ] %10 = getelementptr inbounds i32, ptr %call.i, i64 %index62 %wide.load65 = load <4 x i32>, ptr %10, align 4, !tbaa !5 %11 = getelementptr inbounds i32, ptr %10, i64 4 %wide.load66 = load <4 x i32>, ptr %11, align 4, !tbaa !5 %12 = add <4 x i32> %wide.load65, %vec.phi63 %13 = add <4 x i32> %wide.load66, %vec.phi64 %index.next67 = add nuw i64 %index62, 8 %14 = icmp eq i64 %index.next67, %n.vec58 br i1 %14, label %middle.block53, label %vector.body61, !llvm.loop !18 middle.block53: ; preds = %vector.body61 %bin.rdx = add <4 x i32> %13, %12 %15 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n60 = icmp eq i64 %n.vec58, %wide.trip.count.i br i1 %cmp.n60, label %for.body.preheader.i26, label %for.body.i19.preheader for.body.i19.preheader: ; preds = %for.body.preheader.i17, %middle.block53 %indvars.iv.i20.ph = phi i64 [ 0, %for.body.preheader.i17 ], [ %n.vec58, %middle.block53 ] %ret.05.i.ph = phi i32 [ 0, %for.body.preheader.i17 ], [ %15, %middle.block53 ] br label %for.body.i19 for.body.i19: ; preds = %for.body.i19.preheader, %for.body.i19 %indvars.iv.i20 = phi i64 [ %indvars.iv.next.i22, %for.body.i19 ], [ %indvars.iv.i20.ph, %for.body.i19.preheader ] %ret.05.i = phi i32 [ %add.i, %for.body.i19 ], [ %ret.05.i.ph, %for.body.i19.preheader ] %arrayidx.i21 = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.i20 %16 = load i32, ptr %arrayidx.i21, align 4, !tbaa !5 %add.i = add nsw i32 %16, %ret.05.i %indvars.iv.next.i22 = add nuw nsw i64 %indvars.iv.i20, 1 %exitcond.not.i23 = icmp eq i64 %indvars.iv.next.i22, %wide.trip.count.i br i1 %exitcond.not.i23, label %for.body.preheader.i26, label %for.body.i19, !llvm.loop !19 for.body.preheader.i26: ; preds = %for.body.i19, %middle.block53 %add.i.lcssa = phi i32 [ %15, %middle.block53 ], [ %add.i, %for.body.i19 ] %min.iters.check71 = icmp ult i32 %26, 8 br i1 %min.iters.check71, label %for.body.i28.preheader, label %vector.ph72 vector.ph72: ; preds = %for.body.preheader.i26 %n.vec74 = and i64 %wide.trip.count.i, 4294967288 br label %vector.body77 vector.body77: ; preds = %vector.body77, %vector.ph72 %index78 = phi i64 [ 0, %vector.ph72 ], [ %index.next83, %vector.body77 ] %vec.phi79 = phi <4 x i32> [ zeroinitializer, %vector.ph72 ], [ %19, %vector.body77 ] %vec.phi80 = phi <4 x i32> [ zeroinitializer, %vector.ph72 ], [ %20, %vector.body77 ] %17 = getelementptr inbounds i32, ptr %call.i, i64 %index78 %wide.load81 = load <4 x i32>, ptr %17, align 4, !tbaa !5 %18 = getelementptr inbounds i32, ptr %17, i64 4 %wide.load82 = load <4 x i32>, ptr %18, align 4, !tbaa !5 %19 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load81, <4 x i32> %vec.phi79) %20 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load82, <4 x i32> %vec.phi80) %index.next83 = add nuw i64 %index78, 8 %21 = icmp eq i64 %index.next83, %n.vec74 br i1 %21, label %middle.block69, label %vector.body77, !llvm.loop !20 middle.block69: ; preds = %vector.body77 %rdx.minmax84 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %19, <4 x i32> %20) %22 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax84) %cmp.n76 = icmp eq i64 %n.vec74, %wide.trip.count.i br i1 %cmp.n76, label %max.exit35, label %for.body.i28.preheader for.body.i28.preheader: ; preds = %for.body.preheader.i26, %middle.block69 %indvars.iv.i29.ph = phi i64 [ 0, %for.body.preheader.i26 ], [ %n.vec74, %middle.block69 ] %ret.010.i30.ph = phi i32 [ 0, %for.body.preheader.i26 ], [ %22, %middle.block69 ] br label %for.body.i28 for.body.i28: ; preds = %for.body.i28.preheader, %for.body.i28 %indvars.iv.i29 = phi i64 [ %indvars.iv.next.i33, %for.body.i28 ], [ %indvars.iv.i29.ph, %for.body.i28.preheader ] %ret.010.i30 = phi i32 [ %spec.select.i32, %for.body.i28 ], [ %ret.010.i30.ph, %for.body.i28.preheader ] %arrayidx.i31 = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv.i29 %23 = load i32, ptr %arrayidx.i31, align 4, !tbaa !5 %spec.select.i32 = call i32 @llvm.smax.i32(i32 %23, i32 %ret.010.i30) %indvars.iv.next.i33 = add nuw nsw i64 %indvars.iv.i29, 1 %exitcond.not.i34 = icmp eq i64 %indvars.iv.next.i33, %wide.trip.count.i br i1 %exitcond.not.i34, label %max.exit35, label %for.body.i28, !llvm.loop !21 max.exit35: ; preds = %for.body.i28, %middle.block69 %spec.select.i32.lcssa = phi i32 [ %22, %middle.block69 ], [ %spec.select.i32, %for.body.i28 ] %24 = sub nsw i32 %add.i.lcssa, %spec.select.i32.lcssa %cmp6 = icmp slt i32 %spec.select.i.lcssa, %24 br i1 %cmp6, label %if.end, label %if.else for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %tmp) #11 store i32 0, ptr %tmp, align 4, !tbaa !5 %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %tmp) %25 = load i32, ptr %tmp, align 4, !tbaa !5 %arrayidx = getelementptr inbounds i32, ptr %call.i, i64 %indvars.iv store i32 %25, ptr %arrayidx, align 4, !tbaa !5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %tmp) #11 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %26 = load i32, ptr %N, align 4, !tbaa !5 %27 = sext i32 %26 to i64 %cmp = icmp slt i64 %indvars.iv.next, %27 br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !22 if.else: ; preds = %entry, %for.cond.cleanup, %max.exit35 br label %if.end if.end: ; preds = %max.exit35, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %max.exit35 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #7 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.smax.v4i32(<4 x i32>) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #9 attributes #0 = { mustprogress nofree nounwind willreturn memory(write, argmem: none, inaccessiblemem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind } attributes #8 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind allocsize(0) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11} !14 = distinct !{!14, !10, !11, !12} !15 = distinct !{!15, !10, !12, !11} !16 = distinct !{!16, !10, !11, !12} !17 = distinct !{!17, !10, !12, !11} !18 = distinct !{!18, !10, !11, !12} !19 = distinct !{!19, !10, !12, !11} !20 = distinct !{!20, !10, !11, !12} !21 = distinct !{!21, !10, !12, !11} !22 = distinct !{!22, !10}
#include <stdio.h> int main(void){ // Your code here! int N; scanf("%d",&N); int i,li[N],sum,big=0; for(i=0;i<N;i++){ scanf("%d",&li[i]); if (big<li[i]){ sum+=big; big=li[i]; } else{ sum+=li[i]; } } //printf("%d,%d,%d\n",sum,N,big); (sum>big) ? puts("Yes"):puts("No"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155213/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155213/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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) #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 %cmp22 = icmp sgt i32 %3, 0 br i1 %cmp22, label %for.body, label %cond.false for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %big.025 = phi i32 [ %.big.0, %for.body ], [ 0, %entry ] %sum.024 = phi i32 [ %sum.1, %for.body ], [ undef, %entry ] %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %4 = load i32, ptr %arrayidx, align 4, !tbaa !5 %big.0. = call i32 @llvm.smin.i32(i32 %big.025, i32 %4) %.big.0 = call i32 @llvm.smax.i32(i32 %big.025, i32 %4) %sum.1 = add nsw i32 %big.0., %sum.024 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %N, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %cmp10 = icmp sgt i32 %sum.1, %.big.0 br i1 %cmp10, label %cond.end, label %cond.false cond.false: ; preds = %entry, %for.end br label %cond.end cond.end: ; preds = %for.end, %cond.false %.str.2.sink = phi ptr [ @.str.2, %cond.false ], [ @.str.1, %for.end ] %call12 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink) 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 declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; 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.smax.i32(i32, i32) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(void) { int n = 0; int a[100]; int i; int max = 0; int sum = 0; scanf("%d", &n); for (i = 0; i < n;i++){ scanf("%d", &a[i]); if(max < a[i]){max = a[i];} sum += a[i]; } if(max < (sum - max)){ printf("Yes"); } else{ printf("No"); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155271/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155271/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 store i32 0, ptr %n, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp22 = icmp sgt i32 %0, 0 br i1 %cmp22, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %sum.025 = phi i32 [ %add, %for.body ], [ 0, %entry ] %max.024 = phi i32 [ %spec.select, %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) %1 = load i32, ptr %arrayidx, align 4, !tbaa !5 %spec.select = call i32 @llvm.smax.i32(i32 %max.024, i32 %1) %add = add nsw i32 %1, %sum.025 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %2 = load i32, ptr %n, align 4, !tbaa !5 %3 = sext i32 %2 to i64 %cmp = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %spec.select, %for.body ] %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %for.body ] %sub = sub nsw i32 %sum.0.lcssa, %max.0.lcssa %cmp9 = icmp slt i32 %max.0.lcssa, %sub %.str.1..str.2 = select i1 %cmp9, ptr @.str.1, ptr @.str.2 %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> #define NEW(p,n){p=malloc((n)*sizeof(p[0]));if(p==NULL){printf("not enough memory\n");exit(1);};} //pの型の変数n個の要素分のメモリを確保し、そのアドレスをpに代入するマクロ #define INFTY 999999 int main(void){ int N; scanf("%d",&N); int* L; NEW(L,N); for(int i=0;i<N;i++){ scanf("%d",&L[i]); } int index; int max=0; for(int i=0;i<N;i++){ if(L[i]>max){ max=L[i]; index=i; } } int sum=0; for(int i=0;i<N;i++){ if(i!=index){ sum+=L[i]; } } if(sum>L[index]){ printf("Yes\n"); } else{ printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155314/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155314/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.5 = private unnamed_addr constant [18 x i8] c"not enough memory\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) #7 %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) #8 %cmp = icmp eq ptr %call1, null br i1 %cmp, label %if.then, label %for.cond.preheader for.cond.preheader: ; preds = %entry %cmp466 = icmp sgt i32 %0, 0 br i1 %cmp466, label %for.body, label %for.cond.cleanup28 if.then: ; preds = %entry %puts64 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) call void @exit(i32 noundef 1) #9 unreachable for.cond8.preheader: ; preds = %for.body %cmp968 = icmp sgt i32 %2, 0 br i1 %cmp968, label %for.body12.preheader, label %for.cond.cleanup28 for.body12.preheader: ; preds = %for.cond8.preheader %wide.trip.count = zext i32 %2 to i64 %xtraiter = and i64 %wide.trip.count, 3 %1 = icmp ult i32 %2, 4 br i1 %1, label %for.cond25.preheader.unr-lcssa, label %for.body12.preheader.new for.body12.preheader.new: ; preds = %for.body12.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body12 for.body: ; preds = %for.cond.preheader, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ] %arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv %call6 = 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 %cmp4 = icmp slt i64 %indvars.iv.next, %3 br i1 %cmp4, label %for.body, label %for.cond8.preheader, !llvm.loop !9 for.cond25.preheader.unr-lcssa: ; preds = %for.body12, %for.body12.preheader %indvars.iv79.unr = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next80.3, %for.body12 ] %max.070.unr = phi i32 [ 0, %for.body12.preheader ], [ %spec.select65.3, %for.body12 ] %index.069.unr = phi i32 [ undef, %for.body12.preheader ], [ %spec.select.3, %for.body12 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond25.preheader, label %for.body12.epil for.body12.epil: ; preds = %for.cond25.preheader.unr-lcssa, %for.body12.epil %indvars.iv79.epil = phi i64 [ %indvars.iv.next80.epil, %for.body12.epil ], [ %indvars.iv79.unr, %for.cond25.preheader.unr-lcssa ] %max.070.epil = phi i32 [ %spec.select65.epil, %for.body12.epil ], [ %max.070.unr, %for.cond25.preheader.unr-lcssa ] %index.069.epil = phi i32 [ %spec.select.epil, %for.body12.epil ], [ %index.069.unr, %for.cond25.preheader.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body12.epil ], [ 0, %for.cond25.preheader.unr-lcssa ] %arrayidx14.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv79.epil %4 = load i32, ptr %arrayidx14.epil, align 4, !tbaa !5 %cmp15.epil = icmp sgt i32 %4, %max.070.epil %5 = trunc i64 %indvars.iv79.epil to i32 %spec.select.epil = select i1 %cmp15.epil, i32 %5, i32 %index.069.epil %spec.select65.epil = call i32 @llvm.smax.i32(i32 %4, i32 %max.070.epil) %indvars.iv.next80.epil = add nuw nsw i64 %indvars.iv79.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond25.preheader, label %for.body12.epil, !llvm.loop !11 for.cond25.preheader: ; preds = %for.body12.epil, %for.cond25.preheader.unr-lcssa %spec.select.lcssa = phi i32 [ %index.069.unr, %for.cond25.preheader.unr-lcssa ], [ %spec.select.epil, %for.body12.epil ] br i1 %cmp968, label %for.body29.preheader, label %for.cond.cleanup28 for.body29.preheader: ; preds = %for.cond25.preheader %6 = zext i32 %spec.select.lcssa to i64 %xtraiter96 = and i64 %wide.trip.count, 3 %7 = icmp ult i32 %2, 4 br i1 %7, label %for.cond.cleanup28.loopexit.unr-lcssa, label %for.body29.preheader.new for.body29.preheader.new: ; preds = %for.body29.preheader %unroll_iter100 = and i64 %wide.trip.count, 4294967292 br label %for.body29 for.body12: ; preds = %for.body12, %for.body12.preheader.new %indvars.iv79 = phi i64 [ 0, %for.body12.preheader.new ], [ %indvars.iv.next80.3, %for.body12 ] %max.070 = phi i32 [ 0, %for.body12.preheader.new ], [ %spec.select65.3, %for.body12 ] %index.069 = phi i32 [ undef, %for.body12.preheader.new ], [ %spec.select.3, %for.body12 ] %niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.3, %for.body12 ] %arrayidx14 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv79 %8 = load i32, ptr %arrayidx14, align 4, !tbaa !5 %cmp15 = icmp sgt i32 %8, %max.070 %9 = trunc i64 %indvars.iv79 to i32 %spec.select = select i1 %cmp15, i32 %9, i32 %index.069 %spec.select65 = call i32 @llvm.smax.i32(i32 %8, i32 %max.070) %indvars.iv.next80 = or i64 %indvars.iv79, 1 %arrayidx14.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next80 %10 = load i32, ptr %arrayidx14.1, align 4, !tbaa !5 %cmp15.1 = icmp sgt i32 %10, %spec.select65 %11 = trunc i64 %indvars.iv.next80 to i32 %spec.select.1 = select i1 %cmp15.1, i32 %11, i32 %spec.select %spec.select65.1 = call i32 @llvm.smax.i32(i32 %10, i32 %spec.select65) %indvars.iv.next80.1 = or i64 %indvars.iv79, 2 %arrayidx14.2 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next80.1 %12 = load i32, ptr %arrayidx14.2, align 4, !tbaa !5 %cmp15.2 = icmp sgt i32 %12, %spec.select65.1 %13 = trunc i64 %indvars.iv.next80.1 to i32 %spec.select.2 = select i1 %cmp15.2, i32 %13, i32 %spec.select.1 %spec.select65.2 = call i32 @llvm.smax.i32(i32 %12, i32 %spec.select65.1) %indvars.iv.next80.2 = or i64 %indvars.iv79, 3 %arrayidx14.3 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next80.2 %14 = load i32, ptr %arrayidx14.3, align 4, !tbaa !5 %cmp15.3 = icmp sgt i32 %14, %spec.select65.2 %15 = trunc i64 %indvars.iv.next80.2 to i32 %spec.select.3 = select i1 %cmp15.3, i32 %15, i32 %spec.select.2 %spec.select65.3 = call i32 @llvm.smax.i32(i32 %14, i32 %spec.select65.2) %indvars.iv.next80.3 = add nuw nsw i64 %indvars.iv79, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond25.preheader.unr-lcssa, label %for.body12, !llvm.loop !13 for.cond.cleanup28.loopexit.unr-lcssa: ; preds = %for.inc36.3, %for.body29.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body29.preheader ], [ %sum.1.3, %for.inc36.3 ] %indvars.iv82.unr = phi i64 [ 0, %for.body29.preheader ], [ %indvars.iv.next83.3, %for.inc36.3 ] %sum.074.unr = phi i32 [ 0, %for.body29.preheader ], [ %sum.1.3, %for.inc36.3 ] %lcmp.mod98.not = icmp eq i64 %xtraiter96, 0 br i1 %lcmp.mod98.not, label %for.cond.cleanup28, label %for.body29.epil for.body29.epil: ; preds = %for.cond.cleanup28.loopexit.unr-lcssa, %for.inc36.epil %indvars.iv82.epil = phi i64 [ %indvars.iv.next83.epil, %for.inc36.epil ], [ %indvars.iv82.unr, %for.cond.cleanup28.loopexit.unr-lcssa ] %sum.074.epil = phi i32 [ %sum.1.epil, %for.inc36.epil ], [ %sum.074.unr, %for.cond.cleanup28.loopexit.unr-lcssa ] %epil.iter97 = phi i64 [ %epil.iter97.next, %for.inc36.epil ], [ 0, %for.cond.cleanup28.loopexit.unr-lcssa ] %cmp30.not.epil = icmp eq i64 %indvars.iv82.epil, %6 br i1 %cmp30.not.epil, label %for.inc36.epil, label %if.then32.epil if.then32.epil: ; preds = %for.body29.epil %arrayidx34.epil = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv82.epil %16 = load i32, ptr %arrayidx34.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %16, %sum.074.epil br label %for.inc36.epil for.inc36.epil: ; preds = %if.then32.epil, %for.body29.epil %sum.1.epil = phi i32 [ %add.epil, %if.then32.epil ], [ %sum.074.epil, %for.body29.epil ] %indvars.iv.next83.epil = add nuw nsw i64 %indvars.iv82.epil, 1 %epil.iter97.next = add i64 %epil.iter97, 1 %epil.iter97.cmp.not = icmp eq i64 %epil.iter97.next, %xtraiter96 br i1 %epil.iter97.cmp.not, label %for.cond.cleanup28, label %for.body29.epil, !llvm.loop !14 for.cond.cleanup28: ; preds = %for.cond.cleanup28.loopexit.unr-lcssa, %for.inc36.epil, %for.cond.preheader, %for.cond8.preheader, %for.cond25.preheader %index.0.lcssa94 = phi i32 [ %spec.select.lcssa, %for.cond25.preheader ], [ undef, %for.cond8.preheader ], [ undef, %for.cond.preheader ], [ %spec.select.lcssa, %for.inc36.epil ], [ %spec.select.lcssa, %for.cond.cleanup28.loopexit.unr-lcssa ] %sum.0.lcssa = phi i32 [ 0, %for.cond25.preheader ], [ 0, %for.cond8.preheader ], [ 0, %for.cond.preheader ], [ %sum.1.lcssa.ph, %for.cond.cleanup28.loopexit.unr-lcssa ], [ %sum.1.epil, %for.inc36.epil ] %idxprom39 = sext i32 %index.0.lcssa94 to i64 %arrayidx40 = getelementptr inbounds i32, ptr %call1, i64 %idxprom39 %17 = load i32, ptr %arrayidx40, align 4, !tbaa !5 %cmp41 = icmp sgt i32 %sum.0.lcssa, %17 %str.4.str = select i1 %cmp41, ptr @str.4, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #7 ret i32 0 for.body29: ; preds = %for.inc36.3, %for.body29.preheader.new %indvars.iv82 = phi i64 [ 0, %for.body29.preheader.new ], [ %indvars.iv.next83.3, %for.inc36.3 ] %sum.074 = phi i32 [ 0, %for.body29.preheader.new ], [ %sum.1.3, %for.inc36.3 ] %niter101 = phi i64 [ 0, %for.body29.preheader.new ], [ %niter101.next.3, %for.inc36.3 ] %cmp30.not = icmp eq i64 %indvars.iv82, %6 br i1 %cmp30.not, label %for.inc36, label %if.then32 if.then32: ; preds = %for.body29 %arrayidx34 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv82 %18 = load i32, ptr %arrayidx34, align 4, !tbaa !5 %add = add nsw i32 %18, %sum.074 br label %for.inc36 for.inc36: ; preds = %for.body29, %if.then32 %sum.1 = phi i32 [ %add, %if.then32 ], [ %sum.074, %for.body29 ] %indvars.iv.next83 = or i64 %indvars.iv82, 1 %cmp30.not.1 = icmp eq i64 %indvars.iv.next83, %6 br i1 %cmp30.not.1, label %for.inc36.1, label %if.then32.1 if.then32.1: ; preds = %for.inc36 %arrayidx34.1 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next83 %19 = load i32, ptr %arrayidx34.1, align 4, !tbaa !5 %add.1 = add nsw i32 %19, %sum.1 br label %for.inc36.1 for.inc36.1: ; preds = %if.then32.1, %for.inc36 %sum.1.1 = phi i32 [ %add.1, %if.then32.1 ], [ %sum.1, %for.inc36 ] %indvars.iv.next83.1 = or i64 %indvars.iv82, 2 %cmp30.not.2 = icmp eq i64 %indvars.iv.next83.1, %6 br i1 %cmp30.not.2, label %for.inc36.2, label %if.then32.2 if.then32.2: ; preds = %for.inc36.1 %arrayidx34.2 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next83.1 %20 = load i32, ptr %arrayidx34.2, align 4, !tbaa !5 %add.2 = add nsw i32 %20, %sum.1.1 br label %for.inc36.2 for.inc36.2: ; preds = %if.then32.2, %for.inc36.1 %sum.1.2 = phi i32 [ %add.2, %if.then32.2 ], [ %sum.1.1, %for.inc36.1 ] %indvars.iv.next83.2 = or i64 %indvars.iv82, 3 %cmp30.not.3 = icmp eq i64 %indvars.iv.next83.2, %6 br i1 %cmp30.not.3, label %for.inc36.3, label %if.then32.3 if.then32.3: ; preds = %for.inc36.2 %arrayidx34.3 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.next83.2 %21 = load i32, ptr %arrayidx34.3, align 4, !tbaa !5 %add.3 = add nsw i32 %21, %sum.1.2 br label %for.inc36.3 for.inc36.3: ; preds = %if.then32.3, %for.inc36.2 %sum.1.3 = phi i32 [ %add.3, %if.then32.3 ], [ %sum.1.2, %for.inc36.2 ] %indvars.iv.next83.3 = add nuw nsw i64 %indvars.iv82, 4 %niter101.next.3 = add i64 %niter101, 4 %niter101.ncmp.3 = icmp eq i64 %niter101.next.3, %unroll_iter100 br i1 %niter101.ncmp.3, label %for.cond.cleanup28.loopexit.unr-lcssa, label %for.body29, !llvm.loop !15 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3 ; Function Attrs: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #6 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } attributes #8 = { nounwind allocsize(0) } attributes #9 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !12} !15 = distinct !{!15, !10}
#include <stdio.h> int main() { int N,i,max=0,maxf; int L[100],sum=0; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d",&L[i]); if(L[i]>max){ max = L[i]; maxf=i; } } for(i=0;i<N;i++){ if(i != maxf){ sum += L[i]; } } if(sum > max){ printf("Yes"); }else{ printf("No"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155358/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155358/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %L = alloca [100 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %L) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp35 = icmp sgt i32 %0, 0 br i1 %cmp35, label %for.body, label %if.else for.cond7.preheader: ; preds = %for.body %1 = zext i32 %spec.select34 to i64 %cmp841 = icmp sgt i32 %5, 0 br i1 %cmp841, label %for.body9.preheader, label %for.end17 for.body9.preheader: ; preds = %for.cond7.preheader %wide.trip.count = zext i32 %5 to i64 %xtraiter = and i64 %wide.trip.count, 3 %2 = icmp ult i32 %5, 4 br i1 %2, label %for.end17.loopexit.unr-lcssa, label %for.body9.preheader.new for.body9.preheader.new: ; preds = %for.body9.preheader %unroll_iter = and i64 %wide.trip.count, 4294967292 br label %for.body9 for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %maxf.038 = phi i32 [ %spec.select34, %for.body ], [ undef, %entry ] %max.037 = phi i32 [ %spec.select, %for.body ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100 x i32], ptr %L, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %3 = load i32, ptr %arrayidx, align 4, !tbaa !5 %cmp4 = icmp sgt i32 %3, %max.037 %spec.select = call i32 @llvm.smax.i32(i32 %3, i32 %max.037) %4 = trunc i64 %indvars.iv to i32 %spec.select34 = select i1 %cmp4, i32 %4, i32 %maxf.038 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %N, align 4, !tbaa !5 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.cond7.preheader, !llvm.loop !9 for.body9: ; preds = %for.inc15.3, %for.body9.preheader.new %indvars.iv47 = phi i64 [ 0, %for.body9.preheader.new ], [ %indvars.iv.next48.3, %for.inc15.3 ] %sum.043 = phi i32 [ 0, %for.body9.preheader.new ], [ %sum.1.3, %for.inc15.3 ] %niter = phi i64 [ 0, %for.body9.preheader.new ], [ %niter.next.3, %for.inc15.3 ] %cmp10.not = icmp eq i64 %indvars.iv47, %1 br i1 %cmp10.not, label %for.inc15, label %if.then11 if.then11: ; preds = %for.body9 %arrayidx13 = getelementptr inbounds [100 x i32], ptr %L, i64 0, i64 %indvars.iv47 %7 = load i32, ptr %arrayidx13, align 16, !tbaa !5 %add = add nsw i32 %7, %sum.043 br label %for.inc15 for.inc15: ; preds = %for.body9, %if.then11 %sum.1 = phi i32 [ %add, %if.then11 ], [ %sum.043, %for.body9 ] %indvars.iv.next48 = or i64 %indvars.iv47, 1 %cmp10.not.1 = icmp eq i64 %indvars.iv.next48, %1 br i1 %cmp10.not.1, label %for.inc15.1, label %if.then11.1 if.then11.1: ; preds = %for.inc15 %arrayidx13.1 = getelementptr inbounds [100 x i32], ptr %L, i64 0, i64 %indvars.iv.next48 %8 = load i32, ptr %arrayidx13.1, align 4, !tbaa !5 %add.1 = add nsw i32 %8, %sum.1 br label %for.inc15.1 for.inc15.1: ; preds = %if.then11.1, %for.inc15 %sum.1.1 = phi i32 [ %add.1, %if.then11.1 ], [ %sum.1, %for.inc15 ] %indvars.iv.next48.1 = or i64 %indvars.iv47, 2 %cmp10.not.2 = icmp eq i64 %indvars.iv.next48.1, %1 br i1 %cmp10.not.2, label %for.inc15.2, label %if.then11.2 if.then11.2: ; preds = %for.inc15.1 %arrayidx13.2 = getelementptr inbounds [100 x i32], ptr %L, i64 0, i64 %indvars.iv.next48.1 %9 = load i32, ptr %arrayidx13.2, align 8, !tbaa !5 %add.2 = add nsw i32 %9, %sum.1.1 br label %for.inc15.2 for.inc15.2: ; preds = %if.then11.2, %for.inc15.1 %sum.1.2 = phi i32 [ %add.2, %if.then11.2 ], [ %sum.1.1, %for.inc15.1 ] %indvars.iv.next48.2 = or i64 %indvars.iv47, 3 %cmp10.not.3 = icmp eq i64 %indvars.iv.next48.2, %1 br i1 %cmp10.not.3, label %for.inc15.3, label %if.then11.3 if.then11.3: ; preds = %for.inc15.2 %arrayidx13.3 = getelementptr inbounds [100 x i32], ptr %L, i64 0, i64 %indvars.iv.next48.2 %10 = load i32, ptr %arrayidx13.3, align 4, !tbaa !5 %add.3 = add nsw i32 %10, %sum.1.2 br label %for.inc15.3 for.inc15.3: ; preds = %if.then11.3, %for.inc15.2 %sum.1.3 = phi i32 [ %add.3, %if.then11.3 ], [ %sum.1.2, %for.inc15.2 ] %indvars.iv.next48.3 = add nuw nsw i64 %indvars.iv47, 4 %niter.next.3 = add i64 %niter, 4 %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.end17.loopexit.unr-lcssa, label %for.body9, !llvm.loop !11 for.end17.loopexit.unr-lcssa: ; preds = %for.inc15.3, %for.body9.preheader %sum.1.lcssa.ph = phi i32 [ undef, %for.body9.preheader ], [ %sum.1.3, %for.inc15.3 ] %indvars.iv47.unr = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next48.3, %for.inc15.3 ] %sum.043.unr = phi i32 [ 0, %for.body9.preheader ], [ %sum.1.3, %for.inc15.3 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end17, label %for.body9.epil for.body9.epil: ; preds = %for.end17.loopexit.unr-lcssa, %for.inc15.epil %indvars.iv47.epil = phi i64 [ %indvars.iv.next48.epil, %for.inc15.epil ], [ %indvars.iv47.unr, %for.end17.loopexit.unr-lcssa ] %sum.043.epil = phi i32 [ %sum.1.epil, %for.inc15.epil ], [ %sum.043.unr, %for.end17.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.inc15.epil ], [ 0, %for.end17.loopexit.unr-lcssa ] %cmp10.not.epil = icmp eq i64 %indvars.iv47.epil, %1 br i1 %cmp10.not.epil, label %for.inc15.epil, label %if.then11.epil if.then11.epil: ; preds = %for.body9.epil %arrayidx13.epil = getelementptr inbounds [100 x i32], ptr %L, i64 0, i64 %indvars.iv47.epil %11 = load i32, ptr %arrayidx13.epil, align 4, !tbaa !5 %add.epil = add nsw i32 %11, %sum.043.epil br label %for.inc15.epil for.inc15.epil: ; preds = %if.then11.epil, %for.body9.epil %sum.1.epil = phi i32 [ %add.epil, %if.then11.epil ], [ %sum.043.epil, %for.body9.epil ] %indvars.iv.next48.epil = add nuw nsw i64 %indvars.iv47.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end17, label %for.body9.epil, !llvm.loop !12 for.end17: ; preds = %for.end17.loopexit.unr-lcssa, %for.inc15.epil, %for.cond7.preheader %sum.0.lcssa = phi i32 [ 0, %for.cond7.preheader ], [ %sum.1.lcssa.ph, %for.end17.loopexit.unr-lcssa ], [ %sum.1.epil, %for.inc15.epil ] %cmp18 = icmp sgt i32 %sum.0.lcssa, %spec.select br i1 %cmp18, label %if.end22, label %if.else if.else: ; preds = %entry, %for.end17 br label %if.end22 if.end22: ; preds = %for.end17, %if.else %.str.2.sink = phi ptr [ @.str.2, %if.else ], [ @.str.1, %for.end17 ] %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %L) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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, !13} !13 = !{!"llvm.loop.unroll.disable"}
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> typedef long long ll; int ft_sqrt(int nb) { int i = 1; int cnt = 0; while (i <= nb) { if (i % 2) { nb -= i; cnt++; } i++; } // if (nb == 0) return cnt; // return 0; } int main() { int x; scanf("%d", &x); int max = 0; int j,k,i = 1; int n = 1; while (i <= x) { // printf("%d : %d\n", i, ft_sqrt(i)); j = 0; while (j <= sqrt(i)) { n = 1; k = 0; while (k < x) { n *= j; if (n == i) { if (i > max) max = i; break ; } k++; } j++; } i++; } printf("%d", max); return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155400/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155400/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @ft_sqrt(i32 noundef %nb) local_unnamed_addr #0 { entry: %cmp.not7 = icmp slt i32 %nb, 1 br i1 %cmp.not7, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %cnt.010 = phi i32 [ %cnt.1, %while.body ], [ 0, %entry ] %i.09 = phi i32 [ %inc1, %while.body ], [ 1, %entry ] %nb.addr.08 = phi i32 [ %nb.addr.1, %while.body ], [ %nb, %entry ] %rem = and i32 %i.09, 1 %tobool.not = icmp eq i32 %rem, 0 %sub = select i1 %tobool.not, i32 0, i32 %i.09 %nb.addr.1 = sub nsw i32 %nb.addr.08, %sub %cnt.1 = add i32 %cnt.010, %rem %inc1 = add nuw nsw i32 %i.09, 1 %cmp.not.not = icmp slt i32 %i.09, %nb.addr.1 br i1 %cmp.not.not, label %while.body, label %while.end, !llvm.loop !5 while.end: ; preds = %while.body, %entry %cnt.0.lcssa = phi i32 [ 0, %entry ], [ %cnt.1, %while.body ] ret i32 %cnt.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: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !7 %cmp.not39 = icmp slt i32 %0, 1 br i1 %cmp.not39, label %while.end20, label %while.cond1.preheader while.cond1.preheader: ; preds = %entry, %while.end18 %i.041 = phi i32 [ %inc19, %while.end18 ], [ 1, %entry ] %max.040 = phi i32 [ %max.1.lcssa, %while.end18 ], [ 0, %entry ] %conv2 = sitofp i32 %i.041 to double %call335 = call double @sqrt(double noundef %conv2) #6 %cmp436 = fcmp ult double %call335, 0.000000e+00 br i1 %cmp436, label %while.end18, label %while.cond7.preheader while.cond7.preheader: ; preds = %while.cond1.preheader, %while.end %j.038 = phi i32 [ %inc17, %while.end ], [ 0, %while.cond1.preheader ] %max.137 = phi i32 [ %max.2, %while.end ], [ %max.040, %while.cond1.preheader ] %1 = load i32, ptr %x, align 4, !tbaa !7 %cmp832 = icmp sgt i32 %1, 0 br i1 %cmp832, label %while.body10, label %while.end while.cond7: ; preds = %while.body10 %inc = add nuw nsw i32 %k.033, 1 %exitcond.not = icmp eq i32 %inc, %1 br i1 %exitcond.not, label %while.end, label %while.body10, !llvm.loop !11 while.body10: ; preds = %while.cond7.preheader, %while.cond7 %n.034 = phi i32 [ %mul, %while.cond7 ], [ 1, %while.cond7.preheader ] %k.033 = phi i32 [ %inc, %while.cond7 ], [ 0, %while.cond7.preheader ] %mul = mul nuw nsw i32 %n.034, %j.038 %cmp11 = icmp eq i32 %mul, %i.041 br i1 %cmp11, label %if.then, label %while.cond7 if.then: ; preds = %while.body10 %spec.select = call i32 @llvm.smax.i32(i32 %i.041, i32 %max.137) br label %while.end while.end: ; preds = %while.cond7, %while.cond7.preheader, %if.then %max.2 = phi i32 [ %spec.select, %if.then ], [ %max.137, %while.cond7.preheader ], [ %max.137, %while.cond7 ] %inc17 = add nuw nsw i32 %j.038, 1 %conv = sitofp i32 %inc17 to double %call3 = call double @sqrt(double noundef %conv2) #6 %cmp4 = fcmp ult double %call3, %conv br i1 %cmp4, label %while.end18, label %while.cond7.preheader, !llvm.loop !12 while.end18: ; preds = %while.end, %while.cond1.preheader %max.1.lcssa = phi i32 [ %max.040, %while.cond1.preheader ], [ %max.2, %while.end ] %inc19 = add nuw nsw i32 %i.041, 1 %2 = load i32, ptr %x, align 4, !tbaa !7 %cmp.not.not = icmp slt i32 %i.041, %2 br i1 %cmp.not.not, label %while.cond1.preheader, label %while.end20, !llvm.loop !13 while.end20: ; preds = %while.end18, %entry %max.0.lcssa = phi i32 [ 0, %entry ], [ %max.1.lcssa, %while.end18 ] %call21 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #5 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 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { 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 = 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}
#include <stdio.h> #include <stdlib.h> #include <string.h> int exponential(int bottom, int top); int main(void){ int X,i,j,top,bottom,max; char str[10]; fgets(str,sizeof(str),stdin); X=atoi(str); if(X==1){ printf("1\n"); return 0; } for(i=1;;i++){ if(exponential(i,2)>X){ break; } } bottom=i-1; for(j=2;;j++){ if(exponential(2,j)>X){ break; } } top=j-1; max=0; for(i=1;i<=bottom;i++){ for(j=2;j<=top;j++){ if(exponential(i,j)>max && exponential(i,j)<=X){ max=exponential(i,j); } } } printf("%d\n",max); return 0; } int exponential(int bottom, int top){ int i,j,ex=1; for(i=1;i<=top;i++){ ex*=bottom; } return ex; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155444/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155444/source.c" target datalayout = "e-m:e-p270: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.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 @str = private unnamed_addr constant [2 x i8] c"1\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %str = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %str) #7 %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call = call ptr @fgets(ptr noundef nonnull %str, i32 noundef 10, ptr noundef %0) %call.i = call i64 @strtol(ptr nocapture noundef nonnull %str, ptr noundef null, i32 noundef 10) #7 %conv.i = trunc i64 %call.i to i32 %cmp = icmp eq i32 %conv.i, 1 br i1 %cmp, label %if.then, label %for.cond if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %cleanup for.cond: ; preds = %entry, %for.cond %i.0 = phi i32 [ %inc, %for.cond ], [ 1, %entry ] %mul.i.1 = mul nsw i32 %i.0, %i.0 %cmp5 = icmp sgt i32 %mul.i.1, %conv.i %inc = add nuw nsw i32 %i.0, 1 br i1 %cmp5, label %for.cond8, label %for.cond for.cond8: ; preds = %for.cond, %exponential.exit66 %indvar = phi i32 [ %indvar.next, %exponential.exit66 ], [ 0, %for.cond ] %j.0 = phi i32 [ %inc14, %exponential.exit66 ], [ 2, %for.cond ] %1 = add i32 %indvar, 1 %xtraiter = and i32 %j.0, 7 %2 = icmp ult i32 %1, 7 br i1 %2, label %exponential.exit66.unr-lcssa, label %for.cond8.new for.cond8.new: ; preds = %for.cond8 %unroll_iter = and i32 %j.0, 2147483640 br label %for.body.i60 for.body.i60: ; preds = %for.body.i60, %for.cond8.new %ex.05.i61 = phi i32 [ 1, %for.cond8.new ], [ %mul.i63, %for.body.i60 ] %niter = phi i32 [ 0, %for.cond8.new ], [ %niter.next.7, %for.body.i60 ] %mul.i63 = shl i32 %ex.05.i61, 8 %niter.next.7 = add i32 %niter, 8 %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %exponential.exit66.unr-lcssa, label %for.body.i60, !llvm.loop !9 exponential.exit66.unr-lcssa: ; preds = %for.body.i60, %for.cond8 %mul.i63.lcssa.ph = phi i32 [ undef, %for.cond8 ], [ %mul.i63, %for.body.i60 ] %ex.05.i61.unr = phi i32 [ 1, %for.cond8 ], [ %mul.i63, %for.body.i60 ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %exponential.exit66, label %for.body.i60.epil for.body.i60.epil: ; preds = %exponential.exit66.unr-lcssa, %for.body.i60.epil %ex.05.i61.epil = phi i32 [ %mul.i63.epil, %for.body.i60.epil ], [ %ex.05.i61.unr, %exponential.exit66.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body.i60.epil ], [ 0, %exponential.exit66.unr-lcssa ] %mul.i63.epil = shl nsw i32 %ex.05.i61.epil, 1 %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %exponential.exit66, label %for.body.i60.epil, !llvm.loop !11 exponential.exit66: ; preds = %for.body.i60.epil, %exponential.exit66.unr-lcssa %mul.i63.lcssa = phi i32 [ %mul.i63.lcssa.ph, %exponential.exit66.unr-lcssa ], [ %mul.i63.epil, %for.body.i60.epil ] %cmp10 = icmp sgt i32 %mul.i63.lcssa, %conv.i %inc14 = add nuw nsw i32 %j.0, 1 %indvar.next = add i32 %indvar, 1 br i1 %cmp10, label %for.cond17.preheader, label %for.cond8 for.cond17.preheader: ; preds = %exponential.exit66 %cmp18.not.not91 = icmp ugt i32 %i.0, 1 %cmp20.not.not88 = icmp ugt i32 %j.0, 2 %or.cond = and i1 %cmp18.not.not91, %cmp20.not.not88 br i1 %or.cond, label %for.cond19.preheader.us, label %for.end34 for.cond19.preheader.us: ; preds = %for.cond17.preheader, %for.cond19.for.inc32_crit_edge.us %3 = phi <2 x i32> [ %22, %for.cond19.for.inc32_crit_edge.us ], [ <i32 1, i32 0>, %for.cond17.preheader ] %4 = extractelement <2 x i32> %3, i64 1 %broadcast.splat132 = shufflevector <2 x i32> %3, <2 x i32> poison, <4 x i32> zeroinitializer %5 = extractelement <2 x i32> %3, i64 0 %broadcast.splat114 = shufflevector <2 x i32> %3, <2 x i32> poison, <4 x i32> zeroinitializer %6 = extractelement <2 x i32> %3, i64 0 %broadcast.splat = shufflevector <2 x i32> %3, <2 x i32> poison, <4 x i32> zeroinitializer %7 = extractelement <2 x i32> %3, i64 0 br label %for.body.i67.preheader.us for.body.i67.us: ; preds = %for.body.i67.us.preheader, %for.body.i67.us %ex.05.i68.us = phi i32 [ %mul.i70.us, %for.body.i67.us ], [ %ex.05.i68.us.ph, %for.body.i67.us.preheader ] %i.04.i69.us = phi i32 [ %inc.i71.us, %for.body.i67.us ], [ %i.04.i69.us.ph, %for.body.i67.us.preheader ] %mul.i70.us = mul nsw i32 %ex.05.i68.us, %5 %inc.i71.us = add nuw nsw i32 %i.04.i69.us, 1 %exitcond.not.i72.us = icmp eq i32 %i.04.i69.us, %j.189.us br i1 %exitcond.not.i72.us, label %exponential.exit73.us, label %for.body.i67.us, !llvm.loop !13 exponential.exit73.us: ; preds = %for.body.i67.us, %middle.block118 %mul.i70.us.lcssa = phi i32 [ %19, %middle.block118 ], [ %mul.i70.us, %for.body.i67.us ] %cmp23.us = icmp sgt i32 %mul.i70.us.lcssa, %max.190.us br i1 %cmp23.us, label %for.body.i74.us.preheader, label %for.inc29.us for.body.i74.us.preheader: ; preds = %exponential.exit73.us %min.iters.check102 = icmp ult i32 %j.189.us, 8 br i1 %min.iters.check102, label %for.body.i74.us.preheader137, label %vector.ph103 vector.ph103: ; preds = %for.body.i74.us.preheader %n.vec105 = and i32 %j.189.us, 2147483640 %ind.end106 = or i32 %n.vec105, 1 br label %vector.body109 vector.body109: ; preds = %vector.body109, %vector.ph103 %index110 = phi i32 [ 0, %vector.ph103 ], [ %index.next115, %vector.body109 ] %vec.phi111 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph103 ], [ %8, %vector.body109 ] %vec.phi112 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph103 ], [ %9, %vector.body109 ] %8 = mul <4 x i32> %vec.phi111, %broadcast.splat114 %9 = mul <4 x i32> %vec.phi112, %broadcast.splat114 %index.next115 = add nuw i32 %index110, 8 %10 = icmp eq i32 %index.next115, %n.vec105 br i1 %10, label %middle.block100, label %vector.body109, !llvm.loop !16 middle.block100: ; preds = %vector.body109 %bin.rdx116 = mul <4 x i32> %9, %8 %11 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx116) %cmp.n108 = icmp eq i32 %j.189.us, %n.vec105 br i1 %cmp.n108, label %exponential.exit80.us, label %for.body.i74.us.preheader137 for.body.i74.us.preheader137: ; preds = %for.body.i74.us.preheader, %middle.block100 %ex.05.i75.us.ph = phi i32 [ 1, %for.body.i74.us.preheader ], [ %11, %middle.block100 ] %i.04.i76.us.ph = phi i32 [ 1, %for.body.i74.us.preheader ], [ %ind.end106, %middle.block100 ] br label %for.body.i74.us for.body.i74.us: ; preds = %for.body.i74.us.preheader137, %for.body.i74.us %ex.05.i75.us = phi i32 [ %mul.i77.us, %for.body.i74.us ], [ %ex.05.i75.us.ph, %for.body.i74.us.preheader137 ] %i.04.i76.us = phi i32 [ %inc.i78.us, %for.body.i74.us ], [ %i.04.i76.us.ph, %for.body.i74.us.preheader137 ] %mul.i77.us = mul nsw i32 %ex.05.i75.us, %6 %inc.i78.us = add nuw nsw i32 %i.04.i76.us, 1 %exitcond.not.i79.us = icmp eq i32 %i.04.i76.us, %j.189.us br i1 %exitcond.not.i79.us, label %exponential.exit80.us, label %for.body.i74.us, !llvm.loop !17 exponential.exit80.us: ; preds = %for.body.i74.us, %middle.block100 %mul.i77.us.lcssa = phi i32 [ %11, %middle.block100 ], [ %mul.i77.us, %for.body.i74.us ] %cmp25.not.us = icmp sgt i32 %mul.i77.us.lcssa, %conv.i br i1 %cmp25.not.us, label %for.inc29.us, label %for.body.i81.us.preheader for.body.i81.us.preheader: ; preds = %exponential.exit80.us %min.iters.check = icmp ult i32 %j.189.us, 8 br i1 %min.iters.check, label %for.body.i81.us.preheader136, label %vector.ph vector.ph: ; preds = %for.body.i81.us.preheader %n.vec = and i32 %j.189.us, 2147483640 %ind.end = or i32 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %12, %vector.body ] %vec.phi99 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %13, %vector.body ] %12 = mul <4 x i32> %vec.phi, %broadcast.splat %13 = mul <4 x i32> %vec.phi99, %broadcast.splat %index.next = add nuw i32 %index, 8 %14 = icmp eq i32 %index.next, %n.vec br i1 %14, label %middle.block, label %vector.body, !llvm.loop !18 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %13, %12 %15 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %j.189.us, %n.vec br i1 %cmp.n, label %for.inc29.us, label %for.body.i81.us.preheader136 for.body.i81.us.preheader136: ; preds = %for.body.i81.us.preheader, %middle.block %ex.05.i82.us.ph = phi i32 [ 1, %for.body.i81.us.preheader ], [ %15, %middle.block ] %i.04.i83.us.ph = phi i32 [ 1, %for.body.i81.us.preheader ], [ %ind.end, %middle.block ] br label %for.body.i81.us for.body.i81.us: ; preds = %for.body.i81.us.preheader136, %for.body.i81.us %ex.05.i82.us = phi i32 [ %mul.i84.us, %for.body.i81.us ], [ %ex.05.i82.us.ph, %for.body.i81.us.preheader136 ] %i.04.i83.us = phi i32 [ %inc.i85.us, %for.body.i81.us ], [ %i.04.i83.us.ph, %for.body.i81.us.preheader136 ] %mul.i84.us = mul nsw i32 %ex.05.i82.us, %7 %inc.i85.us = add nuw nsw i32 %i.04.i83.us, 1 %exitcond.not.i86.us = icmp eq i32 %i.04.i83.us, %j.189.us br i1 %exitcond.not.i86.us, label %for.inc29.us, label %for.body.i81.us, !llvm.loop !19 for.inc29.us: ; preds = %for.body.i81.us, %middle.block, %exponential.exit80.us, %exponential.exit73.us %max.2.us = phi i32 [ %max.190.us, %exponential.exit80.us ], [ %max.190.us, %exponential.exit73.us ], [ %15, %middle.block ], [ %mul.i84.us, %for.body.i81.us ] %inc30.us = add nuw nsw i32 %j.189.us, 1 %exitcond.not = icmp eq i32 %inc30.us, %j.0 br i1 %exitcond.not, label %for.cond19.for.inc32_crit_edge.us, label %for.body.i67.preheader.us, !llvm.loop !20 for.body.i67.preheader.us: ; preds = %for.cond19.preheader.us, %for.inc29.us %max.190.us = phi i32 [ %4, %for.cond19.preheader.us ], [ %max.2.us, %for.inc29.us ] %j.189.us = phi i32 [ 2, %for.cond19.preheader.us ], [ %inc30.us, %for.inc29.us ] %min.iters.check120 = icmp ult i32 %j.189.us, 8 br i1 %min.iters.check120, label %for.body.i67.us.preheader, label %vector.ph121 vector.ph121: ; preds = %for.body.i67.preheader.us %n.vec123 = and i32 %j.189.us, 2147483640 %ind.end124 = or i32 %n.vec123, 1 br label %vector.body127 vector.body127: ; preds = %vector.body127, %vector.ph121 %index128 = phi i32 [ 0, %vector.ph121 ], [ %index.next133, %vector.body127 ] %vec.phi129 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph121 ], [ %16, %vector.body127 ] %vec.phi130 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph121 ], [ %17, %vector.body127 ] %16 = mul <4 x i32> %vec.phi129, %broadcast.splat132 %17 = mul <4 x i32> %vec.phi130, %broadcast.splat132 %index.next133 = add nuw i32 %index128, 8 %18 = icmp eq i32 %index.next133, %n.vec123 br i1 %18, label %middle.block118, label %vector.body127, !llvm.loop !21 middle.block118: ; preds = %vector.body127 %bin.rdx134 = mul <4 x i32> %17, %16 %19 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx134) %cmp.n126 = icmp eq i32 %j.189.us, %n.vec123 br i1 %cmp.n126, label %exponential.exit73.us, label %for.body.i67.us.preheader for.body.i67.us.preheader: ; preds = %for.body.i67.preheader.us, %middle.block118 %ex.05.i68.us.ph = phi i32 [ 1, %for.body.i67.preheader.us ], [ %19, %middle.block118 ] %i.04.i69.us.ph = phi i32 [ 1, %for.body.i67.preheader.us ], [ %ind.end124, %middle.block118 ] br label %for.body.i67.us for.cond19.for.inc32_crit_edge.us: ; preds = %for.inc29.us %20 = extractelement <2 x i32> %3, i64 0 %inc33.us = add nuw nsw i32 %20, 1 %exitcond98.not = icmp eq i32 %inc33.us, %i.0 %21 = insertelement <2 x i32> poison, i32 %inc33.us, i64 0 %22 = insertelement <2 x i32> %21, i32 %max.2.us, i64 1 br i1 %exitcond98.not, label %for.end34, label %for.cond19.preheader.us, !llvm.loop !22 for.end34: ; preds = %for.cond19.for.inc32_crit_edge.us, %for.cond17.preheader %max.0.lcssa = phi i32 [ 0, %for.cond17.preheader ], [ %max.2.us, %for.cond19.for.inc32_crit_edge.us ] %call35 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %max.0.lcssa) br label %cleanup cleanup: ; preds = %for.end34, %if.then call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %str) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @exponential(i32 noundef %bottom, i32 noundef %top) local_unnamed_addr #3 { entry: %cmp.not3 = icmp slt i32 %top, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %top, 8 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %top, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %bottom, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %0 = mul <4 x i32> %vec.phi, %broadcast.splat %1 = mul <4 x i32> %vec.phi6, %broadcast.splat %index.next = add nuw i32 %index, 8 %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !23 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %top br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %ex.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %ex.05 = phi i32 [ %mul, %for.body ], [ %ex.05.ph, %for.body.preheader7 ] %i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ] %mul = mul nsw i32 %ex.05, %bottom %inc = add nuw i32 %i.04, 1 %exitcond.not = icmp eq i32 %i.04, %top br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !24 for.end: ; preds = %for.body, %middle.block, %entry %ex.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %ex.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: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { 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 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 #5 = { nofree nounwind } 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 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.unroll.disable"} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = !{!"llvm.loop.isvectorized", i32 1} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !10, !14, !15} !18 = distinct !{!18, !10, !15, !14} !19 = distinct !{!19, !10, !14, !15} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10, !15, !14} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10, !15, !14} !24 = distinct !{!24, !10, !14, !15}
#include<stdio.h> #include<stdlib.h> int main(void){ int x; scanf("%d",&x); int i,max = 1,t = 1; for(i = 2;i <= x;i++){ if ( (i * i) <= x){ t = i * i; } while ( t * i <= x){ t = t * i; } if (max < t){ max = t; } } printf("%d",max); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155488/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155488/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp.not22 = icmp slt i32 %0, 2 br i1 %cmp.not22, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %1 = add i32 %0, -1 %xtraiter = and i32 %1, 1 %2 = icmp eq i32 %0, 2 br i1 %2, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %1, -2 br label %for.body for.body: ; preds = %while.end.1, %for.body.preheader.new %t.025 = phi i32 [ 1, %for.body.preheader.new ], [ %t.2.1, %while.end.1 ] %max.024 = phi i32 [ 1, %for.body.preheader.new ], [ %spec.select21.1, %while.end.1 ] %i.023 = phi i32 [ 2, %for.body.preheader.new ], [ %inc.1, %while.end.1 ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.1, %while.end.1 ] %mul = mul nsw i32 %i.023, %i.023 %cmp1.not = icmp sgt i32 %mul, %0 %spec.select = select i1 %cmp1.not, i32 %t.025, i32 %mul br label %while.cond while.cond: ; preds = %while.cond, %for.body %t.2 = phi i32 [ %spec.select, %for.body ], [ %mul3, %while.cond ] %mul3 = mul nsw i32 %t.2, %i.023 %cmp4.not = icmp sgt i32 %mul3, %0 br i1 %cmp4.not, label %while.end, label %while.cond, !llvm.loop !9 while.end: ; preds = %while.cond %spec.select21 = call i32 @llvm.smax.i32(i32 %max.024, i32 %t.2) %inc = or i32 %i.023, 1 %mul.1 = mul nsw i32 %inc, %inc %cmp1.not.1 = icmp sgt i32 %mul.1, %0 %spec.select.1 = select i1 %cmp1.not.1, i32 %t.2, i32 %mul.1 br label %while.cond.1 while.cond.1: ; preds = %while.cond.1, %while.end %t.2.1 = phi i32 [ %spec.select.1, %while.end ], [ %mul3.1, %while.cond.1 ] %mul3.1 = mul nsw i32 %t.2.1, %inc %cmp4.not.1 = icmp sgt i32 %mul3.1, %0 br i1 %cmp4.not.1, label %while.end.1, label %while.cond.1, !llvm.loop !9 while.end.1: ; preds = %while.cond.1 %spec.select21.1 = call i32 @llvm.smax.i32(i32 %spec.select21, i32 %t.2.1) %inc.1 = add nuw i32 %i.023, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !11 for.end.loopexit.unr-lcssa: ; preds = %while.end.1, %for.body.preheader %spec.select21.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select21.1, %while.end.1 ] %t.025.unr = phi i32 [ 1, %for.body.preheader ], [ %t.2.1, %while.end.1 ] %max.024.unr = phi i32 [ 1, %for.body.preheader ], [ %spec.select21.1, %while.end.1 ] %i.023.unr = phi i32 [ 2, %for.body.preheader ], [ %inc.1, %while.end.1 ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %mul.epil = mul nsw i32 %i.023.unr, %i.023.unr %cmp1.not.epil = icmp sgt i32 %mul.epil, %0 %spec.select.epil = select i1 %cmp1.not.epil, i32 %t.025.unr, i32 %mul.epil br label %while.cond.epil while.cond.epil: ; preds = %while.cond.epil, %for.body.epil %t.2.epil = phi i32 [ %spec.select.epil, %for.body.epil ], [ %mul3.epil, %while.cond.epil ] %mul3.epil = mul nsw i32 %t.2.epil, %i.023.unr %cmp4.not.epil = icmp sgt i32 %mul3.epil, %0 br i1 %cmp4.not.epil, label %while.end.epil, label %while.cond.epil, !llvm.loop !9 while.end.epil: ; preds = %while.cond.epil %spec.select21.epil = call i32 @llvm.smax.i32(i32 %max.024.unr, i32 %t.2.epil) br label %for.end for.end: ; preds = %while.end.epil, %for.end.loopexit.unr-lcssa, %entry %max.0.lcssa = phi i32 [ 1, %entry ], [ %spec.select21.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select21.epil, %while.end.epil ] %call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %max.0.lcssa) 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
//set many funcs template #include<stdio.h> #include<string.h> #include<stdlib.h> #include<stdbool.h> #include<time.h> #define inf 1072114514 #define llinf 4154118101919364364 #define mod 1000000007 #define pi 3.1415926535897932384 int max(int a,int b){if(a>b){return a;}return b;} int min(int a,int b){if(a<b){return a;}return b;} int zt(int a,int b){return max(a,b)-min(a,b);} int round(int a,int b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} int ceil(int a,int b){if(a%b==0){return a/b;}return (a/b)+1;} int gcd(int a,int b){int c;while(b!=0){c=a%b;a=b;b=c;}return a;} int lcm(int a,int b){int c=gcd(a,b);a/=c;return a*b;} int nCr(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} int nHr(int a,int b){return nCr(a+b-1,b);} int fact(int a){int i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} int pow(int a,int b){int i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} long long llmax(long long a,long long b){if(a>b){return a;}return b;} long long llmin(long long a,long long b){if(a<b){return a;}return b;} long long llzt(long long a,long long b){return llmax(a,b)-llmin(a,b);} long long llround(long long a,long long b){if((a%b)*2 >= b){return (a/b)+1;}return a/b;} long long llceil(long long a,long long b){if(a%b==0){return a/b;}return (a/b)+1;} long long llgcd(long long a,long long b){long long c;while(b!=0){c=a%b;a=b;b=c;}return a;} long long lllcm(long long a,long long b){long long c=llgcd(a,b);a/=c;return a*b;} long long llnCr(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;} long long llnHr(long long a,long long b){return llnCr(a+b-1,b);} long long llfact(long long a){long long i,r=1;for(i=1;i<=a;i++){r*=i;}return r;} long long llpow(long long a,long long b){long long i,r=1;for(i=1;i<=b;i++){r*=a;}return r;} double dbmax(double a,double b){if(a>b){return a;}return b;} double dbmin(double a,double b){if(a<b){return a;}return b;} double dbzt(double a,double b){return dbmax(a,b)-dbmin(a,b);} int sortfncsj(const void *a,const void *b){if(*(int *)a>*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int sortfnckj(const void *a,const void *b){if(*(int *)a<*(int *)b){return 1;}if(*(int *)a==*(int *)b){return 0;}return -1;} int llsortfncsj(const void *a,const void *b){if(*(long long *)a>*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int llsortfnckj(const void *a,const void *b){if(*(long long *)a<*(long long *)b){return 1;}if(*(long long *)a==*(long long *)b){return 0;}return -1;} int dbsortfncsj(const void *a,const void *b){if(*(double *)a>*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int dbsortfnckj(const void *a,const void *b){if(*(double *)a<*(double *)b){return 1;}if(*(double *)a==*(double *)b){return 0;}return -1;} int strsortfncsj(const void *a,const void *b){return strcmp((char *)a,(char *)b);} int strsortfnckj(const void *a,const void *b){return strcmp((char *)b,(char *)a);} int main(void){ long long i,j,n,m,k,a[262144],b,c,w,r=0,l,t,x; double d; char s[262144]; scanf("%d",&x); //l=strlen(s); for(i=1;i<=31;i++){ w=i; for(j=2;j<=9;j++){ w*=i; if(w>x){break;}else{r=max(r,w);} } } //qsort(a,n,sizeof(int),sortfncsj); printf("%d\n",r); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155530/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155530/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @max(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) ret i32 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i32 @zt(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i32 %a, %b %sub = tail call i32 @llvm.abs.i32(i32 %sub5, i1 true) ret i32 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @round(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %mul = shl nsw i32 %rem, 1 %cmp.not = icmp sge i32 %mul, %b %div1 = sdiv i32 %a, %b %add = zext i1 %cmp.not to i32 %retval.0 = add nsw i32 %div1, %add ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i32 @ceil(i32 noundef %a, i32 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i32 %a, %b %cmp = icmp ne i32 %rem, 0 %div = sdiv i32 %a, %b %add = zext i1 %cmp to i32 %retval.0 = add nsw i32 %div, %add ret i32 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i32 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i32 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i32 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i32 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i32 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i32 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i32 %a.addr.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i32 %b, 0 br i1 %cmp.not4.i, label %gcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i32 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i32 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i32 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i32 %rem.i, 0 br i1 %cmp.not.i, label %gcd.exit, label %while.body.i, !llvm.loop !5 gcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i32 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i32 %a, %a.addr.0.lcssa.i %mul = mul nsw i32 %div, %b ret i32 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nCr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i32 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i32 %a, 1 %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i32 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i32 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i32 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i32 %add, %i.07 %mul = mul nsw i32 %r.08, %sub %div = sdiv i32 %mul, %i.07 %inc = add nuw i32 %i.07, 1 %sub.1 = sub i32 %add, %inc %mul.1 = mul nsw i32 %div, %sub.1 %div.1 = sdiv i32 %mul.1, %inc %inc.1 = add nuw i32 %i.07, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !7 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i32 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i32 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i32 %add, %i.07.unr %mul.epil = mul nsw i32 %r.08.unr, %sub.epil %div.epil = sdiv i32 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @nHr(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i32 %b, %a %cmp.not6.i = icmp slt i32 %b, 1 br i1 %cmp.not6.i, label %nCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i32 %b, 1 %0 = icmp eq i32 %b, 1 br i1 %0, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i32 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i32 %add, %i.07.i %mul.i = mul nsw i32 %sub.i, %r.08.i %div.i = sdiv i32 %mul.i, %i.07.i %inc.i = add nuw i32 %i.07.i, 1 %sub.i.1 = sub i32 %add, %inc.i %mul.i.1 = mul nsw i32 %sub.i.1, %div.i %div.i.1 = sdiv i32 %mul.i.1, %inc.i %inc.i.1 = add nuw i32 %i.07.i, 2 %niter.next.1 = add i32 %niter, 2 %niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %nCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !7 nCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %nCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %nCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i32 %add, %i.07.i.unr %mul.i.epil = mul nsw i32 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i32 %mul.i.epil, %i.07.i.unr br label %nCr.exit nCr.exit: ; preds = %for.body.i.epil, %nCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i32 [ 1, %entry ], [ %div.i.lcssa.ph, %nCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i32 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @fact(i32 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i32 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %a, 8 br i1 %min.iters.check, label %for.body.preheader9, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %a, -8 %ind.end = or i32 %n.vec, 1 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi7 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %vec.ind = phi <4 x i32> [ <i32 1, i32 2, i32 3, i32 4>, %vector.ph ], [ %vec.ind.next, %vector.body ] %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4> %0 = mul <4 x i32> %vec.phi, %vec.ind %1 = mul <4 x i32> %vec.phi7, %step.add %index.next = add nuw i32 %index, 8 %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8> %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !8 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %a br i1 %cmp.n, label %for.end, label %for.body.preheader9 for.body.preheader9: ; preds = %for.body.preheader, %middle.block %r.06.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.05.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader9, %for.body %r.06 = phi i32 [ %mul, %for.body ], [ %r.06.ph, %for.body.preheader9 ] %i.05 = phi i32 [ %inc, %for.body ], [ %i.05.ph, %for.body.preheader9 ] %mul = mul nsw i32 %r.06, %i.05 %inc = add nuw i32 %i.05, 1 %exitcond.not = icmp eq i32 %i.05, %a br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i32 @pow(i32 noundef %a, i32 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i32 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %b, 8 br i1 %min.iters.check, label %for.body.preheader7, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %b, -8 %ind.end = or i32 %n.vec, 1 %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %a, i64 0 %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %0, %vector.body ] %vec.phi6 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %0 = mul <4 x i32> %vec.phi, %broadcast.splat %1 = mul <4 x i32> %vec.phi6, %broadcast.splat %index.next = add nuw i32 %index, 8 %2 = icmp eq i32 %index.next, %n.vec br i1 %2, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %1, %0 %3 = tail call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %n.vec, %b br i1 %cmp.n, label %for.end, label %for.body.preheader7 for.body.preheader7: ; preds = %for.body.preheader, %middle.block %r.05.ph = phi i32 [ 1, %for.body.preheader ], [ %3, %middle.block ] %i.04.ph = phi i32 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader7, %for.body %r.05 = phi i32 [ %mul, %for.body ], [ %r.05.ph, %for.body.preheader7 ] %i.04 = phi i32 [ %inc, %for.body ], [ %i.04.ph, %for.body.preheader7 ] %mul = mul nsw i32 %r.05, %a %inc = add nuw i32 %i.04, 1 %exitcond.not = icmp eq i32 %i.04, %b br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block, %entry %r.0.lcssa = phi i32 [ 1, %entry ], [ %3, %middle.block ], [ %mul, %for.body ] ret i32 %r.0.lcssa } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmax(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llmin(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %a.b = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %a.b } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llzt(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %sub5 = sub nsw i64 %a, %b %sub = tail call i64 @llvm.abs.i64(i64 %sub5, i1 true) ret i64 %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llround(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %mul = shl nsw i64 %rem, 1 %cmp.not = icmp sge i64 %mul, %b %div1 = sdiv i64 %a, %b %add = zext i1 %cmp.not to i64 %retval.0 = add nsw i64 %div1, %add ret i64 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local i64 @llceil(i64 noundef %a, i64 noundef %b) local_unnamed_addr #1 { entry: %rem = srem i64 %a, %b %cmp = icmp ne i64 %rem, 0 %div = sdiv i64 %a, %b %add = zext i1 %cmp to i64 %retval.0 = add nsw i64 %div, %add ret i64 %retval.0 } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llgcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4 = icmp eq i64 %b, 0 br i1 %cmp.not4, label %while.end, label %while.body while.body: ; preds = %entry, %while.body %a.addr.06 = phi i64 [ %b.addr.05, %while.body ], [ %a, %entry ] %b.addr.05 = phi i64 [ %rem, %while.body ], [ %b, %entry ] %rem = srem i64 %a.addr.06, %b.addr.05 %cmp.not = icmp eq i64 %rem, 0 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !14 while.end: ; preds = %while.body, %entry %a.addr.0.lcssa = phi i64 [ %a, %entry ], [ %b.addr.05, %while.body ] ret i64 %a.addr.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @lllcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not4.i = icmp eq i64 %b, 0 br i1 %cmp.not4.i, label %llgcd.exit, label %while.body.i while.body.i: ; preds = %entry, %while.body.i %a.addr.06.i = phi i64 [ %b.addr.05.i, %while.body.i ], [ %a, %entry ] %b.addr.05.i = phi i64 [ %rem.i, %while.body.i ], [ %b, %entry ] %rem.i = srem i64 %a.addr.06.i, %b.addr.05.i %cmp.not.i = icmp eq i64 %rem.i, 0 br i1 %cmp.not.i, label %llgcd.exit, label %while.body.i, !llvm.loop !14 llgcd.exit: ; preds = %while.body.i, %entry %a.addr.0.lcssa.i = phi i64 [ %a, %entry ], [ %b.addr.05.i, %while.body.i ] %div = sdiv i64 %a, %a.addr.0.lcssa.i %mul = mul nsw i64 %div, %b ret i64 %mul } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnCr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not6 = icmp slt i64 %b, 1 br i1 %cmp.not6, label %for.end, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %add = add nsw i64 %a, 1 %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.lr.ph.new for.body.lr.ph.new: ; preds = %for.body.lr.ph %unroll_iter = and i64 %b, -2 br label %for.body for.body: ; preds = %for.body, %for.body.lr.ph.new %r.08 = phi i64 [ 1, %for.body.lr.ph.new ], [ %div.1, %for.body ] %i.07 = phi i64 [ 1, %for.body.lr.ph.new ], [ %inc.1, %for.body ] %niter = phi i64 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ] %sub = sub i64 %add, %i.07 %mul = mul nsw i64 %r.08, %sub %div = sdiv i64 %mul, %i.07 %inc = add nuw i64 %i.07, 1 %sub.1 = sub i64 %add, %inc %mul.1 = mul nsw i64 %div, %sub.1 %div.1 = sdiv i64 %mul.1, %inc %inc.1 = add nuw i64 %i.07, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !15 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph %div.lcssa.ph = phi i64 [ undef, %for.body.lr.ph ], [ %div.1, %for.body ] %r.08.unr = phi i64 [ 1, %for.body.lr.ph ], [ %div.1, %for.body ] %i.07.unr = phi i64 [ 1, %for.body.lr.ph ], [ %inc.1, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa %sub.epil = sub i64 %add, %i.07.unr %mul.epil = mul nsw i64 %r.08.unr, %sub.epil %div.epil = sdiv i64 %mul.epil, %i.07.unr br label %for.end for.end: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %div.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %div.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llnHr(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %add = add nsw i64 %b, %a %cmp.not6.i = icmp slt i64 %b, 1 br i1 %cmp.not6.i, label %llnCr.exit, label %for.body.i.preheader for.body.i.preheader: ; preds = %entry %xtraiter = and i64 %b, 1 %0 = icmp eq i64 %b, 1 br i1 %0, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new for.body.i.preheader.new: ; preds = %for.body.i.preheader %unroll_iter = and i64 %b, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new %r.08.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %div.i.1, %for.body.i ] %i.07.i = phi i64 [ 1, %for.body.i.preheader.new ], [ %inc.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.i.preheader.new ], [ %niter.next.1, %for.body.i ] %sub.i = sub i64 %add, %i.07.i %mul.i = mul nsw i64 %sub.i, %r.08.i %div.i = sdiv i64 %mul.i, %i.07.i %inc.i = add nuw i64 %i.07.i, 1 %sub.i.1 = sub i64 %add, %inc.i %mul.i.1 = mul nsw i64 %sub.i.1, %div.i %div.i.1 = sdiv i64 %mul.i.1, %inc.i %inc.i.1 = add nuw i64 %i.07.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %llnCr.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !15 llnCr.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader %div.i.lcssa.ph = phi i64 [ undef, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %r.08.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %div.i.1, %for.body.i ] %i.07.i.unr = phi i64 [ 1, %for.body.i.preheader ], [ %inc.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %llnCr.exit, label %for.body.i.epil for.body.i.epil: ; preds = %llnCr.exit.loopexit.unr-lcssa %sub.i.epil = sub i64 %add, %i.07.i.unr %mul.i.epil = mul nsw i64 %sub.i.epil, %r.08.i.unr %div.i.epil = sdiv i64 %mul.i.epil, %i.07.i.unr br label %llnCr.exit llnCr.exit: ; preds = %for.body.i.epil, %llnCr.exit.loopexit.unr-lcssa, %entry %r.0.lcssa.i = phi i64 [ 1, %entry ], [ %div.i.lcssa.ph, %llnCr.exit.loopexit.unr-lcssa ], [ %div.i.epil, %for.body.i.epil ] ret i64 %r.0.lcssa.i } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llfact(i64 noundef %a) local_unnamed_addr #2 { entry: %cmp.not4 = icmp slt i64 %a, 1 br i1 %cmp.not4, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %a, 7 %0 = icmp ult i64 %a, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %a, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.06 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %i.05 = phi i64 [ 1, %for.body.preheader.new ], [ %inc.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.06, %i.05 %inc = add nuw nsw i64 %i.05, 1 %mul.1 = mul nsw i64 %mul, %inc %inc.1 = add nuw nsw i64 %i.05, 2 %mul.2 = mul nsw i64 %mul.1, %inc.1 %inc.2 = add nuw nsw i64 %i.05, 3 %mul.3 = mul nsw i64 %mul.2, %inc.2 %inc.3 = add nuw nsw i64 %i.05, 4 %mul.4 = mul nsw i64 %mul.3, %inc.3 %inc.4 = add nuw nsw i64 %i.05, 5 %mul.5 = mul nsw i64 %mul.4, %inc.4 %inc.5 = add nuw nsw i64 %i.05, 6 %mul.6 = mul nsw i64 %mul.5, %inc.5 %inc.6 = add nuw i64 %i.05, 7 %mul.7 = mul nsw i64 %mul.6, %inc.6 %inc.7 = add nuw i64 %i.05, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !16 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.06.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %i.05.unr = phi i64 [ 1, %for.body.preheader ], [ %inc.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %r.06.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.06.unr, %for.end.loopexit.unr-lcssa ] %i.05.epil = phi i64 [ %inc.epil, %for.body.epil ], [ %i.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.06.epil, %i.05.epil %inc.epil = add nuw i64 %i.05.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !17 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @llpow(i64 noundef %a, i64 noundef %b) local_unnamed_addr #2 { entry: %cmp.not3 = icmp slt i64 %b, 1 br i1 %cmp.not3, label %for.end, label %for.body.preheader for.body.preheader: ; preds = %entry %xtraiter = and i64 %b, 7 %0 = icmp ult i64 %b, 8 br i1 %0, label %for.end.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %b, -8 br label %for.body for.body: ; preds = %for.body, %for.body.preheader.new %r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %mul.7, %for.body ] %niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ] %mul = mul nsw i64 %r.05, %a %mul.1 = mul nsw i64 %mul, %a %mul.2 = mul nsw i64 %mul.1, %a %mul.3 = mul nsw i64 %mul.2, %a %mul.4 = mul nsw i64 %mul.3, %a %mul.5 = mul nsw i64 %mul.4, %a %mul.6 = mul nsw i64 %mul.5, %a %mul.7 = mul nsw i64 %mul.6, %a %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !19 for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %mul.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %mul.7, %for.body ] %r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %mul.7, %for.body ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end, label %for.body.epil for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil %r.05.epil = phi i64 [ %mul.epil, %for.body.epil ], [ %r.05.unr, %for.end.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ] %mul.epil = mul nsw i64 %r.05.epil, %a %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.end, label %for.body.epil, !llvm.loop !20 for.end: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %mul.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ] ret i64 %r.0.lcssa } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmax(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp ogt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbmin(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp = fcmp olt double %a, %b %a.b = select i1 %cmp, double %a, double %b ret double %a.b } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable define dso_local double @dbzt(double noundef %a, double noundef %b) local_unnamed_addr #1 { entry: %cmp.i = fcmp ogt double %a, %b %a.b.i = select i1 %cmp.i, double %a, double %b %cmp.i4 = fcmp olt double %a, %b %a.b.i5 = select i1 %cmp.i4, double %a, double %b %sub = fsub double %a.b.i, %a.b.i5 ret double %sub } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !21 %1 = load i32, ptr %b, align 4, !tbaa !21 %cmp = icmp sgt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @sortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i32, ptr %a, align 4, !tbaa !21 %1 = load i32, ptr %b, align 4, !tbaa !21 %cmp = icmp slt i32 %0, %1 %cmp1 = icmp ne i32 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @llsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !25 %1 = load i64, ptr %b, align 8, !tbaa !25 %cmp = icmp sgt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @llsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load i64, ptr %a, align 8, !tbaa !25 %1 = load i64, ptr %b, align 8, !tbaa !25 %cmp = icmp slt i64 %0, %1 %cmp1 = icmp ne i64 %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dbsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !27 %1 = load double, ptr %b, align 8, !tbaa !27 %cmp = fcmp ogt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @dbsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #4 { entry: %0 = load double, ptr %a, align 8, !tbaa !27 %1 = load double, ptr %b, align 8, !tbaa !27 %cmp = fcmp olt double %0, %1 %cmp1 = fcmp une double %0, %1 %. = sext i1 %cmp1 to i32 %retval.0 = select i1 %cmp, i32 1, i32 %. ret i32 %retval.0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfncsj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #10 ret i32 %call } ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #6 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @strsortfnckj(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #5 { entry: %call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #10 ret i32 %call } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #7 { entry: %x = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #11 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i64, ptr %x, align 8, !tbaa !25 br label %for.cond1.preheader for.cond1.preheader: ; preds = %entry, %for.inc8 %i.023 = phi i64 [ 1, %entry ], [ %inc9, %for.inc8 ] %r.022 = phi i64 [ 0, %entry ], [ %r.1.lcssa, %for.inc8 ] %mul = mul nuw nsw i64 %i.023, %i.023 %cmp4 = icmp sgt i64 %mul, %0 br i1 %cmp4, label %for.inc8, label %if.else if.else: ; preds = %for.cond1.preheader %conv = trunc i64 %r.022 to i32 %conv5 = trunc i64 %mul to i32 %a.b.i = call i32 @llvm.smax.i32(i32 %conv, i32 %conv5) %conv7 = sext i32 %a.b.i to i64 %mul.1 = mul nuw nsw i64 %mul, %i.023 %cmp4.1 = icmp sgt i64 %mul.1, %0 br i1 %cmp4.1, label %for.inc8, label %if.else.1 if.else.1: ; preds = %if.else %conv5.1 = trunc i64 %mul.1 to i32 %a.b.i.1 = call i32 @llvm.smax.i32(i32 %a.b.i, i32 %conv5.1) %conv7.1 = sext i32 %a.b.i.1 to i64 %mul.2 = mul nuw nsw i64 %mul.1, %i.023 %cmp4.2 = icmp sgt i64 %mul.2, %0 br i1 %cmp4.2, label %for.inc8, label %if.else.2 if.else.2: ; preds = %if.else.1 %conv5.2 = trunc i64 %mul.2 to i32 %a.b.i.2 = call i32 @llvm.smax.i32(i32 %a.b.i.1, i32 %conv5.2) %conv7.2 = sext i32 %a.b.i.2 to i64 %mul.3 = mul nuw nsw i64 %mul.2, %i.023 %cmp4.3 = icmp sgt i64 %mul.3, %0 br i1 %cmp4.3, label %for.inc8, label %if.else.3 if.else.3: ; preds = %if.else.2 %conv5.3 = trunc i64 %mul.3 to i32 %a.b.i.3 = call i32 @llvm.smax.i32(i32 %a.b.i.2, i32 %conv5.3) %conv7.3 = sext i32 %a.b.i.3 to i64 %mul.4 = mul nuw nsw i64 %mul.3, %i.023 %cmp4.4 = icmp sgt i64 %mul.4, %0 br i1 %cmp4.4, label %for.inc8, label %if.else.4 if.else.4: ; preds = %if.else.3 %conv5.4 = trunc i64 %mul.4 to i32 %a.b.i.4 = call i32 @llvm.smax.i32(i32 %a.b.i.3, i32 %conv5.4) %conv7.4 = sext i32 %a.b.i.4 to i64 %mul.5 = mul nuw nsw i64 %mul.4, %i.023 %cmp4.5 = icmp sgt i64 %mul.5, %0 br i1 %cmp4.5, label %for.inc8, label %if.else.5 if.else.5: ; preds = %if.else.4 %conv5.5 = trunc i64 %mul.5 to i32 %a.b.i.5 = call i32 @llvm.smax.i32(i32 %a.b.i.4, i32 %conv5.5) %conv7.5 = sext i32 %a.b.i.5 to i64 %mul.6 = mul nuw nsw i64 %mul.5, %i.023 %cmp4.6 = icmp sgt i64 %mul.6, %0 br i1 %cmp4.6, label %for.inc8, label %if.else.6 if.else.6: ; preds = %if.else.5 %conv5.6 = trunc i64 %mul.6 to i32 %a.b.i.6 = call i32 @llvm.smax.i32(i32 %a.b.i.5, i32 %conv5.6) %conv7.6 = sext i32 %a.b.i.6 to i64 %mul.7 = mul nuw nsw i64 %mul.6, %i.023 %cmp4.7 = icmp sgt i64 %mul.7, %0 br i1 %cmp4.7, label %for.inc8, label %if.else.7 if.else.7: ; preds = %if.else.6 %conv5.7 = trunc i64 %mul.7 to i32 %a.b.i.7 = call i32 @llvm.smax.i32(i32 %a.b.i.6, i32 %conv5.7) %conv7.7 = sext i32 %a.b.i.7 to i64 br label %for.inc8 for.inc8: ; preds = %if.else.7, %if.else.6, %if.else.5, %if.else.4, %if.else.3, %if.else.2, %if.else.1, %if.else, %for.cond1.preheader %r.1.lcssa = phi i64 [ %r.022, %for.cond1.preheader ], [ %conv7, %if.else ], [ %conv7.1, %if.else.1 ], [ %conv7.2, %if.else.2 ], [ %conv7.3, %if.else.3 ], [ %conv7.4, %if.else.4 ], [ %conv7.5, %if.else.5 ], [ %conv7.6, %if.else.6 ], [ %conv7.7, %if.else.7 ] %inc9 = add nuw nsw i64 %i.023, 1 %exitcond.not = icmp eq i64 %inc9, 32 br i1 %exitcond.not, label %for.end10, label %for.cond1.preheader, !llvm.loop !29 for.end10: ; preds = %for.inc8 %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %r.1.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #11 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #8 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smax.i64(i64, i64) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.smin.i64(i64, i64) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.abs.i64(i64, i1 immarg) #9 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #9 attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #4 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #8 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #9 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #10 = { nounwind willreturn memory(read) } attributes #11 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = distinct !{!7, !6} !8 = distinct !{!8, !6, !9, !10} !9 = !{!"llvm.loop.isvectorized", i32 1} !10 = !{!"llvm.loop.unroll.runtime.disable"} !11 = distinct !{!11, !6, !10, !9} !12 = distinct !{!12, !6, !9, !10} !13 = distinct !{!13, !6, !10, !9} !14 = distinct !{!14, !6} !15 = distinct !{!15, !6} !16 = distinct !{!16, !6} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.unroll.disable"} !19 = distinct !{!19, !6} !20 = distinct !{!20, !18} !21 = !{!22, !22, i64 0} !22 = !{!"int", !23, i64 0} !23 = !{!"omnipotent char", !24, i64 0} !24 = !{!"Simple C/C++ TBAA"} !25 = !{!26, !26, i64 0} !26 = !{!"long long", !23, i64 0} !27 = !{!28, !28, i64 0} !28 = !{!"double", !23, i64 0} !29 = distinct !{!29, !6}
#include<stdio.h> int main(void) { int x,i=1,ans=0,temp,j; scanf("%d",&x); while(1) { temp = i; if(i*i > x) { break; } for(j=0;j<10;j++) { temp *= i; if(temp <= x && ans < temp) { ans = temp; } else if(temp > x) { break; } } i++; } printf("%d\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155574/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155574/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %x = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x) %0 = load i32, ptr %x, align 4, !tbaa !5 %cmp25 = icmp slt i32 %0, 1 br i1 %cmp25, label %while.end, label %for.cond.preheader for.cond.preheader: ; preds = %entry, %for.end %ans.027 = phi i32 [ %ans.1.lcssa, %for.end ], [ 0, %entry ] %i.026 = phi i32 [ %inc10, %for.end ], [ 1, %entry ] %mul2 = mul nuw nsw i32 %i.026, %i.026 %spec.select = call i32 @llvm.smax.i32(i32 %ans.027, i32 %mul2) %mul2.1 = mul nuw nsw i32 %mul2, %i.026 %cmp3.not.1 = icmp sle i32 %mul2.1, %0 %cmp4.1 = icmp ult i32 %spec.select, %mul2.1 %or.cond.1 = and i1 %cmp3.not.1, %cmp4.1 br i1 %or.cond.1, label %for.inc.1, label %if.else.1 if.else.1: ; preds = %for.cond.preheader %cmp6.1 = icmp sgt i32 %mul2.1, %0 br i1 %cmp6.1, label %for.end, label %for.inc.1 for.inc.1: ; preds = %if.else.1, %for.cond.preheader %ans.2.1 = phi i32 [ %spec.select, %if.else.1 ], [ %mul2.1, %for.cond.preheader ] %mul2.2 = mul nuw nsw i32 %mul2.1, %i.026 %cmp3.not.2 = icmp sle i32 %mul2.2, %0 %cmp4.2 = icmp slt i32 %ans.2.1, %mul2.2 %or.cond.2 = and i1 %cmp3.not.2, %cmp4.2 br i1 %or.cond.2, label %for.inc.2, label %if.else.2 if.else.2: ; preds = %for.inc.1 %cmp6.2 = icmp sgt i32 %mul2.2, %0 br i1 %cmp6.2, label %for.end, label %for.inc.2 for.inc.2: ; preds = %if.else.2, %for.inc.1 %ans.2.2 = phi i32 [ %ans.2.1, %if.else.2 ], [ %mul2.2, %for.inc.1 ] %mul2.3 = mul nuw nsw i32 %mul2.2, %i.026 %cmp3.not.3 = icmp sle i32 %mul2.3, %0 %cmp4.3 = icmp slt i32 %ans.2.2, %mul2.3 %or.cond.3 = and i1 %cmp3.not.3, %cmp4.3 br i1 %or.cond.3, label %for.inc.3, label %if.else.3 if.else.3: ; preds = %for.inc.2 %cmp6.3 = icmp sgt i32 %mul2.3, %0 br i1 %cmp6.3, label %for.end, label %for.inc.3 for.inc.3: ; preds = %if.else.3, %for.inc.2 %ans.2.3 = phi i32 [ %ans.2.2, %if.else.3 ], [ %mul2.3, %for.inc.2 ] %mul2.4 = mul nuw nsw i32 %mul2.3, %i.026 %cmp3.not.4 = icmp sle i32 %mul2.4, %0 %cmp4.4 = icmp slt i32 %ans.2.3, %mul2.4 %or.cond.4 = and i1 %cmp3.not.4, %cmp4.4 br i1 %or.cond.4, label %for.inc.4, label %if.else.4 if.else.4: ; preds = %for.inc.3 %cmp6.4 = icmp sgt i32 %mul2.4, %0 br i1 %cmp6.4, label %for.end, label %for.inc.4 for.inc.4: ; preds = %if.else.4, %for.inc.3 %ans.2.4 = phi i32 [ %ans.2.3, %if.else.4 ], [ %mul2.4, %for.inc.3 ] %mul2.5 = mul nuw nsw i32 %mul2.4, %i.026 %cmp3.not.5 = icmp sle i32 %mul2.5, %0 %cmp4.5 = icmp slt i32 %ans.2.4, %mul2.5 %or.cond.5 = and i1 %cmp3.not.5, %cmp4.5 br i1 %or.cond.5, label %for.inc.5, label %if.else.5 if.else.5: ; preds = %for.inc.4 %cmp6.5 = icmp sgt i32 %mul2.5, %0 br i1 %cmp6.5, label %for.end, label %for.inc.5 for.inc.5: ; preds = %if.else.5, %for.inc.4 %ans.2.5 = phi i32 [ %ans.2.4, %if.else.5 ], [ %mul2.5, %for.inc.4 ] %mul2.6 = mul nuw nsw i32 %mul2.5, %i.026 %cmp3.not.6 = icmp sle i32 %mul2.6, %0 %cmp4.6 = icmp slt i32 %ans.2.5, %mul2.6 %or.cond.6 = and i1 %cmp3.not.6, %cmp4.6 br i1 %or.cond.6, label %for.inc.6, label %if.else.6 if.else.6: ; preds = %for.inc.5 %cmp6.6 = icmp sgt i32 %mul2.6, %0 br i1 %cmp6.6, label %for.end, label %for.inc.6 for.inc.6: ; preds = %if.else.6, %for.inc.5 %ans.2.6 = phi i32 [ %ans.2.5, %if.else.6 ], [ %mul2.6, %for.inc.5 ] %mul2.7 = mul nuw nsw i32 %mul2.6, %i.026 %cmp3.not.7 = icmp sle i32 %mul2.7, %0 %cmp4.7 = icmp slt i32 %ans.2.6, %mul2.7 %or.cond.7 = and i1 %cmp3.not.7, %cmp4.7 br i1 %or.cond.7, label %for.inc.7, label %if.else.7 if.else.7: ; preds = %for.inc.6 %cmp6.7 = icmp sgt i32 %mul2.7, %0 br i1 %cmp6.7, label %for.end, label %for.inc.7 for.inc.7: ; preds = %if.else.7, %for.inc.6 %ans.2.7 = phi i32 [ %ans.2.6, %if.else.7 ], [ %mul2.7, %for.inc.6 ] %mul2.8 = mul nuw nsw i32 %mul2.7, %i.026 %cmp3.not.8 = icmp sle i32 %mul2.8, %0 %cmp4.8 = icmp slt i32 %ans.2.7, %mul2.8 %or.cond.8 = and i1 %cmp3.not.8, %cmp4.8 br i1 %or.cond.8, label %for.inc.8, label %if.else.8 if.else.8: ; preds = %for.inc.7 %cmp6.8 = icmp sgt i32 %mul2.8, %0 br i1 %cmp6.8, label %for.end, label %for.inc.8 for.inc.8: ; preds = %if.else.8, %for.inc.7 %ans.2.8 = phi i32 [ %ans.2.7, %if.else.8 ], [ %mul2.8, %for.inc.7 ] %mul2.9 = mul nuw nsw i32 %mul2.8, %i.026 %cmp3.not.9 = icmp sle i32 %mul2.9, %0 %cmp4.9 = icmp slt i32 %ans.2.8, %mul2.9 %or.cond.9 = and i1 %cmp3.not.9, %cmp4.9 %spec.select28 = select i1 %or.cond.9, i32 %mul2.9, i32 %ans.2.8 br label %for.end for.end: ; preds = %for.inc.8, %if.else.8, %if.else.7, %if.else.6, %if.else.5, %if.else.4, %if.else.3, %if.else.2, %if.else.1 %ans.1.lcssa = phi i32 [ %spec.select, %if.else.1 ], [ %ans.2.1, %if.else.2 ], [ %ans.2.2, %if.else.3 ], [ %ans.2.3, %if.else.4 ], [ %ans.2.4, %if.else.5 ], [ %ans.2.5, %if.else.6 ], [ %ans.2.6, %if.else.7 ], [ %ans.2.7, %if.else.8 ], [ %spec.select28, %for.inc.8 ] %inc10 = add nuw nsw i32 %i.026, 1 %mul = mul nsw i32 %inc10, %inc10 %cmp = icmp sgt i32 %mul, %0 br i1 %cmp, label %while.end, label %for.cond.preheader while.end: ; preds = %for.end, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %ans.1.lcssa, %for.end ] %call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main(void) { int n, m; int i, j; int a, b; int count; int list[501][501]; int friend[501]; while (1){ scanf("%d", &n); scanf("%d", &m); if (n == 0 && m == 0){ break; } memset(list, 0, sizeof(list)); memset(friend, 0, sizeof(friend)); count = 0; for (i = 0; i < m; i++){ scanf("%d %d", &a, &b); list[a][b] = 1; list[b][a] = 1; } for (i = 2; i <= n; i++){ if (list[1][i] == 1){ friend[i] = 1; for (j = 2; j <= n; j++){ if (list[i][j] == 1){ friend[j] = 1; } } } } for (i = 2; i <= n; i++){ if (friend[i] == 1){ count++; } } printf("%d\n", count); } return (0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155624/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155624/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %a = alloca i32, align 4 %b = alloca i32, align 4 %list = alloca [501 x [501 x i32]], align 16 %friend = alloca [501 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.start.p0(i64 1004004, ptr nonnull %list) #5 call void @llvm.lifetime.start.p0(i64 2004, ptr nonnull %friend) #5 %call77 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call178 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp79 = icmp eq i32 %0, 0 %1 = load i32, ptr %m, align 4 %cmp280 = icmp eq i32 %1, 0 %or.cond81 = select i1 %cmp79, i1 %cmp280, i1 false br i1 %or.cond81, label %while.end, label %if.end if.end: ; preds = %entry, %for.end52 %2 = phi i32 [ %53, %for.end52 ], [ %0, %entry ] %3 = phi i32 [ %54, %for.end52 ], [ %1, %entry ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1004004) %list, i8 0, i64 1004004, i1 false) call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2004) %friend, i8 0, i64 2004, i1 false) %cmp467 = icmp sgt i32 %3, 0 br i1 %cmp467, label %for.body, label %for.cond12.preheader for.cond12.preheader.loopexit: ; preds = %for.body %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond12.preheader for.cond12.preheader: ; preds = %for.cond12.preheader.loopexit, %if.end %4 = phi i32 [ %.pre, %for.cond12.preheader.loopexit ], [ %2, %if.end ] %cmp13.not71 = icmp slt i32 %4, 2 br i1 %cmp13.not71, label %for.end52, label %for.body14.preheader for.body14.preheader: ; preds = %for.cond12.preheader %5 = add i32 %4, 1 %wide.trip.count86 = zext i32 %5 to i64 %6 = add nsw i64 %wide.trip.count86, -2 %min.iters.check97 = icmp ult i64 %6, 8 %n.vec100 = and i64 %6, -8 %ind.end101 = or i64 %n.vec100, 2 %cmp.n103 = icmp eq i64 %6, %n.vec100 br label %for.body14 for.body: ; preds = %if.end, %for.body %i.068 = phi i32 [ %inc, %for.body ], [ 0, %if.end ] %call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b) %7 = load i32, ptr %a, align 4, !tbaa !5 %idxprom = sext i32 %7 to i64 %8 = load i32, ptr %b, align 4, !tbaa !5 %idxprom6 = sext i32 %8 to i64 %arrayidx7 = getelementptr inbounds [501 x [501 x i32]], ptr %list, i64 0, i64 %idxprom, i64 %idxprom6 store i32 1, ptr %arrayidx7, align 4, !tbaa !5 %arrayidx11 = getelementptr inbounds [501 x [501 x i32]], ptr %list, i64 0, i64 %idxprom6, i64 %idxprom store i32 1, ptr %arrayidx11, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.068, 1 %9 = load i32, ptr %m, align 4, !tbaa !5 %cmp4 = icmp slt i32 %inc, %9 br i1 %cmp4, label %for.body, label %for.cond12.preheader.loopexit, !llvm.loop !9 for.cond41.preheader: ; preds = %for.inc38 br i1 %cmp13.not71, label %for.end52, label %for.body43.preheader for.body43.preheader: ; preds = %for.cond41.preheader %10 = add nuw i32 %4, 1 %wide.trip.count91 = zext i32 %10 to i64 %11 = add nsw i64 %wide.trip.count86, -2 %min.iters.check = icmp ult i64 %11, 8 br i1 %min.iters.check, label %for.body43.preheader124, label %vector.ph vector.ph: ; preds = %for.body43.preheader %n.vec = and i64 %11, -8 %ind.end = or i64 %n.vec, 2 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ] %vec.phi93 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ] %offset.idx = or i64 %index, 2 %12 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %offset.idx %wide.load = load <4 x i32>, ptr %12, align 8, !tbaa !5 %13 = getelementptr inbounds i32, ptr %12, i64 4 %wide.load94 = load <4 x i32>, ptr %13, align 8, !tbaa !5 %14 = icmp eq <4 x i32> %wide.load, <i32 1, i32 1, i32 1, i32 1> %15 = icmp eq <4 x i32> %wide.load94, <i32 1, i32 1, i32 1, i32 1> %16 = zext <4 x i1> %14 to <4 x i32> %17 = zext <4 x i1> %15 to <4 x i32> %18 = add <4 x i32> %vec.phi, %16 %19 = add <4 x i32> %vec.phi93, %17 %index.next = add nuw i64 %index, 8 %20 = icmp eq i64 %index.next, %n.vec br i1 %20, label %middle.block, label %vector.body, !llvm.loop !11 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %19, %18 %21 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i64 %11, %n.vec br i1 %cmp.n, label %for.end52, label %for.body43.preheader124 for.body43.preheader124: ; preds = %for.body43.preheader, %middle.block %indvars.iv88.ph = phi i64 [ 2, %for.body43.preheader ], [ %ind.end, %middle.block ] %count.075.ph = phi i32 [ 0, %for.body43.preheader ], [ %21, %middle.block ] br label %for.body43 for.body14: ; preds = %for.body14.preheader, %for.inc38 %indvars.iv83 = phi i64 [ 2, %for.body14.preheader ], [ %indvars.iv.next84, %for.inc38 ] %arrayidx17 = getelementptr inbounds [501 x [501 x i32]], ptr %list, i64 0, i64 1, i64 %indvars.iv83 %22 = load i32, ptr %arrayidx17, align 4, !tbaa !5 %cmp18 = icmp eq i32 %22, 1 br i1 %cmp18, label %if.then19, label %for.inc38 if.then19: ; preds = %for.body14 %arrayidx21 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %indvars.iv83 store i32 1, ptr %arrayidx21, align 4, !tbaa !5 br i1 %min.iters.check97, label %for.body24.preheader, label %vector.body104 vector.body104: ; preds = %if.then19, %pred.store.continue122 %index105 = phi i64 [ %index.next123, %pred.store.continue122 ], [ 0, %if.then19 ] %offset.idx106 = or i64 %index105, 2 %23 = or i64 %index105, 6 %24 = getelementptr inbounds [501 x [501 x i32]], ptr %list, i64 0, i64 %indvars.iv83, i64 %offset.idx106 %wide.load107 = load <4 x i32>, ptr %24, align 4, !tbaa !5 %25 = getelementptr inbounds i32, ptr %24, i64 4 %wide.load108 = load <4 x i32>, ptr %25, align 4, !tbaa !5 %26 = icmp eq <4 x i32> %wide.load107, <i32 1, i32 1, i32 1, i32 1> %27 = icmp eq <4 x i32> %wide.load108, <i32 1, i32 1, i32 1, i32 1> %28 = extractelement <4 x i1> %26, i64 0 br i1 %28, label %pred.store.if, label %pred.store.continue pred.store.if: ; preds = %vector.body104 %29 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %offset.idx106 store i32 1, ptr %29, align 8, !tbaa !5 br label %pred.store.continue pred.store.continue: ; preds = %pred.store.if, %vector.body104 %30 = extractelement <4 x i1> %26, i64 1 br i1 %30, label %pred.store.if109, label %pred.store.continue110 pred.store.if109: ; preds = %pred.store.continue %31 = or i64 %index105, 3 %32 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %31 store i32 1, ptr %32, align 4, !tbaa !5 br label %pred.store.continue110 pred.store.continue110: ; preds = %pred.store.if109, %pred.store.continue %33 = extractelement <4 x i1> %26, i64 2 br i1 %33, label %pred.store.if111, label %pred.store.continue112 pred.store.if111: ; preds = %pred.store.continue110 %34 = or i64 %index105, 4 %35 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %34 store i32 1, ptr %35, align 16, !tbaa !5 br label %pred.store.continue112 pred.store.continue112: ; preds = %pred.store.if111, %pred.store.continue110 %36 = extractelement <4 x i1> %26, i64 3 br i1 %36, label %pred.store.if113, label %pred.store.continue114 pred.store.if113: ; preds = %pred.store.continue112 %37 = or i64 %index105, 5 %38 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %37 store i32 1, ptr %38, align 4, !tbaa !5 br label %pred.store.continue114 pred.store.continue114: ; preds = %pred.store.if113, %pred.store.continue112 %39 = extractelement <4 x i1> %27, i64 0 br i1 %39, label %pred.store.if115, label %pred.store.continue116 pred.store.if115: ; preds = %pred.store.continue114 %40 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %23 store i32 1, ptr %40, align 8, !tbaa !5 br label %pred.store.continue116 pred.store.continue116: ; preds = %pred.store.if115, %pred.store.continue114 %41 = extractelement <4 x i1> %27, i64 1 br i1 %41, label %pred.store.if117, label %pred.store.continue118 pred.store.if117: ; preds = %pred.store.continue116 %42 = or i64 %index105, 7 %43 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %42 store i32 1, ptr %43, align 4, !tbaa !5 br label %pred.store.continue118 pred.store.continue118: ; preds = %pred.store.if117, %pred.store.continue116 %44 = extractelement <4 x i1> %27, i64 2 br i1 %44, label %pred.store.if119, label %pred.store.continue120 pred.store.if119: ; preds = %pred.store.continue118 %45 = add i64 %index105, 8 %46 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %45 store i32 1, ptr %46, align 16, !tbaa !5 br label %pred.store.continue120 pred.store.continue120: ; preds = %pred.store.if119, %pred.store.continue118 %47 = extractelement <4 x i1> %27, i64 3 br i1 %47, label %pred.store.if121, label %pred.store.continue122 pred.store.if121: ; preds = %pred.store.continue120 %48 = add i64 %index105, 9 %49 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %48 store i32 1, ptr %49, align 4, !tbaa !5 br label %pred.store.continue122 pred.store.continue122: ; preds = %pred.store.if121, %pred.store.continue120 %index.next123 = add nuw i64 %index105, 8 %50 = icmp eq i64 %index.next123, %n.vec100 br i1 %50, label %middle.block95, label %vector.body104, !llvm.loop !14 middle.block95: ; preds = %pred.store.continue122 br i1 %cmp.n103, label %for.inc38, label %for.body24.preheader for.body24.preheader: ; preds = %if.then19, %middle.block95 %indvars.iv.ph = phi i64 [ 2, %if.then19 ], [ %ind.end101, %middle.block95 ] br label %for.body24 for.body24: ; preds = %for.body24.preheader, %for.inc34 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc34 ], [ %indvars.iv.ph, %for.body24.preheader ] %arrayidx28 = getelementptr inbounds [501 x [501 x i32]], ptr %list, i64 0, i64 %indvars.iv83, i64 %indvars.iv %51 = load i32, ptr %arrayidx28, align 4, !tbaa !5 %cmp29 = icmp eq i32 %51, 1 br i1 %cmp29, label %if.then30, label %for.inc34 if.then30: ; preds = %for.body24 %arrayidx32 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %indvars.iv store i32 1, ptr %arrayidx32, align 4, !tbaa !5 br label %for.inc34 for.inc34: ; preds = %for.body24, %if.then30 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count86 br i1 %exitcond.not, label %for.inc38, label %for.body24, !llvm.loop !15 for.inc38: ; preds = %for.inc34, %middle.block95, %for.body14 %indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1 %exitcond87.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count86 br i1 %exitcond87.not, label %for.cond41.preheader, label %for.body14, !llvm.loop !16 for.body43: ; preds = %for.body43.preheader124, %for.body43 %indvars.iv88 = phi i64 [ %indvars.iv.next89, %for.body43 ], [ %indvars.iv88.ph, %for.body43.preheader124 ] %count.075 = phi i32 [ %spec.select, %for.body43 ], [ %count.075.ph, %for.body43.preheader124 ] %arrayidx45 = getelementptr inbounds [501 x i32], ptr %friend, i64 0, i64 %indvars.iv88 %52 = load i32, ptr %arrayidx45, align 4, !tbaa !5 %cmp46 = icmp eq i32 %52, 1 %inc48 = zext i1 %cmp46 to i32 %spec.select = add nuw nsw i32 %count.075, %inc48 %indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1 %exitcond92.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count91 br i1 %exitcond92.not, label %for.end52, label %for.body43, !llvm.loop !17 for.end52: ; preds = %for.body43, %middle.block, %for.cond12.preheader, %for.cond41.preheader %count.0.lcssa = phi i32 [ 0, %for.cond41.preheader ], [ 0, %for.cond12.preheader ], [ %21, %middle.block ], [ %spec.select, %for.body43 ] %call53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %count.0.lcssa) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m) %53 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %53, 0 %54 = load i32, ptr %m, align 4 %cmp2 = icmp eq i32 %54, 0 %or.cond = select i1 %cmp, i1 %cmp2, i1 false br i1 %or.cond, label %while.end, label %if.end while.end: ; preds = %for.end52, %entry call void @llvm.lifetime.end.p0(i64 2004, ptr nonnull %friend) #5 call void @llvm.lifetime.end.p0(i64 1004004, ptr nonnull %list) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10, !12, !13} !15 = distinct !{!15, !10, !13, !12} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !13, !12}
#include <stdio.h> int main(void) { int n,w,h,x,y,s,t,i,j,k,l,sum,max; for(;;){ scanf("%d", &n); if(n==0) break; int per[100][100]={0}; sum=0; max=0; scanf("%d %d", &w, &h); for(i=0;i<n;i++){ scanf("%d %d", &x, &y); per[x-1][y-1]=1; } scanf("%d %d", &s, &t); for(i=0;i+t-1<h;i++){ for(j=0;j+s-1<w;j++){ for(k=i;k<t+i;k++){ for(l=j;l<s+j;l++){ if(per[l][k]==1) sum++; } } if(sum>max) max=sum; sum=0; } } printf("%d\n", max); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155668/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155668/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%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 %w = alloca i32, align 4 %h = alloca i32, align 4 %x = alloca i32, align 4 %y = alloca i32, align 4 %s = alloca i32, align 4 %t = alloca i32, align 4 %per = alloca [100 x [100 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %h) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5 %call95 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp96 = icmp eq i32 %0, 0 br i1 %cmp96, label %for.end50, label %if.end if.end: ; preds = %entry, %for.end48 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %per) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40000) %per, i8 0, i64 40000, i1 false) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %w, ptr noundef nonnull %h) %1 = load i32, ptr %n, align 4, !tbaa !5 %cmp367 = icmp sgt i32 %1, 0 br i1 %cmp367, label %for.body, label %for.end for.body: ; preds = %if.end, %for.body %i.068 = phi i32 [ %inc, %for.body ], [ 0, %if.end ] %call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x, ptr noundef nonnull %y) %2 = load i32, ptr %x, align 4, !tbaa !5 %sub = add nsw i32 %2, -1 %idxprom = sext i32 %sub to i64 %3 = load i32, ptr %y, align 4, !tbaa !5 %sub5 = add nsw i32 %3, -1 %idxprom6 = sext i32 %sub5 to i64 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr %per, i64 0, i64 %idxprom, i64 %idxprom6 store i32 1, ptr %arrayidx7, align 4, !tbaa !5 %inc = add nuw nsw i32 %i.068, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp3 = icmp slt i32 %inc, %4 br i1 %cmp3, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body, %if.end %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %t) %5 = load i32, ptr %t, align 4, !tbaa !5 %6 = load i32, ptr %h, align 4, !tbaa !5 %cmp11.not89 = icmp sgt i32 %5, %6 br i1 %cmp11.not89, label %for.end48, label %for.cond13.preheader.lr.ph for.cond13.preheader.lr.ph: ; preds = %for.end %7 = load i32, ptr %s, align 4, !tbaa !5 %8 = load i32, ptr %w, align 4, !tbaa !5 %cmp16.not76 = icmp sgt i32 %7, %8 br i1 %cmp16.not76, label %for.end48, label %for.cond13.preheader.preheader for.cond13.preheader.preheader: ; preds = %for.cond13.preheader.lr.ph %9 = add i32 %7, 1 %10 = add i32 %8, 1 %smax = call i32 @llvm.smax.i32(i32 %9, i32 %10) %11 = sub i32 %smax, %7 %min.iters.check121 = icmp ult i32 %11, 8 %n.vec124 = and i32 %11, -8 %cmp.n126 = icmp eq i32 %11, %n.vec124 br label %for.cond13.preheader for.cond13.preheader: ; preds = %for.cond13.preheader.preheader, %for.cond13.for.inc46_crit_edge %indvars.iv110 = phi i32 [ %indvars.iv.next111, %for.cond13.for.inc46_crit_edge ], [ %5, %for.cond13.preheader.preheader ] %indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.cond13.for.inc46_crit_edge ], [ 0, %for.cond13.preheader.preheader ] %max.092 = phi i32 [ %.us-phi88, %for.cond13.for.inc46_crit_edge ], [ 0, %for.cond13.preheader.preheader ] %indvars115 = trunc i64 %indvars.iv105 to i32 %cmp2072 = icmp sgt i32 %indvars.iv110, %indvars115 br i1 %cmp2072, label %for.cond18.preheader.us.preheader, label %for.cond18.preheader.preheader for.cond18.preheader.preheader: ; preds = %for.cond13.preheader br i1 %min.iters.check121, label %for.cond18.preheader.preheader133, label %vector.ph122 vector.ph122: ; preds = %for.cond18.preheader.preheader %minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %max.092, i64 0 %minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer br label %vector.body127 vector.body127: ; preds = %vector.body127, %vector.ph122 %index128 = phi i32 [ 0, %vector.ph122 ], [ %index.next131, %vector.body127 ] %vec.phi129 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph122 ], [ %12, %vector.body127 ] %vec.phi130 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph122 ], [ %13, %vector.body127 ] %12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi129, <4 x i32> zeroinitializer) %13 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %vec.phi130, <4 x i32> zeroinitializer) %index.next131 = add nuw i32 %index128, 8 %14 = icmp eq i32 %index.next131, %n.vec124 br i1 %14, label %middle.block119, label %vector.body127, !llvm.loop !11 middle.block119: ; preds = %vector.body127 %rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %12, <4 x i32> %13) %15 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax) br i1 %cmp.n126, label %for.cond13.for.inc46_crit_edge, label %for.cond18.preheader.preheader133 for.cond18.preheader.preheader133: ; preds = %for.cond18.preheader.preheader, %middle.block119 %max.179.ph = phi i32 [ %max.092, %for.cond18.preheader.preheader ], [ %15, %middle.block119 ] %j.077.ph = phi i32 [ 0, %for.cond18.preheader.preheader ], [ %n.vec124, %middle.block119 ] br label %for.cond18.preheader for.cond18.preheader.us.preheader: ; preds = %for.cond13.preheader %wide.trip.count112 = zext i32 %indvars.iv110 to i64 br label %for.cond18.preheader.us for.cond18.preheader.us: ; preds = %for.cond18.preheader.us.preheader, %for.cond18.for.end39_crit_edge.us %indvars.iv103 = phi i32 [ %7, %for.cond18.preheader.us.preheader ], [ %indvars.iv.next104, %for.cond18.for.end39_crit_edge.us ] %indvars.iv = phi i64 [ 0, %for.cond18.preheader.us.preheader ], [ %indvars.iv.next, %for.cond18.for.end39_crit_edge.us ] %max.179.us = phi i32 [ %max.092, %for.cond18.preheader.us.preheader ], [ %spec.select66.us, %for.cond18.for.end39_crit_edge.us ] %16 = zext i32 %indvars.iv103 to i64 %17 = sub nsw i64 %16, %indvars.iv %indvars114 = trunc i64 %indvars.iv to i32 %cmp2469.us = icmp sgt i32 %indvars.iv103, %indvars114 br i1 %cmp2469.us, label %for.cond22.preheader.us.us.preheader, label %for.cond18.for.end39_crit_edge.us for.cond22.preheader.us.us.preheader: ; preds = %for.cond18.preheader.us %wide.trip.count = zext i32 %indvars.iv103 to i64 %min.iters.check = icmp ult i64 %17, 8 %n.vec = and i64 %17, -8 %ind.end = add i64 %indvars.iv, %n.vec %cmp.n = icmp eq i64 %17, %n.vec br label %for.cond22.preheader.us.us for.cond18.for.end39_crit_edge.us: ; preds = %for.cond22.for.inc37_crit_edge.us.us, %for.cond18.preheader.us %.us-phi.us = phi i32 [ 0, %for.cond18.preheader.us ], [ %spec.select.us.us.lcssa, %for.cond22.for.inc37_crit_edge.us.us ] %spec.select66.us = call i32 @llvm.smax.i32(i32 %.us-phi.us, i32 %max.179.us) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %indvars.iv.next104 = add i32 %indvars.iv103, 1 %cmp16.not.us = icmp sgt i32 %indvars.iv.next104, %8 br i1 %cmp16.not.us, label %for.cond13.for.inc46_crit_edge, label %for.cond18.preheader.us, !llvm.loop !14 for.cond22.preheader.us.us: ; preds = %for.cond22.preheader.us.us.preheader, %for.cond22.for.inc37_crit_edge.us.us %indvars.iv107 = phi i64 [ %indvars.iv105, %for.cond22.preheader.us.us.preheader ], [ %indvars.iv.next108, %for.cond22.for.inc37_crit_edge.us.us ] %sum.274.us.us = phi i32 [ 0, %for.cond22.preheader.us.us.preheader ], [ %spec.select.us.us.lcssa, %for.cond22.for.inc37_crit_edge.us.us ] br i1 %min.iters.check, label %for.body25.us.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond22.preheader.us.us %18 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %sum.274.us.us, i64 0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ %18, %vector.ph ], [ %54, %vector.body ] %vec.phi118 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %55, %vector.body ] %offset.idx = add i64 %indvars.iv, %index %19 = add i64 %offset.idx, 1 %20 = add i64 %offset.idx, 2 %21 = add i64 %offset.idx, 3 %22 = add i64 %offset.idx, 4 %23 = add i64 %offset.idx, 5 %24 = add i64 %offset.idx, 6 %25 = add i64 %offset.idx, 7 %26 = getelementptr inbounds [100 x [100 x i32]], ptr %per, i64 0, i64 %offset.idx, i64 %indvars.iv107 %27 = getelementptr inbounds [100 x [100 x i32]], ptr %per, i64 0, i64 %19, i64 %indvars.iv107 %28 = getelementptr inbounds [100 x [100 x i32]], ptr %per, i64 0, i64 %20, i64 %indvars.iv107 %29 = getelementptr inbounds [100 x [100 x i32]], ptr %per, i64 0, i64 %21, i64 %indvars.iv107 %30 = getelementptr inbounds [100 x [100 x i32]], ptr %per, i64 0, i64 %22, i64 %indvars.iv107 %31 = getelementptr inbounds [100 x [100 x i32]], ptr %per, i64 0, i64 %23, i64 %indvars.iv107 %32 = getelementptr inbounds [100 x [100 x i32]], ptr %per, i64 0, i64 %24, i64 %indvars.iv107 %33 = getelementptr inbounds [100 x [100 x i32]], ptr %per, i64 0, i64 %25, i64 %indvars.iv107 %34 = load i32, ptr %26, align 4, !tbaa !5 %35 = load i32, ptr %27, align 4, !tbaa !5 %36 = load i32, ptr %28, align 4, !tbaa !5 %37 = load i32, ptr %29, align 4, !tbaa !5 %38 = insertelement <4 x i32> poison, i32 %34, i64 0 %39 = insertelement <4 x i32> %38, i32 %35, i64 1 %40 = insertelement <4 x i32> %39, i32 %36, i64 2 %41 = insertelement <4 x i32> %40, i32 %37, i64 3 %42 = load i32, ptr %30, align 4, !tbaa !5 %43 = load i32, ptr %31, align 4, !tbaa !5 %44 = load i32, ptr %32, align 4, !tbaa !5 %45 = load i32, ptr %33, align 4, !tbaa !5 %46 = insertelement <4 x i32> poison, i32 %42, i64 0 %47 = insertelement <4 x i32> %46, i32 %43, i64 1 %48 = insertelement <4 x i32> %47, i32 %44, i64 2 %49 = insertelement <4 x i32> %48, i32 %45, i64 3 %50 = icmp eq <4 x i32> %41, <i32 1, i32 1, i32 1, i32 1> %51 = icmp eq <4 x i32> %49, <i32 1, i32 1, i32 1, i32 1> %52 = zext <4 x i1> %50 to <4 x i32> %53 = zext <4 x i1> %51 to <4 x i32> %54 = add <4 x i32> %vec.phi, %52 %55 = add <4 x i32> %vec.phi118, %53 %index.next = add nuw i64 %index, 8 %56 = icmp eq i64 %index.next, %n.vec br i1 %56, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body %bin.rdx = add <4 x i32> %55, %54 %57 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx) br i1 %cmp.n, label %for.cond22.for.inc37_crit_edge.us.us, label %for.body25.us.us.preheader for.body25.us.us.preheader: ; preds = %for.cond22.preheader.us.us, %middle.block %indvars.iv100.ph = phi i64 [ %indvars.iv, %for.cond22.preheader.us.us ], [ %ind.end, %middle.block ] %sum.371.us.us.ph = phi i32 [ %sum.274.us.us, %for.cond22.preheader.us.us ], [ %57, %middle.block ] br label %for.body25.us.us for.body25.us.us: ; preds = %for.body25.us.us.preheader, %for.body25.us.us %indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.body25.us.us ], [ %indvars.iv100.ph, %for.body25.us.us.preheader ] %sum.371.us.us = phi i32 [ %spec.select.us.us, %for.body25.us.us ], [ %sum.371.us.us.ph, %for.body25.us.us.preheader ] %arrayidx29.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %per, i64 0, i64 %indvars.iv100, i64 %indvars.iv107 %58 = load i32, ptr %arrayidx29.us.us, align 4, !tbaa !5 %cmp30.us.us = icmp eq i32 %58, 1 %inc32.us.us = zext i1 %cmp30.us.us to i32 %spec.select.us.us = add nsw i32 %sum.371.us.us, %inc32.us.us %indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1 %exitcond.not = icmp eq i64 %indvars.iv.next101, %wide.trip.count br i1 %exitcond.not, label %for.cond22.for.inc37_crit_edge.us.us, label %for.body25.us.us, !llvm.loop !16 for.cond22.for.inc37_crit_edge.us.us: ; preds = %for.body25.us.us, %middle.block %spec.select.us.us.lcssa = phi i32 [ %57, %middle.block ], [ %spec.select.us.us, %for.body25.us.us ] %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1 %exitcond113.not = icmp eq i64 %indvars.iv.next108, %wide.trip.count112 br i1 %exitcond113.not, label %for.cond18.for.end39_crit_edge.us, label %for.cond22.preheader.us.us, !llvm.loop !17 for.cond18.preheader: ; preds = %for.cond18.preheader.preheader133, %for.cond18.preheader %max.179 = phi i32 [ %spec.select66, %for.cond18.preheader ], [ %max.179.ph, %for.cond18.preheader.preheader133 ] %j.077 = phi i32 [ %inc44, %for.cond18.preheader ], [ %j.077.ph, %for.cond18.preheader.preheader133 ] %spec.select66 = call i32 @llvm.smax.i32(i32 %max.179, i32 0) %inc44 = add nuw nsw i32 %j.077, 1 %add14 = add nsw i32 %7, %inc44 %cmp16.not = icmp sgt i32 %add14, %8 br i1 %cmp16.not, label %for.cond13.for.inc46_crit_edge, label %for.cond18.preheader, !llvm.loop !18 for.cond13.for.inc46_crit_edge: ; preds = %for.cond18.preheader, %for.cond18.for.end39_crit_edge.us, %middle.block119 %.us-phi88 = phi i32 [ %15, %middle.block119 ], [ %spec.select66.us, %for.cond18.for.end39_crit_edge.us ], [ %spec.select66, %for.cond18.preheader ] %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1 %indvars.iv.next111 = add i32 %indvars.iv110, 1 %cmp11.not = icmp sgt i32 %indvars.iv.next111, %6 br i1 %cmp11.not, label %for.end48, label %for.cond13.preheader, !llvm.loop !19 for.end48: ; preds = %for.cond13.for.inc46_crit_edge, %for.cond13.preheader.lr.ph, %for.end %max.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %for.cond13.preheader.lr.ph ], [ %.us-phi88, %for.cond13.for.inc46_crit_edge ] %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %max.0.lcssa) call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %per) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %59 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp eq i32 %59, 0 br i1 %cmp, label %for.end50, label %if.end for.end50: ; preds = %for.end48, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %h) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smax.i32(i32, i32) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v4i32(<4 x 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 = { nofree nounwind "no-trapping-math"="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 = { 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, !13} !12 = !{!"llvm.loop.isvectorized", i32 1} !13 = !{!"llvm.loop.unroll.runtime.disable"} !14 = distinct !{!14, !10} !15 = distinct !{!15, !10, !12, !13} !16 = distinct !{!16, !10, !13, !12} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10, !13, !12} !19 = distinct !{!19, !10}
#include<stdio.h> #include<stdlib.h> typedef struct { int number; int id; } set; int cmpnum( const void *p, const void *q ) { return ((set*)p)->number - ((set*)q)->number; } int cmpid( const void *p, const void *q ) { return ((set*)p)->id - ((set*)q)->id; } int main(){ int i,j,k; int N; scanf("%d",&N); set A[N]; for(i=0;i<N;i++){ scanf("%d ",&A[i].number); A[i].id = i; } qsort(A,sizeof(A) / sizeof(set),sizeof(set),cmpnum); int half = (N/2); int a,b; a = A[half-1].number; b = A[half].number; qsort(A,sizeof(A) / sizeof(set),sizeof(set),cmpid); for(i=0;i<N;i++){ if(A[i].number < b){ printf("%d\n",b); } else printf("%d\n",a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155718/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155718/source.c" target datalayout = "e-m:e-p270: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.set = type { i32, i32 } @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @cmpnum(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #0 { entry: %0 = load i32, ptr %p, align 4, !tbaa !5 %1 = load i32, ptr %q, 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 @cmpid(ptr nocapture noundef readonly %p, ptr nocapture noundef readonly %q) #0 { entry: %id = getelementptr inbounds %struct.set, ptr %p, i64 0, i32 1 %0 = load i32, ptr %id, align 4, !tbaa !10 %id1 = getelementptr inbounds %struct.set, ptr %q, i64 0, i32 1 %1 = load i32, ptr %id1, align 4, !tbaa !10 %sub = sub nsw i32 %0, %1 ret i32 %sub } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %N = alloca i32, align 4 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 !11 %1 = zext i32 %0 to i64 %2 = call ptr @llvm.stacksave.p0() %vla = alloca %struct.set, i64 %1, align 16 %3 = load i32, ptr %N, align 4, !tbaa !11 %cmp33 = icmp sgt i32 %3, 0 br i1 %cmp33, 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 %struct.set, ptr %vla, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %id = getelementptr inbounds %struct.set, ptr %vla, i64 %indvars.iv, i32 1 %4 = trunc i64 %indvars.iv to i32 store i32 %4, ptr %id, align 4, !tbaa !10 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %5 = load i32, ptr %N, align 4, !tbaa !11 %6 = sext i32 %5 to i64 %cmp = icmp slt i64 %indvars.iv.next, %6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12 for.end: ; preds = %for.body, %entry call void @qsort(ptr noundef nonnull %vla, i64 noundef %1, i64 noundef 8, ptr noundef nonnull @cmpnum) #6 %7 = load i32, ptr %N, align 4, !tbaa !11 %div4 = sdiv i32 %7, 2 %sub = add nsw i32 %div4, -1 %idxprom5 = sext i32 %sub to i64 %arrayidx6 = getelementptr inbounds %struct.set, ptr %vla, i64 %idxprom5 %8 = load i32, ptr %arrayidx6, align 8, !tbaa !5 %idxprom8 = sext i32 %div4 to i64 %arrayidx9 = getelementptr inbounds %struct.set, ptr %vla, i64 %idxprom8 %9 = load i32, ptr %arrayidx9, align 8, !tbaa !5 call void @qsort(ptr noundef nonnull %vla, i64 noundef %1, i64 noundef 8, ptr noundef nonnull @cmpid) #6 %10 = load i32, ptr %N, align 4, !tbaa !11 %cmp1335 = icmp sgt i32 %10, 0 br i1 %cmp1335, label %for.body14, label %for.end23 for.body14: ; preds = %for.end, %for.body14 %indvars.iv38 = phi i64 [ %indvars.iv.next39, %for.body14 ], [ 0, %for.end ] %arrayidx16 = getelementptr inbounds %struct.set, ptr %vla, i64 %indvars.iv38 %11 = load i32, ptr %arrayidx16, align 8, !tbaa !5 %cmp18 = icmp slt i32 %11, %9 %. = select i1 %cmp18, i32 %9, i32 %8 %call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.) %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1 %12 = load i32, ptr %N, align 4, !tbaa !11 %13 = sext i32 %12 to i64 %cmp13 = icmp slt i64 %indvars.iv.next39, %13 br i1 %cmp13, label %for.body14, label %for.end23, !llvm.loop !14 for.end23: ; preds = %for.body14, %for.end call void @llvm.stackrestore.p0(ptr %2) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #5 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #5 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !7, i64 0} !6 = !{!"", !7, i64 0, !7, i64 4} !7 = !{!"int", !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = !{!6, !7, i64 4} !11 = !{!7, !7, i64 0} !12 = distinct !{!12, !13} !13 = !{!"llvm.loop.mustprogress"} !14 = distinct !{!14, !13}
#include<stdio.h> int main(void){ unsigned long long a[101][101]; unsigned long long b[101][101]; unsigned long long c[101][101] = {0}; unsigned long long n,m,l,k; scanf("%lld %lld %lld",&n,&m,&l); for(int i = 0; i<n; i++){ for(int j =0; j<m; j++){ scanf("%lld",&a[i][j]); } } for(int j = 0; j<m; j++){ for(int k = 0; k<l; k++){ scanf("%lld",&b[j][k]); } } for(int i = 0; i < n; i++){ for(int j = 0; j<m; j++){ for(int k = 0; k<l; k++){ c[i][k] += a[i][j] * b[j][k]; } } } for(int i = 0; i<n; i++){ for(k = 0; k<l-1; k++){ printf("%lld ",c[i][k]); } printf("%lld\n",c[i][l-1]); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155776/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155776/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [15 x i8] c"%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 \00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca [101 x [101 x i64]], align 16 %b = alloca [101 x [101 x i64]], align 16 %c = alloca [101 x [101 x i64]], align 16 %n = alloca i64, align 8 %m = alloca i64, align 8 %l = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %c) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(81608) %c, i8 0, i64 81608, i1 false) 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 %l) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i64, ptr %n, align 8, !tbaa !5 %cmp132.not = icmp eq i64 %0, 0 %.pre210 = load i64, ptr %m, align 8, !tbaa !5 br i1 %cmp132.not, label %for.cond15.preheader, label %for.cond2.preheader.lr.ph for.cond2.preheader.lr.ph: ; preds = %entry %.not = icmp eq i64 %.pre210, 0 br i1 %.not, label %for.cond88.preheader.preheader, label %for.cond2.preheader for.cond88.preheader.preheader: ; preds = %for.cond47.for.cond.cleanup51_crit_edge.split.us.us.us, %for.cond47.preheader.lr.ph, %for.cond2.preheader.lr.ph br label %for.cond88.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.cond.cleanup6 %1 = phi i64 [ %7, %for.cond.cleanup6 ], [ %.pre210, %for.cond2.preheader.lr.ph ] %2 = phi i64 [ %8, %for.cond.cleanup6 ], [ %0, %for.cond2.preheader.lr.ph ] %3 = phi i64 [ %9, %for.cond.cleanup6 ], [ 1, %for.cond2.preheader.lr.ph ] %indvars.iv172 = phi i64 [ %indvars.iv.next173, %for.cond.cleanup6 ], [ 0, %for.cond2.preheader.lr.ph ] %cmp4129.not = icmp eq i64 %3, 0 br i1 %cmp4129.not, label %for.cond.cleanup6, label %for.body7 for.cond15.preheader: ; preds = %for.cond.cleanup6, %entry %4 = phi i64 [ 0, %entry ], [ %8, %for.cond.cleanup6 ] %5 = phi i64 [ %.pre210, %entry ], [ %7, %for.cond.cleanup6 ] %cmp17138.not = icmp eq i64 %5, 0 br i1 %cmp17138.not, label %for.cond40.preheader, label %for.cond22.preheader.lr.ph for.cond22.preheader.lr.ph: ; preds = %for.cond15.preheader %6 = load i64, ptr %l, align 8, !tbaa !5 %.not164 = icmp eq i64 %6, 0 br i1 %.not164, label %for.cond40.preheader, label %for.cond22.preheader for.cond.cleanup6.loopexit: ; preds = %for.body7 %.pre = load i64, ptr %n, align 8, !tbaa !5 br label %for.cond.cleanup6 for.cond.cleanup6: ; preds = %for.cond.cleanup6.loopexit, %for.cond2.preheader %7 = phi i64 [ %10, %for.cond.cleanup6.loopexit ], [ %1, %for.cond2.preheader ] %8 = phi i64 [ %.pre, %for.cond.cleanup6.loopexit ], [ %2, %for.cond2.preheader ] %9 = phi i64 [ %10, %for.cond.cleanup6.loopexit ], [ 0, %for.cond2.preheader ] %indvars.iv.next173 = add nuw i64 %indvars.iv172, 1 %cmp = icmp ugt i64 %8, %indvars.iv.next173 br i1 %cmp, label %for.cond2.preheader, label %for.cond15.preheader, !llvm.loop !9 for.body7: ; preds = %for.cond2.preheader, %for.body7 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body7 ], [ 0, %for.cond2.preheader ] %arrayidx9 = getelementptr inbounds [101 x [101 x i64]], ptr %a, i64 0, i64 %indvars.iv172, i64 %indvars.iv %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx9) %indvars.iv.next = add nuw i64 %indvars.iv, 1 %10 = load i64, ptr %m, align 8, !tbaa !5 %cmp4 = icmp ugt i64 %10, %indvars.iv.next br i1 %cmp4, label %for.body7, label %for.cond.cleanup6.loopexit, !llvm.loop !12 for.cond22.preheader: ; preds = %for.cond22.preheader.lr.ph, %for.cond.cleanup26 %11 = phi i64 [ %27, %for.cond.cleanup26 ], [ %5, %for.cond22.preheader.lr.ph ] %12 = phi i64 [ %28, %for.cond.cleanup26 ], [ 1, %for.cond22.preheader.lr.ph ] %indvars.iv181 = phi i64 [ %indvars.iv.next182, %for.cond.cleanup26 ], [ 0, %for.cond22.preheader.lr.ph ] %cmp24135.not = icmp eq i64 %12, 0 br i1 %cmp24135.not, label %for.cond.cleanup26, label %for.body27 for.cond40.preheader.loopexit167: ; preds = %for.cond.cleanup26 %.pre212 = load i64, ptr %n, align 8, !tbaa !5 br label %for.cond40.preheader for.cond40.preheader: ; preds = %for.cond22.preheader.lr.ph, %for.cond40.preheader.loopexit167, %for.cond15.preheader %13 = phi i64 [ %4, %for.cond15.preheader ], [ %.pre212, %for.cond40.preheader.loopexit167 ], [ %4, %for.cond22.preheader.lr.ph ] %.lcssa = phi i64 [ 0, %for.cond15.preheader ], [ %27, %for.cond40.preheader.loopexit167 ], [ %5, %for.cond22.preheader.lr.ph ] %cmp42147.not = icmp eq i64 %13, 0 br i1 %cmp42147.not, label %for.cond.cleanup86, label %for.cond47.preheader.lr.ph for.cond47.preheader.lr.ph: ; preds = %for.cond40.preheader %cmp49144.not = icmp eq i64 %.lcssa, 0 %14 = load i64, ptr %l, align 8 %cmp56141.not = icmp eq i64 %14, 0 %or.cond = select i1 %cmp49144.not, i1 true, i1 %cmp56141.not br i1 %or.cond, label %for.cond88.preheader.preheader, label %for.cond47.preheader.us.us.preheader for.cond47.preheader.us.us.preheader: ; preds = %for.cond47.preheader.lr.ph %min.iters.check = icmp ult i64 %14, 4 %n.vec = and i64 %14, -4 %cmp.n = icmp eq i64 %14, %n.vec br label %for.cond47.preheader.us.us for.cond47.preheader.us.us: ; preds = %for.cond47.preheader.us.us.preheader, %for.cond47.for.cond.cleanup51_crit_edge.split.us.us.us %indvars.iv194 = phi i64 [ %indvars.iv.next195, %for.cond47.for.cond.cleanup51_crit_edge.split.us.us.us ], [ 0, %for.cond47.preheader.us.us.preheader ] br label %for.cond54.preheader.us.us.us for.cond54.preheader.us.us.us: ; preds = %for.cond54.for.cond.cleanup58_crit_edge.us.us.us, %for.cond47.preheader.us.us %indvars.iv190 = phi i64 [ %indvars.iv.next191, %for.cond54.for.cond.cleanup58_crit_edge.us.us.us ], [ 0, %for.cond47.preheader.us.us ] %arrayidx63.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %a, i64 0, i64 %indvars.iv194, i64 %indvars.iv190 %15 = load i64, ptr %arrayidx63.us.us.us, align 8, !tbaa !5 br i1 %min.iters.check, label %for.body59.us.us.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond54.preheader.us.us.us %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %15, i64 0 %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %16 = getelementptr inbounds [101 x [101 x i64]], ptr %b, i64 0, i64 %indvars.iv190, i64 %index %wide.load = load <2 x i64>, ptr %16, align 8, !tbaa !5 %17 = getelementptr inbounds i64, ptr %16, i64 2 %wide.load238 = load <2 x i64>, ptr %17, align 8, !tbaa !5 %18 = mul <2 x i64> %wide.load, %broadcast.splat %19 = mul <2 x i64> %wide.load238, %broadcast.splat %20 = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv194, i64 %index %wide.load239 = load <2 x i64>, ptr %20, align 8, !tbaa !5 %21 = getelementptr inbounds i64, ptr %20, i64 2 %wide.load240 = load <2 x i64>, ptr %21, align 8, !tbaa !5 %22 = add <2 x i64> %wide.load239, %18 %23 = add <2 x i64> %wide.load240, %19 store <2 x i64> %22, ptr %20, align 8, !tbaa !5 store <2 x i64> %23, ptr %21, align 8, !tbaa !5 %index.next = add nuw i64 %index, 4 %24 = icmp eq i64 %index.next, %n.vec br i1 %24, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond54.for.cond.cleanup58_crit_edge.us.us.us, label %for.body59.us.us.us.preheader for.body59.us.us.us.preheader: ; preds = %for.cond54.preheader.us.us.us, %middle.block %indvars.iv187.ph = phi i64 [ 0, %for.cond54.preheader.us.us.us ], [ %n.vec, %middle.block ] br label %for.body59.us.us.us for.body59.us.us.us: ; preds = %for.body59.us.us.us.preheader, %for.body59.us.us.us %indvars.iv187 = phi i64 [ %indvars.iv.next188, %for.body59.us.us.us ], [ %indvars.iv187.ph, %for.body59.us.us.us.preheader ] %arrayidx67.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %b, i64 0, i64 %indvars.iv190, i64 %indvars.iv187 %25 = load i64, ptr %arrayidx67.us.us.us, align 8, !tbaa !5 %mul.us.us.us = mul i64 %25, %15 %arrayidx71.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv194, i64 %indvars.iv187 %26 = load i64, ptr %arrayidx71.us.us.us, align 8, !tbaa !5 %add.us.us.us = add i64 %26, %mul.us.us.us store i64 %add.us.us.us, ptr %arrayidx71.us.us.us, align 8, !tbaa !5 %indvars.iv.next188 = add nuw nsw i64 %indvars.iv187, 1 %exitcond.not = icmp eq i64 %indvars.iv.next188, %14 br i1 %exitcond.not, label %for.cond54.for.cond.cleanup58_crit_edge.us.us.us, label %for.body59.us.us.us, !llvm.loop !16 for.cond54.for.cond.cleanup58_crit_edge.us.us.us: ; preds = %for.body59.us.us.us, %middle.block %indvars.iv.next191 = add nuw nsw i64 %indvars.iv190, 1 %exitcond193.not = icmp eq i64 %indvars.iv.next191, %.lcssa br i1 %exitcond193.not, label %for.cond47.for.cond.cleanup51_crit_edge.split.us.us.us, label %for.cond54.preheader.us.us.us, !llvm.loop !17 for.cond47.for.cond.cleanup51_crit_edge.split.us.us.us: ; preds = %for.cond54.for.cond.cleanup58_crit_edge.us.us.us %indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1 %exitcond197.not = icmp eq i64 %indvars.iv.next195, %13 br i1 %exitcond197.not, label %for.cond88.preheader.preheader, label %for.cond47.preheader.us.us, !llvm.loop !18 for.cond.cleanup26.loopexit: ; preds = %for.body27 %.pre211 = load i64, ptr %m, align 8, !tbaa !5 br label %for.cond.cleanup26 for.cond.cleanup26: ; preds = %for.cond.cleanup26.loopexit, %for.cond22.preheader %27 = phi i64 [ %.pre211, %for.cond.cleanup26.loopexit ], [ %11, %for.cond22.preheader ] %28 = phi i64 [ %29, %for.cond.cleanup26.loopexit ], [ 0, %for.cond22.preheader ] %indvars.iv.next182 = add nuw i64 %indvars.iv181, 1 %cmp17 = icmp ugt i64 %27, %indvars.iv.next182 br i1 %cmp17, label %for.cond22.preheader, label %for.cond40.preheader.loopexit167, !llvm.loop !19 for.body27: ; preds = %for.cond22.preheader, %for.body27 %indvars.iv178 = phi i64 [ %indvars.iv.next179, %for.body27 ], [ 0, %for.cond22.preheader ] %arrayidx31 = getelementptr inbounds [101 x [101 x i64]], ptr %b, i64 0, i64 %indvars.iv181, i64 %indvars.iv178 %call32 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx31) %indvars.iv.next179 = add nuw i64 %indvars.iv178, 1 %29 = load i64, ptr %l, align 8, !tbaa !5 %cmp24 = icmp ugt i64 %29, %indvars.iv.next179 br i1 %cmp24, label %for.body27, label %for.cond.cleanup26.loopexit, !llvm.loop !20 for.cond88.preheader: ; preds = %for.cond88.preheader.preheader, %for.end98 %indvars.iv207 = phi i64 [ %indvars.iv.next208, %for.end98 ], [ 0, %for.cond88.preheader.preheader ] %30 = load i64, ptr %l, align 8, !tbaa !5 %cmp89158.not = icmp eq i64 %30, 1 br i1 %cmp89158.not, label %for.end98, label %for.body91 for.cond.cleanup86: ; preds = %for.end98, %for.cond40.preheader call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %l) #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 call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %a) #4 ret i32 0 for.body91: ; preds = %for.cond88.preheader, %for.body91 %k.0159 = phi i64 [ %inc97, %for.body91 ], [ 0, %for.cond88.preheader ] %arrayidx94 = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv207, i64 %k.0159 %31 = load i64, ptr %arrayidx94, align 8, !tbaa !5 %call95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %31) %inc97 = add nuw i64 %k.0159, 1 %32 = load i64, ptr %l, align 8, !tbaa !5 %sub = add i64 %32, -1 %cmp89 = icmp ult i64 %inc97, %sub br i1 %cmp89, label %for.body91, label %for.end98, !llvm.loop !21 for.end98: ; preds = %for.body91, %for.cond88.preheader %sub.lcssa = phi i64 [ 0, %for.cond88.preheader ], [ %sub, %for.body91 ] %arrayidx102 = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv207, i64 %sub.lcssa %33 = load i64, ptr %arrayidx102, align 8, !tbaa !5 %call103 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %33) %indvars.iv.next208 = add nuw i64 %indvars.iv207, 1 %34 = load i64, ptr %n, align 8, !tbaa !5 %cmp84 = icmp ugt i64 %34, %indvars.iv.next208 br i1 %cmp84, label %for.cond88.preheader, label %for.cond.cleanup86, !llvm.loop !22 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !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.unswitch.partial.disable"} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !15, !14} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10, !11} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10}
#include<stdio.h> int main() { int a[100][100], b[100][100], m, n, l, i, j, k; long long c = 0; scanf("%d %d %d", &m, &n ,&l); for(i = 0; i < m; ++i) { for(j = 0; j < n; ++j) { scanf("%d", &a[i][j]); } } for(i = 0; i < n; ++i) { for(j = 0; j < l; ++j) { scanf("%d", &b[i][j]); } } for(i = 0; i < m; ++i) { for(j = 0; j < l; ++j) { for(k = 0; k < n; ++k) { c += a[i][k] * b[k][j]; } if(j == l - 1) { printf("%lld\n", c); c = 0; continue; } printf("%lld ", c); c = 0; } // printf("\n"); } // puts(""); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155819/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155819/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.3 = 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: %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 %m = alloca i32, align 4 %n = alloca i32, align 4 %l = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n, ptr noundef nonnull %l) %0 = load i32, ptr %m, align 4, !tbaa !5 %cmp81 = icmp sgt i32 %0, 0 %.pre116 = load i32, ptr %n, align 4, !tbaa !5 br i1 %cmp81, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre116, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre116, %for.cond1.preheader.lr.ph ] %indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp279 = icmp sgt i32 %3, 0 br i1 %cmp279, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre116, %entry ], [ %11, %for.inc7 ] %cmp1185 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp1185, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv98, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next99, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %21, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %22, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp1483 = icmp sgt i32 %14, 0 br i1 %cmp1483, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre118 = load i32, ptr %m, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %.pre118, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ] %cmp2892 = icmp sgt i32 %15, 0 br i1 %cmp2892, label %for.cond30.preheader.lr.ph, label %for.end56 for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader %16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %17 = load i32, ptr %l, align 4, !tbaa !5 %18 = icmp sgt i32 %17, 0 br i1 %18, label %for.cond30.preheader, label %for.end56 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv104, i64 %indvars.iv101 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1 %19 = load i32, ptr %l, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp14 = icmp slt i64 %indvars.iv.next102, %20 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre117 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %21 = phi i32 [ %.pre117, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %22 = phi i32 [ %19, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %23 = sext i32 %21 to i64 %cmp11 = icmp slt i64 %indvars.iv.next105, %23 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.lr.ph, %for.inc54 %24 = phi i32 [ %38, %for.inc54 ], [ %16, %for.cond30.preheader.lr.ph ] %25 = phi i32 [ %39, %for.inc54 ], [ %17, %for.cond30.preheader.lr.ph ] %indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.inc54 ], [ 0, %for.cond30.preheader.lr.ph ] %cmp3190 = icmp sgt i32 %25, 0 br i1 %cmp3190, label %for.cond33.preheader, label %for.inc54 for.cond33.preheader: ; preds = %for.cond30.preheader, %for.end46 %indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.end46 ], [ 0, %for.cond30.preheader ] %26 = phi i32 [ %36, %for.end46 ], [ %25, %for.cond30.preheader ] %27 = load i32, ptr %n, align 4, !tbaa !5 %cmp3487 = icmp sgt i32 %27, 0 br i1 %cmp3487, label %for.body35.lr.ph, label %for.end46 for.body35.lr.ph: ; preds = %for.cond33.preheader %wide.trip.count = zext i32 %27 to i64 %xtraiter = and i64 %wide.trip.count, 1 %28 = icmp eq i32 %27, 1 br i1 %28, label %for.end46.loopexit.unr-lcssa, label %for.body35.lr.ph.new for.body35.lr.ph.new: ; preds = %for.body35.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body35 for.body35: ; preds = %for.body35, %for.body35.lr.ph.new %indvars.iv107 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next108.1, %for.body35 ] %c.289 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ] %niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ] %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv107 %29 = load i32, ptr %arrayidx39, align 8, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv107, i64 %indvars.iv110 %30 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %mul = mul nsw i32 %30, %29 %conv = sext i32 %mul to i64 %add = add nsw i64 %c.289, %conv %indvars.iv.next108 = or i64 %indvars.iv107, 1 %arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv.next108 %31 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next108, i64 %indvars.iv110 %32 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %32, %31 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 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.end46.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15 for.end46.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %indvars.iv107.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next108.1, %for.body35 ] %c.289.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end46, label %for.body35.epil for.body35.epil: ; preds = %for.end46.loopexit.unr-lcssa %arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv107.unr %33 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv107.unr, i64 %indvars.iv110 %34 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %34, %33 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %c.289.unr, %conv.epil br label %for.end46 for.end46: ; preds = %for.body35.epil, %for.end46.loopexit.unr-lcssa, %for.cond33.preheader %c.2.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ] %sub = add nsw i32 %26, -1 %35 = zext i32 %sub to i64 %cmp47 = icmp eq i64 %indvars.iv110, %35 %.str.2..str.3 = select i1 %cmp47, ptr @.str.2, ptr @.str.3 %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3, i64 noundef %c.2.lcssa) %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %36 = load i32, ptr %l, align 4, !tbaa !5 %37 = sext i32 %36 to i64 %cmp31 = icmp slt i64 %indvars.iv.next111, %37 br i1 %cmp31, label %for.cond33.preheader, label %for.inc54.loopexit, !llvm.loop !16 for.inc54.loopexit: ; preds = %for.end46 %.pre119 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc54 for.inc54: ; preds = %for.inc54.loopexit, %for.cond30.preheader %38 = phi i32 [ %.pre119, %for.inc54.loopexit ], [ %24, %for.cond30.preheader ] %39 = phi i32 [ %36, %for.inc54.loopexit ], [ %25, %for.cond30.preheader ] %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %40 = sext i32 %38 to i64 %cmp28 = icmp slt i64 %indvars.iv.next114, %40 br i1 %cmp28, label %for.cond30.preheader, label %for.end56, !llvm.loop !17 for.end56: ; preds = %for.inc54, %for.cond30.preheader.lr.ph, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !12}
#include <stdio.h> int main(int argc, char const *argv[]) { int n, a[200002]; int b[200002]; for(int i=0;i<200002;i++) b[i] = 0; scanf("%d", &n); int neset = 0; for(int i=0;i<n;i++) scanf("%d", &a[i]); for(int i=n-1; i>=0; i--) { if(b[a[i]]==0) { b[a[i]]=1; neset = a[i]; } } printf("%d", neset); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15587/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15587/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca [200002 x i32], align 16 %b = alloca [200002 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5 call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 800008, ptr nonnull %b) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800008) %b, i8 0, i64 800008, 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 %cmp340 = icmp sgt i32 %0, 0 br i1 %cmp340, label %for.body5, label %for.cond.cleanup15 for.cond13.preheader: ; preds = %for.body5 %cmp1442 = icmp sgt i32 %3, 0 br i1 %cmp1442, label %for.body16.preheader, label %for.cond.cleanup15 for.body16.preheader: ; preds = %for.cond13.preheader %1 = zext i32 %3 to i64 %xtraiter = and i64 %1, 1 %2 = icmp eq i32 %3, 1 br i1 %2, label %for.cond.cleanup15.loopexit.unr-lcssa, label %for.body16.preheader.new for.body16.preheader.new: ; preds = %for.body16.preheader %unroll_iter = and i64 %1, 4294967294 br label %for.body16 for.body5: ; preds = %entry, %for.body5 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body5 ], [ 0, %entry ] %arrayidx7 = getelementptr inbounds [200002 x i32], ptr %a, i64 0, i64 %indvars.iv %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7) %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 %cmp3 = icmp slt i64 %indvars.iv.next, %4 br i1 %cmp3, label %for.body5, label %for.cond13.preheader, !llvm.loop !9 for.cond.cleanup15.loopexit.unr-lcssa: ; preds = %for.body16, %for.body16.preheader %spec.select.lcssa.ph = phi i32 [ undef, %for.body16.preheader ], [ %spec.select.1, %for.body16 ] %indvars.iv49.unr = phi i64 [ %1, %for.body16.preheader ], [ %indvars.iv.next50.1, %for.body16 ] %neset.043.unr = phi i32 [ 0, %for.body16.preheader ], [ %spec.select.1, %for.body16 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup15, label %for.body16.epil for.body16.epil: ; preds = %for.cond.cleanup15.loopexit.unr-lcssa %indvars.iv.next50.epil = add i64 %indvars.iv49.unr, 4294967295 %idxprom17.epil = and i64 %indvars.iv.next50.epil, 4294967295 %arrayidx18.epil = getelementptr inbounds [200002 x i32], ptr %a, i64 0, i64 %idxprom17.epil %5 = load i32, ptr %arrayidx18.epil, align 4, !tbaa !5 %idxprom19.epil = sext i32 %5 to i64 %arrayidx20.epil = getelementptr inbounds [200002 x i32], ptr %b, i64 0, i64 %idxprom19.epil %6 = load i32, ptr %arrayidx20.epil, align 4, !tbaa !5 %cmp21.epil = icmp eq i32 %6, 0 %spec.store.select.epil = call i32 @llvm.umax.i32(i32 %6, i32 1) store i32 %spec.store.select.epil, ptr %arrayidx20.epil, align 4 %spec.select.epil = select i1 %cmp21.epil, i32 %5, i32 %neset.043.unr br label %for.cond.cleanup15 for.cond.cleanup15: ; preds = %for.body16.epil, %for.cond.cleanup15.loopexit.unr-lcssa, %entry, %for.cond13.preheader %neset.0.lcssa = phi i32 [ 0, %for.cond13.preheader ], [ 0, %entry ], [ %spec.select.lcssa.ph, %for.cond.cleanup15.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body16.epil ] %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %neset.0.lcssa) call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %b) #5 call void @llvm.lifetime.end.p0(i64 800008, ptr nonnull %a) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5 ret i32 0 for.body16: ; preds = %for.body16, %for.body16.preheader.new %indvars.iv49 = phi i64 [ %1, %for.body16.preheader.new ], [ %indvars.iv.next50.1, %for.body16 ] %neset.043 = phi i32 [ 0, %for.body16.preheader.new ], [ %spec.select.1, %for.body16 ] %niter = phi i64 [ 0, %for.body16.preheader.new ], [ %niter.next.1, %for.body16 ] %indvars.iv.next50 = add i64 %indvars.iv49, 4294967295 %idxprom17 = and i64 %indvars.iv.next50, 4294967295 %arrayidx18 = getelementptr inbounds [200002 x i32], ptr %a, i64 0, i64 %idxprom17 %7 = load i32, ptr %arrayidx18, align 4, !tbaa !5 %idxprom19 = sext i32 %7 to i64 %arrayidx20 = getelementptr inbounds [200002 x i32], ptr %b, i64 0, i64 %idxprom19 %8 = load i32, ptr %arrayidx20, align 4, !tbaa !5 %cmp21 = icmp eq i32 %8, 0 %spec.store.select = call i32 @llvm.umax.i32(i32 %8, i32 1) store i32 %spec.store.select, ptr %arrayidx20, align 4 %spec.select = select i1 %cmp21, i32 %7, i32 %neset.043 %indvars.iv.next50.1 = add nsw i64 %indvars.iv49, -2 %idxprom17.1 = and i64 %indvars.iv.next50.1, 4294967295 %arrayidx18.1 = getelementptr inbounds [200002 x i32], ptr %a, i64 0, i64 %idxprom17.1 %9 = load i32, ptr %arrayidx18.1, align 4, !tbaa !5 %idxprom19.1 = sext i32 %9 to i64 %arrayidx20.1 = getelementptr inbounds [200002 x i32], ptr %b, i64 0, i64 %idxprom19.1 %10 = load i32, ptr %arrayidx20.1, align 4, !tbaa !5 %cmp21.1 = icmp eq i32 %10, 0 %spec.store.select.1 = call i32 @llvm.umax.i32(i32 %10, i32 1) store i32 %spec.store.select.1, ptr %arrayidx20.1, align 4 %spec.select.1 = select i1 %cmp21.1, i32 %9, i32 %spec.select %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.cleanup15.loopexit.unr-lcssa, label %for.body16, !llvm.loop !11 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.umax.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(void) { int n, m, l, a[100][100], b[100][100]; long long c[100][100] = {0}; int i, j, k; scanf("%d %d %d", &n, &m, &l); for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { scanf("%d", &a[i][j]); } } for (i = 0; i < m; i++) { for (j = 0; j < l; j++) { scanf("%d", &b[i][j]); } } for (i = 0; i < n; i++){ for (j = 0; j < m; j++) { for (k = 0; k < l; k++) { c[i][k] += a[i][j] * b[j][k]; } } } for (i = 0; i < n; i++) { for (j = 0; j < l; j++) { if (j < l - 1) { printf("%lld ", c[i][j]); } else { printf("%lld\n", c[i][j]); } } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155912/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155912/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld \00", align 1 @.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 %c = alloca [100 x [100 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %c) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(80000) %c, i8 0, i64 80000, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp115 = icmp sgt i32 %0, 0 %.pre172 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp115, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre172, 0 br i1 %1, label %for.cond1.preheader, label %for.cond61.preheader.lr.phthread-pre-split for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre172, %for.cond1.preheader.lr.ph ] %indvars.iv144 = phi i64 [ %indvars.iv.next145, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp2113 = icmp sgt i32 %3, 0 br i1 %cmp2113, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre172, %entry ], [ %11, %for.inc7 ] %cmp11119 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp11119, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv144, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next145, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %33, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %34, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv150 = phi i64 [ %indvars.iv.next151, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp14117 = icmp sgt i32 %14, 0 br i1 %cmp14117, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre174 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre174, %for.cond27.preheader.loopexit ] %.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %33, %for.cond27.preheader.loopexit ] %cmp28125 = icmp sgt i32 %15, 0 br i1 %cmp28125, label %for.cond30.preheader.lr.ph, label %for.end82 for.cond30.preheader.lr.ph: ; preds = %for.cond27.preheader %cmp31123 = icmp sgt i32 %.lcssa, 0 %16 = load i32, ptr %l, align 4 br i1 %cmp31123, label %for.cond30.preheader.lr.ph.split.us, label %for.cond61.preheader.lr.ph for.cond30.preheader.lr.ph.split.us: ; preds = %for.cond30.preheader.lr.ph %cmp34121 = icmp sgt i32 %16, 0 br i1 %cmp34121, label %for.cond30.preheader.us.us.preheader, label %for.end82 for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph.split.us %wide.trip.count164 = zext i32 %15 to i64 %wide.trip.count159 = zext i32 %.lcssa to i64 %wide.trip.count = zext i32 %16 to i64 %min.iters.check = icmp ult i32 %16, 4 %n.vec = and i64 %wide.trip.count, 4294967292 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br label %for.cond30.preheader.us.us for.cond30.preheader.us.us: ; preds = %for.cond30.preheader.us.us.preheader, %for.cond30.for.inc54_crit_edge.split.us.us.us %indvars.iv161 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next162, %for.cond30.for.inc54_crit_edge.split.us.us.us ] br label %for.cond33.preheader.us.us.us for.cond33.preheader.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us, %for.cond30.preheader.us.us %indvars.iv156 = phi i64 [ %indvars.iv.next157, %for.cond33.for.inc51_crit_edge.us.us.us ], [ 0, %for.cond30.preheader.us.us ] %arrayidx39.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv161, i64 %indvars.iv156 %17 = load i32, ptr %arrayidx39.us.us.us, align 4, !tbaa !5 br i1 %min.iters.check, label %for.body35.us.us.us.preheader, label %vector.ph vector.ph: ; preds = %for.cond33.preheader.us.us.us %broadcast.splatinsert = insertelement <2 x i32> poison, i32 %17, i64 0 %broadcast.splat = shufflevector <2 x i32> %broadcast.splatinsert, <2 x i32> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %18 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv156, i64 %index %wide.load = load <2 x i32>, ptr %18, align 16, !tbaa !5 %19 = getelementptr inbounds i32, ptr %18, i64 2 %wide.load202 = load <2 x i32>, ptr %19, align 8, !tbaa !5 %20 = mul nsw <2 x i32> %wide.load, %broadcast.splat %21 = mul nsw <2 x i32> %wide.load202, %broadcast.splat %22 = sext <2 x i32> %20 to <2 x i64> %23 = sext <2 x i32> %21 to <2 x i64> %24 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv161, i64 %index %wide.load203 = load <2 x i64>, ptr %24, align 16, !tbaa !13 %25 = getelementptr inbounds i64, ptr %24, i64 2 %wide.load204 = load <2 x i64>, ptr %25, align 16, !tbaa !13 %26 = add nsw <2 x i64> %wide.load203, %22 %27 = add nsw <2 x i64> %wide.load204, %23 store <2 x i64> %26, ptr %24, align 16, !tbaa !13 store <2 x i64> %27, ptr %25, align 16, !tbaa !13 %index.next = add nuw i64 %index, 4 %28 = icmp eq i64 %index.next, %n.vec br i1 %28, label %middle.block, label %vector.body, !llvm.loop !15 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us.preheader for.body35.us.us.us.preheader: ; preds = %for.cond33.preheader.us.us.us, %middle.block %indvars.iv153.ph = phi i64 [ 0, %for.cond33.preheader.us.us.us ], [ %n.vec, %middle.block ] br label %for.body35.us.us.us for.body35.us.us.us: ; preds = %for.body35.us.us.us.preheader, %for.body35.us.us.us %indvars.iv153 = phi i64 [ %indvars.iv.next154, %for.body35.us.us.us ], [ %indvars.iv153.ph, %for.body35.us.us.us.preheader ] %arrayidx43.us.us.us = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv156, i64 %indvars.iv153 %29 = load i32, ptr %arrayidx43.us.us.us, align 4, !tbaa !5 %mul.us.us.us = mul nsw i32 %29, %17 %conv.us.us.us = sext i32 %mul.us.us.us to i64 %arrayidx47.us.us.us = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv161, i64 %indvars.iv153 %30 = load i64, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 %add.us.us.us = add nsw i64 %30, %conv.us.us.us store i64 %add.us.us.us, ptr %arrayidx47.us.us.us, align 8, !tbaa !13 %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1 %exitcond.not = icmp eq i64 %indvars.iv.next154, %wide.trip.count br i1 %exitcond.not, label %for.cond33.for.inc51_crit_edge.us.us.us, label %for.body35.us.us.us, !llvm.loop !18 for.cond33.for.inc51_crit_edge.us.us.us: ; preds = %for.body35.us.us.us, %middle.block %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1 %exitcond160.not = icmp eq i64 %indvars.iv.next157, %wide.trip.count159 br i1 %exitcond160.not, label %for.cond30.for.inc54_crit_edge.split.us.us.us, label %for.cond33.preheader.us.us.us, !llvm.loop !19 for.cond30.for.inc54_crit_edge.split.us.us.us: ; preds = %for.cond33.for.inc51_crit_edge.us.us.us %indvars.iv.next162 = add nuw nsw i64 %indvars.iv161, 1 %exitcond165.not = icmp eq i64 %indvars.iv.next162, %wide.trip.count164 br i1 %exitcond165.not, label %for.cond61.preheader.lr.phthread-pre-split, label %for.cond30.preheader.us.us, !llvm.loop !20 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv147 = phi i64 [ %indvars.iv.next148, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv150, i64 %indvars.iv147 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1 %31 = load i32, ptr %l, align 4, !tbaa !5 %32 = sext i32 %31 to i64 %cmp14 = icmp slt i64 %indvars.iv.next148, %32 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !21 for.inc24.loopexit: ; preds = %for.body15 %.pre173 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %33 = phi i32 [ %.pre173, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %34 = phi i32 [ %31, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1 %35 = sext i32 %33 to i64 %cmp11 = icmp slt i64 %indvars.iv.next151, %35 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !22 for.cond61.preheader.lr.phthread-pre-split: ; preds = %for.cond30.for.inc54_crit_edge.split.us.us.us, %for.cond1.preheader.lr.ph %.ph = phi i32 [ %0, %for.cond1.preheader.lr.ph ], [ %15, %for.cond30.for.inc54_crit_edge.split.us.us.us ] %.pr = load i32, ptr %l, align 4, !tbaa !5 br label %for.cond61.preheader.lr.ph for.cond61.preheader.lr.ph: ; preds = %for.cond61.preheader.lr.phthread-pre-split, %for.cond30.preheader.lr.ph %36 = phi i32 [ %.pr, %for.cond61.preheader.lr.phthread-pre-split ], [ %16, %for.cond30.preheader.lr.ph ] %37 = phi i32 [ %.ph, %for.cond61.preheader.lr.phthread-pre-split ], [ %15, %for.cond30.preheader.lr.ph ] %38 = icmp sgt i32 %36, 0 br i1 %38, label %for.cond61.preheader, label %for.end82 for.cond61.preheader: ; preds = %for.cond61.preheader.lr.ph, %for.inc80 %39 = phi i32 [ %46, %for.inc80 ], [ %37, %for.cond61.preheader.lr.ph ] %40 = phi i32 [ %47, %for.inc80 ], [ %36, %for.cond61.preheader.lr.ph ] %indvars.iv169 = phi i64 [ %indvars.iv.next170, %for.inc80 ], [ 0, %for.cond61.preheader.lr.ph ] %cmp62133 = icmp sgt i32 %40, 0 br i1 %cmp62133, label %for.body64, label %for.inc80 for.body64: ; preds = %for.cond61.preheader, %for.body64 %indvars.iv166 = phi i64 [ %indvars.iv.next167, %for.body64 ], [ 0, %for.cond61.preheader ] %41 = phi i32 [ %44, %for.body64 ], [ %40, %for.cond61.preheader ] %sub = add nsw i32 %41, -1 %42 = sext i32 %sub to i64 %cmp65 = icmp slt i64 %indvars.iv166, %42 %arrayidx70 = getelementptr inbounds [100 x [100 x i64]], ptr %c, i64 0, i64 %indvars.iv169, i64 %indvars.iv166 %43 = load i64, ptr %arrayidx70, align 8, !tbaa !13 %.str.2..str.3 = select i1 %cmp65, ptr @.str.2, ptr @.str.3 %call71 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3, i64 noundef %43) %indvars.iv.next167 = add nuw nsw i64 %indvars.iv166, 1 %44 = load i32, ptr %l, align 4, !tbaa !5 %45 = sext i32 %44 to i64 %cmp62 = icmp slt i64 %indvars.iv.next167, %45 br i1 %cmp62, label %for.body64, label %for.inc80.loopexit, !llvm.loop !23 for.inc80.loopexit: ; preds = %for.body64 %.pre175 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc80 for.inc80: ; preds = %for.inc80.loopexit, %for.cond61.preheader %46 = phi i32 [ %.pre175, %for.inc80.loopexit ], [ %39, %for.cond61.preheader ] %47 = phi i32 [ %44, %for.inc80.loopexit ], [ %40, %for.cond61.preheader ] %indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1 %48 = sext i32 %46 to i64 %cmp58 = icmp slt i64 %indvars.iv.next170, %48 br i1 %cmp58, label %for.cond61.preheader, label %for.end82, !llvm.loop !24 for.end82: ; preds = %for.inc80, %for.cond30.preheader.lr.ph.split.us, %for.cond27.preheader, %for.cond61.preheader.lr.ph call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = !{!14, !14, i64 0} !14 = !{!"long long", !7, i64 0} !15 = distinct !{!15, !10, !16, !17} !16 = !{!"llvm.loop.isvectorized", i32 1} !17 = !{!"llvm.loop.unroll.runtime.disable"} !18 = distinct !{!18, !10, !17, !16} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10, !12} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10, !12}
#include <stdio.h> int main(void) { int n, m, l; int i, j, k; int a[100][100], b[100][100]; long long sum; scanf("%d %d %d", &n, &m, &l); for(i=0;i<n;i++){ for(j=0;j<m;j++) scanf("%d", &a[i][j]); } for(i=0;i<m;i++){ for(j=0;j<l;j++) scanf("%d", &b[i][j]); } for(i=0;i<n;i++){ for(j=0;j<l;j++){ sum = 0; for(k=0;k<m;k++) sum += a[i][k] * b[k][j]; if(j==l-1) printf("%ld", sum); else printf("%ld ", sum); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_155956/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_155956/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 @.str.3 = 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 i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp82 = icmp sgt i32 %0, 0 %.pre116 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp82, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre116, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre116, %for.cond1.preheader.lr.ph ] %indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp280 = icmp sgt i32 %3, 0 br i1 %cmp280, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre116, %entry ], [ %11, %for.inc7 ] %cmp1186 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp1186, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv98, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next99, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %18, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %19, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp1484 = icmp sgt i32 %14, 0 br i1 %cmp1484, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre118 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %.pre118, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ] %cmp2893 = icmp sgt i32 %15, 0 br i1 %cmp2893, label %for.cond30.preheader.preheader, label %for.end57 for.cond30.preheader.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader br label %for.cond30.preheader for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv104, i64 %indvars.iv101 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1 %16 = load i32, ptr %l, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp14 = icmp slt i64 %indvars.iv.next102, %17 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre117 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %18 = phi i32 [ %.pre117, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %19 = phi i32 [ %16, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %20 = sext i32 %18 to i64 %cmp11 = icmp slt i64 %indvars.iv.next105, %20 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.preheader, %for.end53 %indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.end53 ], [ 0, %for.cond30.preheader.preheader ] %21 = load i32, ptr %l, align 4, !tbaa !5 %cmp3191 = icmp sgt i32 %21, 0 br i1 %cmp3191, label %for.cond33.preheader, label %for.end53 for.cond33.preheader: ; preds = %for.cond30.preheader, %for.end46 %indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.end46 ], [ 0, %for.cond30.preheader ] %22 = phi i32 [ %32, %for.end46 ], [ %21, %for.cond30.preheader ] %23 = load i32, ptr %m, align 4, !tbaa !5 %cmp3488 = icmp sgt i32 %23, 0 br i1 %cmp3488, label %for.body35.lr.ph, label %for.end46 for.body35.lr.ph: ; preds = %for.cond33.preheader %wide.trip.count = zext i32 %23 to i64 %xtraiter = and i64 %wide.trip.count, 1 %24 = icmp eq i32 %23, 1 br i1 %24, label %for.end46.loopexit.unr-lcssa, label %for.body35.lr.ph.new for.body35.lr.ph.new: ; preds = %for.body35.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body35 for.body35: ; preds = %for.body35, %for.body35.lr.ph.new %indvars.iv107 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next108.1, %for.body35 ] %sum.090 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ] %niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ] %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv107 %25 = load i32, ptr %arrayidx39, align 8, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv107, i64 %indvars.iv110 %26 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %mul = mul nsw i32 %26, %25 %conv = sext i32 %mul to i64 %add = add nsw i64 %sum.090, %conv %indvars.iv.next108 = or i64 %indvars.iv107, 1 %arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv.next108 %27 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next108, i64 %indvars.iv110 %28 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %28, %27 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 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.end46.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15 for.end46.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %indvars.iv107.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next108.1, %for.body35 ] %sum.090.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end46, label %for.body35.epil for.body35.epil: ; preds = %for.end46.loopexit.unr-lcssa %arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv107.unr %29 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv107.unr, i64 %indvars.iv110 %30 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %30, %29 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %sum.090.unr, %conv.epil br label %for.end46 for.end46: ; preds = %for.body35.epil, %for.end46.loopexit.unr-lcssa, %for.cond33.preheader %sum.0.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ] %sub = add nsw i32 %22, -1 %31 = zext i32 %sub to i64 %cmp47 = icmp eq i64 %indvars.iv110, %31 %.str.2..str.3 = select i1 %cmp47, ptr @.str.2, ptr @.str.3 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3, i64 noundef %sum.0.lcssa) %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %32 = load i32, ptr %l, align 4, !tbaa !5 %33 = sext i32 %32 to i64 %cmp31 = icmp slt i64 %indvars.iv.next111, %33 br i1 %cmp31, label %for.cond33.preheader, label %for.end53, !llvm.loop !16 for.end53: ; preds = %for.end46, %for.cond30.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %34 = load i32, ptr %n, align 4, !tbaa !5 %35 = sext i32 %34 to i64 %cmp28 = icmp slt i64 %indvars.iv.next114, %35 br i1 %cmp28, label %for.cond30.preheader, label %for.end57, !llvm.loop !17 for.end57: ; preds = %for.end53, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> int main(){ int n, m, l; int x, y, k; long sum; int a[100][100], b[100][100]; scanf( "%d %d %d", &n, &m, &l ); for( y=0; y<n; y++ ){ for( x=0; x<m; x++ ){ scanf( "%d", &a[x][y] ); }} for( y=0; y<m; y++ ){ for( x=0; x<l; x++ ){ scanf( "%d", &b[x][y] ); }} for( y=0; y<n; y++ ){ for( x=0; x<l; x++ ){ sum=0; for( k=0; k<m; k++ ){ sum += a[k][y]*b[x][k]; } printf( "%ld", sum ); if( x != (l-1) ) printf( " " ); }printf( "\n" );} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156005/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156005/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\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 %l = alloca i32, align 4 %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp82 = icmp sgt i32 %0, 0 %.pre116 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp82, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre116, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.preheader for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre116, %for.cond1.preheader.lr.ph ] %indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp280 = icmp sgt i32 %3, 0 br i1 %cmp280, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre116, %entry ], [ %11, %for.inc7 ] %cmp1186 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp1186, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv, i64 %indvars.iv98 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next99, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %18, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %19, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp1484 = icmp sgt i32 %14, 0 br i1 %cmp1484, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre118 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %.pre118, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ] %cmp2893 = icmp sgt i32 %15, 0 br i1 %cmp2893, label %for.cond30.preheader.preheader, label %for.end57 for.cond30.preheader.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader br label %for.cond30.preheader for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv101, i64 %indvars.iv104 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1 %16 = load i32, ptr %l, align 4, !tbaa !5 %17 = sext i32 %16 to i64 %cmp14 = icmp slt i64 %indvars.iv.next102, %17 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre117 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %18 = phi i32 [ %.pre117, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %19 = phi i32 [ %16, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %20 = sext i32 %18 to i64 %cmp11 = icmp slt i64 %indvars.iv.next105, %20 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.preheader, %for.end53 %indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.end53 ], [ 0, %for.cond30.preheader.preheader ] %21 = load i32, ptr %l, align 4, !tbaa !5 %cmp3191 = icmp sgt i32 %21, 0 br i1 %cmp3191, label %for.cond33.preheader, label %for.end53 for.cond33.preheader: ; preds = %for.cond30.preheader, %for.inc51 %indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.inc51 ], [ 0, %for.cond30.preheader ] %22 = load i32, ptr %m, align 4, !tbaa !5 %cmp3488 = icmp sgt i32 %22, 0 br i1 %cmp3488, label %for.body35.lr.ph, label %for.end46 for.body35.lr.ph: ; preds = %for.cond33.preheader %wide.trip.count = zext i32 %22 to i64 %xtraiter = and i64 %wide.trip.count, 1 %23 = icmp eq i32 %22, 1 br i1 %23, label %for.end46.loopexit.unr-lcssa, label %for.body35.lr.ph.new for.body35.lr.ph.new: ; preds = %for.body35.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body35 for.body35: ; preds = %for.body35, %for.body35.lr.ph.new %indvars.iv107 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next108.1, %for.body35 ] %sum.090 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ] %niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ] %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv107, i64 %indvars.iv113 %24 = load i32, ptr %arrayidx39, align 4, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv110, i64 %indvars.iv107 %25 = load i32, ptr %arrayidx43, align 8, !tbaa !5 %mul = mul nsw i32 %25, %24 %conv = sext i32 %mul to i64 %add = add nsw i64 %sum.090, %conv %indvars.iv.next108 = or i64 %indvars.iv107, 1 %arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv.next108, i64 %indvars.iv113 %26 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv110, i64 %indvars.iv.next108 %27 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %27, %26 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 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.end46.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15 for.end46.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %indvars.iv107.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next108.1, %for.body35 ] %sum.090.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end46, label %for.body35.epil for.body35.epil: ; preds = %for.end46.loopexit.unr-lcssa %arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv107.unr, i64 %indvars.iv113 %28 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv110, i64 %indvars.iv107.unr %29 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %29, %28 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %sum.090.unr, %conv.epil br label %for.end46 for.end46: ; preds = %for.body35.epil, %for.end46.loopexit.unr-lcssa, %for.cond33.preheader %sum.0.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ] %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sum.0.lcssa) %30 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %30, -1 %31 = zext i32 %sub to i64 %cmp48.not = icmp eq i64 %indvars.iv110, %31 br i1 %cmp48.not, label %for.inc51, label %if.then if.then: ; preds = %for.end46 %putchar79 = call i32 @putchar(i32 32) %.pre119 = load i32, ptr %l, align 4, !tbaa !5 br label %for.inc51 for.inc51: ; preds = %for.end46, %if.then %32 = phi i32 [ %30, %for.end46 ], [ %.pre119, %if.then ] %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %33 = sext i32 %32 to i64 %cmp31 = icmp slt i64 %indvars.iv.next111, %33 br i1 %cmp31, label %for.cond33.preheader, label %for.end53, !llvm.loop !16 for.end53: ; preds = %for.inc51, %for.cond30.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %34 = load i32, ptr %n, align 4, !tbaa !5 %35 = sext i32 %34 to i64 %cmp28 = icmp slt i64 %indvars.iv.next114, %35 br i1 %cmp28, label %for.cond30.preheader, label %for.end57, !llvm.loop !17 for.end57: ; preds = %for.end53, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10}
#include <stdio.h> //#include <string.h> int main() { int n, m, l, i, j, k; long s; scanf("%d %d %d", &n, &m, &l); int first[n][m]; int second[m][l]; long out[n][l]; for (i = 0; i < n; i++) { for (j = 0; j < m; j++) { scanf("%d", &first[i][j]); } } for (i = 0; i < m; i++) { for (j = 0; j < l; j++) { scanf("%d", &second[i][j]); } } for (i = 0; i < n; i++) { for (j = 0; j < l; j++) { s = 0; for (k = 0; k < m; k++) { s += first[i][k] * second[k][j]; } out[i][j] = s; } } for (int i1 = 0; i1 < n; ++i1) { for (int j1 = 0; j1 < l; ++j1) { if (j1 == l-1) printf("%ld\n", out[i1][j1]); else printf("%ld ", out[i1][j1]); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156106/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156106/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1 @.str.3 = 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 i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = load i32, ptr %m, align 4, !tbaa !5 %3 = zext i32 %2 to i64 %4 = call ptr @llvm.stacksave.p0() %5 = mul nuw i64 %3, %1 %vla = alloca i32, i64 %5, align 16 %6 = load i32, ptr %m, align 4, !tbaa !5 %7 = zext i32 %6 to i64 %8 = load i32, ptr %l, align 4, !tbaa !5 %9 = zext i32 %8 to i64 %10 = mul nuw i64 %9, %7 %vla1 = alloca i32, i64 %10, align 16 %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = zext i32 %11 to i64 %13 = mul nuw i64 %12, %9 %vla2 = alloca i64, i64 %13, align 16 %cmp117 = icmp sgt i32 %11, 0 br i1 %cmp117, label %for.cond3.preheader.lr.ph, label %for.cond12.preheader for.cond3.preheader.lr.ph: ; preds = %entry %14 = icmp sgt i32 %6, 0 br i1 %14, label %for.cond3.preheader, label %for.cond32.preheader.lr.ph for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.inc9 %15 = phi i32 [ %24, %for.inc9 ], [ %11, %for.cond3.preheader.lr.ph ] %16 = phi i32 [ %25, %for.inc9 ], [ %6, %for.cond3.preheader.lr.ph ] %indvars.iv150 = phi i64 [ %indvars.iv.next151, %for.inc9 ], [ 0, %for.cond3.preheader.lr.ph ] %cmp4115 = icmp sgt i32 %16, 0 br i1 %cmp4115, label %for.body5.lr.ph, label %for.inc9 for.body5.lr.ph: ; preds = %for.cond3.preheader %17 = mul nuw nsw i64 %indvars.iv150, %3 %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %17 br label %for.body5 for.cond12.preheader: ; preds = %for.inc9, %entry %18 = phi i32 [ %11, %entry ], [ %24, %for.inc9 ] %19 = phi i32 [ %6, %entry ], [ %25, %for.inc9 ] %cmp13121 = icmp sgt i32 %19, 0 %20 = load i32, ptr %l, align 4 %21 = icmp sgt i32 %20, 0 %or.cond = select i1 %cmp13121, i1 %21, i1 false br i1 %or.cond, label %for.cond15.preheader, label %for.cond29.preheader for.body5: ; preds = %for.body5.lr.ph, %for.body5 %indvars.iv = phi i64 [ 0, %for.body5.lr.ph ], [ %indvars.iv.next, %for.body5 ] %arrayidx7 = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %22 = load i32, ptr %m, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp4 = icmp slt i64 %indvars.iv.next, %23 br i1 %cmp4, label %for.body5, label %for.inc9.loopexit, !llvm.loop !9 for.inc9.loopexit: ; preds = %for.body5 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc9 for.inc9: ; preds = %for.inc9.loopexit, %for.cond3.preheader %24 = phi i32 [ %.pre, %for.inc9.loopexit ], [ %15, %for.cond3.preheader ] %25 = phi i32 [ %22, %for.inc9.loopexit ], [ %16, %for.cond3.preheader ] %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1 %26 = sext i32 %24 to i64 %cmp = icmp slt i64 %indvars.iv.next151, %26 br i1 %cmp, label %for.cond3.preheader, label %for.cond12.preheader, !llvm.loop !11 for.cond15.preheader: ; preds = %for.cond12.preheader, %for.inc26 %27 = phi i32 [ %73, %for.inc26 ], [ %19, %for.cond12.preheader ] %28 = phi i32 [ %74, %for.inc26 ], [ %20, %for.cond12.preheader ] %indvars.iv156 = phi i64 [ %indvars.iv.next157, %for.inc26 ], [ 0, %for.cond12.preheader ] %cmp16119 = icmp sgt i32 %28, 0 br i1 %cmp16119, label %for.body17.lr.ph, label %for.inc26 for.body17.lr.ph: ; preds = %for.cond15.preheader %29 = mul nuw nsw i64 %indvars.iv156, %9 %arrayidx19 = getelementptr inbounds i32, ptr %vla1, i64 %29 br label %for.body17 for.cond29.preheader.loopexit: ; preds = %for.inc26 %.pre185 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond29.preheader for.cond29.preheader: ; preds = %for.cond29.preheader.loopexit, %for.cond12.preheader %30 = phi i32 [ %18, %for.cond12.preheader ], [ %.pre185, %for.cond29.preheader.loopexit ] %.lcssa = phi i32 [ %19, %for.cond12.preheader ], [ %73, %for.cond29.preheader.loopexit ] %cmp30129 = icmp sgt i32 %30, 0 br i1 %cmp30129, label %for.cond32.preheader.lr.ph, label %for.cond.cleanup for.cond32.preheader.lr.ph: ; preds = %for.cond3.preheader.lr.ph, %for.cond29.preheader %.lcssa190 = phi i32 [ %.lcssa, %for.cond29.preheader ], [ %6, %for.cond3.preheader.lr.ph ] %31 = phi i32 [ %30, %for.cond29.preheader ], [ %11, %for.cond3.preheader.lr.ph ] %32 = load i32, ptr %l, align 4, !tbaa !5 %cmp33127 = icmp sgt i32 %32, 0 br i1 %cmp33127, label %for.cond32.preheader.lr.ph.split.us, label %for.cond59.preheader for.cond32.preheader.lr.ph.split.us: ; preds = %for.cond32.preheader.lr.ph %cmp36123 = icmp sgt i32 %.lcssa190, 0 %wide.trip.count171 = zext i32 %32 to i64 br i1 %cmp36123, label %for.cond32.preheader.us.us.preheader, label %for.cond32.preheader.us.preheader for.cond32.preheader.us.preheader: ; preds = %for.cond32.preheader.lr.ph.split.us %33 = shl nuw nsw i64 %9, 3 %34 = shl nuw nsw i64 %wide.trip.count171, 3 %wide.trip.count = zext i32 %31 to i64 %xtraiter = and i64 %wide.trip.count, 7 %35 = icmp ult i32 %31, 8 br i1 %35, label %for.cond59.preheader.loopexit220.unr-lcssa, label %for.cond32.preheader.us.preheader.new for.cond32.preheader.us.preheader.new: ; preds = %for.cond32.preheader.us.preheader %unroll_iter = and i64 %wide.trip.count, 4294967288 br label %for.cond32.preheader.us for.cond32.preheader.us.us.preheader: ; preds = %for.cond32.preheader.lr.ph.split.us %wide.trip.count176 = zext i32 %31 to i64 %wide.trip.count166 = zext i32 %.lcssa190 to i64 %min.iters.check = icmp ugt i32 %.lcssa190, 3 %ident.check.not = icmp eq i32 %8, 1 %or.cond215 = select i1 %min.iters.check, i1 %ident.check.not, i1 false %n.vec = and i64 %wide.trip.count166, 4294967292 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count166 %xtraiter226 = and i64 %wide.trip.count166, 1 %lcmp.mod227.not = icmp eq i64 %xtraiter226, 0 %36 = sub nsw i64 0, %wide.trip.count166 br label %for.cond32.preheader.us.us for.cond32.preheader.us.us: ; preds = %for.cond32.preheader.us.us.preheader, %for.cond32.for.inc56_crit_edge.split.us.us.us %indvars.iv173 = phi i64 [ 0, %for.cond32.preheader.us.us.preheader ], [ %indvars.iv.next174, %for.cond32.for.inc56_crit_edge.split.us.us.us ] %37 = mul nuw nsw i64 %indvars.iv173, %3 %arrayidx39.us.us = getelementptr inbounds i32, ptr %vla, i64 %37 %38 = mul nuw nsw i64 %indvars.iv173, %9 %arrayidx50.us.us = getelementptr inbounds i64, ptr %vla2, i64 %38 br label %for.cond35.preheader.us.us.us for.cond35.preheader.us.us.us: ; preds = %for.cond35.for.end48_crit_edge.us.us.us, %for.cond32.preheader.us.us %indvars.iv168 = phi i64 [ %indvars.iv.next169, %for.cond35.for.end48_crit_edge.us.us.us ], [ 0, %for.cond32.preheader.us.us ] %invariant.gep.us.us.us = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv168 br i1 %or.cond215, label %vector.body, label %for.body37.us.us.us.preheader vector.body: ; preds = %for.cond35.preheader.us.us.us, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond35.preheader.us.us.us ] %vec.phi = phi <2 x i64> [ %48, %vector.body ], [ zeroinitializer, %for.cond35.preheader.us.us.us ] %vec.phi211 = phi <2 x i64> [ %49, %vector.body ], [ zeroinitializer, %for.cond35.preheader.us.us.us ] %39 = getelementptr inbounds i32, ptr %arrayidx39.us.us, i64 %index %wide.load = load <2 x i32>, ptr %39, align 4, !tbaa !5 %40 = getelementptr inbounds i32, ptr %39, i64 2 %wide.load212 = load <2 x i32>, ptr %40, align 4, !tbaa !5 %41 = mul nuw nsw i64 %index, %9 %42 = getelementptr inbounds i32, ptr %invariant.gep.us.us.us, i64 %41 %wide.load213 = load <2 x i32>, ptr %42, align 4, !tbaa !5 %43 = getelementptr inbounds i32, ptr %42, i64 2 %wide.load214 = load <2 x i32>, ptr %43, align 4, !tbaa !5 %44 = mul nsw <2 x i32> %wide.load213, %wide.load %45 = mul nsw <2 x i32> %wide.load214, %wide.load212 %46 = sext <2 x i32> %44 to <2 x i64> %47 = sext <2 x i32> %45 to <2 x i64> %48 = add <2 x i64> %vec.phi, %46 %49 = add <2 x i64> %vec.phi211, %47 %index.next = add nuw i64 %index, 4 %50 = icmp eq i64 %index.next, %n.vec br i1 %50, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %49, %48 %51 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) br i1 %cmp.n, label %for.cond35.for.end48_crit_edge.us.us.us, label %for.body37.us.us.us.preheader for.body37.us.us.us.preheader: ; preds = %for.cond35.preheader.us.us.us, %middle.block %indvars.iv163.ph = phi i64 [ 0, %for.cond35.preheader.us.us.us ], [ %n.vec, %middle.block ] %s.0124.us.us.us.ph = phi i64 [ 0, %for.cond35.preheader.us.us.us ], [ %51, %middle.block ] br i1 %lcmp.mod227.not, label %for.body37.us.us.us.prol.loopexit, label %for.body37.us.us.us.prol for.body37.us.us.us.prol: ; preds = %for.body37.us.us.us.preheader %arrayidx41.us.us.us.prol = getelementptr inbounds i32, ptr %arrayidx39.us.us, i64 %indvars.iv163.ph %52 = load i32, ptr %arrayidx41.us.us.us.prol, align 4, !tbaa !5 %53 = mul nuw nsw i64 %indvars.iv163.ph, %9 %gep.us.us.us.prol = getelementptr inbounds i32, ptr %invariant.gep.us.us.us, i64 %53 %54 = load i32, ptr %gep.us.us.us.prol, align 4, !tbaa !5 %mul.us.us.us.prol = mul nsw i32 %54, %52 %conv.us.us.us.prol = sext i32 %mul.us.us.us.prol to i64 %add.us.us.us.prol = add nsw i64 %s.0124.us.us.us.ph, %conv.us.us.us.prol %indvars.iv.next164.prol = or i64 %indvars.iv163.ph, 1 br label %for.body37.us.us.us.prol.loopexit for.body37.us.us.us.prol.loopexit: ; preds = %for.body37.us.us.us.prol, %for.body37.us.us.us.preheader %add.us.us.us.lcssa219.unr = phi i64 [ undef, %for.body37.us.us.us.preheader ], [ %add.us.us.us.prol, %for.body37.us.us.us.prol ] %indvars.iv163.unr = phi i64 [ %indvars.iv163.ph, %for.body37.us.us.us.preheader ], [ %indvars.iv.next164.prol, %for.body37.us.us.us.prol ] %s.0124.us.us.us.unr = phi i64 [ %s.0124.us.us.us.ph, %for.body37.us.us.us.preheader ], [ %add.us.us.us.prol, %for.body37.us.us.us.prol ] %55 = xor i64 %indvars.iv163.ph, %36 %56 = icmp eq i64 %55, -1 br i1 %56, label %for.cond35.for.end48_crit_edge.us.us.us, label %for.body37.us.us.us for.body37.us.us.us: ; preds = %for.body37.us.us.us.prol.loopexit, %for.body37.us.us.us %indvars.iv163 = phi i64 [ %indvars.iv.next164.1, %for.body37.us.us.us ], [ %indvars.iv163.unr, %for.body37.us.us.us.prol.loopexit ] %s.0124.us.us.us = phi i64 [ %add.us.us.us.1, %for.body37.us.us.us ], [ %s.0124.us.us.us.unr, %for.body37.us.us.us.prol.loopexit ] %arrayidx41.us.us.us = getelementptr inbounds i32, ptr %arrayidx39.us.us, i64 %indvars.iv163 %57 = load i32, ptr %arrayidx41.us.us.us, align 4, !tbaa !5 %58 = mul nuw nsw i64 %indvars.iv163, %9 %gep.us.us.us = getelementptr inbounds i32, ptr %invariant.gep.us.us.us, i64 %58 %59 = load i32, ptr %gep.us.us.us, align 4, !tbaa !5 %mul.us.us.us = mul nsw i32 %59, %57 %conv.us.us.us = sext i32 %mul.us.us.us to i64 %add.us.us.us = add nsw i64 %s.0124.us.us.us, %conv.us.us.us %indvars.iv.next164 = add nuw nsw i64 %indvars.iv163, 1 %arrayidx41.us.us.us.1 = getelementptr inbounds i32, ptr %arrayidx39.us.us, i64 %indvars.iv.next164 %60 = load i32, ptr %arrayidx41.us.us.us.1, align 4, !tbaa !5 %61 = mul nuw nsw i64 %indvars.iv.next164, %9 %gep.us.us.us.1 = getelementptr inbounds i32, ptr %invariant.gep.us.us.us, i64 %61 %62 = load i32, ptr %gep.us.us.us.1, align 4, !tbaa !5 %mul.us.us.us.1 = mul nsw i32 %62, %60 %conv.us.us.us.1 = sext i32 %mul.us.us.us.1 to i64 %add.us.us.us.1 = add nsw i64 %add.us.us.us, %conv.us.us.us.1 %indvars.iv.next164.1 = add nuw nsw i64 %indvars.iv163, 2 %exitcond167.not.1 = icmp eq i64 %indvars.iv.next164.1, %wide.trip.count166 br i1 %exitcond167.not.1, label %for.cond35.for.end48_crit_edge.us.us.us, label %for.body37.us.us.us, !llvm.loop !16 for.cond35.for.end48_crit_edge.us.us.us: ; preds = %for.body37.us.us.us.prol.loopexit, %for.body37.us.us.us, %middle.block %add.us.us.us.lcssa = phi i64 [ %51, %middle.block ], [ %add.us.us.us.lcssa219.unr, %for.body37.us.us.us.prol.loopexit ], [ %add.us.us.us.1, %for.body37.us.us.us ] %arrayidx52.us.us.us = getelementptr inbounds i64, ptr %arrayidx50.us.us, i64 %indvars.iv168 store i64 %add.us.us.us.lcssa, ptr %arrayidx52.us.us.us, align 8, !tbaa !17 %indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1 %exitcond172.not = icmp eq i64 %indvars.iv.next169, %wide.trip.count171 br i1 %exitcond172.not, label %for.cond32.for.inc56_crit_edge.split.us.us.us, label %for.cond35.preheader.us.us.us, !llvm.loop !19 for.cond32.for.inc56_crit_edge.split.us.us.us: ; preds = %for.cond35.for.end48_crit_edge.us.us.us %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1 %exitcond177.not = icmp eq i64 %indvars.iv.next174, %wide.trip.count176 br i1 %exitcond177.not, label %for.cond59.preheader, label %for.cond32.preheader.us.us, !llvm.loop !20 for.cond32.preheader.us: ; preds = %for.cond32.preheader.us, %for.cond32.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond32.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond32.preheader.us ] %niter = phi i64 [ 0, %for.cond32.preheader.us.preheader.new ], [ %niter.next.7, %for.cond32.preheader.us ] %63 = mul nuw nsw i64 %33, %indvar %scevgep = getelementptr i8, ptr %vla2, i64 %63 call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %34, i1 false), !tbaa !17 %indvar.next = or i64 %indvar, 1 %64 = mul nuw nsw i64 %33, %indvar.next %scevgep.1 = getelementptr i8, ptr %vla2, i64 %64 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.1, i8 0, i64 %34, i1 false), !tbaa !17 %indvar.next.1 = or i64 %indvar, 2 %65 = mul nuw nsw i64 %33, %indvar.next.1 %scevgep.2 = getelementptr i8, ptr %vla2, i64 %65 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.2, i8 0, i64 %34, i1 false), !tbaa !17 %indvar.next.2 = or i64 %indvar, 3 %66 = mul nuw nsw i64 %33, %indvar.next.2 %scevgep.3 = getelementptr i8, ptr %vla2, i64 %66 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.3, i8 0, i64 %34, i1 false), !tbaa !17 %indvar.next.3 = or i64 %indvar, 4 %67 = mul nuw nsw i64 %33, %indvar.next.3 %scevgep.4 = getelementptr i8, ptr %vla2, i64 %67 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.4, i8 0, i64 %34, i1 false), !tbaa !17 %indvar.next.4 = or i64 %indvar, 5 %68 = mul nuw nsw i64 %33, %indvar.next.4 %scevgep.5 = getelementptr i8, ptr %vla2, i64 %68 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.5, i8 0, i64 %34, i1 false), !tbaa !17 %indvar.next.5 = or i64 %indvar, 6 %69 = mul nuw nsw i64 %33, %indvar.next.5 %scevgep.6 = getelementptr i8, ptr %vla2, i64 %69 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.6, i8 0, i64 %34, i1 false), !tbaa !17 %indvar.next.6 = or i64 %indvar, 7 %70 = mul nuw nsw i64 %33, %indvar.next.6 %scevgep.7 = getelementptr i8, ptr %vla2, i64 %70 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.7, i8 0, i64 %34, i1 false), !tbaa !17 %indvar.next.7 = add nuw nsw i64 %indvar, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond59.preheader.loopexit220.unr-lcssa, label %for.cond32.preheader.us, !llvm.loop !20 for.body17: ; preds = %for.body17.lr.ph, %for.body17 %indvars.iv153 = phi i64 [ 0, %for.body17.lr.ph ], [ %indvars.iv.next154, %for.body17 ] %arrayidx21 = getelementptr inbounds i32, ptr %arrayidx19, i64 %indvars.iv153 %call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx21) %indvars.iv.next154 = add nuw nsw i64 %indvars.iv153, 1 %71 = load i32, ptr %l, align 4, !tbaa !5 %72 = sext i32 %71 to i64 %cmp16 = icmp slt i64 %indvars.iv.next154, %72 br i1 %cmp16, label %for.body17, label %for.inc26.loopexit, !llvm.loop !21 for.inc26.loopexit: ; preds = %for.body17 %.pre184 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc26 for.inc26: ; preds = %for.inc26.loopexit, %for.cond15.preheader %73 = phi i32 [ %.pre184, %for.inc26.loopexit ], [ %27, %for.cond15.preheader ] %74 = phi i32 [ %71, %for.inc26.loopexit ], [ %28, %for.cond15.preheader ] %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1 %75 = sext i32 %73 to i64 %cmp13 = icmp slt i64 %indvars.iv.next157, %75 br i1 %cmp13, label %for.cond15.preheader, label %for.cond29.preheader.loopexit, !llvm.loop !22 for.cond59.preheader.loopexit220.unr-lcssa: ; preds = %for.cond32.preheader.us, %for.cond32.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond32.preheader.us.preheader ], [ %indvar.next.7, %for.cond32.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond59.preheader, label %for.cond32.preheader.us.epil for.cond32.preheader.us.epil: ; preds = %for.cond59.preheader.loopexit220.unr-lcssa, %for.cond32.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond32.preheader.us.epil ], [ %indvar.unr, %for.cond59.preheader.loopexit220.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond32.preheader.us.epil ], [ 0, %for.cond59.preheader.loopexit220.unr-lcssa ] %76 = mul nuw nsw i64 %33, %indvar.epil %scevgep.epil = getelementptr i8, ptr %vla2, i64 %76 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 0, i64 %34, i1 false), !tbaa !17 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond59.preheader, label %for.cond32.preheader.us.epil, !llvm.loop !23 for.cond59.preheader: ; preds = %for.cond59.preheader.loopexit220.unr-lcssa, %for.cond32.preheader.us.epil, %for.cond32.for.inc56_crit_edge.split.us.us.us, %for.cond32.preheader.lr.ph %77 = load i32, ptr %l, align 4 %78 = icmp sgt i32 %77, 0 br i1 %78, label %for.cond63.preheader, label %for.cond.cleanup for.cond63.preheader: ; preds = %for.cond59.preheader, %for.cond.cleanup66 %79 = phi i32 [ %82, %for.cond.cleanup66 ], [ %31, %for.cond59.preheader ] %80 = phi i32 [ %83, %for.cond.cleanup66 ], [ %77, %for.cond59.preheader ] %indvars.iv181 = phi i64 [ %indvars.iv.next182, %for.cond.cleanup66 ], [ 0, %for.cond59.preheader ] %cmp64139 = icmp sgt i32 %80, 0 br i1 %cmp64139, label %for.body67.lr.ph, label %for.cond.cleanup66 for.body67.lr.ph: ; preds = %for.cond63.preheader %81 = mul nuw nsw i64 %indvars.iv181, %9 %arrayidx76 = getelementptr inbounds i64, ptr %vla2, i64 %81 br label %for.body67 for.cond.cleanup: ; preds = %for.cond.cleanup66, %for.cond29.preheader, %for.cond59.preheader call void @llvm.stackrestore.p0(ptr %4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 for.cond.cleanup66.loopexit: ; preds = %for.body67 %.pre186 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond.cleanup66 for.cond.cleanup66: ; preds = %for.cond.cleanup66.loopexit, %for.cond63.preheader %82 = phi i32 [ %.pre186, %for.cond.cleanup66.loopexit ], [ %79, %for.cond63.preheader ] %83 = phi i32 [ %88, %for.cond.cleanup66.loopexit ], [ %80, %for.cond63.preheader ] %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1 %84 = sext i32 %82 to i64 %cmp60 = icmp slt i64 %indvars.iv.next182, %84 br i1 %cmp60, label %for.cond63.preheader, label %for.cond.cleanup, !llvm.loop !25 for.body67: ; preds = %for.body67.lr.ph, %for.body67 %indvars.iv178 = phi i64 [ 0, %for.body67.lr.ph ], [ %indvars.iv.next179, %for.body67 ] %85 = phi i32 [ %80, %for.body67.lr.ph ], [ %88, %for.body67 ] %sub = add nsw i32 %85, -1 %86 = zext i32 %sub to i64 %cmp68 = icmp eq i64 %indvars.iv178, %86 %arrayidx73 = getelementptr inbounds i64, ptr %arrayidx76, i64 %indvars.iv178 %87 = load i64, ptr %arrayidx73, align 8, !tbaa !17 %.str.2..str.3 = select i1 %cmp68, ptr @.str.2, ptr @.str.3 %call74 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3, i64 noundef %87) %indvars.iv.next179 = add nuw nsw i64 %indvars.iv178, 1 %88 = load i32, ptr %l, align 4, !tbaa !5 %89 = sext i32 %88 to i64 %cmp64 = icmp slt i64 %indvars.iv.next179, %89 br i1 %cmp64, label %for.body67, label %for.cond.cleanup66.loopexit, !llvm.loop !26 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare 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 = { 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, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10, !14, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !10, !14} !17 = !{!18, !18, i64 0} !18 = !{!"long", !7, i64 0} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10} !22 = distinct !{!22, !10, !12} !23 = distinct !{!23, !24} !24 = !{!"llvm.loop.unroll.disable"} !25 = distinct !{!25, !10, !12} !26 = distinct !{!26, !10}
#include<stdio.h> int arr[6],i,j,k,l[10],r[10],flag=0; int main() { for(i=1;i<=6;i++) scanf("%d",&arr[i]); l[0]=arr[1]+arr[2]+arr[3],r[0]=arr[4]+arr[5]+arr[6]; l[1]=arr[1]+arr[2]+arr[4],r[1]=arr[3]+arr[5]+arr[6]; l[2]=arr[1]+arr[2]+arr[5],r[2]=arr[3]+arr[4]+arr[6]; l[3]=arr[1]+arr[2]+arr[6],r[3]=arr[3]+arr[4]+arr[5]; l[4]=arr[1]+arr[3]+arr[4],r[4]=arr[2]+arr[5]+arr[6]; l[5]=arr[1]+arr[3]+arr[5],r[5]=arr[2]+arr[4]+arr[6]; l[6]=arr[1]+arr[3]+arr[6],r[6]=arr[2]+arr[4]+arr[5]; l[7]=arr[1]+arr[4]+arr[5],r[7]=arr[2]+arr[3]+arr[6]; l[8]=arr[1]+arr[4]+arr[6],r[8]=arr[2]+arr[3]+arr[5]; l[9]=arr[1]+arr[5]+arr[6],r[9]=arr[2]+arr[3]+arr[4]; for (i = 0; i < 10; i++) { if(l[i]==r[i]) flag=1; } if (flag==0) printf("No\n"); else if (flag==1) printf("Yes\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15615/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15615/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @flag = dso_local local_unnamed_addr global i32 0, align 4 @i = dso_local local_unnamed_addr global i32 0, align 4 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @arr = dso_local global [6 x i32] zeroinitializer, align 16 @l = dso_local local_unnamed_addr global [10 x i32] zeroinitializer, align 16 @r = dso_local local_unnamed_addr global [10 x i32] zeroinitializer, align 16 @j = dso_local local_unnamed_addr global i32 0, align 4 @k = dso_local local_unnamed_addr global i32 0, align 4 @str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 @str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: store i32 1, ptr @i, align 4, !tbaa !5 br label %for.body for.body: ; preds = %entry, %for.body %storemerge63 = phi i32 [ 1, %entry ], [ %inc, %for.body ] %idxprom = sext i32 %storemerge63 to i64 %arrayidx = getelementptr inbounds [6 x i32], ptr @arr, i64 0, i64 %idxprom %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx) %0 = load i32, ptr @i, align 4, !tbaa !5 %inc = add nsw i32 %0, 1 store i32 %inc, ptr @i, align 4, !tbaa !5 %cmp = icmp slt i32 %0, 6 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9 for.end: ; preds = %for.body %1 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @arr, i64 0, i64 1), align 4, !tbaa !5 %2 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @arr, i64 0, i64 2), align 8, !tbaa !5 %add = add nsw i32 %2, %1 %3 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @arr, i64 0, i64 3), align 4, !tbaa !5 %add1 = add nsw i32 %add, %3 store i32 %add1, ptr @l, align 16, !tbaa !5 %4 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @arr, i64 0, i64 4), align 16, !tbaa !5 %5 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @arr, i64 0, i64 5), align 4, !tbaa !5 %6 = load i32, ptr getelementptr inbounds ([6 x i32], ptr @arr, i64 1, i64 0), align 8, !tbaa !5 %add2 = add i32 %6, %5 %add3 = add i32 %add2, %4 store i32 %add3, ptr @r, align 16, !tbaa !5 %add5 = add nsw i32 %4, %add store i32 %add5, ptr getelementptr inbounds ([10 x i32], ptr @l, i64 0, i64 1), align 4, !tbaa !5 %add7 = add i32 %add2, %3 store i32 %add7, ptr getelementptr inbounds ([10 x i32], ptr @r, i64 0, i64 1), align 4, !tbaa !5 %add9 = add nsw i32 %5, %add store i32 %add9, ptr getelementptr inbounds ([10 x i32], ptr @l, i64 0, i64 2), align 8, !tbaa !5 %add10 = add nsw i32 %4, %3 %add11 = add nsw i32 %6, %add10 store i32 %add11, ptr getelementptr inbounds ([10 x i32], ptr @r, i64 0, i64 2), align 8, !tbaa !5 %add13 = add nsw i32 %6, %add store i32 %add13, ptr getelementptr inbounds ([10 x i32], ptr @l, i64 0, i64 3), align 4, !tbaa !5 %add15 = add nsw i32 %add10, %5 store i32 %add15, ptr getelementptr inbounds ([10 x i32], ptr @r, i64 0, i64 3), align 4, !tbaa !5 %add16 = add nsw i32 %3, %1 %add17 = add nsw i32 %4, %add16 store i32 %add17, ptr getelementptr inbounds ([10 x i32], ptr @l, i64 0, i64 4), align 16, !tbaa !5 %add19 = add i32 %add2, %2 store i32 %add19, ptr getelementptr inbounds ([10 x i32], ptr @r, i64 0, i64 4), align 16, !tbaa !5 %add21 = add nsw i32 %5, %add16 store i32 %add21, ptr getelementptr inbounds ([10 x i32], ptr @l, i64 0, i64 5), align 4, !tbaa !5 %add22 = add nsw i32 %4, %2 %add23 = add nsw i32 %6, %add22 store i32 %add23, ptr getelementptr inbounds ([10 x i32], ptr @r, i64 0, i64 5), align 4, !tbaa !5 %add25 = add nsw i32 %6, %add16 store i32 %add25, ptr getelementptr inbounds ([10 x i32], ptr @l, i64 0, i64 6), align 8, !tbaa !5 %add27 = add nsw i32 %add22, %5 store i32 %add27, ptr getelementptr inbounds ([10 x i32], ptr @r, i64 0, i64 6), align 8, !tbaa !5 %add28 = add nsw i32 %4, %1 %add29 = add nsw i32 %add28, %5 store i32 %add29, ptr getelementptr inbounds ([10 x i32], ptr @l, i64 0, i64 7), align 4, !tbaa !5 %add30 = add nsw i32 %3, %2 %add31 = add nsw i32 %6, %add30 store i32 %add31, ptr getelementptr inbounds ([10 x i32], ptr @r, i64 0, i64 7), align 4, !tbaa !5 %add33 = add nsw i32 %6, %add28 store i32 %add33, ptr getelementptr inbounds ([10 x i32], ptr @l, i64 0, i64 8), align 16, !tbaa !5 %add35 = add nsw i32 %5, %add30 store i32 %add35, ptr getelementptr inbounds ([10 x i32], ptr @r, i64 0, i64 8), align 16, !tbaa !5 %add37 = add i32 %add2, %1 store i32 %add37, ptr getelementptr inbounds ([10 x i32], ptr @l, i64 0, i64 9), align 4, !tbaa !5 %add39 = add nsw i32 %4, %add30 store i32 %add39, ptr getelementptr inbounds ([10 x i32], ptr @r, i64 0, i64 9), align 4, !tbaa !5 %cmp47.not = icmp eq i32 %add1, %add3 %cmp47.1.not = icmp eq i32 %add5, %add7 %.not.not = or i1 %cmp47.not, %cmp47.1.not %cmp47.2.not = icmp eq i32 %add9, %add11 %7 = or i1 %.not.not, %cmp47.2.not %cmp47.3.not = icmp eq i32 %add13, %add15 %8 = or i1 %7, %cmp47.3.not %cmp47.4.not = icmp eq i32 %add17, %add19 %9 = or i1 %8, %cmp47.4.not %cmp47.5.not = icmp eq i32 %add21, %add23 %10 = or i1 %9, %cmp47.5.not %cmp47.6.not = icmp eq i32 %add25, %add27 %11 = or i1 %10, %cmp47.6.not %cmp47.7.not = icmp eq i32 %add29, %add31 %12 = or i1 %11, %cmp47.7.not %cmp47.8.not = icmp eq i32 %add33, %add35 %13 = or i1 %12, %cmp47.8.not br i1 %13, label %14, label %15 14: ; preds = %for.end store i32 1, ptr @flag, align 4, !tbaa !5 br label %15 15: ; preds = %for.end, %14 %cmp47.9 = icmp eq i32 %add37, %add39 br i1 %cmp47.9, label %for.inc48.9.thread, label %for.inc48.9 for.inc48.9.thread: ; preds = %15 store i32 1, ptr @flag, align 4, !tbaa !5 store i32 10, ptr @i, align 4, !tbaa !5 br label %if.then55 for.inc48.9: ; preds = %15 %.pre = load i32, ptr @flag, align 4, !tbaa !5 store i32 10, ptr @i, align 4, !tbaa !5 switch i32 %.pre, label %if.end58 [ i32 0, label %if.end58.sink.split i32 1, label %if.then55 ] if.then55: ; preds = %for.inc48.9.thread, %for.inc48.9 br label %if.end58.sink.split if.end58.sink.split: ; preds = %for.inc48.9, %if.then55 %str.sink = phi ptr [ @str, %if.then55 ], [ @str.3, %for.inc48.9 ] %puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) br label %if.end58 if.end58: ; preds = %if.end58.sink.split, %for.inc48.9 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(void){ int n,m,l,i,j,k; int a[101][101], b[101][101]; long c[101][101]; scanf("%d%d%d",&n,&m,&l); for(i=0; i<n; i++){ for(j=0; j<m; j++){ scanf("%d",&a[i][j]); } } for(i=0; i<m; i++){ for(j=0; j<l; j++){ scanf("%d",&b[i][j]); } } for(i=0; i<n; i++){ for(j=0; j<l; j++){ c[i][j]=0; for(k=0; k<m; k++){ c[i][j]+=a[i][k]*b[k][j]; } } } for(i=0; i<n; i++){ for(j=0; j<l; j++){ printf("%ld",c[i][j]); if(j!=l-1) printf(" "); } putchar('\n'); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156193/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156193/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\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: %n = alloca i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 %a = alloca [101 x [101 x i32]], align 16 %b = alloca [101 x [101 x i32]], align 16 %c = alloca [101 x [101 x i64]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 40804, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 81608, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp117 = icmp sgt i32 %0, 0 %.pre185 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp117, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre185, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre185, %for.cond1.preheader.lr.ph ] %indvars.iv148 = phi i64 [ %indvars.iv.next149, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp2115 = icmp sgt i32 %3, 0 br i1 %cmp2115, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre185, %entry ], [ %11, %for.inc7 ] %cmp11121 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp11121, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv148, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next149 = add nuw nsw i64 %indvars.iv148, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next149, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %39, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %40, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv154 = phi i64 [ %indvars.iv.next155, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp14119 = icmp sgt i32 %14, 0 br i1 %cmp14119, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre187 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %4, %for.cond10.preheader ], [ %.pre187, %for.cond27.preheader.loopexit ] %.lcssa = phi i32 [ %5, %for.cond10.preheader ], [ %39, %for.cond27.preheader.loopexit ] %cmp28128 = icmp sgt i32 %15, 0 br i1 %cmp28128, label %for.cond30.preheader.lr.ph, label %for.end83 for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader %.lcssa192 = phi i32 [ %.lcssa, %for.cond27.preheader ], [ %.pre185, %for.cond1.preheader.lr.ph ] %16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %17 = load i32, ptr %l, align 4, !tbaa !5 %cmp31126 = icmp sgt i32 %17, 0 br i1 %cmp31126, label %for.cond30.preheader.lr.ph.split.us, label %for.cond65.preheader.preheader for.cond65.preheader.preheader.loopexit209.unr-lcssa: ; preds = %for.cond30.preheader.us, %for.cond30.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond30.preheader.us.preheader ], [ %indvar.next.7, %for.cond30.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond65.preheader.preheader, label %for.cond30.preheader.us.epil for.cond30.preheader.us.epil: ; preds = %for.cond65.preheader.preheader.loopexit209.unr-lcssa, %for.cond30.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond30.preheader.us.epil ], [ %indvar.unr, %for.cond65.preheader.preheader.loopexit209.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond30.preheader.us.epil ], [ 0, %for.cond65.preheader.preheader.loopexit209.unr-lcssa ] %18 = mul nuw nsw i64 %indvar.epil, 808 %scevgep.epil = getelementptr i8, ptr %c, i64 %18 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 0, i64 %20, i1 false), !tbaa !13 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond65.preheader.preheader, label %for.cond30.preheader.us.epil, !llvm.loop !15 for.cond65.preheader.preheader: ; preds = %for.cond65.preheader.preheader.loopexit209.unr-lcssa, %for.cond30.preheader.us.epil, %for.cond30.for.inc58_crit_edge.split.us.us.us, %for.cond30.preheader.lr.ph br label %for.cond65.preheader for.cond30.preheader.lr.ph.split.us: ; preds = %for.cond30.preheader.lr.ph %cmp38123 = icmp sgt i32 %.lcssa192, 0 br i1 %cmp38123, label %for.cond30.preheader.us.us.preheader, label %for.cond30.preheader.us.preheader for.cond30.preheader.us.preheader: ; preds = %for.cond30.preheader.lr.ph.split.us %19 = zext i32 %17 to i64 %20 = shl nuw nsw i64 %19, 3 %wide.trip.count = zext i32 %16 to i64 %xtraiter = and i64 %wide.trip.count, 7 %21 = icmp ult i32 %16, 8 br i1 %21, label %for.cond65.preheader.preheader.loopexit209.unr-lcssa, label %for.cond30.preheader.us.preheader.new for.cond30.preheader.us.preheader.new: ; preds = %for.cond30.preheader.us.preheader %unroll_iter = and i64 %wide.trip.count, 4294967288 %invariant.gep = getelementptr i8, ptr %c, i64 808 %invariant.gep226 = getelementptr i8, ptr %c, i64 1616 %invariant.gep228 = getelementptr i8, ptr %c, i64 2424 %invariant.gep230 = getelementptr i8, ptr %c, i64 3232 %invariant.gep232 = getelementptr i8, ptr %c, i64 4040 %invariant.gep234 = getelementptr i8, ptr %c, i64 4848 %invariant.gep236 = getelementptr i8, ptr %c, i64 5656 br label %for.cond30.preheader.us for.cond30.preheader.us.us.preheader: ; preds = %for.cond30.preheader.lr.ph.split.us %wide.trip.count177 = zext i32 %16 to i64 %wide.trip.count172 = zext i32 %17 to i64 %wide.trip.count164 = zext i32 %.lcssa192 to i64 %xtraiter215 = and i64 %wide.trip.count164, 1 %22 = icmp eq i32 %.lcssa192, 1 %unroll_iter219 = and i64 %wide.trip.count164, 4294967294 %lcmp.mod217.not = icmp eq i64 %xtraiter215, 0 br label %for.cond30.preheader.us.us for.cond30.preheader.us.us: ; preds = %for.cond30.preheader.us.us.preheader, %for.cond30.for.inc58_crit_edge.split.us.us.us %indvars.iv174 = phi i64 [ 0, %for.cond30.preheader.us.us.preheader ], [ %indvars.iv.next175, %for.cond30.for.inc58_crit_edge.split.us.us.us ] br label %for.body32.us.us.us for.body32.us.us.us: ; preds = %for.cond37.for.inc55_crit_edge.us.us.us, %for.cond30.preheader.us.us %indvars.iv169 = phi i64 [ %indvars.iv.next170, %for.cond37.for.inc55_crit_edge.us.us.us ], [ 0, %for.cond30.preheader.us.us ] %arrayidx36.us.us.us = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv174, i64 %indvars.iv169 br i1 %22, label %for.cond37.for.inc55_crit_edge.us.us.us.unr-lcssa, label %for.body39.us.us.us for.body39.us.us.us: ; preds = %for.body32.us.us.us, %for.body39.us.us.us %indvars.iv161 = phi i64 [ %indvars.iv.next162.1, %for.body39.us.us.us ], [ 0, %for.body32.us.us.us ] %add125.us.us.us = phi i64 [ %add.us.us.us.1, %for.body39.us.us.us ], [ 0, %for.body32.us.us.us ] %niter220 = phi i64 [ %niter220.next.1, %for.body39.us.us.us ], [ 0, %for.body32.us.us.us ] %arrayidx43.us.us.us = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv174, i64 %indvars.iv161 %23 = load i32, ptr %arrayidx43.us.us.us, align 4, !tbaa !5 %arrayidx47.us.us.us = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv161, i64 %indvars.iv169 %24 = load i32, ptr %arrayidx47.us.us.us, align 4, !tbaa !5 %mul.us.us.us = mul nsw i32 %24, %23 %conv.us.us.us = sext i32 %mul.us.us.us to i64 %add.us.us.us = add nsw i64 %add125.us.us.us, %conv.us.us.us %indvars.iv.next162 = or i64 %indvars.iv161, 1 %arrayidx43.us.us.us.1 = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv174, i64 %indvars.iv.next162 %25 = load i32, ptr %arrayidx43.us.us.us.1, align 4, !tbaa !5 %arrayidx47.us.us.us.1 = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv.next162, i64 %indvars.iv169 %26 = load i32, ptr %arrayidx47.us.us.us.1, align 4, !tbaa !5 %mul.us.us.us.1 = mul nsw i32 %26, %25 %conv.us.us.us.1 = sext i32 %mul.us.us.us.1 to i64 %add.us.us.us.1 = add nsw i64 %add.us.us.us, %conv.us.us.us.1 %indvars.iv.next162.1 = add nuw nsw i64 %indvars.iv161, 2 %niter220.next.1 = add i64 %niter220, 2 %niter220.ncmp.1 = icmp eq i64 %niter220.next.1, %unroll_iter219 br i1 %niter220.ncmp.1, label %for.cond37.for.inc55_crit_edge.us.us.us.unr-lcssa, label %for.body39.us.us.us, !llvm.loop !17 for.cond37.for.inc55_crit_edge.us.us.us.unr-lcssa: ; preds = %for.body39.us.us.us, %for.body32.us.us.us %add.us.us.us.lcssa.ph = phi i64 [ undef, %for.body32.us.us.us ], [ %add.us.us.us.1, %for.body39.us.us.us ] %indvars.iv161.unr = phi i64 [ 0, %for.body32.us.us.us ], [ %indvars.iv.next162.1, %for.body39.us.us.us ] %add125.us.us.us.unr = phi i64 [ 0, %for.body32.us.us.us ], [ %add.us.us.us.1, %for.body39.us.us.us ] br i1 %lcmp.mod217.not, label %for.cond37.for.inc55_crit_edge.us.us.us, label %for.body39.us.us.us.epil for.body39.us.us.us.epil: ; preds = %for.cond37.for.inc55_crit_edge.us.us.us.unr-lcssa %arrayidx43.us.us.us.epil = getelementptr inbounds [101 x [101 x i32]], ptr %a, i64 0, i64 %indvars.iv174, i64 %indvars.iv161.unr %27 = load i32, ptr %arrayidx43.us.us.us.epil, align 4, !tbaa !5 %arrayidx47.us.us.us.epil = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv161.unr, i64 %indvars.iv169 %28 = load i32, ptr %arrayidx47.us.us.us.epil, align 4, !tbaa !5 %mul.us.us.us.epil = mul nsw i32 %28, %27 %conv.us.us.us.epil = sext i32 %mul.us.us.us.epil to i64 %add.us.us.us.epil = add nsw i64 %add125.us.us.us.unr, %conv.us.us.us.epil br label %for.cond37.for.inc55_crit_edge.us.us.us for.cond37.for.inc55_crit_edge.us.us.us: ; preds = %for.cond37.for.inc55_crit_edge.us.us.us.unr-lcssa, %for.body39.us.us.us.epil %add.us.us.us.lcssa = phi i64 [ %add.us.us.us.lcssa.ph, %for.cond37.for.inc55_crit_edge.us.us.us.unr-lcssa ], [ %add.us.us.us.epil, %for.body39.us.us.us.epil ] store i64 %add.us.us.us.lcssa, ptr %arrayidx36.us.us.us, align 8, !tbaa !13 %indvars.iv.next170 = add nuw nsw i64 %indvars.iv169, 1 %exitcond173.not = icmp eq i64 %indvars.iv.next170, %wide.trip.count172 br i1 %exitcond173.not, label %for.cond30.for.inc58_crit_edge.split.us.us.us, label %for.body32.us.us.us, !llvm.loop !18 for.cond30.for.inc58_crit_edge.split.us.us.us: ; preds = %for.cond37.for.inc55_crit_edge.us.us.us %indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1 %exitcond178.not = icmp eq i64 %indvars.iv.next175, %wide.trip.count177 br i1 %exitcond178.not, label %for.cond65.preheader.preheader, label %for.cond30.preheader.us.us, !llvm.loop !19 for.cond30.preheader.us: ; preds = %for.cond30.preheader.us, %for.cond30.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond30.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond30.preheader.us ] %niter = phi i64 [ 0, %for.cond30.preheader.us.preheader.new ], [ %niter.next.7, %for.cond30.preheader.us ] %29 = mul nuw nsw i64 %indvar, 808 %scevgep = getelementptr i8, ptr %c, i64 %29 call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %20, i1 false), !tbaa !13 %30 = mul nuw i64 %indvar, 808 %gep = getelementptr i8, ptr %invariant.gep, i64 %30 call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %20, i1 false), !tbaa !13 %31 = mul nuw i64 %indvar, 808 %gep227 = getelementptr i8, ptr %invariant.gep226, i64 %31 call void @llvm.memset.p0.i64(ptr align 16 %gep227, i8 0, i64 %20, i1 false), !tbaa !13 %32 = mul nuw i64 %indvar, 808 %gep229 = getelementptr i8, ptr %invariant.gep228, i64 %32 call void @llvm.memset.p0.i64(ptr align 8 %gep229, i8 0, i64 %20, i1 false), !tbaa !13 %33 = mul nuw i64 %indvar, 808 %gep231 = getelementptr i8, ptr %invariant.gep230, i64 %33 call void @llvm.memset.p0.i64(ptr align 16 %gep231, i8 0, i64 %20, i1 false), !tbaa !13 %34 = mul nuw i64 %indvar, 808 %gep233 = getelementptr i8, ptr %invariant.gep232, i64 %34 call void @llvm.memset.p0.i64(ptr align 8 %gep233, i8 0, i64 %20, i1 false), !tbaa !13 %35 = mul nuw i64 %indvar, 808 %gep235 = getelementptr i8, ptr %invariant.gep234, i64 %35 call void @llvm.memset.p0.i64(ptr align 16 %gep235, i8 0, i64 %20, i1 false), !tbaa !13 %36 = mul nuw i64 %indvar, 808 %gep237 = getelementptr i8, ptr %invariant.gep236, i64 %36 call void @llvm.memset.p0.i64(ptr align 8 %gep237, i8 0, i64 %20, i1 false), !tbaa !13 %indvar.next.7 = add nuw nsw i64 %indvar, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond65.preheader.preheader.loopexit209.unr-lcssa, label %for.cond30.preheader.us, !llvm.loop !19 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv151 = phi i64 [ %indvars.iv.next152, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [101 x [101 x i32]], ptr %b, i64 0, i64 %indvars.iv154, i64 %indvars.iv151 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next152 = add nuw nsw i64 %indvars.iv151, 1 %37 = load i32, ptr %l, align 4, !tbaa !5 %38 = sext i32 %37 to i64 %cmp14 = icmp slt i64 %indvars.iv.next152, %38 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !20 for.inc24.loopexit: ; preds = %for.body15 %.pre186 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %39 = phi i32 [ %.pre186, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %40 = phi i32 [ %37, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next155 = add nuw nsw i64 %indvars.iv154, 1 %41 = sext i32 %39 to i64 %cmp11 = icmp slt i64 %indvars.iv.next155, %41 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !21 for.cond65.preheader: ; preds = %for.cond65.preheader.preheader, %for.end79 %indvars.iv182 = phi i64 [ %indvars.iv.next183, %for.end79 ], [ 0, %for.cond65.preheader.preheader ] %42 = load i32, ptr %l, align 4, !tbaa !5 %cmp66138 = icmp sgt i32 %42, 0 br i1 %cmp66138, label %for.body68, label %for.end79 for.body68: ; preds = %for.cond65.preheader, %for.inc77 %indvars.iv179 = phi i64 [ %indvars.iv.next180, %for.inc77 ], [ 0, %for.cond65.preheader ] %arrayidx72 = getelementptr inbounds [101 x [101 x i64]], ptr %c, i64 0, i64 %indvars.iv182, i64 %indvars.iv179 %43 = load i64, ptr %arrayidx72, align 8, !tbaa !13 %call73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %43) %44 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %44, -1 %45 = zext i32 %sub to i64 %cmp74.not = icmp eq i64 %indvars.iv179, %45 br i1 %cmp74.not, label %for.inc77, label %if.then if.then: ; preds = %for.body68 %46 = load ptr, ptr @stdout, align 8, !tbaa !22 %call.i = call noundef i32 @putc(i32 noundef 32, ptr noundef %46) %.pre188 = load i32, ptr %l, align 4, !tbaa !5 br label %for.inc77 for.inc77: ; preds = %for.body68, %if.then %47 = phi i32 [ %44, %for.body68 ], [ %.pre188, %if.then ] %indvars.iv.next180 = add nuw nsw i64 %indvars.iv179, 1 %48 = sext i32 %47 to i64 %cmp66 = icmp slt i64 %indvars.iv.next180, %48 br i1 %cmp66, label %for.body68, label %for.end79, !llvm.loop !24 for.end79: ; preds = %for.inc77, %for.cond65.preheader %49 = load ptr, ptr @stdout, align 8, !tbaa !22 %call.i114 = call noundef i32 @putc(i32 noundef 10, ptr noundef %49) %indvars.iv.next183 = add nuw nsw i64 %indvars.iv182, 1 %50 = load i32, ptr %n, align 4, !tbaa !5 %51 = sext i32 %50 to i64 %cmp62 = icmp slt i64 %indvars.iv.next183, %51 br i1 %cmp62, label %for.cond65.preheader, label %for.end83, !llvm.loop !25 for.end83: ; preds = %for.end79, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 81608, ptr nonnull %c) #4 call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 40804, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = !{!14, !14, i64 0} !14 = !{!"long", !7, i64 0} !15 = distinct !{!15, !16} !16 = !{!"llvm.loop.unroll.disable"} !17 = distinct !{!17, !10} !18 = distinct !{!18, !10} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10} !21 = distinct !{!21, !10, !12} !22 = !{!23, !23, i64 0} !23 = !{!"any pointer", !7, i64 0} !24 = distinct !{!24, !10} !25 = distinct !{!25, !10}
#include<stdio.h> int main(void){ int n,m,l; int i,j,k; scanf("%d %d %d",&n,&m,&l); long long A[n][m],B[m][l],sum; for(i=0;i<n;i++){ for(j=0;j<m;j++){ scanf("%lld",&A[i][j]); } } for(i=0;i<m;i++){ for(j=0;j<l;j++){ scanf("%lld",&B[i][j]); } } for(i=0;i<n;i++){ for(j=0;j<l;j++){ sum=0; for(k=0;k<m;k++){ sum+=A[i][k]*B[k][j]; } if(j==0) printf("%lld",sum); else printf(" %lld",sum); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156236/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156236/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [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 %m = alloca i32, align 4 %l = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #6 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = load i32, ptr %m, align 4, !tbaa !5 %3 = zext i32 %2 to i64 %4 = call ptr @llvm.stacksave.p0() %5 = mul nuw i64 %3, %1 %vla = alloca i64, i64 %5, align 16 %6 = load i32, ptr %m, align 4, !tbaa !5 %7 = zext i32 %6 to i64 %8 = load i32, ptr %l, align 4, !tbaa !5 %9 = zext i32 %8 to i64 %10 = mul nuw i64 %9, %7 %vla1 = alloca i64, i64 %10, align 16 %11 = load i32, ptr %n, align 4, !tbaa !5 %cmp82 = icmp sgt i32 %11, 0 br i1 %cmp82, label %for.cond2.preheader.lr.ph, label %for.cond11.preheader for.cond2.preheader.lr.ph: ; preds = %entry %12 = icmp sgt i32 %6, 0 br i1 %12, label %for.cond2.preheader, label %for.cond31.preheader.preheader for.cond2.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.inc8 %13 = phi i32 [ %22, %for.inc8 ], [ %11, %for.cond2.preheader.lr.ph ] %14 = phi i32 [ %23, %for.inc8 ], [ %6, %for.cond2.preheader.lr.ph ] %indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.inc8 ], [ 0, %for.cond2.preheader.lr.ph ] %cmp380 = icmp sgt i32 %14, 0 br i1 %cmp380, label %for.body4.lr.ph, label %for.inc8 for.body4.lr.ph: ; preds = %for.cond2.preheader %15 = mul nuw nsw i64 %indvars.iv98, %3 %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %15 br label %for.body4 for.cond11.preheader: ; preds = %for.inc8, %entry %16 = phi i32 [ %11, %entry ], [ %22, %for.inc8 ] %17 = phi i32 [ %6, %entry ], [ %23, %for.inc8 ] %cmp1286 = icmp sgt i32 %17, 0 %18 = load i32, ptr %l, align 4 %19 = icmp sgt i32 %18, 0 %or.cond = select i1 %cmp1286, i1 %19, i1 false br i1 %or.cond, label %for.cond14.preheader, label %for.cond28.preheader for.body4: ; preds = %for.body4.lr.ph, %for.body4 %indvars.iv = phi i64 [ 0, %for.body4.lr.ph ], [ %indvars.iv.next, %for.body4 ] %arrayidx6 = getelementptr inbounds i64, ptr %arrayidx, i64 %indvars.iv %call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %20 = load i32, ptr %m, align 4, !tbaa !5 %21 = sext i32 %20 to i64 %cmp3 = icmp slt i64 %indvars.iv.next, %21 br i1 %cmp3, label %for.body4, label %for.inc8.loopexit, !llvm.loop !9 for.inc8.loopexit: ; preds = %for.body4 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc8 for.inc8: ; preds = %for.inc8.loopexit, %for.cond2.preheader %22 = phi i32 [ %.pre, %for.inc8.loopexit ], [ %13, %for.cond2.preheader ] %23 = phi i32 [ %20, %for.inc8.loopexit ], [ %14, %for.cond2.preheader ] %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %24 = sext i32 %22 to i64 %cmp = icmp slt i64 %indvars.iv.next99, %24 br i1 %cmp, label %for.cond2.preheader, label %for.cond11.preheader, !llvm.loop !11 for.cond14.preheader: ; preds = %for.cond11.preheader, %for.inc25 %25 = phi i32 [ %31, %for.inc25 ], [ %17, %for.cond11.preheader ] %26 = phi i32 [ %32, %for.inc25 ], [ %18, %for.cond11.preheader ] %indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.inc25 ], [ 0, %for.cond11.preheader ] %cmp1584 = icmp sgt i32 %26, 0 br i1 %cmp1584, label %for.body16.lr.ph, label %for.inc25 for.body16.lr.ph: ; preds = %for.cond14.preheader %27 = mul nuw nsw i64 %indvars.iv104, %9 %arrayidx18 = getelementptr inbounds i64, ptr %vla1, i64 %27 br label %for.body16 for.cond28.preheader.loopexit: ; preds = %for.inc25 %.pre117 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond28.preheader for.cond28.preheader: ; preds = %for.cond28.preheader.loopexit, %for.cond11.preheader %28 = phi i32 [ %.pre117, %for.cond28.preheader.loopexit ], [ %16, %for.cond11.preheader ] %cmp2993 = icmp sgt i32 %28, 0 br i1 %cmp2993, label %for.cond31.preheader.preheader, label %for.end57 for.cond31.preheader.preheader: ; preds = %for.cond2.preheader.lr.ph, %for.cond28.preheader %ident.check.not = icmp eq i32 %8, 1 br label %for.cond31.preheader for.body16: ; preds = %for.body16.lr.ph, %for.body16 %indvars.iv101 = phi i64 [ 0, %for.body16.lr.ph ], [ %indvars.iv.next102, %for.body16 ] %arrayidx20 = getelementptr inbounds i64, ptr %arrayidx18, i64 %indvars.iv101 %call21 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx20) %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1 %29 = load i32, ptr %l, align 4, !tbaa !5 %30 = sext i32 %29 to i64 %cmp15 = icmp slt i64 %indvars.iv.next102, %30 br i1 %cmp15, label %for.body16, label %for.inc25.loopexit, !llvm.loop !13 for.inc25.loopexit: ; preds = %for.body16 %.pre116 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc25 for.inc25: ; preds = %for.inc25.loopexit, %for.cond14.preheader %31 = phi i32 [ %.pre116, %for.inc25.loopexit ], [ %25, %for.cond14.preheader ] %32 = phi i32 [ %29, %for.inc25.loopexit ], [ %26, %for.cond14.preheader ] %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %33 = sext i32 %31 to i64 %cmp12 = icmp slt i64 %indvars.iv.next105, %33 br i1 %cmp12, label %for.cond14.preheader, label %for.cond28.preheader.loopexit, !llvm.loop !14 for.cond31.preheader: ; preds = %for.cond31.preheader.preheader, %for.end53 %indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.end53 ], [ 0, %for.cond31.preheader.preheader ] %34 = load i32, ptr %l, align 4, !tbaa !5 %cmp3291 = icmp sgt i32 %34, 0 br i1 %cmp3291, label %for.cond34.preheader.lr.ph, label %for.end53 for.cond34.preheader.lr.ph: ; preds = %for.cond31.preheader %35 = mul nuw nsw i64 %indvars.iv113, %3 %arrayidx38 = getelementptr inbounds i64, ptr %vla, i64 %35 br label %for.cond34.preheader for.cond34.preheader: ; preds = %for.cond34.preheader.lr.ph, %for.end47 %indvars.iv110 = phi i64 [ 0, %for.cond34.preheader.lr.ph ], [ %indvars.iv.next111, %for.end47 ] %36 = load i32, ptr %m, align 4, !tbaa !5 %cmp3588 = icmp sgt i32 %36, 0 br i1 %cmp3588, label %for.body36.lr.ph, label %for.end47 for.body36.lr.ph: ; preds = %for.cond34.preheader %invariant.gep = getelementptr inbounds i64, ptr %vla1, i64 %indvars.iv110 %wide.trip.count = zext i32 %36 to i64 %min.iters.check = icmp ugt i32 %36, 3 %or.cond131 = select i1 %min.iters.check, i1 %ident.check.not, i1 false br i1 %or.cond131, label %vector.ph, label %for.body36.preheader vector.ph: ; preds = %for.body36.lr.ph %n.vec = and i64 %wide.trip.count, 4294967292 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %44, %vector.body ] %vec.phi127 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %45, %vector.body ] %37 = getelementptr inbounds i64, ptr %arrayidx38, i64 %index %wide.load = load <2 x i64>, ptr %37, align 8, !tbaa !15 %38 = getelementptr inbounds i64, ptr %37, i64 2 %wide.load128 = load <2 x i64>, ptr %38, align 8, !tbaa !15 %39 = mul nuw nsw i64 %index, %9 %40 = getelementptr inbounds i64, ptr %invariant.gep, i64 %39 %wide.load129 = load <2 x i64>, ptr %40, align 8, !tbaa !15 %41 = getelementptr inbounds i64, ptr %40, i64 2 %wide.load130 = load <2 x i64>, ptr %41, align 8, !tbaa !15 %42 = mul nsw <2 x i64> %wide.load129, %wide.load %43 = mul nsw <2 x i64> %wide.load130, %wide.load128 %44 = add <2 x i64> %42, %vec.phi %45 = add <2 x i64> %43, %vec.phi127 %index.next = add nuw i64 %index, 4 %46 = icmp eq i64 %index.next, %n.vec br i1 %46, label %middle.block, label %vector.body, !llvm.loop !17 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %45, %44 %47 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) %cmp.n = icmp eq i64 %n.vec, %wide.trip.count br i1 %cmp.n, label %for.end47, label %for.body36.preheader for.body36.preheader: ; preds = %for.body36.lr.ph, %middle.block %indvars.iv107.ph = phi i64 [ 0, %for.body36.lr.ph ], [ %n.vec, %middle.block ] %sum.090.ph = phi i64 [ 0, %for.body36.lr.ph ], [ %47, %middle.block ] %48 = xor i64 %indvars.iv107.ph, -1 %49 = add nsw i64 %48, %wide.trip.count %xtraiter = and i64 %wide.trip.count, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body36.prol.loopexit, label %for.body36.prol for.body36.prol: ; preds = %for.body36.preheader, %for.body36.prol %indvars.iv107.prol = phi i64 [ %indvars.iv.next108.prol, %for.body36.prol ], [ %indvars.iv107.ph, %for.body36.preheader ] %sum.090.prol = phi i64 [ %add.prol, %for.body36.prol ], [ %sum.090.ph, %for.body36.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %for.body36.prol ], [ 0, %for.body36.preheader ] %arrayidx40.prol = getelementptr inbounds i64, ptr %arrayidx38, i64 %indvars.iv107.prol %50 = load i64, ptr %arrayidx40.prol, align 8, !tbaa !15 %51 = mul nuw nsw i64 %indvars.iv107.prol, %9 %gep.prol = getelementptr inbounds i64, ptr %invariant.gep, i64 %51 %52 = load i64, ptr %gep.prol, align 8, !tbaa !15 %mul.prol = mul nsw i64 %52, %50 %add.prol = add nsw i64 %mul.prol, %sum.090.prol %indvars.iv.next108.prol = add nuw nsw i64 %indvars.iv107.prol, 1 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %for.body36.prol.loopexit, label %for.body36.prol, !llvm.loop !20 for.body36.prol.loopexit: ; preds = %for.body36.prol, %for.body36.preheader %add.lcssa.unr = phi i64 [ undef, %for.body36.preheader ], [ %add.prol, %for.body36.prol ] %indvars.iv107.unr = phi i64 [ %indvars.iv107.ph, %for.body36.preheader ], [ %indvars.iv.next108.prol, %for.body36.prol ] %sum.090.unr = phi i64 [ %sum.090.ph, %for.body36.preheader ], [ %add.prol, %for.body36.prol ] %53 = icmp ult i64 %49, 3 br i1 %53, label %for.end47, label %for.body36 for.body36: ; preds = %for.body36.prol.loopexit, %for.body36 %indvars.iv107 = phi i64 [ %indvars.iv.next108.3, %for.body36 ], [ %indvars.iv107.unr, %for.body36.prol.loopexit ] %sum.090 = phi i64 [ %add.3, %for.body36 ], [ %sum.090.unr, %for.body36.prol.loopexit ] %arrayidx40 = getelementptr inbounds i64, ptr %arrayidx38, i64 %indvars.iv107 %54 = load i64, ptr %arrayidx40, align 8, !tbaa !15 %55 = mul nuw nsw i64 %indvars.iv107, %9 %gep = getelementptr inbounds i64, ptr %invariant.gep, i64 %55 %56 = load i64, ptr %gep, align 8, !tbaa !15 %mul = mul nsw i64 %56, %54 %add = add nsw i64 %mul, %sum.090 %indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1 %arrayidx40.1 = getelementptr inbounds i64, ptr %arrayidx38, i64 %indvars.iv.next108 %57 = load i64, ptr %arrayidx40.1, align 8, !tbaa !15 %58 = mul nuw nsw i64 %indvars.iv.next108, %9 %gep.1 = getelementptr inbounds i64, ptr %invariant.gep, i64 %58 %59 = load i64, ptr %gep.1, align 8, !tbaa !15 %mul.1 = mul nsw i64 %59, %57 %add.1 = add nsw i64 %mul.1, %add %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 2 %arrayidx40.2 = getelementptr inbounds i64, ptr %arrayidx38, i64 %indvars.iv.next108.1 %60 = load i64, ptr %arrayidx40.2, align 8, !tbaa !15 %61 = mul nuw nsw i64 %indvars.iv.next108.1, %9 %gep.2 = getelementptr inbounds i64, ptr %invariant.gep, i64 %61 %62 = load i64, ptr %gep.2, align 8, !tbaa !15 %mul.2 = mul nsw i64 %62, %60 %add.2 = add nsw i64 %mul.2, %add.1 %indvars.iv.next108.2 = add nuw nsw i64 %indvars.iv107, 3 %arrayidx40.3 = getelementptr inbounds i64, ptr %arrayidx38, i64 %indvars.iv.next108.2 %63 = load i64, ptr %arrayidx40.3, align 8, !tbaa !15 %64 = mul nuw nsw i64 %indvars.iv.next108.2, %9 %gep.3 = getelementptr inbounds i64, ptr %invariant.gep, i64 %64 %65 = load i64, ptr %gep.3, align 8, !tbaa !15 %mul.3 = mul nsw i64 %65, %63 %add.3 = add nsw i64 %mul.3, %add.2 %indvars.iv.next108.3 = add nuw nsw i64 %indvars.iv107, 4 %exitcond.not.3 = icmp eq i64 %indvars.iv.next108.3, %wide.trip.count br i1 %exitcond.not.3, label %for.end47, label %for.body36, !llvm.loop !22 for.end47: ; preds = %for.body36.prol.loopexit, %for.body36, %middle.block, %for.cond34.preheader %sum.0.lcssa = phi i64 [ 0, %for.cond34.preheader ], [ %47, %middle.block ], [ %add.lcssa.unr, %for.body36.prol.loopexit ], [ %add.3, %for.body36 ] %cmp48 = icmp eq i64 %indvars.iv110, 0 %.str.1..str.2 = select i1 %cmp48, ptr @.str.1, ptr @.str.2 %call49 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i64 noundef %sum.0.lcssa) %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %66 = load i32, ptr %l, align 4, !tbaa !5 %67 = sext i32 %66 to i64 %cmp32 = icmp slt i64 %indvars.iv.next111, %67 br i1 %cmp32, label %for.cond34.preheader, label %for.end53, !llvm.loop !23 for.end53: ; preds = %for.end47, %for.cond31.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %68 = load i32, ptr %n, align 4, !tbaa !5 %69 = sext i32 %68 to i64 %cmp29 = icmp slt i64 %indvars.iv.next114, %69 br i1 %cmp29, label %for.cond31.preheader, label %for.end57, !llvm.loop !24 for.end57: ; preds = %for.end53, %for.cond28.preheader call void @llvm.stackrestore.p0(ptr %4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; 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 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = !{!16, !16, i64 0} !16 = !{!"long long", !7, i64 0} !17 = distinct !{!17, !10, !18, !19} !18 = !{!"llvm.loop.isvectorized", i32 1} !19 = !{!"llvm.loop.unroll.runtime.disable"} !20 = distinct !{!20, !21} !21 = !{!"llvm.loop.unroll.disable"} !22 = distinct !{!22, !10, !18} !23 = distinct !{!23, !10} !24 = distinct !{!24, !10}
#include<stdio.h> #include<stdlib.h> long long maximum(long long a,long long b){ if(a>=b) return a; return b; } int main(){ int x1,y1,x2,y2; long long chng1,chng2; scanf("%d %d",&x1,&y1); scanf("%d %d",&x2,&y2); chng1=x1-x2; if(chng1<0) chng1=-chng1; chng2=y1-y2; if(chng2<0) chng2=-chng2; printf("%I64d",maximum(chng1,chng2)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15628/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15628/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%I64d\00", align 1 ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @maximum(i64 noundef %a, i64 noundef %b) local_unnamed_addr #0 { entry: %b.a = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %b.a } ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #1 { entry: %x1 = alloca i32, align 4 %y1 = alloca i32, align 4 %x2 = alloca i32, align 4 %y2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x2, ptr noundef nonnull %y2) %0 = load i32, ptr %x1, align 4, !tbaa !5 %1 = load i32, ptr %x2, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = call i32 @llvm.abs.i32(i32 %sub, i1 false) %spec.select = zext i32 %2 to i64 %3 = load i32, ptr %y1, align 4, !tbaa !5 %4 = load i32, ptr %y2, align 4, !tbaa !5 %sub4 = sub nsw i32 %3, %4 %5 = call i32 @llvm.abs.i32(i32 %sub4, i1 false) %chng2.0 = zext i32 %5 to i64 %b.a.i = call i64 @llvm.smax.i64(i64 %spec.select, i64 %chng2.0) %call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %b.a.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #5 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #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 i64 @llvm.smax.i64(i64, i64) #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #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"}
#include<stdio.h> int main() { int a[100][100], b[100][100], m, n, l, i, j, k; long long c = 0; scanf("%d %d %d", &m, &n ,&l); for(i = 0; i < m; ++i) { for(j = 0; j < n; ++j) { scanf("%d", &a[i][j]); } } for(i = 0; i < n; ++i) { for(j = 0; j < l; ++j) { scanf("%d", &b[i][j]); } } for(i = 0; i < m; ++i) { for(j = 0; j < l; ++j) { for(k = 0; k < n; ++k) { c += a[i][k] * b[k][j]; } if(j == l - 1) { printf("%lld\n", c); c = 0; continue; } printf("%lld ", c); c = 0; } // printf("\n"); } // puts(""); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156322/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156322/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 @.str.3 = 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: %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 %m = alloca i32, align 4 %n = alloca i32, align 4 %l = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m, ptr noundef nonnull %n, ptr noundef nonnull %l) %0 = load i32, ptr %m, align 4, !tbaa !5 %cmp81 = icmp sgt i32 %0, 0 %.pre116 = load i32, ptr %n, align 4, !tbaa !5 br i1 %cmp81, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre116, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre116, %for.cond1.preheader.lr.ph ] %indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp279 = icmp sgt i32 %3, 0 br i1 %cmp279, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre116, %entry ], [ %11, %for.inc7 ] %cmp1185 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp1185, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv98, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %n, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next99, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %21, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %22, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp1483 = icmp sgt i32 %14, 0 br i1 %cmp1483, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre118 = load i32, ptr %m, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %.pre118, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ] %cmp2892 = icmp sgt i32 %15, 0 br i1 %cmp2892, label %for.cond30.preheader.lr.ph, label %for.end56 for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader %16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %17 = load i32, ptr %l, align 4, !tbaa !5 %18 = icmp sgt i32 %17, 0 br i1 %18, label %for.cond30.preheader, label %for.end56 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv104, i64 %indvars.iv101 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1 %19 = load i32, ptr %l, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp14 = icmp slt i64 %indvars.iv.next102, %20 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre117 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %21 = phi i32 [ %.pre117, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %22 = phi i32 [ %19, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1 %23 = sext i32 %21 to i64 %cmp11 = icmp slt i64 %indvars.iv.next105, %23 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.lr.ph, %for.inc54 %24 = phi i32 [ %38, %for.inc54 ], [ %16, %for.cond30.preheader.lr.ph ] %25 = phi i32 [ %39, %for.inc54 ], [ %17, %for.cond30.preheader.lr.ph ] %indvars.iv113 = phi i64 [ %indvars.iv.next114, %for.inc54 ], [ 0, %for.cond30.preheader.lr.ph ] %cmp3190 = icmp sgt i32 %25, 0 br i1 %cmp3190, label %for.cond33.preheader, label %for.inc54 for.cond33.preheader: ; preds = %for.cond30.preheader, %for.end46 %indvars.iv110 = phi i64 [ %indvars.iv.next111, %for.end46 ], [ 0, %for.cond30.preheader ] %26 = phi i32 [ %36, %for.end46 ], [ %25, %for.cond30.preheader ] %27 = load i32, ptr %n, align 4, !tbaa !5 %cmp3487 = icmp sgt i32 %27, 0 br i1 %cmp3487, label %for.body35.lr.ph, label %for.end46 for.body35.lr.ph: ; preds = %for.cond33.preheader %wide.trip.count = zext i32 %27 to i64 %xtraiter = and i64 %wide.trip.count, 1 %28 = icmp eq i32 %27, 1 br i1 %28, label %for.end46.loopexit.unr-lcssa, label %for.body35.lr.ph.new for.body35.lr.ph.new: ; preds = %for.body35.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body35 for.body35: ; preds = %for.body35, %for.body35.lr.ph.new %indvars.iv107 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next108.1, %for.body35 ] %c.289 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ] %niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ] %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv107 %29 = load i32, ptr %arrayidx39, align 8, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv107, i64 %indvars.iv110 %30 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %mul = mul nsw i32 %30, %29 %conv = sext i32 %mul to i64 %add = add nsw i64 %c.289, %conv %indvars.iv.next108 = or i64 %indvars.iv107, 1 %arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv.next108 %31 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next108, i64 %indvars.iv110 %32 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %32, %31 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next108.1 = add nuw nsw i64 %indvars.iv107, 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.end46.loopexit.unr-lcssa, label %for.body35, !llvm.loop !15 for.end46.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %indvars.iv107.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next108.1, %for.body35 ] %c.289.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.end46, label %for.body35.epil for.body35.epil: ; preds = %for.end46.loopexit.unr-lcssa %arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv113, i64 %indvars.iv107.unr %33 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv107.unr, i64 %indvars.iv110 %34 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %34, %33 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %c.289.unr, %conv.epil br label %for.end46 for.end46: ; preds = %for.body35.epil, %for.end46.loopexit.unr-lcssa, %for.cond33.preheader %c.2.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.end46.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ] %sub = add nsw i32 %26, -1 %35 = zext i32 %sub to i64 %cmp47 = icmp eq i64 %indvars.iv110, %35 %.str.2..str.3 = select i1 %cmp47, ptr @.str.2, ptr @.str.3 %call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3, i64 noundef %c.2.lcssa) %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %36 = load i32, ptr %l, align 4, !tbaa !5 %37 = sext i32 %36 to i64 %cmp31 = icmp slt i64 %indvars.iv.next111, %37 br i1 %cmp31, label %for.cond33.preheader, label %for.inc54.loopexit, !llvm.loop !16 for.inc54.loopexit: ; preds = %for.end46 %.pre119 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc54 for.inc54: ; preds = %for.inc54.loopexit, %for.cond30.preheader %38 = phi i32 [ %.pre119, %for.inc54.loopexit ], [ %24, %for.cond30.preheader ] %39 = phi i32 [ %36, %for.inc54.loopexit ], [ %25, %for.cond30.preheader ] %indvars.iv.next114 = add nuw nsw i64 %indvars.iv113, 1 %40 = sext i32 %38 to i64 %cmp28 = icmp slt i64 %indvars.iv.next114, %40 br i1 %cmp28, label %for.cond30.preheader, label %for.end56, !llvm.loop !17 for.end56: ; preds = %for.inc54, %for.cond30.preheader.lr.ph, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !12}
#include<stdio.h> int main(void){ int n,m,l,i,j; long int sum=0; int a[100][100],b[100][100]; scanf("%d %d %d",&n,&m,&l); for(i=0;i<n;i++){ for(j=0;j<m;j++){ scanf("%d",&a[i][j]); } } for(i=0;i<m;i++){ for(j=0;j<l;j++){ scanf("%d",&b[i][j]); } } for(i=0;i<n;i++){ for(j=0;j<l;j++){ for(int k=0;k<m;k++){ sum+=a[i][k]*b[k][j]; } printf("%ld",sum); if(j==l-1){ printf("\n"); }else{ printf(" "); } sum=0; } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156366/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156366/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"%ld\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 %l = alloca i32, align 4 %a = alloca [100 x [100 x i32]], align 16 %b = alloca [100 x [100 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp82 = icmp sgt i32 %0, 0 %.pre117 = load i32, ptr %m, align 4, !tbaa !5 br i1 %cmp82, label %for.cond1.preheader.lr.ph, label %for.cond10.preheader for.cond1.preheader.lr.ph: ; preds = %entry %1 = icmp sgt i32 %.pre117, 0 br i1 %1, label %for.cond1.preheader, label %for.cond30.preheader.lr.ph for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %for.inc7 %2 = phi i32 [ %10, %for.inc7 ], [ %0, %for.cond1.preheader.lr.ph ] %3 = phi i32 [ %11, %for.inc7 ], [ %.pre117, %for.cond1.preheader.lr.ph ] %indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.inc7 ], [ 0, %for.cond1.preheader.lr.ph ] %cmp280 = icmp sgt i32 %3, 0 br i1 %cmp280, label %for.body3, label %for.inc7 for.cond10.preheader: ; preds = %for.inc7, %entry %4 = phi i32 [ %0, %entry ], [ %10, %for.inc7 ] %5 = phi i32 [ %.pre117, %entry ], [ %11, %for.inc7 ] %cmp1186 = icmp sgt i32 %5, 0 %6 = load i32, ptr %l, align 4 %7 = icmp sgt i32 %6, 0 %or.cond = select i1 %cmp1186, i1 %7, i1 false br i1 %or.cond, label %for.cond13.preheader, label %for.cond27.preheader for.body3: ; preds = %for.cond1.preheader, %for.body3 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body3 ], [ 0, %for.cond1.preheader ] %arrayidx5 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv99, i64 %indvars.iv %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx5) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %8 = load i32, ptr %m, align 4, !tbaa !5 %9 = sext i32 %8 to i64 %cmp2 = icmp slt i64 %indvars.iv.next, %9 br i1 %cmp2, label %for.body3, label %for.inc7.loopexit, !llvm.loop !9 for.inc7.loopexit: ; preds = %for.body3 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc7 for.inc7: ; preds = %for.inc7.loopexit, %for.cond1.preheader %10 = phi i32 [ %.pre, %for.inc7.loopexit ], [ %2, %for.cond1.preheader ] %11 = phi i32 [ %8, %for.inc7.loopexit ], [ %3, %for.cond1.preheader ] %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1 %12 = sext i32 %10 to i64 %cmp = icmp slt i64 %indvars.iv.next100, %12 br i1 %cmp, label %for.cond1.preheader, label %for.cond10.preheader, !llvm.loop !11 for.cond13.preheader: ; preds = %for.cond10.preheader, %for.inc24 %13 = phi i32 [ %21, %for.inc24 ], [ %5, %for.cond10.preheader ] %14 = phi i32 [ %22, %for.inc24 ], [ %6, %for.cond10.preheader ] %indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.inc24 ], [ 0, %for.cond10.preheader ] %cmp1484 = icmp sgt i32 %14, 0 br i1 %cmp1484, label %for.body15, label %for.inc24 for.cond27.preheader.loopexit: ; preds = %for.inc24 %.pre119 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.loopexit, %for.cond10.preheader %15 = phi i32 [ %.pre119, %for.cond27.preheader.loopexit ], [ %4, %for.cond10.preheader ] %cmp2893 = icmp sgt i32 %15, 0 br i1 %cmp2893, label %for.cond30.preheader.lr.ph, label %for.end57 for.cond30.preheader.lr.ph: ; preds = %for.cond1.preheader.lr.ph, %for.cond27.preheader %16 = phi i32 [ %15, %for.cond27.preheader ], [ %0, %for.cond1.preheader.lr.ph ] %17 = load i32, ptr %l, align 4, !tbaa !5 %18 = icmp sgt i32 %17, 0 br i1 %18, label %for.cond30.preheader, label %for.end57 for.body15: ; preds = %for.cond13.preheader, %for.body15 %indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.body15 ], [ 0, %for.cond13.preheader ] %arrayidx19 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv105, i64 %indvars.iv102 %call20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx19) %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1 %19 = load i32, ptr %l, align 4, !tbaa !5 %20 = sext i32 %19 to i64 %cmp14 = icmp slt i64 %indvars.iv.next103, %20 br i1 %cmp14, label %for.body15, label %for.inc24.loopexit, !llvm.loop !13 for.inc24.loopexit: ; preds = %for.body15 %.pre118 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc24 for.inc24: ; preds = %for.inc24.loopexit, %for.cond13.preheader %21 = phi i32 [ %.pre118, %for.inc24.loopexit ], [ %13, %for.cond13.preheader ] %22 = phi i32 [ %19, %for.inc24.loopexit ], [ %14, %for.cond13.preheader ] %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1 %23 = sext i32 %21 to i64 %cmp11 = icmp slt i64 %indvars.iv.next106, %23 br i1 %cmp11, label %for.cond13.preheader, label %for.cond27.preheader.loopexit, !llvm.loop !14 for.cond30.preheader: ; preds = %for.cond30.preheader.lr.ph, %for.inc55 %24 = phi i32 [ %38, %for.inc55 ], [ %16, %for.cond30.preheader.lr.ph ] %25 = phi i32 [ %39, %for.inc55 ], [ %17, %for.cond30.preheader.lr.ph ] %indvars.iv114 = phi i64 [ %indvars.iv.next115, %for.inc55 ], [ 0, %for.cond30.preheader.lr.ph ] %cmp3191 = icmp sgt i32 %25, 0 br i1 %cmp3191, label %for.cond33.preheader, label %for.inc55 for.cond33.preheader: ; preds = %for.cond30.preheader, %for.cond.cleanup %indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.cond.cleanup ], [ 0, %for.cond30.preheader ] %26 = load i32, ptr %m, align 4, !tbaa !5 %cmp3488 = icmp sgt i32 %26, 0 br i1 %cmp3488, label %for.body35.lr.ph, label %for.cond.cleanup for.body35.lr.ph: ; preds = %for.cond33.preheader %wide.trip.count = zext i32 %26 to i64 %xtraiter = and i64 %wide.trip.count, 1 %27 = icmp eq i32 %26, 1 br i1 %27, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body35.lr.ph.new for.body35.lr.ph.new: ; preds = %for.body35.lr.ph %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body35 for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body35, %for.body35.lr.ph %add.lcssa.ph = phi i64 [ undef, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %indvars.iv108.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %indvars.iv.next109.1, %for.body35 ] %sum.289.unr = phi i64 [ 0, %for.body35.lr.ph ], [ %add.1, %for.body35 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body35.epil for.body35.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa %arrayidx39.epil = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv114, i64 %indvars.iv108.unr %28 = load i32, ptr %arrayidx39.epil, align 4, !tbaa !5 %arrayidx43.epil = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv108.unr, i64 %indvars.iv111 %29 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5 %mul.epil = mul nsw i32 %29, %28 %conv.epil = sext i32 %mul.epil to i64 %add.epil = add nsw i64 %sum.289.unr, %conv.epil br label %for.cond.cleanup for.cond.cleanup: ; preds = %for.body35.epil, %for.cond.cleanup.loopexit.unr-lcssa, %for.cond33.preheader %sum.2.lcssa = phi i64 [ 0, %for.cond33.preheader ], [ %add.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %add.epil, %for.body35.epil ] %call47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %sum.2.lcssa) %30 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %30, -1 %31 = zext i32 %sub to i64 %cmp48 = icmp eq i64 %indvars.iv111, %31 %. = select i1 %cmp48, i32 10, i32 32 %putchar = call i32 @putchar(i32 %.) %indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1 %32 = load i32, ptr %l, align 4, !tbaa !5 %33 = sext i32 %32 to i64 %cmp31 = icmp slt i64 %indvars.iv.next112, %33 br i1 %cmp31, label %for.cond33.preheader, label %for.inc55.loopexit, !llvm.loop !15 for.body35: ; preds = %for.body35, %for.body35.lr.ph.new %indvars.iv108 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %indvars.iv.next109.1, %for.body35 ] %sum.289 = phi i64 [ 0, %for.body35.lr.ph.new ], [ %add.1, %for.body35 ] %niter = phi i64 [ 0, %for.body35.lr.ph.new ], [ %niter.next.1, %for.body35 ] %arrayidx39 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv114, i64 %indvars.iv108 %34 = load i32, ptr %arrayidx39, align 8, !tbaa !5 %arrayidx43 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv108, i64 %indvars.iv111 %35 = load i32, ptr %arrayidx43, align 4, !tbaa !5 %mul = mul nsw i32 %35, %34 %conv = sext i32 %mul to i64 %add = add nsw i64 %sum.289, %conv %indvars.iv.next109 = or i64 %indvars.iv108, 1 %arrayidx39.1 = getelementptr inbounds [100 x [100 x i32]], ptr %a, i64 0, i64 %indvars.iv114, i64 %indvars.iv.next109 %36 = load i32, ptr %arrayidx39.1, align 4, !tbaa !5 %arrayidx43.1 = getelementptr inbounds [100 x [100 x i32]], ptr %b, i64 0, i64 %indvars.iv.next109, i64 %indvars.iv111 %37 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5 %mul.1 = mul nsw i32 %37, %36 %conv.1 = sext i32 %mul.1 to i64 %add.1 = add nsw i64 %add, %conv.1 %indvars.iv.next109.1 = add nuw nsw i64 %indvars.iv108, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body35, !llvm.loop !16 for.inc55.loopexit: ; preds = %for.cond.cleanup %.pre120 = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc55 for.inc55: ; preds = %for.inc55.loopexit, %for.cond30.preheader %38 = phi i32 [ %.pre120, %for.inc55.loopexit ], [ %24, %for.cond30.preheader ] %39 = phi i32 [ %32, %for.inc55.loopexit ], [ %25, %for.cond30.preheader ] %indvars.iv.next115 = add nuw nsw i64 %indvars.iv114, 1 %40 = sext i32 %38 to i64 %cmp28 = icmp slt i64 %indvars.iv.next115, %40 br i1 %cmp28, label %for.cond30.preheader, label %for.end57, !llvm.loop !17 for.end57: ; preds = %for.inc55, %for.cond30.preheader.lr.ph, %for.cond27.preheader call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %a) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = distinct !{!13, !10} !14 = distinct !{!14, !10, !12} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !12}
#include<stdio.h> int main(void){ int n,m,l,i,j,k; scanf("%d %d %d",&n,&m,&l); int a[n][m],b[m][l]; long long int c[n][l]; for(i=0;i<n;i++){ for(j=0;j<m;j++){ scanf("%d",&a[i][j]); } } for(i=0;i<m;i++){ for(j=0;j<l;j++){ scanf("%d",&b[i][j]); } } for(i=0;i<n;i++){ for(j=0;j<l;j++){ c[i][j]=0; } } for(i=0;i<n;i++){ for(j=0;j<l;j++){ for(k=0;k<m;k++){ c[i][j]+=a[i][k]*b[k][j]; } } } for(i=0;i<n;i++){ for(j=0;j<l;j++){ printf("%lld",c[i][j]); if(j!=l-1)printf(" "); } printf("\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156409/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156409/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.2 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %l = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #7 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %l) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = zext i32 %0 to i64 %2 = load i32, ptr %m, align 4, !tbaa !5 %3 = zext i32 %2 to i64 %4 = call ptr @llvm.stacksave.p0() %5 = mul nuw i64 %3, %1 %vla = alloca i32, i64 %5, align 16 %6 = load i32, ptr %m, align 4, !tbaa !5 %7 = zext i32 %6 to i64 %8 = load i32, ptr %l, align 4, !tbaa !5 %9 = zext i32 %8 to i64 %10 = mul nuw i64 %9, %7 %vla1 = alloca i32, i64 %10, align 16 %11 = load i32, ptr %n, align 4, !tbaa !5 %12 = zext i32 %11 to i64 %13 = mul nuw i64 %12, %9 %vla2 = alloca i64, i64 %13, align 16 %cmp136 = icmp sgt i32 %11, 0 br i1 %cmp136, label %for.cond3.preheader.lr.ph, label %for.cond12.preheader for.cond3.preheader.lr.ph: ; preds = %entry %14 = icmp sgt i32 %6, 0 br i1 %14, label %for.cond3.preheader, label %for.cond32.preheader.lr.ph for.cond3.preheader: ; preds = %for.cond3.preheader.lr.ph, %for.inc9 %15 = phi i32 [ %24, %for.inc9 ], [ %11, %for.cond3.preheader.lr.ph ] %16 = phi i32 [ %25, %for.inc9 ], [ %6, %for.cond3.preheader.lr.ph ] %indvars.iv171 = phi i64 [ %indvars.iv.next172, %for.inc9 ], [ 0, %for.cond3.preheader.lr.ph ] %cmp4134 = icmp sgt i32 %16, 0 br i1 %cmp4134, label %for.body5.lr.ph, label %for.inc9 for.body5.lr.ph: ; preds = %for.cond3.preheader %17 = mul nuw nsw i64 %indvars.iv171, %3 %arrayidx = getelementptr inbounds i32, ptr %vla, i64 %17 br label %for.body5 for.cond12.preheader: ; preds = %for.inc9, %entry %18 = phi i32 [ %11, %entry ], [ %24, %for.inc9 ] %19 = phi i32 [ %6, %entry ], [ %25, %for.inc9 ] %cmp13140 = icmp sgt i32 %19, 0 %20 = load i32, ptr %l, align 4 %21 = icmp sgt i32 %20, 0 %or.cond227 = select i1 %cmp13140, i1 %21, i1 false br i1 %or.cond227, label %for.cond15.preheader, label %for.cond29.preheader for.body5: ; preds = %for.body5.lr.ph, %for.body5 %indvars.iv = phi i64 [ 0, %for.body5.lr.ph ], [ %indvars.iv.next, %for.body5 ] %arrayidx7 = getelementptr inbounds i32, ptr %arrayidx, i64 %indvars.iv %call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx7) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %22 = load i32, ptr %m, align 4, !tbaa !5 %23 = sext i32 %22 to i64 %cmp4 = icmp slt i64 %indvars.iv.next, %23 br i1 %cmp4, label %for.body5, label %for.inc9.loopexit, !llvm.loop !9 for.inc9.loopexit: ; preds = %for.body5 %.pre = load i32, ptr %n, align 4, !tbaa !5 br label %for.inc9 for.inc9: ; preds = %for.inc9.loopexit, %for.cond3.preheader %24 = phi i32 [ %.pre, %for.inc9.loopexit ], [ %15, %for.cond3.preheader ] %25 = phi i32 [ %22, %for.inc9.loopexit ], [ %16, %for.cond3.preheader ] %indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1 %26 = sext i32 %24 to i64 %cmp = icmp slt i64 %indvars.iv.next172, %26 br i1 %cmp, label %for.cond3.preheader, label %for.cond12.preheader, !llvm.loop !11 for.cond15.preheader: ; preds = %for.cond12.preheader, %for.inc26 %27 = phi i32 [ %47, %for.inc26 ], [ %19, %for.cond12.preheader ] %28 = phi i32 [ %48, %for.inc26 ], [ %20, %for.cond12.preheader ] %indvars.iv177 = phi i64 [ %indvars.iv.next178, %for.inc26 ], [ 0, %for.cond12.preheader ] %cmp16138 = icmp sgt i32 %28, 0 br i1 %cmp16138, label %for.body17.lr.ph, label %for.inc26 for.body17.lr.ph: ; preds = %for.cond15.preheader %29 = mul nuw nsw i64 %indvars.iv177, %9 %arrayidx19 = getelementptr inbounds i32, ptr %vla1, i64 %29 br label %for.body17 for.cond29.preheader.loopexit: ; preds = %for.inc26 %.pre206 = load i32, ptr %n, align 4, !tbaa !5 br label %for.cond29.preheader for.cond29.preheader: ; preds = %for.cond29.preheader.loopexit, %for.cond12.preheader %30 = phi i32 [ %18, %for.cond12.preheader ], [ %.pre206, %for.cond29.preheader.loopexit ] %.lcssa133 = phi i32 [ %19, %for.cond12.preheader ], [ %47, %for.cond29.preheader.loopexit ] %cmp30144 = icmp sgt i32 %30, 0 br i1 %cmp30144, label %for.cond32.preheader.lr.ph, label %for.end97 for.cond32.preheader.lr.ph: ; preds = %for.cond3.preheader.lr.ph, %for.cond29.preheader %.lcssa133212 = phi i32 [ %.lcssa133, %for.cond29.preheader ], [ %6, %for.cond3.preheader.lr.ph ] %31 = phi i32 [ %30, %for.cond29.preheader ], [ %11, %for.cond3.preheader.lr.ph ] %32 = load i32, ptr %l, align 4, !tbaa !5 %cmp33142 = icmp sgt i32 %32, 0 br i1 %cmp33142, label %for.cond32.preheader.us.preheader, label %for.cond48.preheader.lr.ph for.cond32.preheader.us.preheader: ; preds = %for.cond32.preheader.lr.ph %33 = shl nuw nsw i64 %9, 3 %34 = zext i32 %32 to i64 %35 = shl nuw nsw i64 %34, 3 %wide.trip.count = zext i32 %31 to i64 %xtraiter = and i64 %wide.trip.count, 7 %36 = icmp ult i32 %31, 8 br i1 %36, label %for.cond48.preheader.lr.ph.loopexit.unr-lcssa, label %for.cond32.preheader.us.preheader.new for.cond32.preheader.us.preheader.new: ; preds = %for.cond32.preheader.us.preheader %unroll_iter = and i64 %wide.trip.count, 4294967288 br label %for.cond32.preheader.us for.cond32.preheader.us: ; preds = %for.cond32.preheader.us, %for.cond32.preheader.us.preheader.new %indvar = phi i64 [ 0, %for.cond32.preheader.us.preheader.new ], [ %indvar.next.7, %for.cond32.preheader.us ] %niter = phi i64 [ 0, %for.cond32.preheader.us.preheader.new ], [ %niter.next.7, %for.cond32.preheader.us ] %37 = mul nuw nsw i64 %33, %indvar %scevgep = getelementptr i8, ptr %vla2, i64 %37 call void @llvm.memset.p0.i64(ptr align 16 %scevgep, i8 0, i64 %35, i1 false), !tbaa !13 %indvar.next = or i64 %indvar, 1 %38 = mul nuw nsw i64 %33, %indvar.next %scevgep.1 = getelementptr i8, ptr %vla2, i64 %38 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.1, i8 0, i64 %35, i1 false), !tbaa !13 %indvar.next.1 = or i64 %indvar, 2 %39 = mul nuw nsw i64 %33, %indvar.next.1 %scevgep.2 = getelementptr i8, ptr %vla2, i64 %39 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.2, i8 0, i64 %35, i1 false), !tbaa !13 %indvar.next.2 = or i64 %indvar, 3 %40 = mul nuw nsw i64 %33, %indvar.next.2 %scevgep.3 = getelementptr i8, ptr %vla2, i64 %40 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.3, i8 0, i64 %35, i1 false), !tbaa !13 %indvar.next.3 = or i64 %indvar, 4 %41 = mul nuw nsw i64 %33, %indvar.next.3 %scevgep.4 = getelementptr i8, ptr %vla2, i64 %41 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.4, i8 0, i64 %35, i1 false), !tbaa !13 %indvar.next.4 = or i64 %indvar, 5 %42 = mul nuw nsw i64 %33, %indvar.next.4 %scevgep.5 = getelementptr i8, ptr %vla2, i64 %42 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.5, i8 0, i64 %35, i1 false), !tbaa !13 %indvar.next.5 = or i64 %indvar, 6 %43 = mul nuw nsw i64 %33, %indvar.next.5 %scevgep.6 = getelementptr i8, ptr %vla2, i64 %43 call void @llvm.memset.p0.i64(ptr align 16 %scevgep.6, i8 0, i64 %35, i1 false), !tbaa !13 %indvar.next.6 = or i64 %indvar, 7 %44 = mul nuw nsw i64 %33, %indvar.next.6 %scevgep.7 = getelementptr i8, ptr %vla2, i64 %44 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.7, i8 0, i64 %35, i1 false), !tbaa !13 %indvar.next.7 = add nuw nsw i64 %indvar, 8 %niter.next.7 = add i64 %niter, 8 %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter br i1 %niter.ncmp.7, label %for.cond48.preheader.lr.ph.loopexit.unr-lcssa, label %for.cond32.preheader.us, !llvm.loop !15 for.body17: ; preds = %for.body17.lr.ph, %for.body17 %indvars.iv174 = phi i64 [ 0, %for.body17.lr.ph ], [ %indvars.iv.next175, %for.body17 ] %arrayidx21 = getelementptr inbounds i32, ptr %arrayidx19, i64 %indvars.iv174 %call22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx21) %indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1 %45 = load i32, ptr %l, align 4, !tbaa !5 %46 = sext i32 %45 to i64 %cmp16 = icmp slt i64 %indvars.iv.next175, %46 br i1 %cmp16, label %for.body17, label %for.inc26.loopexit, !llvm.loop !16 for.inc26.loopexit: ; preds = %for.body17 %.pre205 = load i32, ptr %m, align 4, !tbaa !5 br label %for.inc26 for.inc26: ; preds = %for.inc26.loopexit, %for.cond15.preheader %47 = phi i32 [ %.pre205, %for.inc26.loopexit ], [ %27, %for.cond15.preheader ] %48 = phi i32 [ %45, %for.inc26.loopexit ], [ %28, %for.cond15.preheader ] %indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1 %49 = sext i32 %47 to i64 %cmp13 = icmp slt i64 %indvars.iv.next178, %49 br i1 %cmp13, label %for.cond15.preheader, label %for.cond29.preheader.loopexit, !llvm.loop !17 for.cond48.preheader.lr.ph.loopexit.unr-lcssa: ; preds = %for.cond32.preheader.us, %for.cond32.preheader.us.preheader %indvar.unr = phi i64 [ 0, %for.cond32.preheader.us.preheader ], [ %indvar.next.7, %for.cond32.preheader.us ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond48.preheader.lr.ph, label %for.cond32.preheader.us.epil for.cond32.preheader.us.epil: ; preds = %for.cond48.preheader.lr.ph.loopexit.unr-lcssa, %for.cond32.preheader.us.epil %indvar.epil = phi i64 [ %indvar.next.epil, %for.cond32.preheader.us.epil ], [ %indvar.unr, %for.cond48.preheader.lr.ph.loopexit.unr-lcssa ] %epil.iter = phi i64 [ %epil.iter.next, %for.cond32.preheader.us.epil ], [ 0, %for.cond48.preheader.lr.ph.loopexit.unr-lcssa ] %50 = mul nuw nsw i64 %33, %indvar.epil %scevgep.epil = getelementptr i8, ptr %vla2, i64 %50 call void @llvm.memset.p0.i64(ptr align 8 %scevgep.epil, i8 0, i64 %35, i1 false), !tbaa !13 %indvar.next.epil = add nuw nsw i64 %indvar.epil, 1 %epil.iter.next = add i64 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond48.preheader.lr.ph, label %for.cond32.preheader.us.epil, !llvm.loop !18 for.cond48.preheader.lr.ph: ; preds = %for.cond48.preheader.lr.ph.loopexit.unr-lcssa, %for.cond32.preheader.us.epil, %for.cond32.preheader.lr.ph %51 = load i32, ptr %l, align 4, !tbaa !5 %cmp49151 = icmp sgt i32 %51, 0 %cmp52148 = icmp sgt i32 %.lcssa133212, 0 %or.cond = select i1 %cmp49151, i1 %cmp52148, i1 false br i1 %or.cond, label %for.cond48.preheader.us.us.preheader, label %for.cond79.preheader.preheader for.cond48.preheader.us.us.preheader: ; preds = %for.cond48.preheader.lr.ph %wide.trip.count197 = zext i32 %31 to i64 %wide.trip.count192 = zext i32 %51 to i64 %wide.trip.count187 = zext i32 %.lcssa133212 to i64 %min.iters.check = icmp ugt i32 %.lcssa133212, 3 %ident.check.not = icmp eq i32 %8, 1 %or.cond236 = select i1 %min.iters.check, i1 %ident.check.not, i1 false %n.vec = and i64 %wide.trip.count187, 4294967292 %cmp.n = icmp eq i64 %n.vec, %wide.trip.count187 %xtraiter244 = and i64 %wide.trip.count187, 1 %lcmp.mod245.not = icmp eq i64 %xtraiter244, 0 %52 = sub nsw i64 0, %wide.trip.count187 br label %for.cond48.preheader.us.us for.cond48.preheader.us.us: ; preds = %for.cond48.preheader.us.us.preheader, %for.cond48.for.inc72_crit_edge.split.us.us.us %indvars.iv194 = phi i64 [ 0, %for.cond48.preheader.us.us.preheader ], [ %indvars.iv.next195, %for.cond48.for.inc72_crit_edge.split.us.us.us ] %53 = mul nuw nsw i64 %indvars.iv194, %3 %arrayidx55.us.us = getelementptr inbounds i32, ptr %vla, i64 %53 %54 = mul nuw nsw i64 %indvars.iv194, %9 %arrayidx63.us.us = getelementptr inbounds i64, ptr %vla2, i64 %54 br label %for.cond51.preheader.us.us.us for.cond51.preheader.us.us.us: ; preds = %for.cond51.for.inc69_crit_edge.us.us.us, %for.cond48.preheader.us.us %indvars.iv189 = phi i64 [ %indvars.iv.next190, %for.cond51.for.inc69_crit_edge.us.us.us ], [ 0, %for.cond48.preheader.us.us ] %invariant.gep.us.us.us = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv189 %arrayidx65.us.us.us = getelementptr inbounds i64, ptr %arrayidx63.us.us, i64 %indvars.iv189 %arrayidx65.promoted.us.us.us = load i64, ptr %arrayidx65.us.us.us, align 8, !tbaa !13 br i1 %or.cond236, label %vector.ph, label %for.body53.us.us.us.preheader vector.ph: ; preds = %for.cond51.preheader.us.us.us %55 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %arrayidx65.promoted.us.us.us, i64 0 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <2 x i64> [ %55, %vector.ph ], [ %65, %vector.body ] %vec.phi232 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %66, %vector.body ] %56 = getelementptr inbounds i32, ptr %arrayidx55.us.us, i64 %index %wide.load = load <2 x i32>, ptr %56, align 4, !tbaa !5 %57 = getelementptr inbounds i32, ptr %56, i64 2 %wide.load233 = load <2 x i32>, ptr %57, align 4, !tbaa !5 %58 = mul nuw nsw i64 %index, %9 %59 = getelementptr inbounds i32, ptr %invariant.gep.us.us.us, i64 %58 %wide.load234 = load <2 x i32>, ptr %59, align 4, !tbaa !5 %60 = getelementptr inbounds i32, ptr %59, i64 2 %wide.load235 = load <2 x i32>, ptr %60, align 4, !tbaa !5 %61 = mul nsw <2 x i32> %wide.load234, %wide.load %62 = mul nsw <2 x i32> %wide.load235, %wide.load233 %63 = sext <2 x i32> %61 to <2 x i64> %64 = sext <2 x i32> %62 to <2 x i64> %65 = add <2 x i64> %vec.phi, %63 %66 = add <2 x i64> %vec.phi232, %64 %index.next = add nuw i64 %index, 4 %67 = icmp eq i64 %index.next, %n.vec br i1 %67, label %middle.block, label %vector.body, !llvm.loop !20 middle.block: ; preds = %vector.body %bin.rdx = add <2 x i64> %66, %65 %68 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx) br i1 %cmp.n, label %for.cond51.for.inc69_crit_edge.us.us.us, label %for.body53.us.us.us.preheader for.body53.us.us.us.preheader: ; preds = %for.cond51.preheader.us.us.us, %middle.block %indvars.iv184.ph = phi i64 [ 0, %for.cond51.preheader.us.us.us ], [ %n.vec, %middle.block ] %add150.us.us.us.ph = phi i64 [ %arrayidx65.promoted.us.us.us, %for.cond51.preheader.us.us.us ], [ %68, %middle.block ] br i1 %lcmp.mod245.not, label %for.body53.us.us.us.prol.loopexit, label %for.body53.us.us.us.prol for.body53.us.us.us.prol: ; preds = %for.body53.us.us.us.preheader %arrayidx57.us.us.us.prol = getelementptr inbounds i32, ptr %arrayidx55.us.us, i64 %indvars.iv184.ph %69 = load i32, ptr %arrayidx57.us.us.us.prol, align 4, !tbaa !5 %70 = mul nuw nsw i64 %indvars.iv184.ph, %9 %gep.us.us.us.prol = getelementptr inbounds i32, ptr %invariant.gep.us.us.us, i64 %70 %71 = load i32, ptr %gep.us.us.us.prol, align 4, !tbaa !5 %mul.us.us.us.prol = mul nsw i32 %71, %69 %conv.us.us.us.prol = sext i32 %mul.us.us.us.prol to i64 %add.us.us.us.prol = add nsw i64 %add150.us.us.us.ph, %conv.us.us.us.prol %indvars.iv.next185.prol = or i64 %indvars.iv184.ph, 1 br label %for.body53.us.us.us.prol.loopexit for.body53.us.us.us.prol.loopexit: ; preds = %for.body53.us.us.us.prol, %for.body53.us.us.us.preheader %add.us.us.us.lcssa238.unr = phi i64 [ undef, %for.body53.us.us.us.preheader ], [ %add.us.us.us.prol, %for.body53.us.us.us.prol ] %indvars.iv184.unr = phi i64 [ %indvars.iv184.ph, %for.body53.us.us.us.preheader ], [ %indvars.iv.next185.prol, %for.body53.us.us.us.prol ] %add150.us.us.us.unr = phi i64 [ %add150.us.us.us.ph, %for.body53.us.us.us.preheader ], [ %add.us.us.us.prol, %for.body53.us.us.us.prol ] %72 = xor i64 %indvars.iv184.ph, %52 %73 = icmp eq i64 %72, -1 br i1 %73, label %for.cond51.for.inc69_crit_edge.us.us.us, label %for.body53.us.us.us for.body53.us.us.us: ; preds = %for.body53.us.us.us.prol.loopexit, %for.body53.us.us.us %indvars.iv184 = phi i64 [ %indvars.iv.next185.1, %for.body53.us.us.us ], [ %indvars.iv184.unr, %for.body53.us.us.us.prol.loopexit ] %add150.us.us.us = phi i64 [ %add.us.us.us.1, %for.body53.us.us.us ], [ %add150.us.us.us.unr, %for.body53.us.us.us.prol.loopexit ] %arrayidx57.us.us.us = getelementptr inbounds i32, ptr %arrayidx55.us.us, i64 %indvars.iv184 %74 = load i32, ptr %arrayidx57.us.us.us, align 4, !tbaa !5 %75 = mul nuw nsw i64 %indvars.iv184, %9 %gep.us.us.us = getelementptr inbounds i32, ptr %invariant.gep.us.us.us, i64 %75 %76 = load i32, ptr %gep.us.us.us, align 4, !tbaa !5 %mul.us.us.us = mul nsw i32 %76, %74 %conv.us.us.us = sext i32 %mul.us.us.us to i64 %add.us.us.us = add nsw i64 %add150.us.us.us, %conv.us.us.us %indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1 %arrayidx57.us.us.us.1 = getelementptr inbounds i32, ptr %arrayidx55.us.us, i64 %indvars.iv.next185 %77 = load i32, ptr %arrayidx57.us.us.us.1, align 4, !tbaa !5 %78 = mul nuw nsw i64 %indvars.iv.next185, %9 %gep.us.us.us.1 = getelementptr inbounds i32, ptr %invariant.gep.us.us.us, i64 %78 %79 = load i32, ptr %gep.us.us.us.1, align 4, !tbaa !5 %mul.us.us.us.1 = mul nsw i32 %79, %77 %conv.us.us.us.1 = sext i32 %mul.us.us.us.1 to i64 %add.us.us.us.1 = add nsw i64 %add.us.us.us, %conv.us.us.us.1 %indvars.iv.next185.1 = add nuw nsw i64 %indvars.iv184, 2 %exitcond188.not.1 = icmp eq i64 %indvars.iv.next185.1, %wide.trip.count187 br i1 %exitcond188.not.1, label %for.cond51.for.inc69_crit_edge.us.us.us, label %for.body53.us.us.us, !llvm.loop !23 for.cond51.for.inc69_crit_edge.us.us.us: ; preds = %for.body53.us.us.us.prol.loopexit, %for.body53.us.us.us, %middle.block %add.us.us.us.lcssa = phi i64 [ %68, %middle.block ], [ %add.us.us.us.lcssa238.unr, %for.body53.us.us.us.prol.loopexit ], [ %add.us.us.us.1, %for.body53.us.us.us ] store i64 %add.us.us.us.lcssa, ptr %arrayidx65.us.us.us, align 8, !tbaa !13 %indvars.iv.next190 = add nuw nsw i64 %indvars.iv189, 1 %exitcond193.not = icmp eq i64 %indvars.iv.next190, %wide.trip.count192 br i1 %exitcond193.not, label %for.cond48.for.inc72_crit_edge.split.us.us.us, label %for.cond51.preheader.us.us.us, !llvm.loop !24 for.cond48.for.inc72_crit_edge.split.us.us.us: ; preds = %for.cond51.for.inc69_crit_edge.us.us.us %indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1 %exitcond198.not = icmp eq i64 %indvars.iv.next195, %wide.trip.count197 br i1 %exitcond198.not, label %for.cond79.preheader.preheader, label %for.cond48.preheader.us.us, !llvm.loop !25 for.cond79.preheader.preheader: ; preds = %for.cond48.for.inc72_crit_edge.split.us.us.us, %for.cond48.preheader.lr.ph br label %for.cond79.preheader for.cond79.preheader: ; preds = %for.cond79.preheader.preheader, %for.end93 %indvars.iv202 = phi i64 [ %indvars.iv.next203, %for.end93 ], [ 0, %for.cond79.preheader.preheader ] %80 = load i32, ptr %l, align 4, !tbaa !5 %cmp80161 = icmp sgt i32 %80, 0 br i1 %cmp80161, label %for.body82.lr.ph, label %for.end93 for.body82.lr.ph: ; preds = %for.cond79.preheader %81 = mul nuw nsw i64 %indvars.iv202, %9 %arrayidx84 = getelementptr inbounds i64, ptr %vla2, i64 %81 br label %for.body82 for.body82: ; preds = %for.body82.lr.ph, %for.inc91 %indvars.iv199 = phi i64 [ 0, %for.body82.lr.ph ], [ %indvars.iv.next200, %for.inc91 ] %arrayidx86 = getelementptr inbounds i64, ptr %arrayidx84, i64 %indvars.iv199 %82 = load i64, ptr %arrayidx86, align 8, !tbaa !13 %call87 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %82) %83 = load i32, ptr %l, align 4, !tbaa !5 %sub = add nsw i32 %83, -1 %84 = zext i32 %sub to i64 %cmp88.not = icmp eq i64 %indvars.iv199, %84 br i1 %cmp88.not, label %for.inc91, label %if.then if.then: ; preds = %for.body82 %putchar132 = call i32 @putchar(i32 32) %.pre207 = load i32, ptr %l, align 4, !tbaa !5 br label %for.inc91 for.inc91: ; preds = %for.body82, %if.then %85 = phi i32 [ %83, %for.body82 ], [ %.pre207, %if.then ] %indvars.iv.next200 = add nuw nsw i64 %indvars.iv199, 1 %86 = sext i32 %85 to i64 %cmp80 = icmp slt i64 %indvars.iv.next200, %86 br i1 %cmp80, label %for.body82, label %for.end93, !llvm.loop !26 for.end93: ; preds = %for.inc91, %for.cond79.preheader %putchar = call i32 @putchar(i32 10) %indvars.iv.next203 = add nuw nsw i64 %indvars.iv202, 1 %87 = load i32, ptr %n, align 4, !tbaa !5 %88 = sext i32 %87 to i64 %cmp76 = icmp slt i64 %indvars.iv.next203, %88 br i1 %cmp76, label %for.cond79.preheader, label %for.end97, !llvm.loop !27 for.end97: ; preds = %for.end93, %for.cond29.preheader call void @llvm.stackrestore.p0(ptr %4) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #7 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #7 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn } attributes #4 = { nofree nounwind } attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #7 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10, !12} !12 = !{!"llvm.loop.unswitch.partial.disable"} !13 = !{!14, !14, i64 0} !14 = !{!"long long", !7, i64 0} !15 = distinct !{!15, !10} !16 = distinct !{!16, !10} !17 = distinct !{!17, !10, !12} !18 = distinct !{!18, !19} !19 = !{!"llvm.loop.unroll.disable"} !20 = distinct !{!20, !10, !21, !22} !21 = !{!"llvm.loop.isvectorized", i32 1} !22 = !{!"llvm.loop.unroll.runtime.disable"} !23 = distinct !{!23, !10, !21} !24 = distinct !{!24, !10} !25 = distinct !{!25, !10} !26 = distinct !{!26, !10} !27 = distinct !{!27, !10}
#include<stdio.h> #include<stdlib.h> #define ll long long #define MOD 1000000007 ll modpow(ll a,ll n) { ll res = 1; while (n > 0) { if (n % 2 > 0) res = res * a % MOD; a = a * a % MOD; n /= 2; } return res; } #if 0 ll rui( ll a,ll b){ if(a==1)return 1; else {ll c=1; for(;b!=0;b--){ c=c*a%MOD; }; return c%MOD; }; }; #endif int main(){ ll n,k,d, ans=0; scanf("%lld %lld",&n,&k); ll w[k+1]; for(int a=k;a!=0;a--){ d=k/a; //printf("%lld\n",d); w[a]=modpow(d,n); for(ll j=2;j*a<=k;j++){ w[a]-=w[a*j]; }; if(w[a]>MOD)w[a]%=MOD; //printf("%lld ",w[a]); ans+=(w[a]*a)%MOD; }; ans%=MOD; printf("%lld",ans); };
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156452/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156452/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @modpow(i64 noundef %a, i64 noundef %n) local_unnamed_addr #0 { entry: %cmp11 = icmp sgt i64 %n, 0 br i1 %cmp11, label %while.body, label %while.end while.body: ; preds = %entry, %if.end %res.014 = phi i64 [ %res.1, %if.end ], [ 1, %entry ] %n.addr.013 = phi i64 [ %div10, %if.end ], [ %n, %entry ] %a.addr.012 = phi i64 [ %rem4, %if.end ], [ %a, %entry ] %rem = and i64 %n.addr.013, 1 %cmp1.not = icmp eq i64 %rem, 0 br i1 %cmp1.not, label %if.end, label %if.then if.then: ; preds = %while.body %mul = mul nsw i64 %res.014, %a.addr.012 %rem2 = srem i64 %mul, 1000000007 br label %if.end if.end: ; preds = %if.then, %while.body %res.1 = phi i64 [ %rem2, %if.then ], [ %res.014, %while.body ] %mul3 = mul nsw i64 %a.addr.012, %a.addr.012 %rem4 = urem i64 %mul3, 1000000007 %div10 = lshr i64 %n.addr.013, 1 %cmp.not = icmp ult i64 %n.addr.013, 2 br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !5 while.end: ; preds = %if.end, %entry %res.0.lcssa = phi i64 [ 1, %entry ], [ %res.1, %if.end ] ret i64 %res.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #2 { entry: %n = alloca i64, align 8 %k = 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 %k) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i64, ptr %k, align 8, !tbaa !7 %add = add nsw i64 %0, 1 %1 = call ptr @llvm.stacksave.p0() %vla = alloca i64, i64 %add, align 16 %2 = load i64, ptr %k, align 8, !tbaa !7 %3 = and i64 %2, 4294967295 %cmp.not49 = icmp eq i64 %3, 0 br i1 %cmp.not49, label %for.cond.cleanup, label %for.body.lr.ph for.body.lr.ph: ; preds = %entry %4 = load i64, ptr %n, align 8, !tbaa !7 %cmp11.i = icmp sgt i64 %4, 0 %sext57 = shl i64 %2, 32 %5 = ashr exact i64 %sext57, 32 br i1 %cmp11.i, label %for.body.us, label %for.body for.body.us: ; preds = %for.body.lr.ph, %if.end.us %indvars.iv54 = phi i64 [ %indvars.iv.next55, %if.end.us ], [ %5, %for.body.lr.ph ] %ans.050.us = phi i64 [ %add26.us, %if.end.us ], [ 0, %for.body.lr.ph ] %div.us = sdiv i64 %2, %indvars.iv54 br label %while.body.i.us while.body.i.us: ; preds = %for.body.us, %if.end.i.us %res.014.i.us = phi i64 [ %arrayidx.promoted.us, %if.end.i.us ], [ 1, %for.body.us ] %n.addr.013.i.us = phi i64 [ %div10.i.us, %if.end.i.us ], [ %4, %for.body.us ] %a.addr.012.i.us = phi i64 [ %rem4.i.us, %if.end.i.us ], [ %div.us, %for.body.us ] %rem.i.us = and i64 %n.addr.013.i.us, 1 %cmp1.not.i.us = icmp eq i64 %rem.i.us, 0 br i1 %cmp1.not.i.us, label %if.end.i.us, label %if.then.i.us if.then.i.us: ; preds = %while.body.i.us %mul.i.us = mul nsw i64 %a.addr.012.i.us, %res.014.i.us %rem2.i.us = srem i64 %mul.i.us, 1000000007 br label %if.end.i.us if.end.i.us: ; preds = %if.then.i.us, %while.body.i.us %arrayidx.promoted.us = phi i64 [ %rem2.i.us, %if.then.i.us ], [ %res.014.i.us, %while.body.i.us ] %mul3.i.us = mul nsw i64 %a.addr.012.i.us, %a.addr.012.i.us %rem4.i.us = urem i64 %mul3.i.us, 1000000007 %div10.i.us = lshr i64 %n.addr.013.i.us, 1 %cmp.not.i.us = icmp ult i64 %n.addr.013.i.us, 2 br i1 %cmp.not.i.us, label %modpow.exit.loopexit.us, label %while.body.i.us, !llvm.loop !5 for.body9.us: ; preds = %modpow.exit.loopexit.us, %for.body9.us %6 = phi i64 [ %sub.us, %for.body9.us ], [ %arrayidx.promoted.us, %modpow.exit.loopexit.us ] %mul48.us = phi i64 [ %mul.us, %for.body9.us ], [ %mul45.us, %modpow.exit.loopexit.us ] %j.047.us = phi i64 [ %inc.us, %for.body9.us ], [ 2, %modpow.exit.loopexit.us ] %arrayidx12.us = getelementptr inbounds i64, ptr %vla, i64 %mul48.us %7 = load i64, ptr %arrayidx12.us, align 8, !tbaa !7 %sub.us = sub nsw i64 %6, %7 store i64 %sub.us, ptr %arrayidx.us, align 8, !tbaa !7 %inc.us = add nuw nsw i64 %j.047.us, 1 %mul.us = mul nsw i64 %inc.us, %indvars.iv54 %cmp6.not.us = icmp sgt i64 %mul.us, %2 br i1 %cmp6.not.us, label %for.cond.cleanup8.us, label %for.body9.us, !llvm.loop !11 for.cond.cleanup8.us: ; preds = %for.body9.us, %modpow.exit.loopexit.us %8 = phi i64 [ %arrayidx.promoted.us, %modpow.exit.loopexit.us ], [ %sub.us, %for.body9.us ] %cmp17.us = icmp sgt i64 %8, 1000000007 br i1 %cmp17.us, label %if.then.us, label %if.end.us if.then.us: ; preds = %for.cond.cleanup8.us %rem.us = urem i64 %8, 1000000007 store i64 %rem.us, ptr %arrayidx.us, align 8, !tbaa !7 br label %if.end.us if.end.us: ; preds = %if.then.us, %for.cond.cleanup8.us %9 = phi i64 [ %rem.us, %if.then.us ], [ %8, %for.cond.cleanup8.us ] %mul24.us = mul nsw i64 %9, %indvars.iv54 %rem25.us = srem i64 %mul24.us, 1000000007 %add26.us = add nsw i64 %rem25.us, %ans.050.us %indvars.iv.next55 = add nsw i64 %indvars.iv54, -1 %10 = and i64 %indvars.iv.next55, 4294967295 %cmp.not.us = icmp eq i64 %10, 0 br i1 %cmp.not.us, label %for.cond.cleanup, label %for.body.us, !llvm.loop !12 modpow.exit.loopexit.us: ; preds = %if.end.i.us %arrayidx.us = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv54 store i64 %arrayidx.promoted.us, ptr %arrayidx.us, align 8, !tbaa !7 %mul45.us = shl nsw i64 %indvars.iv54, 1 %cmp6.not46.us = icmp sgt i64 %mul45.us, %2 br i1 %cmp6.not46.us, label %for.cond.cleanup8.us, label %for.body9.us for.cond.cleanup: ; preds = %if.end, %if.end.us, %entry %ans.0.lcssa = phi i64 [ 0, %entry ], [ %add26.us, %if.end.us ], [ %add26, %if.end ] %rem29 = srem i64 %ans.0.lcssa, 1000000007 %call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %rem29) 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 %n) #5 ret i32 0 for.body: ; preds = %for.body.lr.ph, %if.end %indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ %5, %for.body.lr.ph ] %ans.050 = phi i64 [ %add26, %if.end ], [ 0, %for.body.lr.ph ] %arrayidx = getelementptr inbounds i64, ptr %vla, i64 %indvars.iv store i64 1, ptr %arrayidx, align 8, !tbaa !7 %mul45 = shl nsw i64 %indvars.iv, 1 %cmp6.not46 = icmp sgt i64 %mul45, %2 br i1 %cmp6.not46, label %if.end, label %for.body9 for.cond.cleanup8: ; preds = %for.body9 %cmp17 = icmp sgt i64 %sub, 1000000007 br i1 %cmp17, label %if.then, label %if.end for.body9: ; preds = %for.body, %for.body9 %11 = phi i64 [ %sub, %for.body9 ], [ 1, %for.body ] %mul48 = phi i64 [ %mul, %for.body9 ], [ %mul45, %for.body ] %j.047 = phi i64 [ %inc, %for.body9 ], [ 2, %for.body ] %arrayidx12 = getelementptr inbounds i64, ptr %vla, i64 %mul48 %12 = load i64, ptr %arrayidx12, align 8, !tbaa !7 %sub = sub nsw i64 %11, %12 store i64 %sub, ptr %arrayidx, align 8, !tbaa !7 %inc = add nuw nsw i64 %j.047, 1 %mul = mul nsw i64 %inc, %indvars.iv %cmp6.not = icmp sgt i64 %mul, %2 br i1 %cmp6.not, label %for.cond.cleanup8, label %for.body9, !llvm.loop !11 if.then: ; preds = %for.cond.cleanup8 %rem = urem i64 %sub, 1000000007 store i64 %rem, ptr %arrayidx, align 8, !tbaa !7 br label %if.end if.end: ; preds = %for.body, %if.then, %for.cond.cleanup8 %13 = phi i64 [ %rem, %if.then ], [ %sub, %for.cond.cleanup8 ], [ 1, %for.body ] %mul24 = mul nsw i64 %13, %indvars.iv %rem25 = srem i64 %mul24, 1000000007 %add26 = add nsw i64 %rem25, %ans.050 %indvars.iv.next = add nsw i64 %indvars.iv, -1 %14 = and i64 %indvars.iv.next, 4294967295 %cmp.not = icmp eq i64 %14, 0 br i1 %cmp.not, label %for.cond.cleanup, label %for.body, !llvm.loop !12 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare ptr @llvm.stacksave.p0() #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn declare void @llvm.stackrestore.p0(ptr) #4 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 = { mustprogress nocallback nofree nosync nounwind willreturn } 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"} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6}
#include <stdio.h> #define MAX 10001 int main() { int n; long int a,b; long int x,pre; int i; long int cost = 0; scanf("%d%ld%ld", &n, &a, &b); scanf("%ld", &x); pre = x; for(i = 0; i < n; i++){ long int dx; scanf("%ld", &x); dx = x - pre; if(dx*a >= b){ //テレポートの方が便利なら cost += b; } else{ cost += dx *a; } pre = x; } // for(i = 1; i < n; i++){ // dx = x[i] - x[i-1]; // // printf("%d ", dx); // // if(dx*a >= b){ //テレポートの方が便利なら // cost += b; // } else{ // cost += dx *a; // } // } printf("%ld", cost); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156502/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156502/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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%ld%ld\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %a = alloca i64, align 8 %b = alloca i64, align 8 %x = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %x) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %a, ptr noundef nonnull %b) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp11 = icmp sgt i32 %0, 0 br i1 %cmp11, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %pre.0.pre = load i64, ptr %x, align 8, !tbaa !9 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %pre.0 = phi i64 [ %1, %for.body ], [ %pre.0.pre, %for.body.preheader ] %cost.013 = phi i64 [ %cost.1, %for.body ], [ 0, %for.body.preheader ] %i.012 = phi i32 [ %inc, %for.body ], [ 0, %for.body.preheader ] %call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %x) %1 = load i64, ptr %x, align 8, !tbaa !9 %sub = sub nsw i64 %1, %pre.0 %2 = load i64, ptr %a, align 8, !tbaa !9 %mul = mul nsw i64 %sub, %2 %3 = load i64, ptr %b, align 8, !tbaa !9 %mul. = call i64 @llvm.smin.i64(i64 %mul, i64 %3) %cost.1 = add nsw i64 %mul., %cost.013 %inc = add nuw nsw i32 %i.012, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry %cost.0.lcssa = phi i64 [ 0, %entry ], [ %cost.1, %for.body ] %call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %cost.0.lcssa) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %x) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4 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 i64 @llvm.smin.i64(i64, i64) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !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"}
#pragma warning(disable:4996) #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <float.h> #pragma region 定義 #define i_cin(X) scanf("%d", &X) #define i_cin2(X,Y) scanf("%d %d",&X,&Y) #define i_cin4(X,Y,Z,W) scanf("%d %d %d %d",&X,&Y,&Z,&W) #define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z) #define l_cin(X) scanf("%ld",&X) #define f_cin(X) scanf("%f",&X) #define l_cin2(X,Y) scanf("%ld %ld",&X,&Y) #define s_cin(X) scanf("%s",&X) #define c_cin(X) scanf("%c",&X); #define ll_cin(X) scanf("%lld", &X) #define ull_cin(X) scanf("%llu", &X) #define lf_cin(X) scanf("%lf", &X) #define i_cout(X) printf("%d\n",X) #define f_cout(X) printf("%g\n",X) #define i_cout2(X,Y) printf("%d %d\n",X,Y) #define l_cout(X) printf("%ld\n",X) #define s_cout(X) printf("%s\n",X) #define s_coutc(X) printf("%s",X) #define c_cout(X) printf("%c",X) #define ll_cout(X) printf("%lld\n",X) #define ull_cout(X) printf("%llu\n",X) typedef long long ll; typedef unsigned long long ull; #define rept(x, s, n) for (int x = s; x < n; x++) #define S_RTN(S) s_cout(S);return 0 #define _itoa(A,N) sprintf(A, "%d", N); int i_cins(int n, int* A); int l_cins2(int n, long* A, long* B); int s_dsort(const void* a, const void* b); int s_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_asorts(const void* a, const void* b); //昇順 int s_asorts(const void* a, const void* b) { return(strcmp((char*)a, (char*)b)); } int s_dsort(const void* a, const void* b) { return(*(int*)b - *(int*)a); } int s_asort(const void* a, const void* b) { return(*(int*)a - *(int*)b); } int l_cins2(int n, long* a, long* b) { int i; rept(i, 0, n) { l_cin2(*(a + i), *(b + i)); } return 0; } int i_cins(int n, int* a) { int i; for (i = 0; i < n; i++) { i_cin(*(a + i)); } return 0; } int _gcd(int a, int b) { int r, tmp; if (a < b) { tmp = a; a = b; b = tmp; } r = a % b; while (r) { if (!r) break; a = b; b = r; r = a % b; } return(b); } // puts("Yes\n") puts("No\n") // scanf("%d.%d") 浮動小数点入力を整数2つで得る //#define pai 3.1415926535 #define deg_rad(X) (X*(M_PI/180)) long _max(long a, long b) { return a > b ? a : b; } long _min(long a, long b) { return a < b ? a : b; } int _swp(int* a, int* b) { int tmp; tmp = *b; *b = *a; *a = tmp; return 0; } 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; } #pragma endregion //ABC 95-C Half and Half //int main(void) { // long a, b, c, x, y; // long tmp; // scanf("%ld %ld %ld %ld %ld", &a, &b, &c, &x, &y); // c *= 2; // // /*if (a >= c) { // tmp=(long)x * c + ((y - x < 0) ? 0 :(long)(y - x) * b); // printf("%ld",tmp); // return 0; // } // if (b >= c) { // tmp =(long)y * c + ((x - y < 0) ? 0 : (long)(x - y) * b); // printf("%ld\n", tmp); // return 0; // }*/ // // if ((a + b) <= c) { // printf("%ld\n",a * x + b * y); // return 0; // } // // tmp = a * x + b * y; // if (c * _max(x, y) < tmp) { // printf("%ld\n",c* _max(x, y)); return 0; // } // // tmp = c * _min(x, y); // tmp += ((x < y) ? (y - x) * b :(x - y) * a); // printf("%ld\n", tmp); // return 0; //} int main(void) { int d, n; int i, tmp,cnt=0; i_cin2(d,n); switch(d){ case 0: i_cout((n==100)?101:n); break; case 1: i_cout((n == 100) ? 10100 : n*100); break; case 2: i_cout((n == 100) ? 1010000 : n*10000); break; } return 0; } // 162 D-RGB Triplets //static char s[4001]; //static int r[4000], g[4000], b[4000]; //int main(void) //{ // int n, i, j; // long cnt = 0; // int rp = 0, gp = 0, bp = 0; // // i_cin(n); // s_cin(s); //for (i = 0; i < n; i++) { // switch(s[i]) { // case'R': // r[rp] = i; rp++; break; // case 'G': // g[gp] = i; gp++; break; // case 'B': // b[bp] = i; bp++; break; // } //} // ////RBG R BG //printf("\n r:%d g:%d b:%d %ld", rp, gp, bp,rp*gp*bp); //printf("\n"); for (i = 0; i < rp; i++) printf("%d ",r[i]); //printf("\n"); for (i = 0; i < gp; i++) printf("%d ",g[i]); //printf("\n"); for (i = 0; i < bp; i++) printf("%d ",b[i]); //for (i = 0; i < rp; i++) { // for (j = 0; j < gp; j++) { // if (g[j] < r[i]) continue; // int rg; // rg = g[j] - r[i]; // for (int k = 0; k < bp; k++) { // if (b[k] < g[j])continue; // if (rg == b[k] - g[j]) continue; // cnt++; // } // } //} // // l_cout(cnt); // return 0; //} //066-B //157-C //int main(void) { // int n, m; // int s, c; // int a[3] = { -1,-1,-1 }; // int i, ans=0; // // i_cin2(n, m); // // if (m == 0 && n!=1) { i_cout(-1); return 0; } //???2つ目の条件なし // // for (i = 0; i < m; i++) { // i_cin2(s, c); // if ((a[s - 1] != -1) && //矛盾はないか // (a[s - 1] != c) ) { i_cout(-1); return 0; } // switch (n) { // case 1:if (s != 3) { i_cout(-1); return 0; } // break; // case 2:if (s == 1) { i_cout(-1); return 0; } // if (s == 2 && c == 0) // {i_cout(-1); return 0;} // break; // case 3: // if (s == 1 && c == 0) // {i_cout(-1); return 0;} // break; // } // a[s - 1] = c; // } // // for (i = 0; i < 3; i++) { // if (a[i] == -1) a[i] = 0; // } // ans = a[0] * 100 + a[1] * 10 + a[2]; // // i_cout(ans); // return 0; //}
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156546/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156546/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [3 x i8] c"%d\00", align 1 @pc = internal unnamed_addr global i64 0, align 8 @.str.2 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1 @.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @s_asorts(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 norecurse nosync 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 #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 @s_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 nounwind uwtable define dso_local i32 @l_cins2(i32 noundef %n, ptr noundef %a, ptr noundef %b) local_unnamed_addr #3 { entry: %cmp7 = icmp sgt i32 %n, 0 br i1 %cmp7, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.cond.cleanup: ; preds = %for.body, %entry ret i32 0 for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %add.ptr = getelementptr inbounds i64, ptr %a, i64 %indvars.iv %add.ptr3 = getelementptr inbounds i64, ptr %b, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %add.ptr, ptr noundef %add.ptr3) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #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 uwtable define dso_local i32 @i_cins(i32 noundef %n, ptr noundef %a) local_unnamed_addr #3 { entry: %cmp3 = icmp sgt i32 %n, 0 br i1 %cmp3, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %wide.trip.count = zext i32 %n to i64 br label %for.body for.body: ; preds = %for.body.preheader, %for.body %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %add.ptr = getelementptr inbounds i32, ptr %a, i64 %indvars.iv %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef %add.ptr) %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 !11 for.end: ; preds = %for.body, %entry ret i32 0 } ; Function Attrs: nofree nosync nounwind memory(none) uwtable define dso_local i32 @_gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #6 { entry: %spec.select = tail call i32 @llvm.smin.i32(i32 %a, i32 %b) %spec.select15 = tail call i32 @llvm.smax.i32(i32 %a, i32 %b) %rem = srem i32 %spec.select15, %spec.select %tobool.not16 = icmp eq i32 %rem, 0 br i1 %tobool.not16, label %while.end, label %if.end3 if.end3: ; preds = %entry, %if.end3 %r.018 = phi i32 [ %rem4, %if.end3 ], [ %rem, %entry ] %b.addr.117 = phi i32 [ %r.018, %if.end3 ], [ %spec.select, %entry ] %rem4 = srem i32 %b.addr.117, %r.018 %tobool.not = icmp eq i32 %rem4, 0 br i1 %tobool.not, label %while.end, label %if.end3, !llvm.loop !12 while.end: ; preds = %if.end3, %entry %b.addr.1.lcssa = phi i32 [ %spec.select, %entry ], [ %r.018, %if.end3 ] ret i32 %b.addr.1.lcssa } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @_max(i64 noundef %a, i64 noundef %b) local_unnamed_addr #7 { entry: %cond = tail call i64 @llvm.smax.i64(i64 %a, i64 %b) ret i64 %cond } ; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable define dso_local i64 @_min(i64 noundef %a, i64 noundef %b) local_unnamed_addr #7 { entry: %cond = tail call i64 @llvm.smin.i64(i64 %a, i64 %b) ret i64 %cond } ; 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 #8 { 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: nofree norecurse nosync nounwind memory(argmem: read) uwtable define dso_local i32 @_cknum(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #9 { 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 !13 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 !14 %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 #10 { 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 !14 %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) #11 ; Function Attrs: nofree nounwind memory(readwrite, argmem: write, inaccessiblemem: write) uwtable define dso_local i64 @_pfact(i64 noundef %a) local_unnamed_addr #12 { entry: br label %tailrecurse tailrecurse: ; preds = %tailrecurse.backedge, %entry %a.tr = phi i64 [ %a, %entry ], [ %div, %tailrecurse.backedge ] %0 = and i64 %a.tr, 1 %cmp = icmp eq i64 %0, 0 br i1 %cmp, label %tailrecurse.backedge, label %if.end tailrecurse.backedge: ; preds = %for.body, %tailrecurse %.sink = phi i64 [ 2, %tailrecurse ], [ %i.035, %for.body ] %1 = load i64, ptr @pc, align 8, !tbaa !15 %inc = add nsw i64 %1, 1 store i64 %inc, ptr @pc, align 8, !tbaa !15 %div = sdiv i64 %a.tr, %.sink br label %tailrecurse if.end: ; preds = %tailrecurse %conv = sitofp i64 %a.tr to double %call1 = tail call double @sqrt(double noundef %conv) #17 %conv2 = fptosi double %call1 to i64 %cmp3.not34 = icmp slt i64 %conv2, 3 br i1 %cmp3.not34, label %for.end, label %for.body for.body: ; preds = %if.end, %for.inc %i.035 = phi i64 [ %add, %for.inc ], [ 3, %if.end ] %rem5 = srem i64 %a.tr, %i.035 %cmp6 = icmp eq i64 %rem5, 0 br i1 %cmp6, label %tailrecurse.backedge, label %for.inc for.inc: ; preds = %for.body %add = add nuw nsw i64 %i.035, 2 %cmp3.not = icmp sgt i64 %add, %conv2 br i1 %cmp3.not, label %for.end, label %for.body, !llvm.loop !17 for.end: ; preds = %if.end, %for.inc %cmp14.not = icmp eq i64 %a.tr, 1 br i1 %cmp14.not, label %cleanup, label %if.then16 if.then16: ; preds = %for.end %2 = load i64, ptr @pc, align 8, !tbaa !15 %inc18 = add nsw i64 %2, 1 store i64 %inc18, ptr @pc, align 8, !tbaa !15 br label %cleanup cleanup: ; preds = %for.end, %if.then16 ret i64 0 } ; Function Attrs: mustprogress nofree nounwind willreturn memory(write) declare double @sqrt(double noundef) local_unnamed_addr #13 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %d = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #17 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #17 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %d, ptr noundef nonnull %n) %0 = load i32, ptr %d, align 4, !tbaa !5 switch i32 %0, label %sw.epilog [ i32 0, label %sw.bb i32 1, label %sw.bb2 i32 2, label %sw.bb9 ] sw.bb: ; preds = %entry %1 = load i32, ptr %n, align 4 %cmp = icmp eq i32 %1, 100 %cond = select i1 %cmp, i32 101, i32 %1 br label %sw.epilog.sink.split sw.bb2: ; preds = %entry %2 = load i32, ptr %n, align 4 %cmp3 = icmp eq i32 %2, 100 %mul = mul nsw i32 %2, 100 %cond7 = select i1 %cmp3, i32 10100, i32 %mul br label %sw.epilog.sink.split sw.bb9: ; preds = %entry %3 = load i32, ptr %n, align 4 %cmp10 = icmp eq i32 %3, 100 %mul13 = mul nsw i32 %3, 10000 %cond15 = select i1 %cmp10, i32 1010000, i32 %mul13 br label %sw.epilog.sink.split sw.epilog.sink.split: ; preds = %sw.bb, %sw.bb2, %sw.bb9 %cond15.sink = phi i32 [ %cond15, %sw.bb9 ], [ %cond7, %sw.bb2 ], [ %cond, %sw.bb ] %call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %cond15.sink) br label %sw.epilog sw.epilog: ; preds = %sw.epilog.sink.split, %entry call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #17 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #17 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5 ; Function Attrs: mustprogress nofree nounwind willreturn declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) 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 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #15 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 #7 = { 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 #8 = { 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 #9 = { 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 #10 = { 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 #11 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) } attributes #12 = { nofree nounwind memory(readwrite, argmem: write, inaccessiblemem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #13 = { 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 #14 = { 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 #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 = distinct !{!11, !10} !12 = distinct !{!12, !10} !13 = distinct !{!13, !10} !14 = !{!7, !7, i64 0} !15 = !{!16, !16, i64 0} !16 = !{!"long long", !7, i64 0} !17 = distinct !{!17, !10}
#include<stdio.h> int num(int n); const int number[10]={6,2,5,5,4,5,6,3,7,6}; int main() { int a,b,sum=0,i; scanf("%d%d",&a,&b); for(i=a;i<=b;i++) { sum+=num(i); } printf("%d",sum); return 0; } int num(int n) { int i,sum=0; if(n==0) return number[0]; while(n!=0) { i=n%10; sum+=number[i]; n/=10; } return sum; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15659/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15659/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @number = dso_local local_unnamed_addr constant [10 x i32] [i32 6, i32 2, i32 5, i32 5, i32 4, i32 5, i32 6, i32 3, i32 7, i32 6], align 16 @.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) #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.not6 = icmp sgt i32 %0, %1 br i1 %cmp.not6, label %for.end, label %for.body for.body: ; preds = %entry, %num.exit %i.08 = phi i32 [ %inc, %num.exit ], [ %0, %entry ] %sum.07 = phi i32 [ %add, %num.exit ], [ 0, %entry ] %cmp.i = icmp eq i32 %i.08, 0 br i1 %cmp.i, label %num.exit, label %while.body.i while.body.i: ; preds = %for.body, %while.body.i %sum.08.i = phi i32 [ %add.i, %while.body.i ], [ 0, %for.body ] %n.addr.07.i = phi i32 [ %div.i, %while.body.i ], [ %i.08, %for.body ] %rem.i = srem i32 %n.addr.07.i, 10 %idxprom.i = sext i32 %rem.i to i64 %arrayidx.i = getelementptr inbounds [10 x i32], ptr @number, i64 0, i64 %idxprom.i %2 = load i32, ptr %arrayidx.i, align 4, !tbaa !5 %add.i = add nsw i32 %2, %sum.08.i %div.i = sdiv i32 %n.addr.07.i, 10 %n.addr.07.off.i = add i32 %n.addr.07.i, 9 %cmp1.not.i = icmp ult i32 %n.addr.07.off.i, 19 br i1 %cmp1.not.i, label %num.exit, label %while.body.i, !llvm.loop !9 num.exit: ; preds = %while.body.i, %for.body %retval.0.i = phi i32 [ 6, %for.body ], [ %add.i, %while.body.i ] %add = add nsw i32 %retval.0.i, %sum.07 %inc = add i32 %i.08, 1 %exitcond.not = icmp eq i32 %i.08, %1 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11 for.end: ; preds = %num.exit, %entry %sum.0.lcssa = phi i32 [ 0, %entry ], [ %add, %num.exit ] %call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sum.0.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %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 norecurse nosync nounwind memory(none) uwtable define dso_local i32 @num(i32 noundef %n) local_unnamed_addr #3 { entry: %cmp = icmp eq i32 %n, 0 br i1 %cmp, label %cleanup, label %while.body while.body: ; preds = %entry, %while.body %sum.08 = phi i32 [ %add, %while.body ], [ 0, %entry ] %n.addr.07 = phi i32 [ %div, %while.body ], [ %n, %entry ] %rem = srem i32 %n.addr.07, 10 %idxprom = sext i32 %rem to i64 %arrayidx = getelementptr inbounds [10 x i32], ptr @number, i64 0, i64 %idxprom %0 = load i32, ptr %arrayidx, align 4, !tbaa !5 %add = add nsw i32 %0, %sum.08 %div = sdiv i32 %n.addr.07, 10 %n.addr.07.off = add i32 %n.addr.07, 9 %cmp1.not = icmp ult i32 %n.addr.07.off, 19 br i1 %cmp1.not, label %cleanup, label %while.body, !llvm.loop !9 cleanup: ; preds = %while.body, %entry %retval.0 = phi i32 [ 6, %entry ], [ %add, %while.body ] ret i32 %retval.0 } ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include<stdio.h> int main(void){ int D,N,i,s,t=1; scanf("%d %d",&D,&N); for(i=0;i<D;i++){ t*=100; } s=t*100; if(t*N % s ==0){ printf("%d\n",t*(N+1)); }else{ printf("%d\n",t*N); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156632/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156632/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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: %D = alloca i32, align 4 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #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 %D, ptr noundef nonnull %N) %0 = load i32, ptr %D, align 4, !tbaa !5 %cmp13 = icmp sgt i32 %0, 0 br i1 %cmp13, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %entry %min.iters.check = icmp ult i32 %0, 8 br i1 %min.iters.check, label %for.body.preheader17, label %vector.ph vector.ph: ; preds = %for.body.preheader %n.vec = and i32 %0, -8 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vec.phi = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %1, %vector.body ] %vec.phi16 = phi <4 x i32> [ <i32 1, i32 1, i32 1, i32 1>, %vector.ph ], [ %2, %vector.body ] %1 = mul <4 x i32> %vec.phi, <i32 100, i32 100, i32 100, i32 100> %2 = mul <4 x i32> %vec.phi16, <i32 100, i32 100, i32 100, i32 100> %index.next = add nuw i32 %index, 8 %3 = icmp eq i32 %index.next, %n.vec br i1 %3, label %middle.block, label %vector.body, !llvm.loop !9 middle.block: ; preds = %vector.body %bin.rdx = mul <4 x i32> %2, %1 %4 = call i32 @llvm.vector.reduce.mul.v4i32(<4 x i32> %bin.rdx) %cmp.n = icmp eq i32 %0, %n.vec br i1 %cmp.n, label %for.end, label %for.body.preheader17 for.body.preheader17: ; preds = %for.body.preheader, %middle.block %t.015.ph = phi i32 [ 1, %for.body.preheader ], [ %4, %middle.block ] %i.014.ph = phi i32 [ 0, %for.body.preheader ], [ %n.vec, %middle.block ] br label %for.body for.body: ; preds = %for.body.preheader17, %for.body %t.015 = phi i32 [ %mul, %for.body ], [ %t.015.ph, %for.body.preheader17 ] %i.014 = phi i32 [ %inc, %for.body ], [ %i.014.ph, %for.body.preheader17 ] %mul = mul nsw i32 %t.015, 100 %inc = add nuw nsw i32 %i.014, 1 %exitcond.not = icmp eq i32 %inc, %0 br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !13 for.end: ; preds = %for.body, %middle.block, %entry %t.0.lcssa = phi i32 [ 1, %entry ], [ %4, %middle.block ], [ %mul, %for.body ] %mul1 = mul nsw i32 %t.0.lcssa, 100 %5 = load i32, ptr %N, align 4, !tbaa !5 %mul2 = mul nsw i32 %5, %t.0.lcssa %rem = srem i32 %mul2, %mul1 %cmp3 = icmp eq i32 %rem, 0 %add = add nsw i32 %5, 1 %mul4 = mul nsw i32 %add, %t.0.lcssa %mul2.sink = select i1 %cmp3, i32 %mul4, i32 %mul2 %call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul2.sink) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.mul.v4i32(<4 x i32>) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10, !11, !12} !10 = !{!"llvm.loop.mustprogress"} !11 = !{!"llvm.loop.isvectorized", i32 1} !12 = !{!"llvm.loop.unroll.runtime.disable"} !13 = distinct !{!13, !10, !12, !11}
#include<stdio.h> int main() { int d,n; scanf("%d %d",&d,&n); if(d==0) { if(n<100)printf("%d\n",n); else if(n==100)printf("101\n"); } else { if(d==1) { if(n!=100)printf("%d\n",n*100); else if(n==100)printf("10100\n"); } else { if(n!=100)printf("%d\n",n*10000); else if(n==100)printf("1010000\n"); } } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156676/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156676/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @str = private unnamed_addr constant [8 x i8] c"1010000\00", align 1 @str.5 = private unnamed_addr constant [6 x i8] c"10100\00", align 1 @str.6 = private unnamed_addr constant [4 x i8] c"101\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %d = alloca i32, align 4 %n = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %d) #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 %d, ptr noundef nonnull %n) %0 = load i32, ptr %d, align 4, !tbaa !5 %1 = load i32, ptr %n, align 4, !tbaa !5 switch i32 %0, label %if.else20 [ i32 0, label %if.then i32 1, label %if.then10 ] if.then: ; preds = %entry %cmp1 = icmp slt i32 %1, 100 br i1 %cmp1, label %if.then2, label %if.else if.then2: ; preds = %if.then %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1) br label %if.end32 if.else: ; preds = %if.then %cmp4 = icmp eq i32 %1, 100 br i1 %cmp4, label %if.then5, label %if.end32 if.then5: ; preds = %if.else %puts37 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) br label %if.end32 if.then10: ; preds = %entry %cmp11.not = icmp eq i32 %1, 100 br i1 %cmp11.not, label %if.then16, label %if.then12 if.then12: ; preds = %if.then10 %mul = mul nsw i32 %1, 100 %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul) br label %if.end32 if.then16: ; preds = %if.then10 %puts36 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) br label %if.end32 if.else20: ; preds = %entry %cmp21.not = icmp eq i32 %1, 100 br i1 %cmp21.not, label %if.then27, label %if.then22 if.then22: ; preds = %if.else20 %mul23 = mul nsw i32 %1, 10000 %call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul23) br label %if.end32 if.then27: ; preds = %if.else20 %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) br label %if.end32 if.end32: ; preds = %if.then16, %if.then12, %if.then27, %if.then22, %if.then2, %if.then5, %if.else call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %d) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int d,n,ans ; int main(void){ scanf ("%d%d",&d,&n) ; if ( n==100 ){ n=101 ; } if ( d==0 ){ ans = n ; } else if ( d==1 ){ ans = n*100 ; } else if ( d==2 ){ ans = n*10000 ; } printf ("%d\n",ans) ; return 0 ; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156719/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156719/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @d = dso_local global i32 0, align 4 @n = dso_local global i32 0, align 4 @ans = dso_local local_unnamed_addr global i32 0, align 4 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @d, ptr noundef nonnull @n) %0 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp eq i32 %0, 100 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry store i32 101, ptr @n, align 4, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %1 = phi i32 [ 101, %if.then ], [ %0, %entry ] %2 = load i32, ptr @d, align 4, !tbaa !5 switch i32 %2, label %if.end.if.end11_crit_edge [ i32 0, label %if.then2 i32 1, label %if.then4 i32 2, label %if.then7 ] if.end.if.end11_crit_edge: ; preds = %if.end %.pre = load i32, ptr @ans, align 4, !tbaa !5 br label %if.end11 if.then2: ; preds = %if.end store i32 %1, ptr @ans, align 4, !tbaa !5 br label %if.end11 if.then4: ; preds = %if.end %mul = mul nsw i32 %1, 100 store i32 %mul, ptr @ans, align 4, !tbaa !5 br label %if.end11 if.then7: ; preds = %if.end %mul8 = mul nsw i32 %1, 10000 store i32 %mul8, ptr @ans, align 4, !tbaa !5 br label %if.end11 if.end11: ; preds = %if.end.if.end11_crit_edge, %if.then4, %if.then7, %if.then2 %3 = phi i32 [ %.pre, %if.end.if.end11_crit_edge ], [ %mul, %if.then4 ], [ %mul8, %if.then7 ], [ %1, %if.then2 ] %call12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <math.h> int d, n; int solve(){ switch(d){ case 0: if(n == 100) return 101; return n; case 1: if(n == 100) return 10100; return n * 100; case 2: if(n == 100) return 1010000; return n * 10000; } } int main() { scanf("%d%d", &d, &n); printf("%d\n", solve()); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156762/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156762/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @d = dso_local global i32 0, align 4 @n = dso_local global i32 0, align 4 @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable define dso_local i32 @solve() local_unnamed_addr #0 { entry: %0 = load i32, ptr @d, align 4, !tbaa !5 switch i32 %0, label %sw.epilog [ i32 0, label %sw.bb i32 1, label %sw.bb1 i32 2, label %sw.bb5 ] sw.bb: ; preds = %entry %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp = icmp eq i32 %1, 100 %. = select i1 %cmp, i32 101, i32 %1 br label %sw.epilog sw.bb1: ; preds = %entry %2 = load i32, ptr @n, align 4, !tbaa !5 %cmp2 = icmp eq i32 %2, 100 %mul = mul nsw i32 %2, 100 %spec.select = select i1 %cmp2, i32 10100, i32 %mul br label %sw.epilog sw.bb5: ; preds = %entry %3 = load i32, ptr @n, align 4, !tbaa !5 %cmp6 = icmp eq i32 %3, 100 %mul9 = mul nsw i32 %3, 10000 %spec.select12 = select i1 %cmp6, i32 1010000, i32 %mul9 br label %sw.epilog sw.epilog: ; preds = %sw.bb5, %sw.bb1, %sw.bb, %entry %retval.0 = phi i32 [ undef, %entry ], [ %., %sw.bb ], [ %spec.select, %sw.bb1 ], [ %spec.select12, %sw.bb5 ] 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 @d, ptr noundef nonnull @n) %0 = load i32, ptr @d, align 4, !tbaa !5 %1 = load i32, ptr @n, align 4, !tbaa !5 %cmp.i = icmp eq i32 %1, 100 switch i32 %0, label %unreachable [ i32 0, label %sw.bb.i i32 1, label %sw.bb1.i i32 2, label %sw.bb5.i ] sw.bb.i: ; preds = %entry %..i = select i1 %cmp.i, i32 101, i32 %1 br label %solve.exit sw.bb1.i: ; preds = %entry %mul.i = mul nsw i32 %1, 100 %spec.select.i = select i1 %cmp.i, i32 10100, i32 %mul.i br label %solve.exit sw.bb5.i: ; preds = %entry %mul9.i = mul nsw i32 %1, 10000 %spec.select12.i = select i1 %cmp.i, i32 1010000, i32 %mul9.i br label %solve.exit unreachable: ; preds = %entry unreachable solve.exit: ; preds = %sw.bb.i, %sw.bb1.i, %sw.bb5.i %retval.0.i = phi i32 [ %..i, %sw.bb.i ], [ %spec.select.i, %sw.bb1.i ], [ %spec.select12.i, %sw.bb5.i ] %call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i) 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 = { 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 #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"}
#include <stdio.h> #include <stdlib.h> int main(){ int D, N, a; scanf("%d%d", &D, &N); if(D == 0){ a = 1; } else if(D == 1){ a = 100; } else{ a = 10000; } if(N == 100){ printf("%d\n", 101 * a); } else{ printf("%d\n", N * a); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156812/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156812/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %D = alloca i32, align 4 %N = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %D) #3 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 %D, ptr noundef nonnull %N) %0 = load i32, ptr %D, align 4, !tbaa !5 %switch.selectcmp = icmp eq i32 %0, 1 %switch.select = select i1 %switch.selectcmp, i32 100, i32 10000 %switch.selectcmp14 = icmp eq i32 %0, 0 %switch.select15 = select i1 %switch.selectcmp14, i32 1, i32 %switch.select %1 = load i32, ptr %N, align 4, !tbaa !5 %cmp5 = icmp eq i32 %1, 100 %. = select i1 %cmp5, i32 101, i32 %1 %mul9 = mul nsw i32 %switch.select15, %. %call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul9) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %D) #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> #define R 100000 int dp[55][3005]; int main(){ int h,i,j,k,n,m,s,ans; while(1){ scanf("%d%d%d",&n,&m,&s); if(n+m+s==0)break; memset(dp,0,sizeof(dp)); ans=0; dp[0][0]=1; for(i=1;i<=m;i++){ for(j=n*n;j>0;j--){ for(k=i;k<=s;k++){ dp[j][k]+=dp[j-1][k-i]; dp[j][k]%=R; } } } printf("%d\n",dp[n*n][s]); } return 0; } //n×n-i+1
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156856/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156856/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1 @dp = dso_local local_unnamed_addr global [55 x [3005 x i32]] zeroinitializer, align 16 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i32, align 4 %m = alloca i32, align 4 %s = 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 void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4 %call56 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %s) %0 = load i32, ptr %n, align 4, !tbaa !5 %1 = load i32, ptr %m, align 4, !tbaa !5 %add57 = add nsw i32 %1, %0 %2 = load i32, ptr %s, align 4, !tbaa !5 %add158 = sub i32 0, %2 %cmp59 = icmp eq i32 %add57, %add158 br i1 %cmp59, label %while.end, label %if.end if.end: ; preds = %entry, %for.end25 %3 = phi i32 [ %52, %for.end25 ], [ %2, %entry ] %4 = phi i32 [ %51, %for.end25 ], [ %1, %entry ] %5 = phi i32 [ %50, %for.end25 ], [ %0, %entry ] call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(661100) @dp, i8 0, i64 661100, i1 false) store i32 1, ptr @dp, align 16, !tbaa !5 %cmp2.not47 = icmp slt i32 %4, 1 %.pre = mul i32 %5, %5 br i1 %cmp2.not47, label %for.end25, label %for.body.lr.ph for.body.lr.ph: ; preds = %if.end %cmp445.not = icmp eq i32 %5, 0 br i1 %cmp445.not, label %for.end25, label %for.body.us.preheader for.body.us.preheader: ; preds = %for.body.lr.ph %6 = add i32 %3, 1 %7 = zext i32 %.pre to i64 %8 = sext i32 %3 to i64 %9 = add nuw i32 %4, 1 %wide.trip.count70 = zext i32 %9 to i64 %wide.trip.count = zext i32 %6 to i64 %10 = mul nuw nsw i64 %7, 12020 %11 = shl nuw nsw i64 %wide.trip.count, 2 %12 = add i32 %.pre, -1 %13 = zext i32 %12 to i64 %14 = mul nuw nsw i64 %13, 12020 %15 = add nsw i64 %14, -4 %16 = add nsw i64 %15, %11 %17 = getelementptr i8, ptr @dp, i64 %14 %18 = getelementptr i8, ptr @dp, i64 %10 %19 = getelementptr i8, ptr %18, i64 %11 %gep = getelementptr i8, ptr getelementptr (i8, ptr @dp, i64 4), i64 %10 %bound1 = icmp ult ptr %17, %19 %20 = sub nsw i64 0, %wide.trip.count br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %for.cond3.for.inc23_crit_edge.us %indvar = phi i64 [ 0, %for.body.us.preheader ], [ %indvar.next, %for.cond3.for.inc23_crit_edge.us ] %indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %for.cond3.for.inc23_crit_edge.us ] %21 = xor i64 %indvar, -1 %22 = add i64 %21, %wide.trip.count %23 = shl nuw nsw i64 %indvar, 2 %24 = shl i64 %indvar, 2 %25 = sub i64 %16, %24 %cmp7.not43.us = icmp sgt i64 %indvars.iv, %8 br i1 %cmp7.not43.us, label %for.cond3.for.inc23_crit_edge.us, label %for.cond6.preheader.us50.preheader for.cond6.preheader.us50.preheader: ; preds = %for.body.us %min.iters.check = icmp ult i64 %22, 8 %26 = getelementptr i8, ptr @dp, i64 %25 %27 = getelementptr i8, ptr %gep, i64 %23 %bound0 = icmp ult ptr %27, %26 %found.conflict = and i1 %bound0, %bound1 %n.vec = and i64 %22, -8 %ind.end = add i64 %indvars.iv, %n.vec %cmp.n = icmp eq i64 %22, %n.vec br label %for.cond6.preheader.us50 for.body8.us: ; preds = %for.body8.us.prol.loopexit, %for.body8.us %indvars.iv62 = phi i64 [ %indvars.iv.next63.1, %for.body8.us ], [ %indvars.iv62.unr, %for.body8.us.prol.loopexit ] %28 = sub nuw nsw i64 %indvars.iv62, %indvars.iv %arrayidx11.us = getelementptr inbounds [55 x [3005 x i32]], ptr @dp, i64 0, i64 %idxprom.us, i64 %28 %29 = load i32, ptr %arrayidx11.us, align 4, !tbaa !5 %arrayidx15.us = getelementptr inbounds [55 x [3005 x i32]], ptr @dp, i64 0, i64 %indvars.iv66, i64 %indvars.iv62 %30 = load i32, ptr %arrayidx15.us, align 4, !tbaa !5 %add16.us = add nsw i32 %30, %29 %rem.us = srem i32 %add16.us, 100000 store i32 %rem.us, ptr %arrayidx15.us, align 4, !tbaa !5 %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1 %31 = sub nuw nsw i64 %indvars.iv.next63, %indvars.iv %arrayidx11.us.1 = getelementptr inbounds [55 x [3005 x i32]], ptr @dp, i64 0, i64 %idxprom.us, i64 %31 %32 = load i32, ptr %arrayidx11.us.1, align 4, !tbaa !5 %arrayidx15.us.1 = getelementptr inbounds [55 x [3005 x i32]], ptr @dp, i64 0, i64 %indvars.iv66, i64 %indvars.iv.next63 %33 = load i32, ptr %arrayidx15.us.1, align 4, !tbaa !5 %add16.us.1 = add nsw i32 %33, %32 %rem.us.1 = srem i32 %add16.us.1, 100000 store i32 %rem.us.1, ptr %arrayidx15.us.1, align 4, !tbaa !5 %indvars.iv.next63.1 = add nuw nsw i64 %indvars.iv62, 2 %exitcond.not.1 = icmp eq i64 %indvars.iv.next63.1, %wide.trip.count br i1 %exitcond.not.1, label %for.cond6.for.inc21_crit_edge.us, label %for.body8.us, !llvm.loop !9 for.cond6.preheader.us50: ; preds = %for.cond6.preheader.us50.preheader, %for.cond6.for.inc21_crit_edge.us %indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.cond6.for.inc21_crit_edge.us ], [ %7, %for.cond6.preheader.us50.preheader ] %indvars68 = trunc i64 %indvars.iv66 to i32 %sub.us = add i64 %indvars.iv66, 4294967295 %idxprom.us = and i64 %sub.us, 4294967295 %brmerge = select i1 %min.iters.check, i1 true, i1 %found.conflict br i1 %brmerge, label %for.body8.us.preheader, label %vector.body vector.body: ; preds = %for.cond6.preheader.us50, %vector.body %index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond6.preheader.us50 ] %offset.idx = add i64 %indvars.iv, %index %34 = getelementptr inbounds [55 x [3005 x i32]], ptr @dp, i64 0, i64 %idxprom.us, i64 %index %wide.load = load <4 x i32>, ptr %34, align 4, !tbaa !5, !alias.scope !12 %35 = getelementptr inbounds i32, ptr %34, i64 4 %wide.load77 = load <4 x i32>, ptr %35, align 4, !tbaa !5, !alias.scope !12 %36 = getelementptr inbounds [55 x [3005 x i32]], ptr @dp, i64 0, i64 %indvars.iv66, i64 %offset.idx %wide.load78 = load <4 x i32>, ptr %36, align 4, !tbaa !5, !alias.scope !15, !noalias !12 %37 = getelementptr inbounds i32, ptr %36, i64 4 %wide.load79 = load <4 x i32>, ptr %37, align 4, !tbaa !5, !alias.scope !15, !noalias !12 %38 = add nsw <4 x i32> %wide.load78, %wide.load %39 = add nsw <4 x i32> %wide.load79, %wide.load77 %40 = srem <4 x i32> %38, <i32 100000, i32 100000, i32 100000, i32 100000> %41 = srem <4 x i32> %39, <i32 100000, i32 100000, i32 100000, i32 100000> store <4 x i32> %40, ptr %36, align 4, !tbaa !5, !alias.scope !15, !noalias !12 store <4 x i32> %41, ptr %37, align 4, !tbaa !5, !alias.scope !15, !noalias !12 %index.next = add nuw i64 %index, 8 %42 = icmp eq i64 %index.next, %n.vec br i1 %42, label %middle.block, label %vector.body, !llvm.loop !17 middle.block: ; preds = %vector.body br i1 %cmp.n, label %for.cond6.for.inc21_crit_edge.us, label %for.body8.us.preheader for.body8.us.preheader: ; preds = %for.cond6.preheader.us50, %middle.block %indvars.iv62.ph = phi i64 [ %indvars.iv, %for.cond6.preheader.us50 ], [ %ind.end, %middle.block ] %43 = sub i64 %wide.trip.count, %indvars.iv62.ph %xtraiter = and i64 %43, 1 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body8.us.prol.loopexit, label %for.body8.us.prol for.body8.us.prol: ; preds = %for.body8.us.preheader %44 = sub nuw nsw i64 %indvars.iv62.ph, %indvars.iv %arrayidx11.us.prol = getelementptr inbounds [55 x [3005 x i32]], ptr @dp, i64 0, i64 %idxprom.us, i64 %44 %45 = load i32, ptr %arrayidx11.us.prol, align 4, !tbaa !5 %arrayidx15.us.prol = getelementptr inbounds [55 x [3005 x i32]], ptr @dp, i64 0, i64 %indvars.iv66, i64 %indvars.iv62.ph %46 = load i32, ptr %arrayidx15.us.prol, align 4, !tbaa !5 %add16.us.prol = add nsw i32 %46, %45 %rem.us.prol = srem i32 %add16.us.prol, 100000 store i32 %rem.us.prol, ptr %arrayidx15.us.prol, align 4, !tbaa !5 %indvars.iv.next63.prol = add nuw nsw i64 %indvars.iv62.ph, 1 br label %for.body8.us.prol.loopexit for.body8.us.prol.loopexit: ; preds = %for.body8.us.prol, %for.body8.us.preheader %indvars.iv62.unr = phi i64 [ %indvars.iv62.ph, %for.body8.us.preheader ], [ %indvars.iv.next63.prol, %for.body8.us.prol ] %47 = xor i64 %indvars.iv62.ph, %20 %48 = icmp eq i64 %47, -1 br i1 %48, label %for.cond6.for.inc21_crit_edge.us, label %for.body8.us for.cond6.for.inc21_crit_edge.us: ; preds = %for.body8.us.prol.loopexit, %for.body8.us, %middle.block %indvars.iv.next67 = add nsw i64 %indvars.iv66, -1 %cmp4.us53 = icmp sgt i32 %indvars68, 1 br i1 %cmp4.us53, label %for.cond6.preheader.us50, label %for.cond3.for.inc23_crit_edge.us, !llvm.loop !19 for.cond3.for.inc23_crit_edge.us: ; preds = %for.cond6.for.inc21_crit_edge.us, %for.body.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond71.not = icmp eq i64 %indvars.iv.next, %wide.trip.count70 %indvar.next = add i64 %indvar, 1 br i1 %exitcond71.not, label %for.end25, label %for.body.us, !llvm.loop !20 for.end25: ; preds = %for.cond3.for.inc23_crit_edge.us, %if.end, %for.body.lr.ph %mul26.pre-phi = phi i32 [ 0, %for.body.lr.ph ], [ %.pre, %if.end ], [ %.pre, %for.cond3.for.inc23_crit_edge.us ] %idxprom27 = zext i32 %mul26.pre-phi to i64 %idxprom29 = sext i32 %3 to i64 %arrayidx30 = getelementptr inbounds [55 x [3005 x i32]], ptr @dp, i64 0, i64 %idxprom27, i64 %idxprom29 %49 = load i32, ptr %arrayidx30, align 4, !tbaa !5 %call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %49) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %s) %50 = load i32, ptr %n, align 4, !tbaa !5 %51 = load i32, ptr %m, align 4, !tbaa !5 %add = add nsw i32 %51, %50 %52 = load i32, ptr %s, align 4, !tbaa !5 %add1 = sub i32 0, %52 %cmp = icmp eq i32 %add, %add1 br i1 %cmp, label %while.end, label %if.end while.end: ; preds = %for.end25, %entry 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 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!"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.isvectorized", i32 1} !12 = !{!13} !13 = distinct !{!13, !14} !14 = distinct !{!14, !"LVerDomain"} !15 = !{!16} !16 = distinct !{!16, !14} !17 = distinct !{!17, !10, !11, !18} !18 = !{!"llvm.loop.unroll.runtime.disable"} !19 = distinct !{!19, !10} !20 = distinct !{!20, !10}
#include<stdio.h> int main(void) { int i,j,k,l,n; long long a,b,c,d; scanf("%d",&n); for(i=0; i<n; i++) { scanf("%I64d %I64d %I64d",&a,&b,&c); d=(a+b+c)/2; printf("%I64d\n",d); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1569/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1569/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [18 x i8] c"%I64d %I64d %I64d\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%I64d\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 i64, align 8 %b = alloca i64, align 8 %c = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp5 = icmp sgt i32 %0, 0 br i1 %cmp5, label %for.body, label %for.end for.body: ; preds = %entry, %for.body %i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ] %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c) %1 = load i64, ptr %a, align 8, !tbaa !9 %2 = load i64, ptr %b, align 8, !tbaa !9 %add = add nsw i64 %2, %1 %3 = load i64, ptr %c, align 8, !tbaa !9 %add2 = add nsw i64 %add, %3 %div = sdiv i64 %add2, 2 %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %div) %inc = add nuw nsw i32 %i.06, 1 %4 = load i32, ptr %n, align 4, !tbaa !5 %cmp = icmp slt i32 %inc, %4 br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11 for.end: ; preds = %for.body, %entry call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #3 call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #3 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 = !{!10, !10, i64 0} !10 = !{!"long long", !7, i64 0} !11 = distinct !{!11, !12} !12 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #include<stdlib.h> int main() { int x[3]={1,0,0},t; char a,b; for(;~scanf(" %c,%c",&a,&b);) { //printf("[a-'A']=%d [b-'A']=%d\n",a-'A',b-'A'); t=x[a-'A']; x[a-'A']=x[b-'A']; x[b-'A']=t; // for(t=0;t<3;t++) // printf("%d ",x[t]); // puts(""); } for(t=0;t<3;t++) if(x[t]==1) printf("%c\n",'A'+t); exit(0); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_156957/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_156957/source.c" target datalayout = "e-m:e-p270: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.x = private unnamed_addr constant [3 x i32] [i32 1, i32 0, i32 0], align 4 @.str = private unnamed_addr constant [7 x i8] c" %c,%c\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: noreturn nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %x = alloca [3 x i32], align 4 %a = alloca i8, align 1 %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %x) #5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %x, ptr noundef nonnull align 4 dereferenceable(12) @__const.main.x, i64 12, i1 false) call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #5 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #5 %call26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %tobool.not27 = icmp eq i32 %call26, -1 br i1 %tobool.not27, label %if.then, label %for.body for.cond13.preheader: ; preds = %for.body %.pre = load i32, ptr %x, align 4, !tbaa !5 %0 = icmp eq i32 %.pre, 1 br i1 %0, label %if.then, label %for.inc for.body: ; preds = %entry, %for.body %1 = load i8, ptr %a, align 1, !tbaa !9 %conv = sext i8 %1 to i64 %sub = add nsw i64 %conv, -65 %arrayidx = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 %sub %2 = load i32, ptr %arrayidx, align 4, !tbaa !5 %3 = load i8, ptr %b, align 1, !tbaa !9 %conv1 = sext i8 %3 to i64 %sub2 = add nsw i64 %conv1, -65 %arrayidx4 = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 %sub2 %4 = load i32, ptr %arrayidx4, align 4, !tbaa !5 store i32 %4, ptr %arrayidx, align 4, !tbaa !5 store i32 %2, ptr %arrayidx4, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b) %tobool.not = icmp eq i32 %call, -1 br i1 %tobool.not, label %for.cond13.preheader, label %for.body, !llvm.loop !10 if.then: ; preds = %entry, %for.cond13.preheader %call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 65) br label %for.inc for.inc: ; preds = %for.cond13.preheader, %if.then %arrayidx17.1 = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 1 %5 = load i32, ptr %arrayidx17.1, align 4, !tbaa !5 %cmp18.1 = icmp eq i32 %5, 1 br i1 %cmp18.1, label %if.then.1, label %for.inc.1 if.then.1: ; preds = %for.inc %call20.1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 66) br label %for.inc.1 for.inc.1: ; preds = %if.then.1, %for.inc %arrayidx17.2 = getelementptr inbounds [3 x i32], ptr %x, i64 0, i64 2 %6 = load i32, ptr %arrayidx17.2, align 4, !tbaa !5 %cmp18.2 = icmp eq i32 %6, 1 br i1 %cmp18.2, label %if.then.2, label %for.inc.2 if.then.2: ; preds = %for.inc.1 %call20.2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 67) br label %for.inc.2 for.inc.2: ; preds = %if.then.2, %for.inc.1 call void @exit(i32 noundef 0) #6 unreachable } ; 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: noreturn nounwind declare void @exit(i32 noundef) local_unnamed_addr #4 attributes #0 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nounwind } attributes #6 = { noreturn nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #include <stdbool.h> #define conv(c) (int)(c-'A') void swap(bool *cup1, bool *cup2) { bool tmp = *cup1; *cup1 = *cup2; *cup2 = tmp; } int main() { char input_cup[10]; bool cups[3] = {true, false, false}; // while(~scanf("%c,%c", &cup1, &cup2)) while(fgets(input_cup, sizeof input_cup/sizeof input_cup[0], stdin)!=NULL) swap(&cups[conv(input_cup[0])], &cups[conv(input_cup[2])]); int i; for(i = 0; i < 3; ++i) if(cups[i]){ printf("%c\n", (char)('A'+i)); break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157020/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157020/source.c" target datalayout = "e-m:e-p270: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.cups = private unnamed_addr constant [3 x i8] c"\01\00\00", align 1 @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable define dso_local void @swap(ptr nocapture noundef %cup1, ptr nocapture noundef %cup2) local_unnamed_addr #0 { entry: %0 = load i8, ptr %cup1, align 1, !tbaa !5, !range !9, !noundef !10 %1 = load i8, ptr %cup2, align 1, !tbaa !5, !range !9, !noundef !10 store i8 %1, ptr %cup1, align 1, !tbaa !5 store i8 %0, ptr %cup2, align 1, !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: %input_cup = alloca [10 x i8], align 1 %cups = alloca [3 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %input_cup) #5 call void @llvm.lifetime.start.p0(i64 3, ptr nonnull %cups) #5 call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(3) %cups, ptr noundef nonnull align 1 dereferenceable(3) @__const.main.cups, i64 3, i1 false) %0 = load ptr, ptr @stdin, align 8, !tbaa !11 %call18 = call ptr @fgets(ptr noundef nonnull %input_cup, i32 noundef 10, ptr noundef %0) %cmp.not19 = icmp eq ptr %call18, null br i1 %cmp.not19, label %if.then, label %while.body.lr.ph while.body.lr.ph: ; preds = %entry %arrayidx2 = getelementptr inbounds [10 x i8], ptr %input_cup, i64 0, i64 2 br label %while.body for.cond.preheader: ; preds = %while.body %.pre = load i8, ptr %cups, align 1, !tbaa !5, !range !9 %1 = icmp eq i8 %.pre, 0 br i1 %1, label %for.inc, label %if.then while.body: ; preds = %while.body.lr.ph, %while.body %2 = load i8, ptr %input_cup, align 1, !tbaa !13 %conv = sext i8 %2 to i64 %sub = add nsw i64 %conv, -65 %arrayidx1 = getelementptr inbounds [3 x i8], ptr %cups, i64 0, i64 %sub %3 = load i8, ptr %arrayidx2, align 1, !tbaa !13 %conv3 = sext i8 %3 to i64 %sub4 = add nsw i64 %conv3, -65 %arrayidx6 = getelementptr inbounds [3 x i8], ptr %cups, i64 0, i64 %sub4 %4 = load i8, ptr %arrayidx1, align 1, !tbaa !5, !range !9, !noundef !10 %5 = load i8, ptr %arrayidx6, align 1, !tbaa !5, !range !9, !noundef !10 store i8 %5, ptr %arrayidx1, align 1, !tbaa !5 store i8 %4, ptr %arrayidx6, align 1, !tbaa !5 %6 = load ptr, ptr @stdin, align 8, !tbaa !11 %call = call ptr @fgets(ptr noundef nonnull %input_cup, i32 noundef 10, ptr noundef %6) %cmp.not = icmp eq ptr %call, null br i1 %cmp.not, label %for.cond.preheader, label %while.body, !llvm.loop !14 if.then: ; preds = %entry, %for.inc.1, %for.inc, %for.cond.preheader %i.020.lcssa.wide = phi i32 [ 65, %for.cond.preheader ], [ 66, %for.inc ], [ 67, %for.inc.1 ], [ 65, %entry ] %call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.020.lcssa.wide) br label %for.end for.inc: ; preds = %for.cond.preheader %arrayidx10.1 = getelementptr inbounds [3 x i8], ptr %cups, i64 0, i64 1 %7 = load i8, ptr %arrayidx10.1, align 1, !tbaa !5, !range !9, !noundef !10 %tobool.not.1 = icmp eq i8 %7, 0 br i1 %tobool.not.1, label %for.inc.1, label %if.then for.inc.1: ; preds = %for.inc %arrayidx10.2 = getelementptr inbounds [3 x i8], ptr %cups, i64 0, i64 2 %8 = load i8, ptr %arrayidx10.2, align 1, !tbaa !5, !range !9, !noundef !10 %tobool.not.2 = icmp eq i8 %8, 0 br i1 %tobool.not.2, label %for.end, label %if.then for.end: ; preds = %for.inc.1, %if.then call void @llvm.lifetime.end.p0(i64 3, ptr nonnull %cups) #5 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %input_cup) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3 ; Function Attrs: nofree nounwind declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 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 = { mustprogress nocallback nofree 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"_Bool", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{i8 0, i8 2} !10 = !{} !11 = !{!12, !12, i64 0} !12 = !{!"any pointer", !7, i64 0} !13 = !{!7, !7, i64 0} !14 = distinct !{!14, !15} !15 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> #define MAXN 2999 double S[MAXN+1][MAXN+1]; double A[MAXN+1]; double Coins(int n) { int i,j; double sum = 0; S[0][0] = 1; for ( i = 1; i <= n; i++ ) S[i][0] = S[i-1][0]*(1-A[i]); for ( i = 1; i <= n; i++ ) S[i][i] = S[i-1][i-1]*A[i]; for ( i = 1; i <= n; i++ ) { for ( j = 1; j < i; j++ ) { S[i][j] = S[i-1][j-1]*A[i]+S[i-1][j]*(1-A[i]); } } for ( i = n/2+1; i <= n; i++ ) sum += S[n][i]; return sum; } int main(void) { int i, n; scanf("%d", &n); for ( i = 1; i <= n; i++ ) scanf("%lf", &A[i]); printf("%.10f\n", Coins(n)); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157086/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157086/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @S = dso_local local_unnamed_addr global [3000 x [3000 x double]] zeroinitializer, align 16 @A = dso_local global [3000 x double] zeroinitializer, align 16 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1 @.str.2 = private unnamed_addr constant [7 x i8] c"%.10f\0A\00", align 1 ; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable define dso_local double @Coins(i32 noundef %n) local_unnamed_addr #0 { entry: store double 1.000000e+00, ptr @S, align 16, !tbaa !5 %cmp.not104 = icmp slt i32 %n, 1 br i1 %cmp.not104, label %for.end60, label %for.body.preheader for.body.preheader: ; preds = %entry %0 = add nuw i32 %n, 1 %wide.trip.count = zext i32 %0 to i64 %1 = add nsw i64 %wide.trip.count, -1 %2 = add nsw i64 %wide.trip.count, -2 %xtraiter = and i64 %1, 1 %3 = icmp eq i64 %2, 0 br i1 %3, label %for.cond8.preheader.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i64 %1, -2 br label %for.body for.cond8.preheader.unr-lcssa: ; preds = %for.body, %for.body.preheader %.unr = phi double [ 1.000000e+00, %for.body.preheader ], [ %mul.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.cond8.preheader, label %for.body.epil for.body.epil: ; preds = %for.cond8.preheader.unr-lcssa %arrayidx3.epil = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv.unr %4 = load double, ptr %arrayidx3.epil, align 8, !tbaa !5 %sub4.epil = fsub double 1.000000e+00, %4 %mul.epil = fmul double %.unr, %sub4.epil %arrayidx6.epil = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv.unr store double %mul.epil, ptr %arrayidx6.epil, align 16, !tbaa !5 br label %for.cond8.preheader for.cond8.preheader: ; preds = %for.cond8.preheader.unr-lcssa, %for.body.epil br i1 %cmp.not104, label %for.end60, label %for.body10.preheader for.body10.preheader: ; preds = %for.cond8.preheader %xtraiter142 = and i64 %1, 1 %5 = icmp eq i64 %2, 0 br i1 %5, label %for.cond27.preheader.unr-lcssa, label %for.body10.preheader.new for.body10.preheader.new: ; preds = %for.body10.preheader %unroll_iter145 = and i64 %1, -2 br label %for.body10 for.body: ; preds = %for.body, %for.body.preheader.new %6 = phi double [ 1.000000e+00, %for.body.preheader.new ], [ %mul.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 ] %arrayidx3 = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv %7 = load double, ptr %arrayidx3, align 8, !tbaa !5 %sub4 = fsub double 1.000000e+00, %7 %mul = fmul double %6, %sub4 %arrayidx6 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv store double %mul, ptr %arrayidx6, align 16, !tbaa !5 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %arrayidx3.1 = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv.next %8 = load double, ptr %arrayidx3.1, align 8, !tbaa !5 %sub4.1 = fsub double 1.000000e+00, %8 %mul.1 = fmul double %mul, %sub4.1 %arrayidx6.1 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv.next store double %mul.1, ptr %arrayidx6.1, align 16, !tbaa !5 %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.cond8.preheader.unr-lcssa, label %for.body, !llvm.loop !9 for.cond27.preheader.unr-lcssa: ; preds = %for.body10, %for.body10.preheader %.unr143 = phi double [ 1.000000e+00, %for.body10.preheader ], [ %mul19.1, %for.body10 ] %indvars.iv117.unr = phi i64 [ 1, %for.body10.preheader ], [ %indvars.iv.next118.1, %for.body10 ] %lcmp.mod144.not = icmp eq i64 %xtraiter142, 0 br i1 %lcmp.mod144.not, label %for.cond27.preheader, label %for.body10.epil for.body10.epil: ; preds = %for.cond27.preheader.unr-lcssa %arrayidx18.epil = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv117.unr %9 = load double, ptr %arrayidx18.epil, align 8, !tbaa !5 %mul19.epil = fmul double %.unr143, %9 %arrayidx23.epil = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv117.unr, i64 %indvars.iv117.unr store double %mul19.epil, ptr %arrayidx23.epil, align 8, !tbaa !5 br label %for.cond27.preheader for.cond27.preheader: ; preds = %for.cond27.preheader.unr-lcssa, %for.body10.epil br i1 %cmp.not104, label %for.end60, label %for.cond30.preheader.preheader for.cond30.preheader.preheader: ; preds = %for.cond27.preheader %10 = add nuw i32 %n, 1 %wide.trip.count133 = zext i32 %10 to i64 br label %for.cond30.preheader for.body10: ; preds = %for.body10, %for.body10.preheader.new %11 = phi double [ 1.000000e+00, %for.body10.preheader.new ], [ %mul19.1, %for.body10 ] %indvars.iv117 = phi i64 [ 1, %for.body10.preheader.new ], [ %indvars.iv.next118.1, %for.body10 ] %niter146 = phi i64 [ 0, %for.body10.preheader.new ], [ %niter146.next.1, %for.body10 ] %arrayidx18 = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv117 %12 = load double, ptr %arrayidx18, align 8, !tbaa !5 %mul19 = fmul double %11, %12 %arrayidx23 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv117, i64 %indvars.iv117 store double %mul19, ptr %arrayidx23, align 8, !tbaa !5 %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1 %arrayidx18.1 = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv.next118 %13 = load double, ptr %arrayidx18.1, align 8, !tbaa !5 %mul19.1 = fmul double %mul19, %13 %arrayidx23.1 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv.next118, i64 %indvars.iv.next118 store double %mul19.1, ptr %arrayidx23.1, align 8, !tbaa !5 %indvars.iv.next118.1 = add nuw nsw i64 %indvars.iv117, 2 %niter146.next.1 = add i64 %niter146, 2 %niter146.ncmp.1 = icmp eq i64 %niter146.next.1, %unroll_iter145 br i1 %niter146.ncmp.1, label %for.cond27.preheader.unr-lcssa, label %for.body10, !llvm.loop !11 for.cond30.preheader: ; preds = %for.cond30.preheader.preheader, %for.inc58 %indvar = phi i64 [ 0, %for.cond30.preheader.preheader ], [ %indvar.next, %for.inc58 ] %indvars.iv129 = phi i64 [ 1, %for.cond30.preheader.preheader ], [ %indvars.iv.next130, %for.inc58 ] %cmp31108 = icmp ugt i64 %indvars.iv129, 1 br i1 %cmp31108, label %for.body32.lr.ph, label %for.inc58 for.body32.lr.ph: ; preds = %for.cond30.preheader %14 = add nsw i64 %indvars.iv129, -1 %arrayidx40 = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv129 %15 = load double, ptr %arrayidx40, align 8, !tbaa !5 %sub49 = fsub double 1.000000e+00, %15 %arrayidx38.phi.trans.insert = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %14, i64 0 %.pre = load double, ptr %arrayidx38.phi.trans.insert, align 16, !tbaa !5 %min.iters.check = icmp ult i64 %indvar, 2 br i1 %min.iters.check, label %for.body32.preheader, label %vector.ph vector.ph: ; preds = %for.body32.lr.ph %n.vec = and i64 %indvar, -2 %ind.end = or i64 %indvar, 1 %vector.recur.init = insertelement <2 x double> poison, double %.pre, i64 1 %broadcast.splatinsert = insertelement <2 x double> poison, double %sub49, i64 0 %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer %broadcast.splatinsert140 = insertelement <2 x double> poison, double %15, i64 0 %broadcast.splat141 = shufflevector <2 x double> %broadcast.splatinsert140, <2 x double> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <2 x double> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ] %offset.idx = or i64 %index, 1 %16 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %14, i64 %offset.idx %wide.load = load <2 x double>, ptr %16, align 8, !tbaa !5 %17 = shufflevector <2 x double> %vector.recur, <2 x double> %wide.load, <2 x i32> <i32 1, i32 2> %18 = fmul <2 x double> %wide.load, %broadcast.splat %19 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %17, <2 x double> %broadcast.splat141, <2 x double> %18) %20 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv129, i64 %offset.idx store <2 x double> %19, ptr %20, align 8, !tbaa !5 %index.next = add nuw i64 %index, 2 %21 = icmp eq i64 %index.next, %n.vec br i1 %21, label %middle.block, label %vector.body, !llvm.loop !12 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %indvar, %n.vec %vector.recur.extract = extractelement <2 x double> %wide.load, i64 1 br i1 %cmp.n, label %for.inc58, label %for.body32.preheader for.body32.preheader: ; preds = %for.body32.lr.ph, %middle.block %scalar.recur.ph = phi double [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body32.lr.ph ] %indvars.iv123.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body32.lr.ph ] br label %for.body32 for.body32: ; preds = %for.body32.preheader, %for.body32 %scalar.recur = phi double [ %22, %for.body32 ], [ %scalar.recur.ph, %for.body32.preheader ] %indvars.iv123 = phi i64 [ %indvars.iv.next124, %for.body32 ], [ %indvars.iv123.ph, %for.body32.preheader ] %arrayidx46 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %14, i64 %indvars.iv123 %22 = load double, ptr %arrayidx46, align 8, !tbaa !5 %mul50 = fmul double %22, %sub49 %23 = tail call double @llvm.fmuladd.f64(double %scalar.recur, double %15, double %mul50) %arrayidx54 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv129, i64 %indvars.iv123 store double %23, ptr %arrayidx54, align 8, !tbaa !5 %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1 %exitcond128.not = icmp eq i64 %indvars.iv.next124, %indvars.iv129 br i1 %exitcond128.not, label %for.inc58, label %for.body32, !llvm.loop !15 for.inc58: ; preds = %for.body32, %middle.block, %for.cond30.preheader %indvars.iv.next130 = add nuw nsw i64 %indvars.iv129, 1 %exitcond134.not = icmp eq i64 %indvars.iv.next130, %wide.trip.count133 %indvar.next = add i64 %indvar, 1 br i1 %exitcond134.not, label %for.end60, label %for.cond30.preheader, !llvm.loop !16 for.end60: ; preds = %for.inc58, %entry, %for.cond8.preheader, %for.cond27.preheader %div = sdiv i32 %n, 2 %cmp62.not.not112 = icmp slt i32 %div, %n br i1 %cmp62.not.not112, label %for.body63.lr.ph, label %for.end71 for.body63.lr.ph: ; preds = %for.end60 %idxprom64 = sext i32 %n to i64 %24 = sext i32 %div to i64 %25 = sub nsw i64 %idxprom64, %24 %26 = xor i64 %24, -1 %27 = add nsw i64 %26, %idxprom64 %xtraiter147 = and i64 %25, 3 %lcmp.mod148.not = icmp eq i64 %xtraiter147, 0 br i1 %lcmp.mod148.not, label %for.body63.prol.loopexit, label %for.body63.prol for.body63.prol: ; preds = %for.body63.lr.ph, %for.body63.prol %indvars.iv135.prol = phi i64 [ %indvars.iv.next136.prol, %for.body63.prol ], [ %24, %for.body63.lr.ph ] %sum.0114.prol = phi double [ %add68.prol, %for.body63.prol ], [ 0.000000e+00, %for.body63.lr.ph ] %prol.iter = phi i64 [ %prol.iter.next, %for.body63.prol ], [ 0, %for.body63.lr.ph ] %indvars.iv.next136.prol = add nsw i64 %indvars.iv135.prol, 1 %arrayidx67.prol = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %idxprom64, i64 %indvars.iv.next136.prol %28 = load double, ptr %arrayidx67.prol, align 8, !tbaa !5 %add68.prol = fadd double %sum.0114.prol, %28 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter147 br i1 %prol.iter.cmp.not, label %for.body63.prol.loopexit, label %for.body63.prol, !llvm.loop !17 for.body63.prol.loopexit: ; preds = %for.body63.prol, %for.body63.lr.ph %add68.lcssa.unr = phi double [ undef, %for.body63.lr.ph ], [ %add68.prol, %for.body63.prol ] %indvars.iv135.unr = phi i64 [ %24, %for.body63.lr.ph ], [ %indvars.iv.next136.prol, %for.body63.prol ] %sum.0114.unr = phi double [ 0.000000e+00, %for.body63.lr.ph ], [ %add68.prol, %for.body63.prol ] %29 = icmp ult i64 %27, 3 br i1 %29, label %for.end71, label %for.body63 for.body63: ; preds = %for.body63.prol.loopexit, %for.body63 %indvars.iv135 = phi i64 [ %indvars.iv.next136.3, %for.body63 ], [ %indvars.iv135.unr, %for.body63.prol.loopexit ] %sum.0114 = phi double [ %add68.3, %for.body63 ], [ %sum.0114.unr, %for.body63.prol.loopexit ] %indvars.iv.next136 = add nsw i64 %indvars.iv135, 1 %arrayidx67 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %idxprom64, i64 %indvars.iv.next136 %30 = load double, ptr %arrayidx67, align 8, !tbaa !5 %add68 = fadd double %sum.0114, %30 %indvars.iv.next136.1 = add nsw i64 %indvars.iv135, 2 %arrayidx67.1 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %idxprom64, i64 %indvars.iv.next136.1 %31 = load double, ptr %arrayidx67.1, align 8, !tbaa !5 %add68.1 = fadd double %add68, %31 %indvars.iv.next136.2 = add nsw i64 %indvars.iv135, 3 %arrayidx67.2 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %idxprom64, i64 %indvars.iv.next136.2 %32 = load double, ptr %arrayidx67.2, align 8, !tbaa !5 %add68.2 = fadd double %add68.1, %32 %indvars.iv.next136.3 = add nsw i64 %indvars.iv135, 4 %arrayidx67.3 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %idxprom64, i64 %indvars.iv.next136.3 %33 = load double, ptr %arrayidx67.3, align 8, !tbaa !5 %add68.3 = fadd double %add68.2, %33 %exitcond139.not.3 = icmp eq i64 %indvars.iv.next136.3, %idxprom64 br i1 %exitcond139.not.3, label %for.end71, label %for.body63, !llvm.loop !19 for.end71: ; preds = %for.body63.prol.loopexit, %for.body63, %for.end60 %sum.0.lcssa = phi double [ 0.000000e+00, %for.end60 ], [ %add68.lcssa.unr, %for.body63.prol.loopexit ], [ %add68.3, %for.body63 ] ret double %sum.0.lcssa } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) declare double @llvm.fmuladd.f64(double, double, double) #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #3 { entry: %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 !20 %cmp.not6 = icmp slt i32 %0, 1 br i1 %cmp.not6, label %for.end.thread, label %for.body for.end.thread: ; preds = %entry store double 1.000000e+00, ptr @S, align 16, !tbaa !5 br label %for.end60.i for.body: ; preds = %entry, %for.body %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ] %arrayidx = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx) %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %1 = load i32, ptr %n, align 4, !tbaa !20 %2 = sext i32 %1 to i64 %cmp.not.not = icmp slt i64 %indvars.iv, %2 br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !22 for.end: ; preds = %for.body store double 1.000000e+00, ptr @S, align 16, !tbaa !5 %cmp.not104.i = icmp slt i32 %1, 1 br i1 %cmp.not104.i, label %for.end60.i, label %for.body.preheader.i for.body.preheader.i: ; preds = %for.end %3 = add nuw nsw i32 %1, 1 %wide.trip.count.i = zext i32 %3 to i64 %4 = add nsw i64 %wide.trip.count.i, -1 %5 = add nsw i64 %wide.trip.count.i, -2 %xtraiter = and i64 %4, 1 %6 = icmp eq i64 %5, 0 br i1 %6, label %for.body10.i.preheader.unr-lcssa, label %for.body.preheader.i.new for.body.preheader.i.new: ; preds = %for.body.preheader.i %unroll_iter = and i64 %4, -2 br label %for.body.i for.body.i: ; preds = %for.body.i, %for.body.preheader.i.new %7 = phi double [ 1.000000e+00, %for.body.preheader.i.new ], [ %mul.i.1, %for.body.i ] %indvars.iv.i = phi i64 [ 1, %for.body.preheader.i.new ], [ %indvars.iv.next.i.1, %for.body.i ] %niter = phi i64 [ 0, %for.body.preheader.i.new ], [ %niter.next.1, %for.body.i ] %arrayidx3.i = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv.i %8 = load double, ptr %arrayidx3.i, align 8, !tbaa !5 %sub4.i = fsub double 1.000000e+00, %8 %mul.i = fmul double %7, %sub4.i %arrayidx6.i = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv.i store double %mul.i, ptr %arrayidx6.i, align 16, !tbaa !5 %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1 %arrayidx3.i.1 = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv.next.i %9 = load double, ptr %arrayidx3.i.1, align 8, !tbaa !5 %sub4.i.1 = fsub double 1.000000e+00, %9 %mul.i.1 = fmul double %mul.i, %sub4.i.1 %arrayidx6.i.1 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv.next.i store double %mul.i.1, ptr %arrayidx6.i.1, align 16, !tbaa !5 %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 2 %niter.next.1 = add i64 %niter, 2 %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter br i1 %niter.ncmp.1, label %for.body10.i.preheader.unr-lcssa, label %for.body.i, !llvm.loop !9 for.body10.i.preheader.unr-lcssa: ; preds = %for.body.i, %for.body.preheader.i %.unr = phi double [ 1.000000e+00, %for.body.preheader.i ], [ %mul.i.1, %for.body.i ] %indvars.iv.i.unr = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i.1, %for.body.i ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.body10.i.preheader, label %for.body.i.epil for.body.i.epil: ; preds = %for.body10.i.preheader.unr-lcssa %arrayidx3.i.epil = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv.i.unr %10 = load double, ptr %arrayidx3.i.epil, align 8, !tbaa !5 %sub4.i.epil = fsub double 1.000000e+00, %10 %mul.i.epil = fmul double %.unr, %sub4.i.epil %arrayidx6.i.epil = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv.i.unr store double %mul.i.epil, ptr %arrayidx6.i.epil, align 16, !tbaa !5 br label %for.body10.i.preheader for.body10.i.preheader: ; preds = %for.body10.i.preheader.unr-lcssa, %for.body.i.epil %xtraiter15 = and i64 %4, 1 %11 = icmp eq i64 %5, 0 br i1 %11, label %for.cond30.preheader.i.preheader.unr-lcssa, label %for.body10.i.preheader.new for.body10.i.preheader.new: ; preds = %for.body10.i.preheader %unroll_iter18 = and i64 %4, -2 br label %for.body10.i for.body10.i: ; preds = %for.body10.i, %for.body10.i.preheader.new %12 = phi double [ 1.000000e+00, %for.body10.i.preheader.new ], [ %mul19.i.1, %for.body10.i ] %indvars.iv117.i = phi i64 [ 1, %for.body10.i.preheader.new ], [ %indvars.iv.next118.i.1, %for.body10.i ] %niter19 = phi i64 [ 0, %for.body10.i.preheader.new ], [ %niter19.next.1, %for.body10.i ] %arrayidx18.i = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv117.i %13 = load double, ptr %arrayidx18.i, align 8, !tbaa !5 %mul19.i = fmul double %12, %13 %arrayidx23.i = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv117.i, i64 %indvars.iv117.i store double %mul19.i, ptr %arrayidx23.i, align 8, !tbaa !5 %indvars.iv.next118.i = add nuw nsw i64 %indvars.iv117.i, 1 %arrayidx18.i.1 = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv.next118.i %14 = load double, ptr %arrayidx18.i.1, align 8, !tbaa !5 %mul19.i.1 = fmul double %mul19.i, %14 %arrayidx23.i.1 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv.next118.i, i64 %indvars.iv.next118.i store double %mul19.i.1, ptr %arrayidx23.i.1, align 8, !tbaa !5 %indvars.iv.next118.i.1 = add nuw nsw i64 %indvars.iv117.i, 2 %niter19.next.1 = add i64 %niter19, 2 %niter19.ncmp.1 = icmp eq i64 %niter19.next.1, %unroll_iter18 br i1 %niter19.ncmp.1, label %for.cond30.preheader.i.preheader.unr-lcssa, label %for.body10.i, !llvm.loop !11 for.cond30.preheader.i.preheader.unr-lcssa: ; preds = %for.body10.i, %for.body10.i.preheader %.unr16 = phi double [ 1.000000e+00, %for.body10.i.preheader ], [ %mul19.i.1, %for.body10.i ] %indvars.iv117.i.unr = phi i64 [ 1, %for.body10.i.preheader ], [ %indvars.iv.next118.i.1, %for.body10.i ] %lcmp.mod17.not = icmp eq i64 %xtraiter15, 0 br i1 %lcmp.mod17.not, label %for.cond30.preheader.i.preheader, label %for.body10.i.epil for.body10.i.epil: ; preds = %for.cond30.preheader.i.preheader.unr-lcssa %arrayidx18.i.epil = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv117.i.unr %15 = load double, ptr %arrayidx18.i.epil, align 8, !tbaa !5 %mul19.i.epil = fmul double %.unr16, %15 %arrayidx23.i.epil = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv117.i.unr, i64 %indvars.iv117.i.unr store double %mul19.i.epil, ptr %arrayidx23.i.epil, align 8, !tbaa !5 br label %for.cond30.preheader.i.preheader for.cond30.preheader.i.preheader: ; preds = %for.cond30.preheader.i.preheader.unr-lcssa, %for.body10.i.epil br label %for.cond30.preheader.i for.cond30.preheader.i: ; preds = %for.cond30.preheader.i.preheader, %for.inc58.i %indvar = phi i64 [ %indvar.next, %for.inc58.i ], [ 0, %for.cond30.preheader.i.preheader ] %indvars.iv129.i = phi i64 [ %indvars.iv.next130.i, %for.inc58.i ], [ 1, %for.cond30.preheader.i.preheader ] %cmp31108.i = icmp ugt i64 %indvars.iv129.i, 1 br i1 %cmp31108.i, label %for.body32.lr.ph.i, label %for.inc58.i for.body32.lr.ph.i: ; preds = %for.cond30.preheader.i %16 = add nsw i64 %indvars.iv129.i, -1 %arrayidx40.i = getelementptr inbounds [3000 x double], ptr @A, i64 0, i64 %indvars.iv129.i %17 = load double, ptr %arrayidx40.i, align 8, !tbaa !5 %sub49.i = fsub double 1.000000e+00, %17 %arrayidx38.phi.trans.insert.i = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %16, i64 0 %.pre.i = load double, ptr %arrayidx38.phi.trans.insert.i, align 16, !tbaa !5 %min.iters.check = icmp ult i64 %indvar, 2 br i1 %min.iters.check, label %for.body32.i.preheader, label %vector.ph vector.ph: ; preds = %for.body32.lr.ph.i %n.vec = and i64 %indvar, -2 %ind.end = or i64 %indvar, 1 %vector.recur.init = insertelement <2 x double> poison, double %.pre.i, i64 1 %broadcast.splatinsert = insertelement <2 x double> poison, double %sub49.i, i64 0 %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer %broadcast.splatinsert13 = insertelement <2 x double> poison, double %17, i64 0 %broadcast.splat14 = shufflevector <2 x double> %broadcast.splatinsert13, <2 x double> poison, <2 x i32> zeroinitializer br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %vector.recur = phi <2 x double> [ %vector.recur.init, %vector.ph ], [ %wide.load, %vector.body ] %offset.idx = or i64 %index, 1 %18 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %16, i64 %offset.idx %wide.load = load <2 x double>, ptr %18, align 8, !tbaa !5 %19 = shufflevector <2 x double> %vector.recur, <2 x double> %wide.load, <2 x i32> <i32 1, i32 2> %20 = fmul <2 x double> %broadcast.splat, %wide.load %21 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %19, <2 x double> %broadcast.splat14, <2 x double> %20) %22 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv129.i, i64 %offset.idx store <2 x double> %21, ptr %22, align 8, !tbaa !5 %index.next = add nuw i64 %index, 2 %23 = icmp eq i64 %index.next, %n.vec br i1 %23, label %middle.block, label %vector.body, !llvm.loop !23 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %indvar, %n.vec %vector.recur.extract = extractelement <2 x double> %wide.load, i64 1 br i1 %cmp.n, label %for.inc58.i, label %for.body32.i.preheader for.body32.i.preheader: ; preds = %for.body32.lr.ph.i, %middle.block %scalar.recur.ph = phi double [ %vector.recur.extract, %middle.block ], [ %.pre.i, %for.body32.lr.ph.i ] %indvars.iv123.i.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body32.lr.ph.i ] br label %for.body32.i for.body32.i: ; preds = %for.body32.i.preheader, %for.body32.i %scalar.recur = phi double [ %24, %for.body32.i ], [ %scalar.recur.ph, %for.body32.i.preheader ] %indvars.iv123.i = phi i64 [ %indvars.iv.next124.i, %for.body32.i ], [ %indvars.iv123.i.ph, %for.body32.i.preheader ] %arrayidx46.i = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %16, i64 %indvars.iv123.i %24 = load double, ptr %arrayidx46.i, align 8, !tbaa !5 %mul50.i = fmul double %sub49.i, %24 %25 = call double @llvm.fmuladd.f64(double %scalar.recur, double %17, double %mul50.i) %arrayidx54.i = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %indvars.iv129.i, i64 %indvars.iv123.i store double %25, ptr %arrayidx54.i, align 8, !tbaa !5 %indvars.iv.next124.i = add nuw nsw i64 %indvars.iv123.i, 1 %exitcond128.not.i = icmp eq i64 %indvars.iv.next124.i, %indvars.iv129.i br i1 %exitcond128.not.i, label %for.inc58.i, label %for.body32.i, !llvm.loop !24 for.inc58.i: ; preds = %for.body32.i, %middle.block, %for.cond30.preheader.i %indvars.iv.next130.i = add nuw nsw i64 %indvars.iv129.i, 1 %exitcond134.not.i = icmp eq i64 %indvars.iv.next130.i, %wide.trip.count.i %indvar.next = add i64 %indvar, 1 br i1 %exitcond134.not.i, label %for.end60.i, label %for.cond30.preheader.i, !llvm.loop !16 for.end60.i: ; preds = %for.inc58.i, %for.end.thread, %for.end %.lcssa12 = phi i32 [ %0, %for.end.thread ], [ %1, %for.end ], [ %1, %for.inc58.i ] %div.i = sdiv i32 %.lcssa12, 2 %cmp62.not.not112.i = icmp slt i32 %div.i, %.lcssa12 br i1 %cmp62.not.not112.i, label %for.body63.lr.ph.i, label %Coins.exit for.body63.lr.ph.i: ; preds = %for.end60.i %idxprom64.i = sext i32 %.lcssa12 to i64 %26 = sext i32 %div.i to i64 %27 = sub nsw i64 %idxprom64.i, %26 %28 = xor i64 %26, -1 %29 = add nsw i64 %28, %idxprom64.i %xtraiter20 = and i64 %27, 3 %lcmp.mod21.not = icmp eq i64 %xtraiter20, 0 br i1 %lcmp.mod21.not, label %for.body63.i.prol.loopexit, label %for.body63.i.prol for.body63.i.prol: ; preds = %for.body63.lr.ph.i, %for.body63.i.prol %indvars.iv135.i.prol = phi i64 [ %indvars.iv.next136.i.prol, %for.body63.i.prol ], [ %26, %for.body63.lr.ph.i ] %sum.0114.i.prol = phi double [ %add68.i.prol, %for.body63.i.prol ], [ 0.000000e+00, %for.body63.lr.ph.i ] %prol.iter = phi i64 [ %prol.iter.next, %for.body63.i.prol ], [ 0, %for.body63.lr.ph.i ] %indvars.iv.next136.i.prol = add nsw i64 %indvars.iv135.i.prol, 1 %arrayidx67.i.prol = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %idxprom64.i, i64 %indvars.iv.next136.i.prol %30 = load double, ptr %arrayidx67.i.prol, align 8, !tbaa !5 %add68.i.prol = fadd double %sum.0114.i.prol, %30 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter20 br i1 %prol.iter.cmp.not, label %for.body63.i.prol.loopexit, label %for.body63.i.prol, !llvm.loop !25 for.body63.i.prol.loopexit: ; preds = %for.body63.i.prol, %for.body63.lr.ph.i %add68.i.lcssa.unr = phi double [ undef, %for.body63.lr.ph.i ], [ %add68.i.prol, %for.body63.i.prol ] %indvars.iv135.i.unr = phi i64 [ %26, %for.body63.lr.ph.i ], [ %indvars.iv.next136.i.prol, %for.body63.i.prol ] %sum.0114.i.unr = phi double [ 0.000000e+00, %for.body63.lr.ph.i ], [ %add68.i.prol, %for.body63.i.prol ] %31 = icmp ult i64 %29, 3 br i1 %31, label %Coins.exit, label %for.body63.i for.body63.i: ; preds = %for.body63.i.prol.loopexit, %for.body63.i %indvars.iv135.i = phi i64 [ %indvars.iv.next136.i.3, %for.body63.i ], [ %indvars.iv135.i.unr, %for.body63.i.prol.loopexit ] %sum.0114.i = phi double [ %add68.i.3, %for.body63.i ], [ %sum.0114.i.unr, %for.body63.i.prol.loopexit ] %indvars.iv.next136.i = add nsw i64 %indvars.iv135.i, 1 %arrayidx67.i = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %idxprom64.i, i64 %indvars.iv.next136.i %32 = load double, ptr %arrayidx67.i, align 8, !tbaa !5 %add68.i = fadd double %sum.0114.i, %32 %indvars.iv.next136.i.1 = add nsw i64 %indvars.iv135.i, 2 %arrayidx67.i.1 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %idxprom64.i, i64 %indvars.iv.next136.i.1 %33 = load double, ptr %arrayidx67.i.1, align 8, !tbaa !5 %add68.i.1 = fadd double %add68.i, %33 %indvars.iv.next136.i.2 = add nsw i64 %indvars.iv135.i, 3 %arrayidx67.i.2 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %idxprom64.i, i64 %indvars.iv.next136.i.2 %34 = load double, ptr %arrayidx67.i.2, align 8, !tbaa !5 %add68.i.2 = fadd double %add68.i.1, %34 %indvars.iv.next136.i.3 = add nsw i64 %indvars.iv135.i, 4 %arrayidx67.i.3 = getelementptr inbounds [3000 x [3000 x double]], ptr @S, i64 0, i64 %idxprom64.i, i64 %indvars.iv.next136.i.3 %35 = load double, ptr %arrayidx67.i.3, align 8, !tbaa !5 %add68.i.3 = fadd double %add68.i.2, %35 %exitcond139.not.i.3 = icmp eq i64 %indvars.iv.next136.i.3, %idxprom64.i br i1 %exitcond139.not.i.3, label %Coins.exit, label %for.body63.i, !llvm.loop !19 Coins.exit: ; preds = %for.body63.i.prol.loopexit, %for.body63.i, %for.end60.i %sum.0.lcssa.i = phi double [ 0.000000e+00, %for.end60.i ], [ %add68.i.lcssa.unr, %for.body63.i.prol.loopexit ], [ %add68.i.3, %for.body63.i ] %call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %sum.0.lcssa.i) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6 ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #5 attributes #0 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #6 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"double", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10} !12 = distinct !{!12, !10, !13, !14} !13 = !{!"llvm.loop.isvectorized", i32 1} !14 = !{!"llvm.loop.unroll.runtime.disable"} !15 = distinct !{!15, !10, !14, !13} !16 = distinct !{!16, !10} !17 = distinct !{!17, !18} !18 = !{!"llvm.loop.unroll.disable"} !19 = distinct !{!19, !10} !20 = !{!21, !21, i64 0} !21 = !{!"int", !7, i64 0} !22 = distinct !{!22, !10} !23 = distinct !{!23, !10, !13, !14} !24 = distinct !{!24, !10, !14, !13} !25 = distinct !{!25, !18}
#include <stdio.h> int main(void){ char s; s = getchar(); if(s=='A') printf("T"); if(s=='C') printf("G"); if(s=='T') printf("A"); if(s=='G') printf("C"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157129/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157129/source.c" target datalayout = "e-m:e-p270: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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %0 = load ptr, ptr @stdin, align 8, !tbaa !5 %call.i = tail call i32 @getc(ptr noundef %0) %sext = shl i32 %call.i, 24 switch i32 %sext, label %if.end21 [ i32 1090519040, label %if.end21.sink.split i32 1124073472, label %if.then7 i32 1409286144, label %if.then13 i32 1191182336, label %if.then19 ] if.then7: ; preds = %entry br label %if.end21.sink.split if.then13: ; preds = %entry br label %if.end21.sink.split if.then19: ; preds = %entry br label %if.end21.sink.split if.end21.sink.split: ; preds = %entry, %if.then19, %if.then7, %if.then13 %.sink = phi i32 [ 65, %if.then13 ], [ 71, %if.then7 ], [ 67, %if.then19 ], [ 84, %entry ] %putchar26 = tail call i32 @putchar(i32 %.sink) br label %if.end21 if.end21: ; preds = %if.end21.sink.split, %entry ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @getc(ptr nocapture noundef) local_unnamed_addr #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"any pointer", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#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) { char c; scanf("%c", &c); if (c == 'A') printf("T\n"); else if (c == 'T') printf("A\n"); else if (c == 'G') printf("C\n"); else if (c == 'C') printf("G\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157172/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157172/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"G\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"C\00", align 1 @str.6 = private unnamed_addr constant [2 x i8] c"A\00", align 1 @str.7 = private unnamed_addr constant [2 x i8] c"T\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: %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #8 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !9 switch i8 %0, label %if.end22 [ i8 65, label %if.end22.sink.split i8 84, label %if.then6 i8 71, label %if.then12 i8 67, label %if.then18 ] if.then6: ; preds = %entry br label %if.end22.sink.split if.then12: ; preds = %entry br label %if.end22.sink.split if.then18: ; preds = %entry br label %if.end22.sink.split if.end22.sink.split: ; preds = %entry, %if.then12, %if.then18, %if.then6 %str.6.sink = phi ptr [ @str.6, %if.then6 ], [ @str, %if.then18 ], [ @str.5, %if.then12 ], [ @str.7, %entry ] %puts24 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) br label %if.end22 if.end22: ; preds = %if.end22.sink.split, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #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) #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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress 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 = { nofree nounwind } 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}
#include<stdio.h> int main(void){ char b[2]; scanf("%s",&b[0]); if('A'==b[0]){ printf("T\n"); } else if('T'==b[0]){ printf("A\n"); } else if('C'==b[0]){ printf("G\n"); } else if('G'==b[0]){ printf("C\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157215/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157215/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"C\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"G\00", align 1 @str.6 = private unnamed_addr constant [2 x i8] c"A\00", align 1 @str.7 = private unnamed_addr constant [2 x i8] c"T\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %b = alloca [2 x i8], align 1 call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i8, ptr %b, align 1, !tbaa !5 switch i8 %0, label %if.end26 [ i8 65, label %if.end26.sink.split i8 84, label %if.then8 i8 67, label %if.then15 i8 71, label %if.then22 ] if.then8: ; preds = %entry br label %if.end26.sink.split if.then15: ; preds = %entry br label %if.end26.sink.split if.then22: ; preds = %entry br label %if.end26.sink.split if.end26.sink.split: ; preds = %entry, %if.then15, %if.then22, %if.then8 %str.6.sink = phi ptr [ @str.6, %if.then8 ], [ @str, %if.then22 ], [ @str.5, %if.then15 ], [ @str.7, %entry ] %puts28 = call i32 @puts(ptr nonnull dereferenceable(1) %str.6.sink) br label %if.end26 if.end26: ; preds = %if.end26.sink.split, %entry call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %b) #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 enki[]="ATCG"; char b; scanf("%c", &b); if(b == enki[0]) printf("%c", enki[1]); if(b == enki[1]) printf("%c", enki[0]); if(b == enki[2]) printf("%c", enki[3]); if(b == enki[3]) printf("%c", enki[2]); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157273/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157273/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i8, ptr %b, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 65 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %putchar = call i32 @putchar(i32 84) %.pr = load i8, ptr %b, align 1, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %1 = phi i8 [ %.pr, %if.then ], [ %0, %entry ] %cmp9 = icmp eq i8 %1, 84 br i1 %cmp9, label %if.then11, label %if.end15 if.then11: ; preds = %if.end %putchar40 = call i32 @putchar(i32 65) %.pre = load i8, ptr %b, align 1, !tbaa !5 br label %if.end15 if.end15: ; preds = %if.then11, %if.end %2 = phi i8 [ %.pre, %if.then11 ], [ %1, %if.end ] %cmp19 = icmp eq i8 %2, 67 br i1 %cmp19, label %if.then21, label %if.end25 if.then21: ; preds = %if.end15 %putchar41 = call i32 @putchar(i32 71) %.pr43 = load i8, ptr %b, align 1, !tbaa !5 br label %if.end25 if.end25: ; preds = %if.then21, %if.end15 %3 = phi i8 [ %.pr43, %if.then21 ], [ %2, %if.end15 ] %cmp29 = icmp eq i8 %3, 71 br i1 %cmp29, label %if.then31, label %if.end35 if.then31: ; preds = %if.end25 %putchar42 = call i32 @putchar(i32 67) br label %if.end35 if.end35: ; preds = %if.then31, %if.end25 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { char b; scanf("%c", &b); if (b == 'A') printf("T"); else if (b == 'C') printf("G"); else if (b =='G') printf("C"); else printf("A"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157323/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157323/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @switch.table.main = private unnamed_addr constant [7 x i32] [i32 84, i32 65, i32 71, i32 65, i32 65, i32 65, i32 67], align 4 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %b = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %b) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b) %0 = load i8, ptr %b, align 1, !tbaa !5 %switch.tableidx = add i8 %0, -65 %1 = icmp ult i8 %switch.tableidx, 7 br i1 %1, label %switch.lookup, label %if.end17 switch.lookup: ; preds = %entry %2 = sext i8 %switch.tableidx to i64 %switch.gep = getelementptr inbounds [7 x i32], ptr @switch.table.main, i64 0, i64 %2 %switch.load = load i32, ptr %switch.gep, align 4 br label %if.end17 if.end17: ; preds = %entry, %switch.lookup %.sink = phi i32 [ %switch.load, %switch.lookup ], [ 65, %entry ] %putchar19 = call i32 @putchar(i32 %.sink) call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %b) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include<stdio.h> int main() { char c; scanf("%c",&c); if(c=='A') { printf("T\n"); } if(c=='T') { printf("A\n"); } if(c=='C') { printf("G\n"); } if(c=='G') { printf("C\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157367/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157367/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"T\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"A\00", align 1 @str.6 = private unnamed_addr constant [2 x i8] c"G\00", align 1 @str.7 = private unnamed_addr constant [2 x i8] c"C\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %c = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %0 = load i8, ptr %c, align 1, !tbaa !5 %cmp = icmp eq i8 %0, 65 br i1 %cmp, label %if.then, label %if.end if.then: ; preds = %entry %puts = call i32 @puts(ptr nonnull dereferenceable(1) @str) %.pr = load i8, ptr %c, align 1, !tbaa !5 br label %if.end if.end: ; preds = %if.then, %entry %1 = phi i8 [ %.pr, %if.then ], [ %0, %entry ] %cmp4 = icmp eq i8 %1, 84 br i1 %cmp4, label %if.then6, label %if.end8 if.then6: ; preds = %if.end %puts21 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5) %.pre = load i8, ptr %c, align 1, !tbaa !5 br label %if.end8 if.end8: ; preds = %if.then6, %if.end %2 = phi i8 [ %.pre, %if.then6 ], [ %1, %if.end ] %cmp10 = icmp eq i8 %2, 67 br i1 %cmp10, label %if.then12, label %if.end14 if.then12: ; preds = %if.end8 %puts22 = call i32 @puts(ptr nonnull dereferenceable(1) @str.6) %.pr24 = load i8, ptr %c, align 1, !tbaa !5 br label %if.end14 if.end14: ; preds = %if.then12, %if.end8 %3 = phi i8 [ %.pr24, %if.then12 ], [ %2, %if.end8 ] %cmp16 = icmp eq i8 %3, 71 br i1 %cmp16, label %if.then18, label %if.end20 if.then18: ; preds = %if.end14 %puts23 = call i32 @puts(ptr nonnull dereferenceable(1) @str.7) br label %if.end20 if.end20: ; preds = %if.then18, %if.end14 call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(int argc, char const *argv[]) { int x1, x2, y1, y2; int ans = 0; scanf("%d%d%d%d", &x1, &y1, &x2, &y2); int a = x1 > x2 ? x1 - x2 : x2 - x1; int b = y1 > y2 ? y1 - y2 : y2 - y1; while (a && b) { ans += a > b ? b : a; if (a > b) a = a - b, b = 0; else b = b - a, a = 0; } while (a) { a--; ans++; } while (b) { b--; ans++; } printf("%d\n", ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_15741/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_15741/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1 @.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %x1 = alloca i32, align 4 %x2 = alloca i32, align 4 %y1 = alloca i32, align 4 %y2 = alloca i32, align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x2) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y1) #4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %y2) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x1, ptr noundef nonnull %y1, ptr noundef nonnull %x2, ptr noundef nonnull %y2) %0 = load i32, ptr %x1, align 4, !tbaa !5 %1 = load i32, ptr %x2, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %cond = call i32 @llvm.abs.i32(i32 %sub, i1 true) %2 = load i32, ptr %y1, align 4, !tbaa !5 %3 = load i32, ptr %y2, align 4, !tbaa !5 %sub4 = sub nsw i32 %2, %3 %cond8 = call i32 @llvm.abs.i32(i32 %sub4, i1 true) %tobool52 = icmp ne i32 %0, %1 %tobool953 = icmp ne i32 %2, %3 %4 = select i1 %tobool52, i1 %tobool953, i1 false br i1 %4, label %while.body, label %while.cond18.preheader while.cond18.preheader: ; preds = %while.body, %entry %ans.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ] %a.0.lcssa = phi i32 [ %cond, %entry ], [ %a.1, %while.body ] %b.0.lcssa = phi i32 [ %cond8, %entry ], [ %b.1, %while.body ] %5 = add i32 %a.0.lcssa, %b.0.lcssa %ans.2.lcssa = add i32 %5, %ans.0.lcssa %call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ans.2.lcssa) call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %y1) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x2) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x1) #4 ret i32 0 while.body: ; preds = %entry, %while.body %b.056 = phi i32 [ %sub17, %while.body ], [ %cond8, %entry ] %a.055 = phi i32 [ %sub16, %while.body ], [ %cond, %entry ] %ans.054 = phi i32 [ %add, %while.body ], [ 0, %entry ] %cmp10 = icmp sgt i32 %a.055, %b.056 %cond14 = call i32 @llvm.smin.i32(i32 %a.055, i32 %b.056) %add = add nsw i32 %cond14, %ans.054 %sub16 = sub nsw i32 %a.055, %b.056 %sub17 = sub nsw i32 %b.056, %a.055 %a.1 = select i1 %cmp10, i32 %sub16, i32 0 %b.1 = select i1 %cmp10, i32 0, i32 %sub17 %tobool = icmp ne i32 %a.1, 0 %tobool9 = icmp ne i32 %b.1, 0 %6 = select i1 %tobool, i1 %tobool9, i1 false br i1 %6, label %while.body, label %while.cond18.preheader, !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: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #3 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.abs.i32(i32, i1 immarg) #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main() { char a; scanf("%c",&a); switch(a) {case 'A':printf("T\n");break; case 'T':printf("A\n");break; case 'C':printf("G\n");break; case 'G':printf("C\n");break;} return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157460/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157460/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"C\00", align 1 @str.5 = private unnamed_addr constant [2 x i8] c"G\00", align 1 @str.6 = private unnamed_addr constant [2 x i8] c"A\00", align 1 @str.7 = private unnamed_addr constant [2 x i8] c"T\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %a = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %a) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a) %0 = load i8, ptr %a, align 1, !tbaa !5 %conv = sext i8 %0 to i32 switch i32 %conv, label %sw.epilog [ i32 65, label %sw.epilog.sink.split i32 84, label %sw.bb2 i32 67, label %sw.bb4 i32 71, label %sw.bb6 ] sw.bb2: ; preds = %entry br label %sw.epilog.sink.split sw.bb4: ; preds = %entry br label %sw.epilog.sink.split sw.bb6: ; preds = %entry br label %sw.epilog.sink.split sw.epilog.sink.split: ; preds = %entry, %sw.bb2, %sw.bb4, %sw.bb6 %str.sink = phi ptr [ @str, %sw.bb6 ], [ @str.5, %sw.bb4 ], [ @str.6, %sw.bb2 ], [ @str.7, %entry ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) br label %sw.epilog sw.epilog: ; preds = %sw.epilog.sink.split, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %a) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void){ char input; scanf("%c", &input); switch(input){ case 'A': printf("T"); break; case 'T': printf("A"); break; case 'C': printf("G"); break; case 'G': printf("C"); break; } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157503/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157503/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %input = alloca i8, align 1 call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %input) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %input) %0 = load i8, ptr %input, align 1, !tbaa !5 %conv = sext i8 %0 to i32 switch i32 %conv, label %sw.epilog [ i32 65, label %sw.epilog.sink.split i32 84, label %sw.bb2 i32 67, label %sw.bb4 i32 71, label %sw.bb6 ] sw.bb2: ; preds = %entry br label %sw.epilog.sink.split sw.bb4: ; preds = %entry br label %sw.epilog.sink.split sw.bb6: ; preds = %entry br label %sw.epilog.sink.split sw.epilog.sink.split: ; preds = %entry, %sw.bb2, %sw.bb4, %sw.bb6 %.sink = phi i32 [ 67, %sw.bb6 ], [ 71, %sw.bb4 ], [ 65, %sw.bb2 ], [ 84, %entry ] %putchar = call i32 @putchar(i32 %.sink) br label %sw.epilog sw.epilog: ; preds = %sw.epilog.sink.split, %entry call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %input) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main(void) { char S[10], T[10]={0}; scanf("%s", &S); switch (S[0]) { case 'A': T[0] = 'T'; break; case 'T': T[0] = 'A'; break; case 'C': T[0] = 'G'; break; case 'G': T[0] = 'C'; break; default: break; } printf("%s\n", T); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157554/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157554/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10 x i8], align 1 %T = alloca [10 x i8], align 1 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %S) #5 call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %T) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(10) %T, i8 0, i64 10, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S) %0 = load i8, ptr %S, align 1, !tbaa !5 %conv = sext i8 %0 to i32 switch i32 %conv, label %sw.epilog [ i32 65, label %sw.bb i32 84, label %sw.bb2 i32 67, label %sw.bb4 i32 71, label %sw.bb6 ] sw.bb: ; preds = %entry store i8 84, ptr %T, align 1, !tbaa !5 br label %sw.epilog sw.bb2: ; preds = %entry store i8 65, ptr %T, align 1, !tbaa !5 br label %sw.epilog sw.bb4: ; preds = %entry store i8 71, ptr %T, align 1, !tbaa !5 br label %sw.epilog sw.bb6: ; preds = %entry store i8 67, ptr %T, align 1, !tbaa !5 br label %sw.epilog sw.epilog: ; preds = %entry, %sw.bb6, %sw.bb4, %sw.bb2, %sw.bb %puts = call i32 @puts(ptr nonnull dereferenceable(1) %T) call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %T) #5 call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %S) #5 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nofree nounwind } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> #include <string.h> int main(){ char s[100+1]={0}, t[100+1]={0}, x; scanf("%s %s", s, t); //s for(int i=0; s[i]!=0; i++){ for(int j=i+1; s[j]!=0; j++){ if( s[i] > s[j] ){ x = s[i]; s[i] = s[j]; s[j] = x; } } } //t for(int i=0; t[i]!=0; i++){ for(int j=i+1; t[j]!=0; j++){ if( t[i] < t[j] ){ x = t[i]; t[i] = t[j]; t[j] = x; } } } if( strcmp(s,t) < 0 ){ printf("Yes\n"); } else { printf("No\n"); } return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157604/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157604/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [6 x i8] c"%s %s\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %s = alloca [101 x i8], align 16 %t = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) %s, i8 0, i64 101, i1 false) call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t) #6 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(101) %t, i8 0, i64 101, i1 false) %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t) %0 = load i8, ptr %s, align 16, !tbaa !5 %cmp.not107 = icmp eq i8 %0, 0 br i1 %cmp.not107, label %for.cond31.preheader, label %for.body for.cond.loopexit: ; preds = %for.inc %.pre = load i8, ptr %arrayidx5103, align 1, !tbaa !5 %cmp.not = icmp eq i8 %.pre, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 br i1 %cmp.not, label %for.cond31.preheader, label %for.body, !llvm.loop !8 for.cond31.preheader: ; preds = %for.body, %for.cond.loopexit, %entry %1 = load i8, ptr %t, align 16, !tbaa !5 %cmp35.not115 = icmp eq i8 %1, 0 br i1 %cmp35.not115, label %for.cond.cleanup37, label %for.body38 for.body: ; preds = %entry, %for.cond.loopexit %indvars.iv120 = phi i64 [ %indvars.iv.next121, %for.cond.loopexit ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond.loopexit ], [ 1, %entry ] %arrayidx109 = phi ptr [ %arrayidx5103, %for.cond.loopexit ], [ %s, %entry ] %indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1 %arrayidx5103 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next121 %2 = load i8, ptr %arrayidx5103, align 1, !tbaa !5 %cmp7.not104 = icmp eq i8 %2, 0 br i1 %cmp7.not104, label %for.cond31.preheader, label %for.body10 for.body10: ; preds = %for.body, %for.inc %indvars.iv118 = phi i64 [ %indvars.iv.next119, %for.inc ], [ %indvars.iv, %for.body ] %3 = phi i8 [ %5, %for.inc ], [ %2, %for.body ] %arrayidx5106 = phi ptr [ %arrayidx5, %for.inc ], [ %arrayidx5103, %for.body ] %4 = load i8, ptr %arrayidx109, align 1, !tbaa !5 %cmp17 = icmp sgt i8 %4, %3 br i1 %cmp17, label %if.then, label %for.inc if.then: ; preds = %for.body10 store i8 %3, ptr %arrayidx109, align 1, !tbaa !5 store i8 %4, ptr %arrayidx5106, align 1, !tbaa !5 br label %for.inc for.inc: ; preds = %for.body10, %if.then %indvars.iv.next119 = add nuw i64 %indvars.iv118, 1 %arrayidx5 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv.next119 %5 = load i8, ptr %arrayidx5, align 1, !tbaa !5 %cmp7.not = icmp eq i8 %5, 0 br i1 %cmp7.not, label %for.cond.loopexit, label %for.body10, !llvm.loop !10 for.cond31.loopexit: ; preds = %for.inc67 %.pre130 = load i8, ptr %arrayidx43111, align 1, !tbaa !5 %cmp35.not = icmp eq i8 %.pre130, 0 %indvars.iv.next124 = add nuw i64 %indvars.iv123, 1 br i1 %cmp35.not, label %for.cond.cleanup37, label %for.body38, !llvm.loop !11 for.cond.cleanup37: ; preds = %for.body38, %for.cond31.loopexit, %for.cond31.preheader %call75 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %t) #7 %cmp76 = icmp slt i32 %call75, 0 %str.3.str = select i1 %cmp76, ptr @str.3, ptr @str %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %t) #6 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #6 ret i32 0 for.body38: ; preds = %for.cond31.preheader, %for.cond31.loopexit %indvars.iv127 = phi i64 [ %indvars.iv.next128, %for.cond31.loopexit ], [ 0, %for.cond31.preheader ] %indvars.iv123 = phi i64 [ %indvars.iv.next124, %for.cond31.loopexit ], [ 1, %for.cond31.preheader ] %arrayidx33117 = phi ptr [ %arrayidx43111, %for.cond31.loopexit ], [ %t, %for.cond31.preheader ] %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1 %arrayidx43111 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv.next128 %6 = load i8, ptr %arrayidx43111, align 1, !tbaa !5 %cmp45.not112 = icmp eq i8 %6, 0 br i1 %cmp45.not112, label %for.cond.cleanup37, label %for.body48 for.body48: ; preds = %for.body38, %for.inc67 %indvars.iv125 = phi i64 [ %indvars.iv.next126, %for.inc67 ], [ %indvars.iv123, %for.body38 ] %7 = phi i8 [ %9, %for.inc67 ], [ %6, %for.body38 ] %arrayidx43114 = phi ptr [ %arrayidx43, %for.inc67 ], [ %arrayidx43111, %for.body38 ] %8 = load i8, ptr %arrayidx33117, align 1, !tbaa !5 %cmp55 = icmp slt i8 %8, %7 br i1 %cmp55, label %if.then57, label %for.inc67 if.then57: ; preds = %for.body48 store i8 %7, ptr %arrayidx33117, align 1, !tbaa !5 store i8 %8, ptr %arrayidx43114, align 1, !tbaa !5 br label %for.inc67 for.inc67: ; preds = %for.body48, %if.then57 %indvars.iv.next126 = add nuw i64 %indvars.iv125, 1 %arrayidx43 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv.next126 %9 = load i8, ptr %arrayidx43, align 1, !tbaa !5 %cmp45.not = icmp eq i8 %9, 0 br i1 %cmp45.not, label %for.cond31.loopexit, label %for.body48, !llvm.loop !12 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: 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: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { nofree nounwind } attributes #6 = { nounwind } attributes #7 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"omnipotent char", !7, i64 0} !7 = !{!"Simple C/C++ TBAA"} !8 = distinct !{!8, !9} !9 = !{!"llvm.loop.mustprogress"} !10 = distinct !{!10, !9} !11 = distinct !{!11, !9} !12 = distinct !{!12, !9}
#include <stdio.h> #include <stdlib.h> #include <string.h> #define N 100 int compare1(const void *a, const void *b) { char ca = *(char *) a; char cb = *(char *) b; return ca - cb; } int compare2(const void *a, const void *b) { char ca = *(char *) a; char cb = *(char *) b; return cb - ca; } int main() { static char s[N + 1], t[N + 1]; int n, m; scanf("%s%s", s, t); n = strlen(s); m = strlen(t); qsort(s, n, sizeof *s, compare1); qsort(t, m, sizeof *t, compare2); printf(strcmp(s, t) < 0 ? "Yes\n" : "No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157655/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157655/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @main.s = internal global [101 x i8] zeroinitializer, align 16 @main.t = internal global [101 x i8] zeroinitializer, align 16 @.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1 @.str.1 = private unnamed_addr constant [5 x i8] c"Yes\0A\00", align 1 @.str.2 = private unnamed_addr constant [4 x i8] c"No\0A\00", align 1 ; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable define dso_local i32 @compare1(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !5 %1 = load i8, ptr %b, align 1, !tbaa !5 %conv = sext i8 %0 to i32 %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 @compare2(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #0 { entry: %0 = load i8, ptr %a, align 1, !tbaa !5 %1 = load i8, ptr %b, align 1, !tbaa !5 %conv = sext i8 %1 to i32 %conv1 = sext i8 %0 to i32 %sub = sub nsw i32 %conv, %conv1 ret i32 %sub } ; 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 @main.s, ptr noundef nonnull @main.t) %call1 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @main.s) #5 %call2 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) @main.t) #5 %sext = shl i64 %call1, 32 %conv4 = ashr exact i64 %sext, 32 tail call void @qsort(ptr noundef nonnull @main.s, i64 noundef %conv4, i64 noundef 1, ptr noundef nonnull @compare1) #6 %sext9 = shl i64 %call2, 32 %conv5 = ashr exact i64 %sext9, 32 tail call void @qsort(ptr noundef nonnull @main.t, i64 noundef %conv5, i64 noundef 1, ptr noundef nonnull @compare2) #6 %call6 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) @main.s, ptr noundef nonnull dereferenceable(1) @main.t) #5 %cmp = icmp slt i32 %call6, 0 %cond = select i1 %cmp, ptr @.str.1, ptr @.str.2 %call8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %cond) ret i32 0 } ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #2 = { nofree nounwind "no-trapping-math"="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 "no-trapping-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 willreturn memory(read) } 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"}
#include <stdio.h> #include <string.h> int main(void){ char s[101], t[101], tmp; int ls, lt, i, j; scanf("%s %s", s, t); ls = strlen(s); lt = strlen(t); for( i = 0; i < ls; i++){ for( j = i+1; j < ls; j++){ if(s[i] > s[j]){ tmp = s[i]; s[i] = s[j]; s[j] = tmp; } } } for( i = 0; i < lt; i++){ for( j = i+1; j < lt; j++){ if(t[i] < t[j]){ tmp = t[i]; t[i] = t[j]; t[j] = tmp; } } } if(strcmp(s, t) < 0) printf("Yes"); else printf("No"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157712/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157712/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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 [101 x i8], align 16 %t = alloca [101 x i8], align 16 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %s) #4 call void @llvm.lifetime.start.p0(i64 101, ptr nonnull %t) #4 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t) %call3 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %s) #5 %conv = trunc i64 %call3 to i32 %call5 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #5 %conv6 = trunc i64 %call5 to i32 %cmp96 = icmp sgt i32 %conv, 0 br i1 %cmp96, label %for.body.preheader, label %for.cond29.preheader for.body.preheader: ; preds = %entry %sext = shl i64 %call3, 32 %0 = ashr exact i64 %sext, 32 %wide.trip.count108 = and i64 %call3, 4294967295 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond109.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count108 br i1 %exitcond109.not, label %for.cond29.preheader, label %for.body, !llvm.loop !5 for.cond29.preheader: ; preds = %for.cond.loopexit, %entry %cmp30100 = icmp sgt i32 %conv6, 0 br i1 %cmp30100, label %for.body32.preheader, label %for.end61 for.body32.preheader: ; preds = %for.cond29.preheader %sext122 = shl i64 %call5, 32 %1 = ashr exact i64 %sext122, 32 %wide.trip.count120 = and i64 %call5, 4294967295 br label %for.body32 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvars.iv105 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next106, %for.cond.loopexit ] %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.cond.loopexit ] %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1 %cmp994 = icmp slt i64 %indvars.iv.next106, %0 br i1 %cmp994, label %for.body11.lr.ph, label %for.cond.loopexit for.body11.lr.ph: ; preds = %for.body %arrayidx = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv105 br label %for.body11 for.body11: ; preds = %for.body11.lr.ph, %for.inc %indvars.iv102 = phi i64 [ %indvars.iv, %for.body11.lr.ph ], [ %indvars.iv.next103, %for.inc ] %2 = load i8, ptr %arrayidx, align 1, !tbaa !7 %arrayidx14 = getelementptr inbounds [101 x i8], ptr %s, i64 0, i64 %indvars.iv102 %3 = load i8, ptr %arrayidx14, align 1, !tbaa !7 %cmp16 = icmp sgt i8 %2, %3 br i1 %cmp16, label %if.then, label %for.inc if.then: ; preds = %for.body11 store i8 %3, ptr %arrayidx, align 1, !tbaa !7 store i8 %2, ptr %arrayidx14, align 1, !tbaa !7 br label %for.inc for.inc: ; preds = %for.body11, %if.then %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1 %exitcond.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count108 br i1 %exitcond.not, label %for.cond.loopexit, label %for.body11, !llvm.loop !10 for.cond29.loopexit: ; preds = %for.inc56, %for.body32 %indvars.iv.next111 = add nuw nsw i64 %indvars.iv110, 1 %exitcond121.not = icmp eq i64 %indvars.iv.next118, %wide.trip.count120 br i1 %exitcond121.not, label %for.end61, label %for.body32, !llvm.loop !11 for.body32: ; preds = %for.body32.preheader, %for.cond29.loopexit %indvars.iv117 = phi i64 [ 0, %for.body32.preheader ], [ %indvars.iv.next118, %for.cond29.loopexit ] %indvars.iv110 = phi i64 [ 1, %for.body32.preheader ], [ %indvars.iv.next111, %for.cond29.loopexit ] %indvars.iv.next118 = add nuw nsw i64 %indvars.iv117, 1 %cmp3598 = icmp slt i64 %indvars.iv.next118, %1 br i1 %cmp3598, label %for.body37.lr.ph, label %for.cond29.loopexit for.body37.lr.ph: ; preds = %for.body32 %arrayidx39 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv117 br label %for.body37 for.body37: ; preds = %for.body37.lr.ph, %for.inc56 %indvars.iv112 = phi i64 [ %indvars.iv110, %for.body37.lr.ph ], [ %indvars.iv.next113, %for.inc56 ] %4 = load i8, ptr %arrayidx39, align 1, !tbaa !7 %arrayidx42 = getelementptr inbounds [101 x i8], ptr %t, i64 0, i64 %indvars.iv112 %5 = load i8, ptr %arrayidx42, align 1, !tbaa !7 %cmp44 = icmp slt i8 %4, %5 br i1 %cmp44, label %if.then46, label %for.inc56 if.then46: ; preds = %for.body37 store i8 %5, ptr %arrayidx39, align 1, !tbaa !7 store i8 %4, ptr %arrayidx42, align 1, !tbaa !7 br label %for.inc56 for.inc56: ; preds = %for.body37, %if.then46 %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1 %exitcond116.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count120 br i1 %exitcond116.not, label %for.cond29.loopexit, label %for.body37, !llvm.loop !12 for.end61: ; preds = %for.cond29.loopexit, %for.cond29.preheader %call64 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) %t) #5 %cmp65 = icmp slt i32 %call64, 0 %.str.1..str.2 = select i1 %cmp65, ptr @.str.1, ptr @.str.2 %call69 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2) call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %t) #4 call void @llvm.lifetime.end.p0(i64 101, ptr nonnull %s) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #4 = { nounwind } attributes #5 = { nounwind willreturn memory(read) } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.mustprogress"} !7 = !{!8, !8, i64 0} !8 = !{!"omnipotent char", !9, i64 0} !9 = !{!"Simple C/C++ TBAA"} !10 = distinct !{!10, !6} !11 = distinct !{!11, !6} !12 = distinct !{!12, !6}
#include<stdio.h> int main(){ int i = 0; int n = 0; int k = 0; scanf("%d %d",&n,&k); for(i=0;i<n;i++){ if(n <= k + (k-1)*i){ break; } } printf("%d",i+1); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157770/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157770/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 store i32 0, ptr %n, align 4, !tbaa !5 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3 store i32 0, ptr %k, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k) %0 = load i32, ptr %n, align 4, !tbaa !5 %cmp7 = icmp sgt i32 %0, 0 br i1 %cmp7, label %for.body.lr.ph, label %for.end for.body.lr.ph: ; preds = %entry %1 = load i32, ptr %k, align 4, !tbaa !5 %sub = add nsw i32 %1, -1 br label %for.body for.body: ; preds = %for.body.lr.ph, %for.inc %i.08 = phi i32 [ 0, %for.body.lr.ph ], [ %inc, %for.inc ] %mul = mul nsw i32 %sub, %i.08 %add = add nsw i32 %mul, %1 %cmp1.not = icmp sgt i32 %0, %add br i1 %cmp1.not, label %for.inc, label %for.end.loopexit for.inc: ; preds = %for.body %inc = add nuw nsw i32 %i.08, 1 %exitcond.not = icmp eq i32 %inc, %0 br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9 for.end.loopexit: ; preds = %for.body, %for.inc %i.0.lcssa.ph = phi i32 [ %0, %for.inc ], [ %i.08, %for.body ] %2 = add nuw nsw i32 %i.0.lcssa.ph, 1 br label %for.end for.end: ; preds = %for.end.loopexit, %entry %i.0.lcssa = phi i32 [ 1, %entry ], [ %2, %for.end.loopexit ] %call3 = 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 %k) #3 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> #define mod 1000000007 long long ru2(int a){ long long r=1; for(int i=0;i<a;i++){ r*=2; r%=mod; } return r; } int main(){ int i,n; char l[100102]; scanf("%s",l); for(i=0;l[i]!=0;i++); n=i; long long dp[100101]={1},dps[100101]={1}; for(i=1;i<100010;i++){ dp[i]=dp[i-1]*3; dp[i]%=mod; dps[i]=dp[i-1]*2; dps[i]%=mod; } long long ans=dp[n-1]; int list[100101]={0},c=0; for(i=0;i<n;i++){ if(l[i]=='1')list[c++]=n-i; } // list[c++]=0; long long am=2; for(i=c-1;i>=1;i--){ am+=dp[list[i]-1]; am*=2; am%=mod; } ans+=am; ans%=mod; printf("%lld\n",ans); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157820/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157820/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable define dso_local i64 @ru2(i32 noundef %a) local_unnamed_addr #0 { entry: %cmp4 = icmp sgt i32 %a, 0 br i1 %cmp4, label %for.body.preheader, label %for.cond.cleanup for.body.preheader: ; preds = %entry %xtraiter = and i32 %a, 3 %0 = icmp ult i32 %a, 4 br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new for.body.preheader.new: ; preds = %for.body.preheader %unroll_iter = and i32 %a, -4 br label %for.body for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader %rem.lcssa.ph = phi i64 [ undef, %for.body.preheader ], [ %rem.3, %for.body ] %r.05.unr = phi i64 [ 1, %for.body.preheader ], [ %rem.3, %for.body ] %lcmp.mod.not = icmp eq i32 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil %r.05.epil = phi i64 [ %rem.epil, %for.body.epil ], [ %r.05.unr, %for.cond.cleanup.loopexit.unr-lcssa ] %epil.iter = phi i32 [ %epil.iter.next, %for.body.epil ], [ 0, %for.cond.cleanup.loopexit.unr-lcssa ] %mul.epil = shl nsw i64 %r.05.epil, 1 %rem.epil = srem i64 %mul.epil, 1000000007 %epil.iter.next = add i32 %epil.iter, 1 %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter br i1 %epil.iter.cmp.not, label %for.cond.cleanup, label %for.body.epil, !llvm.loop !5 for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry %r.0.lcssa = phi i64 [ 1, %entry ], [ %rem.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %rem.epil, %for.body.epil ] ret i64 %r.0.lcssa for.body: ; preds = %for.body, %for.body.preheader.new %r.05 = phi i64 [ 1, %for.body.preheader.new ], [ %rem.3, %for.body ] %niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ] %mul = shl nsw i64 %r.05, 1 %rem = srem i64 %mul, 1000000007 %mul.1 = shl nsw i64 %rem, 1 %rem.1 = srem i64 %mul.1, 1000000007 %mul.2 = shl nsw i64 %rem.1, 1 %rem.2 = srem i64 %mul.2, 1000000007 %mul.3 = shl nsw i64 %rem.2, 1 %rem.3 = srem i64 %mul.3, 1000000007 %niter.next.3 = add i32 %niter, 4 %niter.ncmp.3 = icmp eq i32 %niter.next.3, %unroll_iter br i1 %niter.ncmp.3, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !7 } ; 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: %l = alloca [100102 x i8], align 16 %dp = alloca [100101 x i64], align 16 %list = alloca [100101 x i32], align 16 call void @llvm.lifetime.start.p0(i64 100102, ptr nonnull %l) #5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %l) br label %for.cond for.cond: ; preds = %for.cond, %entry %indvars.iv102 = phi i32 [ %indvars.iv.next103, %for.cond ], [ 0, %entry ] %indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %entry ] %arrayidx = getelementptr inbounds [100102 x i8], ptr %l, i64 0, i64 %indvars.iv %0 = load i8, ptr %arrayidx, align 1, !tbaa !9 %cmp.not = icmp eq i8 %0, 0 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %indvars.iv.next103 = add i32 %indvars.iv102, 1 br i1 %cmp.not, label %for.end, label %for.cond, !llvm.loop !12 for.end: ; preds = %for.cond call void @llvm.lifetime.start.p0(i64 800808, ptr nonnull %dp) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(800808) %dp, i8 0, i64 800808, i1 false) store i64 1, ptr %dp, align 16 br label %for.body5 for.body5: ; preds = %for.body5.1, %for.end %1 = phi i64 [ 1, %for.end ], [ %rem.1, %for.body5.1 ] %indvars.iv94 = phi i64 [ 1, %for.end ], [ %indvars.iv.next95.1, %for.body5.1 ] %mul = mul nsw i64 %1, 3 %arrayidx9 = getelementptr inbounds [100101 x i64], ptr %dp, i64 0, i64 %indvars.iv94 %rem = srem i64 %mul, 1000000007 store i64 %rem, ptr %arrayidx9, align 8, !tbaa !13 %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1 %exitcond.not = icmp eq i64 %indvars.iv.next95, 100010 br i1 %exitcond.not, label %for.end23, label %for.body5.1, !llvm.loop !15 for.body5.1: ; preds = %for.body5 %mul.1 = mul nsw i64 %rem, 3 %arrayidx9.1 = getelementptr inbounds [100101 x i64], ptr %dp, i64 0, i64 %indvars.iv.next95 %rem.1 = srem i64 %mul.1, 1000000007 store i64 %rem.1, ptr %arrayidx9.1, align 8, !tbaa !13 %indvars.iv.next95.1 = add nuw nsw i64 %indvars.iv94, 2 br label %for.body5 for.end23: ; preds = %for.body5 %sub24 = shl i64 %indvars.iv, 32 %sext = add i64 %sub24, -4294967296 %idxprom25 = ashr exact i64 %sext, 32 %arrayidx26 = getelementptr inbounds [100101 x i64], ptr %dp, i64 0, i64 %idxprom25 %2 = load i64, ptr %arrayidx26, align 8, !tbaa !13 call void @llvm.lifetime.start.p0(i64 400404, ptr nonnull %list) #5 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400404) %list, i8 0, i64 400404, i1 false) %3 = and i64 %indvars.iv, 4294967295 %cmp2886.not = icmp eq i64 %3, 0 br i1 %cmp2886.not, label %for.end56, label %for.body30.preheader for.body30.preheader: ; preds = %for.end23 %wide.trip.count = zext i32 %indvars.iv102 to i64 %xtraiter = and i64 %wide.trip.count, 1 %4 = icmp eq i32 %indvars.iv102, 1 br i1 %4, label %for.cond44.preheader.unr-lcssa, label %for.body30.preheader.new for.body30.preheader.new: ; preds = %for.body30.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body30 for.cond44.preheader.unr-lcssa: ; preds = %for.inc40.1, %for.body30.preheader %c.1.lcssa.ph = phi i32 [ undef, %for.body30.preheader ], [ %c.1.1, %for.inc40.1 ] %indvars.iv98.unr = phi i64 [ 0, %for.body30.preheader ], [ %indvars.iv.next99.1, %for.inc40.1 ] %c.088.unr = phi i32 [ 0, %for.body30.preheader ], [ %c.1.1, %for.inc40.1 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond44.preheader, label %for.body30.epil for.body30.epil: ; preds = %for.cond44.preheader.unr-lcssa %arrayidx32.epil = getelementptr inbounds [100102 x i8], ptr %l, i64 0, i64 %indvars.iv98.unr %5 = load i8, ptr %arrayidx32.epil, align 1, !tbaa !9 %cmp34.epil = icmp eq i8 %5, 49 br i1 %cmp34.epil, label %if.then.epil, label %for.cond44.preheader if.then.epil: ; preds = %for.body30.epil %6 = sub i64 %indvars.iv, %indvars.iv98.unr %inc37.epil = add nsw i32 %c.088.unr, 1 %idxprom38.epil = sext i32 %c.088.unr to i64 %arrayidx39.epil = getelementptr inbounds [100101 x i32], ptr %list, i64 0, i64 %idxprom38.epil %7 = trunc i64 %6 to i32 store i32 %7, ptr %arrayidx39.epil, align 4, !tbaa !16 br label %for.cond44.preheader for.cond44.preheader: ; preds = %for.body30.epil, %if.then.epil, %for.cond44.preheader.unr-lcssa %c.1.lcssa = phi i32 [ %c.1.lcssa.ph, %for.cond44.preheader.unr-lcssa ], [ %inc37.epil, %if.then.epil ], [ %c.088.unr, %for.body30.epil ] %cmp4589 = icmp sgt i32 %c.1.lcssa, 1 br i1 %cmp4589, label %for.body47.preheader, label %for.end56 for.body47.preheader: ; preds = %for.cond44.preheader %8 = zext i32 %c.1.lcssa to i64 br label %for.body47 for.body30: ; preds = %for.inc40.1, %for.body30.preheader.new %indvars.iv98 = phi i64 [ 0, %for.body30.preheader.new ], [ %indvars.iv.next99.1, %for.inc40.1 ] %c.088 = phi i32 [ 0, %for.body30.preheader.new ], [ %c.1.1, %for.inc40.1 ] %niter = phi i64 [ 0, %for.body30.preheader.new ], [ %niter.next.1, %for.inc40.1 ] %arrayidx32 = getelementptr inbounds [100102 x i8], ptr %l, i64 0, i64 %indvars.iv98 %9 = load i8, ptr %arrayidx32, align 2, !tbaa !9 %cmp34 = icmp eq i8 %9, 49 br i1 %cmp34, label %if.then, label %for.inc40 if.then: ; preds = %for.body30 %10 = sub i64 %indvars.iv, %indvars.iv98 %inc37 = add nsw i32 %c.088, 1 %idxprom38 = sext i32 %c.088 to i64 %arrayidx39 = getelementptr inbounds [100101 x i32], ptr %list, i64 0, i64 %idxprom38 %11 = trunc i64 %10 to i32 store i32 %11, ptr %arrayidx39, align 4, !tbaa !16 br label %for.inc40 for.inc40: ; preds = %for.body30, %if.then %c.1 = phi i32 [ %inc37, %if.then ], [ %c.088, %for.body30 ] %indvars.iv.next99 = or i64 %indvars.iv98, 1 %arrayidx32.1 = getelementptr inbounds [100102 x i8], ptr %l, i64 0, i64 %indvars.iv.next99 %12 = load i8, ptr %arrayidx32.1, align 1, !tbaa !9 %cmp34.1 = icmp eq i8 %12, 49 br i1 %cmp34.1, label %if.then.1, label %for.inc40.1 if.then.1: ; preds = %for.inc40 %13 = sub i64 %indvars.iv, %indvars.iv.next99 %inc37.1 = add nsw i32 %c.1, 1 %idxprom38.1 = sext i32 %c.1 to i64 %arrayidx39.1 = getelementptr inbounds [100101 x i32], ptr %list, i64 0, i64 %idxprom38.1 %14 = trunc i64 %13 to i32 store i32 %14, ptr %arrayidx39.1, align 4, !tbaa !16 br label %for.inc40.1 for.inc40.1: ; preds = %if.then.1, %for.inc40 %c.1.1 = phi i32 [ %inc37.1, %if.then.1 ], [ %c.1, %for.inc40 ] %indvars.iv.next99.1 = add nuw nsw i64 %indvars.iv98, 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.cond44.preheader.unr-lcssa, label %for.body30, !llvm.loop !18 for.body47: ; preds = %for.body47.preheader, %for.body47 %indvars.iv105 = phi i64 [ %8, %for.body47.preheader ], [ %indvars.iv.next106, %for.body47 ] %am.091 = phi i64 [ 2, %for.body47.preheader ], [ %rem54, %for.body47 ] %indvars.iv.next106 = add nsw i64 %indvars.iv105, -1 %idxprom48 = and i64 %indvars.iv.next106, 4294967295 %arrayidx49 = getelementptr inbounds [100101 x i32], ptr %list, i64 0, i64 %idxprom48 %15 = load i32, ptr %arrayidx49, align 4, !tbaa !16 %sub50 = add nsw i32 %15, -1 %idxprom51 = sext i32 %sub50 to i64 %arrayidx52 = getelementptr inbounds [100101 x i64], ptr %dp, i64 0, i64 %idxprom51 %16 = load i64, ptr %arrayidx52, align 8, !tbaa !13 %add = add nsw i64 %16, %am.091 %mul53 = shl nsw i64 %add, 1 %rem54 = srem i64 %mul53, 1000000007 %cmp45 = icmp ugt i64 %indvars.iv105, 2 br i1 %cmp45, label %for.body47, label %for.end56, !llvm.loop !19 for.end56: ; preds = %for.body47, %for.end23, %for.cond44.preheader %am.0.lcssa = phi i64 [ 2, %for.cond44.preheader ], [ 2, %for.end23 ], [ %rem54, %for.body47 ] %add57 = add nsw i64 %am.0.lcssa, %2 %rem58 = srem i64 %add57, 1000000007 %call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %rem58) call void @llvm.lifetime.end.p0(i64 400404, ptr nonnull %list) #5 call void @llvm.lifetime.end.p0(i64 800808, ptr nonnull %dp) #5 call void @llvm.lifetime.end.p0(i64 100102, ptr nonnull %l) #5 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 nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4 ; Function Attrs: nofree nounwind declare noundef i32 @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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #5 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = distinct !{!5, !6} !6 = !{!"llvm.loop.unroll.disable"} !7 = distinct !{!7, !8} !8 = !{!"llvm.loop.mustprogress"} !9 = !{!10, !10, i64 0} !10 = !{!"omnipotent char", !11, i64 0} !11 = !{!"Simple C/C++ TBAA"} !12 = distinct !{!12, !8} !13 = !{!14, !14, i64 0} !14 = !{!"long long", !10, i64 0} !15 = distinct !{!15, !8} !16 = !{!17, !17, i64 0} !17 = !{!"int", !10, i64 0} !18 = distinct !{!18, !8} !19 = distinct !{!19, !8}
#include <stdio.h> int r, c, p; int main() { while((c = getchar_unlocked()) != '\n') { if(p == 1) { r += 1; p = 0; } else if (c == p) { p = 1; } else { r += 1; p = c; } } printf("%d\n", r); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157864/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157864/source.c" target datalayout = "e-m:e-p270: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] } @c = dso_local local_unnamed_addr global i32 0, align 4 @p = dso_local local_unnamed_addr global i32 0, align 4 @r = dso_local local_unnamed_addr global i32 0, align 4 @.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 @main() local_unnamed_addr #0 { entry: %.pre8 = load ptr, ptr @stdin, align 8, !tbaa !5 br label %while.cond while.cond: ; preds = %if.end6, %entry %0 = phi ptr [ %4, %if.end6 ], [ %.pre8, %entry ] %_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 = %while.cond %call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #3 %.pre = load ptr, ptr @stdin, align 8, !tbaa !5 br label %getchar_unlocked.exit cond.false.i: ; preds = %while.cond %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 %4 = phi ptr [ %.pre, %cond.true.i ], [ %0, %cond.false.i ] %cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ] store i32 %cond.i, ptr @c, align 4, !tbaa !17 %cmp.not = icmp eq i32 %cond.i, 10 br i1 %cmp.not, label %while.end, label %while.body while.body: ; preds = %getchar_unlocked.exit %5 = load i32, ptr @p, align 4, !tbaa !17 %cmp1 = icmp eq i32 %5, 1 br i1 %cmp1, label %if.end6.sink.split, label %if.else if.else: ; preds = %while.body %cmp2 = icmp eq i32 %cond.i, %5 br i1 %cmp2, label %if.end6, label %if.end6.sink.split if.end6.sink.split: ; preds = %if.else, %while.body %.sink.ph = phi i32 [ 0, %while.body ], [ %cond.i, %if.else ] %6 = load i32, ptr @r, align 4, !tbaa !17 %add5 = add nsw i32 %6, 1 store i32 %add5, ptr @r, align 4, !tbaa !17 br label %if.end6 if.end6: ; preds = %if.end6.sink.split, %if.else %.sink = phi i32 [ 1, %if.else ], [ %.sink.ph, %if.end6.sink.split ] store i32 %.sink, ptr @p, align 4, !tbaa !17 br label %while.cond, !llvm.loop !18 while.end: ; preds = %getchar_unlocked.exit %7 = load i32, ptr @r, align 4, !tbaa !17 %call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7) ret i32 0 } ; 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 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 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{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 = !{!11, !11, i64 0} !18 = distinct !{!18, !19} !19 = !{!"llvm.loop.mustprogress"}
#include<stdio.h> int main(){ int c[3][3],i,j; for(i=0;i<3;i++)for(j=0;j<3;j++)scanf("%d",&c[i][j]); for(i=0;i<2;i++)if(c[0][i]-c[0][i+1]!=c[1][i]-c[1][i+1]||c[0][i]-c[0][i+1]!=c[2][i]-c[2][i+1]){printf("No");return 0;} for(i=0;i<2;i++)if(c[i][0]-c[i+1][0]!=c[i][1]-c[i+1][1]||c[i][0]-c[i+1][0]!=c[i][2]-c[i+1][2]){printf("No");return 0;} printf("Yes"); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157921/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157921/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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: %c = alloca [3 x [3 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %arrayidx5.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1) %arrayidx5.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2) %arrayidx5.1123 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 0 %call.1124 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1123) %arrayidx5.1.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 1 %call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.1) %arrayidx5.2.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 2 %call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.1) %arrayidx5.2125 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 0 %call.2126 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2125) %arrayidx5.1.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 1 %call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1.2) %arrayidx5.2.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 2 %call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2.2) %0 = load i32, ptr %c, align 16, !tbaa !5 %1 = load i32, ptr %arrayidx5.1, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %arrayidx5.1123, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx5.1.1, align 16, !tbaa !5 %sub25 = sub nsw i32 %2, %3 %cmp26.not = icmp eq i32 %sub, %sub25 br i1 %cmp26.not, label %lor.lhs.false, label %cleanup for.cond48.preheader: ; preds = %lor.lhs.false.1 %sub58 = sub nsw i32 %0, %2 %sub66 = sub nsw i32 %1, %3 %cmp67.not = icmp eq i32 %sub58, %sub66 %sub84 = sub nsw i32 %6, %7 %cmp85.not = icmp eq i32 %sub58, %sub84 %or.cond = select i1 %cmp67.not, i1 %cmp85.not, i1 false br i1 %or.cond, label %for.cond48.1, label %cleanup, !llvm.loop !9 lor.lhs.false: ; preds = %entry %4 = load i32, ptr %arrayidx5.2125, align 8, !tbaa !5 %5 = load i32, ptr %arrayidx5.1.2, align 4, !tbaa !5 %sub42 = sub nsw i32 %4, %5 %cmp43.not = icmp eq i32 %sub, %sub42 br i1 %cmp43.not, label %for.cond9.1, label %cleanup, !llvm.loop !11 for.cond9.1: ; preds = %lor.lhs.false %6 = load i32, ptr %arrayidx5.2, align 8, !tbaa !5 %sub.1 = sub nsw i32 %1, %6 %7 = load i32, ptr %arrayidx5.2.1, align 4, !tbaa !5 %sub25.1 = sub nsw i32 %3, %7 %cmp26.not.1 = icmp eq i32 %sub.1, %sub25.1 br i1 %cmp26.not.1, label %lor.lhs.false.1, label %cleanup lor.lhs.false.1: ; preds = %for.cond9.1 %8 = load i32, ptr %arrayidx5.2.2, align 16, !tbaa !5 %sub42.1 = sub nsw i32 %5, %8 %cmp43.not.1 = icmp eq i32 %sub.1, %sub42.1 br i1 %cmp43.not.1, label %for.cond48.preheader, label %cleanup, !llvm.loop !11 for.cond48.1: ; preds = %for.cond48.preheader %sub58.1 = sub nsw i32 %2, %4 %sub66.1 = sub nsw i32 %3, %5 %cmp67.not.1 = icmp eq i32 %sub58.1, %sub66.1 %sub84.1 = sub nsw i32 %7, %8 %cmp85.not.1 = icmp eq i32 %sub58.1, %sub84.1 %or.cond129 = select i1 %cmp67.not.1, i1 %cmp85.not.1, i1 false %spec.select = select i1 %or.cond129, ptr @.str.2, ptr @.str.1 br label %cleanup, !llvm.loop !9 cleanup: ; preds = %for.cond48.1, %for.cond48.preheader, %entry, %lor.lhs.false, %for.cond9.1, %lor.lhs.false.1 %.str.2.sink = phi ptr [ @.str.1, %lor.lhs.false.1 ], [ @.str.1, %for.cond9.1 ], [ @.str.1, %lor.lhs.false ], [ @.str.1, %entry ], [ @.str.1, %for.cond48.preheader ], [ %spec.select, %for.cond48.1 ] %call92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %c) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"} !11 = distinct !{!11, !10}
#include <stdio.h> int main(int argc, char *argv[]) { int c[3][3]; for(int i = 0; i < 3; i++) scanf("%d %d %d", &c[i][0], &c[i][1], &c[i][2]); int a[2][3], b[3][2]; for(int i = 0; i < 3; i++){ for(int j = 0; j < 2; j++){ a[j][i] = c[j + 1][i] - c[0][i]; } } for(int i = 0; i < 2; i++){ for(int j = 0; j < 3; j++){ b[j][i] = c[j][i + 1] - c[j][0]; } } int s = 0; for(int i = 0; i < 2; i++){ if(a[i][0] == a[i][1] && a[i][1] == a[i][2]) s++; } for(int i = 0; i < 2; i++){ if(b[0][i] == b[1][i] && b[1][i] == b[2][i]) s++; } if(s == 4) printf("Yes\n"); else printf("No\n"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_157972/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_157972/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @str = private unnamed_addr constant [3 x i8] c"No\00", align 1 @str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 { entry: %c = alloca [3 x [3 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %c) #4 %arrayidx4 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 1 %arrayidx7 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx7) %arrayidx.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1 %arrayidx4.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 1 %arrayidx7.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 2 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1, ptr noundef nonnull %arrayidx4.1, ptr noundef nonnull %arrayidx7.1) %arrayidx.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2 %arrayidx4.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 1 %arrayidx7.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2, ptr noundef nonnull %arrayidx4.2, ptr noundef nonnull %arrayidx7.2) %0 = load i32, ptr %c, align 16, !tbaa !5 %1 = load i32, ptr %arrayidx.1, align 4, !tbaa !5 %2 = load i32, ptr %arrayidx7, align 8, !tbaa !5 %3 = load i32, ptr %arrayidx7.1, align 4, !tbaa !5 %sub52.1168 = sub nsw i32 %2, %0 %sub52.1.1 = sub nsw i32 %3, %1 %cmp97.1 = icmp eq i32 %sub52.1168, %sub52.1.1 br i1 %cmp97.1, label %for.inc109.1, label %if.else for.inc109.1: ; preds = %entry %4 = load i32, ptr %arrayidx4, align 4, !tbaa !5 %sub52 = sub nsw i32 %4, %0 %5 = load i32, ptr %arrayidx4.1, align 16, !tbaa !5 %sub52.1 = sub nsw i32 %5, %1 %cmp97 = icmp eq i32 %sub52, %sub52.1 %sub = sub nsw i32 %1, %0 %sub.1163 = sub nsw i32 %5, %4 %cmp74 = icmp eq i32 %sub, %sub.1163 %sub.2 = sub nsw i32 %3, %2 %cmp81 = icmp eq i32 %sub, %sub.2 %narrow = select i1 %cmp74, i1 %cmp81, i1 false %s.1 = zext i1 %narrow to i32 %6 = load i32, ptr %arrayidx.2, align 8, !tbaa !5 %sub.1 = sub nsw i32 %6, %0 %7 = load i32, ptr %arrayidx4.2, align 4, !tbaa !5 %sub.1.1 = sub nsw i32 %7, %4 %cmp74.1 = icmp eq i32 %sub.1, %sub.1.1 %8 = load i32, ptr %arrayidx7.2, align 16, !tbaa !5 %sub.1.2 = sub nsw i32 %8, %2 %cmp81.1 = icmp eq i32 %sub.1, %sub.1.2 %narrow174 = select i1 %cmp74.1, i1 %cmp81.1, i1 false %spec.select.1 = zext i1 %narrow174 to i32 %s.1.1 = add nuw nsw i32 %s.1, %spec.select.1 %sub52.2 = sub nsw i32 %7, %6 %cmp105 = icmp eq i32 %sub52, %sub52.2 %narrow175 = select i1 %cmp97, i1 %cmp105, i1 false %spec.select149 = zext i1 %narrow175 to i32 %s.3 = add nuw nsw i32 %s.1.1, %spec.select149 %sub52.2.1 = sub nsw i32 %8, %6 %cmp105.1 = icmp eq i32 %sub52.1168, %sub52.2.1 %inc107.1 = zext i1 %cmp105.1 to i32 %spec.select149.1 = add nuw nsw i32 %s.3, %inc107.1 %cmp112 = icmp eq i32 %spec.select149.1, 4 br i1 %cmp112, label %if.end116, label %if.else if.else: ; preds = %entry, %for.inc109.1 br label %if.end116 if.end116: ; preds = %for.inc109.1, %if.else %str.sink = phi ptr [ @str, %if.else ], [ @str.3, %for.inc109.1 ] %puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink) call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %c) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nofree nounwind } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}
#include <stdio.h> int main() { int c[3][3]; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { scanf("%d", &c[i][j]); } } for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { if (c[j][i] - c[j + 1][i] != c[j][i + 1] - c[j + 1][i + 1]) { printf("No"); return 0; } if (c[i][j] - c[i][j + 1] != c[i + 1][j] - c[i + 1][j + 1]) { printf("No"); return 0; } } } printf("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158029/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158029/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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"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: %c = alloca [3 x [3 x i32]], align 16 call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %c) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c) %arrayidx6.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 1 %call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1) %arrayidx6.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 0, i64 2 %call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2) %arrayidx6.1107 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 0 %call.1108 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1107) %arrayidx6.1.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 1 %call.1.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1.1) %arrayidx6.2.1 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 1, i64 2 %call.2.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2.1) %arrayidx6.2109 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 0 %call.2110 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2109) %arrayidx6.1.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 1 %call.1.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.1.2) %arrayidx6.2.2 = getelementptr inbounds [3 x [3 x i32]], ptr %c, i64 0, i64 2, i64 2 %call.2.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx6.2.2) %0 = load i32, ptr %c, align 16, !tbaa !5 %1 = load i32, ptr %arrayidx6.1107, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %arrayidx6.1, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx6.1.1, align 16, !tbaa !5 %sub39 = sub nsw i32 %2, %3 %cmp40.not = icmp eq i32 %sub, %sub39 br i1 %cmp40.not, label %if.end, label %cleanup77 if.end: ; preds = %entry %sub51 = sub nsw i32 %0, %2 %sub63 = sub nsw i32 %1, %3 %cmp64.not = icmp eq i32 %sub51, %sub63 br i1 %cmp64.not, label %for.cond16.1, label %cleanup77, !llvm.loop !9 for.cond16.1: ; preds = %if.end %4 = load i32, ptr %arrayidx6.2109, align 8, !tbaa !5 %sub.1 = sub nsw i32 %1, %4 %5 = load i32, ptr %arrayidx6.1.2, align 4, !tbaa !5 %sub39.1 = sub nsw i32 %3, %5 %cmp40.not.1 = icmp eq i32 %sub.1, %sub39.1 br i1 %cmp40.not.1, label %if.end.1, label %cleanup77 if.end.1: ; preds = %for.cond16.1 %6 = load i32, ptr %arrayidx6.2, align 8, !tbaa !5 %sub51.1 = sub nsw i32 %2, %6 %7 = load i32, ptr %arrayidx6.2.1, align 4, !tbaa !5 %sub63.1 = sub nsw i32 %3, %7 %cmp64.not.1 = icmp eq i32 %sub51.1, %sub63.1 %sub39.1125 = sub nsw i32 %6, %7 %cmp40.not.1126 = icmp eq i32 %sub, %sub39.1125 %or.cond = select i1 %cmp64.not.1, i1 %cmp40.not.1126, i1 false %sub63.1133 = sub nsw i32 %4, %5 %cmp64.not.1134 = icmp eq i32 %sub51, %sub63.1133 %or.cond136 = select i1 %or.cond, i1 %cmp64.not.1134, i1 false br i1 %or.cond136, label %for.cond16.1.1, label %cleanup77, !llvm.loop !9 for.cond16.1.1: ; preds = %if.end.1 %8 = load i32, ptr %arrayidx6.2.2, align 16, !tbaa !5 %sub39.1.1 = sub nsw i32 %7, %8 %cmp40.not.1.1 = icmp eq i32 %sub.1, %sub39.1.1 %sub63.1.1 = sub nsw i32 %5, %8 %cmp64.not.1.1 = icmp eq i32 %sub51.1, %sub63.1.1 %or.cond137 = select i1 %cmp40.not.1.1, i1 %cmp64.not.1.1, i1 false %spec.select = select i1 %or.cond137, ptr @.str.2, ptr @.str.1 br label %cleanup77, !llvm.loop !9 cleanup77: ; preds = %for.cond16.1.1, %if.end, %if.end.1, %entry, %for.cond16.1 %.str.1.sink = phi ptr [ @.str.1, %for.cond16.1 ], [ @.str.1, %entry ], [ @.str.1, %if.end.1 ], [ @.str.1, %if.end ], [ %spec.select, %for.cond16.1.1 ] %call66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink) call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %c) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = distinct !{!9, !10} !10 = !{!"llvm.loop.mustprogress"}
#include <stdio.h> int main(){ int i,c[9],a[3][3],b[3][3]; scanf("%d %d %d",&c[0],&c[1],&c[2]); scanf("%d %d %d",&c[3],&c[4],&c[5]); scanf("%d %d %d",&c[6],&c[7],&c[8]); if(c[0]-c[3]!=c[1]-c[4]||c[1]-c[4]!=c[2]-c[5]){ printf("No"); return 0; } if(c[0]-c[6]!=c[1]-c[7]||c[1]-c[7]!=c[2]-c[8]){ printf("No"); return 0; } if(c[0]-c[1]!=c[3]-c[4]||c[3]-c[4]!=c[6]-c[7]){ printf("No"); return 0; } if(c[0]-c[2]!=c[3]-c[5]||c[3]-c[5]!=c[6]-c[8]){ printf("No"); return 0; } printf("Yes"); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158072/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158072/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"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: %c = alloca [9 x i32], align 16 call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %c) #3 %arrayidx1 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 1 %arrayidx2 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 2 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2) %arrayidx3 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 3 %arrayidx4 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 4 %arrayidx5 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 5 %call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx4, ptr noundef nonnull %arrayidx5) %arrayidx7 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 6 %arrayidx8 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 7 %arrayidx9 = getelementptr inbounds [9 x i32], ptr %c, i64 0, i64 8 %call10 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7, ptr noundef nonnull %arrayidx8, ptr noundef nonnull %arrayidx9) %0 = load i32, ptr %c, align 16, !tbaa !5 %1 = load i32, ptr %arrayidx3, align 4, !tbaa !5 %sub = sub nsw i32 %0, %1 %2 = load i32, ptr %arrayidx1, align 4, !tbaa !5 %3 = load i32, ptr %arrayidx4, align 16, !tbaa !5 %sub15 = sub nsw i32 %2, %3 %cmp.not = icmp eq i32 %sub, %sub15 br i1 %cmp.not, label %lor.lhs.false, label %cleanup lor.lhs.false: ; preds = %entry %4 = load i32, ptr %arrayidx2, align 8, !tbaa !5 %5 = load i32, ptr %arrayidx5, align 4, !tbaa !5 %sub21 = sub nsw i32 %4, %5 %cmp22.not = icmp eq i32 %sub, %sub21 br i1 %cmp22.not, label %if.end, label %cleanup if.end: ; preds = %lor.lhs.false %6 = load i32, ptr %arrayidx7, align 8, !tbaa !5 %sub26 = sub nsw i32 %0, %6 %7 = load i32, ptr %arrayidx8, align 4, !tbaa !5 %sub29 = sub nsw i32 %2, %7 %cmp30.not = icmp eq i32 %sub26, %sub29 br i1 %cmp30.not, label %lor.lhs.false31, label %cleanup lor.lhs.false31: ; preds = %if.end %8 = load i32, ptr %arrayidx9, align 16, !tbaa !5 %sub37 = sub nsw i32 %4, %8 %cmp38.not = icmp eq i32 %sub26, %sub37 br i1 %cmp38.not, label %if.end41, label %cleanup if.end41: ; preds = %lor.lhs.false31 %sub44 = sub nsw i32 %0, %2 %sub47 = sub nsw i32 %1, %3 %cmp48.not = icmp eq i32 %sub44, %sub47 %sub55 = sub nsw i32 %6, %7 %cmp56.not = icmp eq i32 %sub47, %sub55 %or.cond = select i1 %cmp48.not, i1 %cmp56.not, i1 false br i1 %or.cond, label %if.end59, label %cleanup if.end59: ; preds = %if.end41 %sub62 = sub nsw i32 %0, %4 %sub65 = sub nsw i32 %1, %5 %cmp66.not = icmp eq i32 %sub62, %sub65 %sub73 = sub nsw i32 %6, %8 %cmp74.not = icmp eq i32 %sub65, %sub73 %or.cond82 = select i1 %cmp66.not, i1 %cmp74.not, i1 false %.str.2..str.1 = select i1 %or.cond82, ptr @.str.2, ptr @.str.1 br label %cleanup cleanup: ; preds = %if.end59, %if.end41, %if.end, %lor.lhs.false31, %entry, %lor.lhs.false %.str.2.sink = phi ptr [ @.str.1, %lor.lhs.false ], [ @.str.1, %entry ], [ @.str.1, %lor.lhs.false31 ], [ @.str.1, %if.end ], [ @.str.1, %if.end41 ], [ %.str.2..str.1, %if.end59 ] %call78 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink) call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %c) #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(void){ int N=0; scanf("%d",&N); char S[30001]={}; scanf("%s",S); int pin=0,count=0,i=0,j=0; int digit[3]; for(int pin=0;pin<1000;pin++){ digit[2] = pin%10; digit[1] =(pin/10)%10; digit[0] = pin/100; for(i=0,j=0;i<N && j<3 ;i++){ if(S[i] == '0' + digit[j]){ j++; } if(j==3){ count++; } } } printf("%d",count); fflush(stdout); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158115/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158115/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @stdout = external local_unnamed_addr global ptr, align 8 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %N = alloca i32, align 4 %S = alloca [30001 x i8], align 16 %digit = alloca [3 x i32], align 4 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4 store i32 0, ptr %N, align 4, !tbaa !5 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N) call void @llvm.lifetime.start.p0(i64 30001, ptr nonnull %S) #4 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(30001) %S, i8 0, i64 30001, i1 false) %call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %S) call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %digit) #4 %arrayidx = getelementptr inbounds [3 x i32], ptr %digit, i64 0, i64 2 %arrayidx4 = getelementptr inbounds [3 x i32], ptr %digit, i64 0, i64 1 %0 = load i32, ptr %N, align 4, !tbaa !5 %cmp841 = icmp sgt i32 %0, 0 br i1 %cmp841, label %for.body.us.preheader, label %for.cond.cleanup for.body.us.preheader: ; preds = %entry %1 = zext i32 %0 to i64 br label %for.body.us for.body.us: ; preds = %for.body.us.preheader, %for.cond7.for.inc22_crit_edge.us %pin2.046.us = phi i32 [ %inc23.us, %for.cond7.for.inc22_crit_edge.us ], [ 0, %for.body.us.preheader ] %count.045.us = phi i32 [ %count.2.us, %for.cond7.for.inc22_crit_edge.us ], [ 0, %for.body.us.preheader ] %rem.lhs.trunc.us = trunc i32 %pin2.046.us to i16 %rem37.us = urem i16 %rem.lhs.trunc.us, 10 %rem.zext.us = zext i16 %rem37.us to i32 store i32 %rem.zext.us, ptr %arrayidx, align 4, !tbaa !5 %div38.us = udiv i16 %rem.lhs.trunc.us, 10 %rem3.lhs.trunc.us = trunc i16 %div38.us to i8 %rem339.us = urem i8 %rem3.lhs.trunc.us, 10 %rem3.zext.us = zext i8 %rem339.us to i32 store i32 %rem3.zext.us, ptr %arrayidx4, align 4, !tbaa !5 %div540.us = udiv i16 %rem.lhs.trunc.us, 100 %div5.zext.us = zext i16 %div540.us to i32 store i32 %div5.zext.us, ptr %digit, align 4, !tbaa !5 br label %for.body10.us for.body10.us: ; preds = %for.body.us, %for.body10.us %indvars.iv = phi i64 [ 0, %for.body.us ], [ %indvars.iv.next, %for.body10.us ] %j.044.us = phi i32 [ 0, %for.body.us ], [ %spec.select.us, %for.body10.us ] %count.142.us = phi i32 [ %count.045.us, %for.body.us ], [ %count.2.us, %for.body10.us ] %arrayidx11.us = getelementptr inbounds [30001 x i8], ptr %S, i64 0, i64 %indvars.iv %2 = load i8, ptr %arrayidx11.us, align 1, !tbaa !9 %conv.us = sext i8 %2 to i32 %idxprom12.us = zext i32 %j.044.us to i64 %arrayidx13.us = getelementptr inbounds [3 x i32], ptr %digit, i64 0, i64 %idxprom12.us %3 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5 %add.us = add nsw i32 %3, 48 %cmp14.us = icmp eq i32 %add.us, %conv.us %inc.us = zext i1 %cmp14.us to i32 %spec.select.us = add nuw nsw i32 %j.044.us, %inc.us %cmp16.us = icmp eq i32 %spec.select.us, 3 %inc19.us = zext i1 %cmp16.us to i32 %count.2.us = add nsw i32 %count.142.us, %inc19.us %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %cmp8.us = icmp ult i64 %indvars.iv.next, %1 %cmp9.us = icmp ult i32 %spec.select.us, 3 %4 = and i1 %cmp9.us, %cmp8.us br i1 %4, label %for.body10.us, label %for.cond7.for.inc22_crit_edge.us, !llvm.loop !10 for.cond7.for.inc22_crit_edge.us: ; preds = %for.body10.us %inc23.us = add nuw nsw i32 %pin2.046.us, 1 %exitcond.not = icmp eq i32 %inc23.us, 1000 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body.us, !llvm.loop !12 for.cond.cleanup: ; preds = %for.cond7.for.inc22_crit_edge.us, %entry %.us-phi = phi i32 [ 0, %entry ], [ %count.2.us, %for.cond7.for.inc22_crit_edge.us ] %call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.us-phi) %5 = load ptr, ptr @stdout, align 8, !tbaa !13 %call26 = call i32 @fflush(ptr noundef %5) call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %digit) #4 call void @llvm.lifetime.end.p0(i64 30001, ptr nonnull %S) #4 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #4 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"int", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"} !9 = !{!7, !7, i64 0} !10 = distinct !{!10, !11} !11 = !{!"llvm.loop.mustprogress"} !12 = distinct !{!12, !11} !13 = !{!14, !14, i64 0} !14 = !{!"any pointer", !7, i64 0}
#include <stdio.h> #define NDEBUG #include <assert.h> #include <stdlib.h> #include <string.h> #include <math.h> // for DEBUG {{{ #ifdef NDEBUG #define DEBUG_PRINT(fmt, ...) ((void)0) #else #define DEBUG_PRINT(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__) #endif #define ASSERT_RANGE(min,x,max) assert(((x)>=(min)) && ((x)<=(max))) // }}} int sort_int(int *a, int N) {// {{{ int i; for (i = 0; i < N-1; i++) { int j; for (j = i + 1; j < N; j++) { if (a[i] > a[j]) { int tmp = a[i]; a[i] = a[j]; a[j] = tmp; } } } return 0; }// }}} void merge_int(int *a, int *b, int lower, int sep, int upper) {// {{{ int i_lower = lower; int i_upper = sep; int i_b = 0; while ((i_lower < sep) && (i_upper < upper)) { if (a[i_lower] < a[i_upper]) { b[i_b++] = a[i_lower++]; } else { b[i_b++] = a[i_upper++]; } } if (i_lower >= sep) { while (i_upper < upper) { b[i_b++] = a[i_upper++]; } } else { while (i_lower < sep) { b[i_b++] = a[i_lower++]; } } for (i_lower = 0; i_lower < i_b; i_lower++) { a[i_lower+lower] = b[i_lower]; } }// }}} void merge_sort_int(int *a, int *b, int lower, int upper) {// {{{ int sep; if ((lower == upper) || (lower + 1 == upper)) { return; } sep = (lower + upper) / 2; merge_sort_int(a,b,lower,sep); merge_sort_int(a,b,sep,upper); merge_int(a,b,lower,sep,upper); }// }}} #define S_MAX 30000 int main(int argc, char **argv) { int n; char s[S_MAX+1]; fscanf(stdin,"%d",&n) > 0; fscanf(stdin,"%s",s) > 0; assert(strlen(s) == n); int init_index[10]; int end_index[10]; { int i; for (i = 0; i < 10; i++) { init_index[i] = -1; end_index[i] = -1; } } { int i; for (i = 0; i < n; i++) { int index = (s[i] - '0'); end_index[index] = i; if (init_index[index] < 0) { init_index[index] = i; } } } #ifndef NDEBUG { int i; for (i = 0; i < 10; i++) { fprintf(stderr,"%d %d %d\n", i, init_index[i],end_index[i]); } } #endif int ret = 0; { int i; for (i = 0; i < 10; i++) { int init = init_index[i]; if (init < 0) { continue; } int j; for (j = 0; j < 10; j++) { int end = end_index[j]; if (init >= end) { continue; } DEBUG_PRINT("%d %d %d %d\n",i,j,init,end); int mid_index[10]; memset(mid_index,0,sizeof(int)*10); { int k; for (k = init+1; k < end; k++) { int index = (s[k] - '0'); mid_index[index] = 1; } } { int k; for (k = 0; k < 10; k++) { ret += mid_index[k]; } } } } } fprintf(stdout,"%d\n",ret); return 0; }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158159/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158159/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @stdin = external local_unnamed_addr global ptr, align 8 @.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1 @stdout = external local_unnamed_addr global ptr, align 8 @.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1 ; Function Attrs: nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable define dso_local i32 @sort_int(ptr nocapture noundef %a, i32 noundef %N) local_unnamed_addr #0 { entry: %cmp36 = icmp sgt i32 %N, 1 br i1 %cmp36, label %for.body.preheader, label %for.end17 for.body.preheader: ; preds = %entry %sub = add nsw i32 %N, -1 %0 = zext i32 %N to i64 %wide.trip.count44 = zext i32 %sub to i64 %wide.trip.count = zext i32 %N to i64 br label %for.body for.cond.loopexit: ; preds = %for.inc, %for.body %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1 %exitcond45.not = icmp eq i64 %indvars.iv.next42, %wide.trip.count44 br i1 %exitcond45.not, label %for.end17, label %for.body, !llvm.loop !5 for.body: ; preds = %for.body.preheader, %for.cond.loopexit %indvars.iv41 = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next42, %for.cond.loopexit ] %indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.cond.loopexit ] %indvars.iv.next42 = add nuw nsw i64 %indvars.iv41, 1 %cmp234 = icmp ult i64 %indvars.iv.next42, %0 br i1 %cmp234, label %for.body3.lr.ph, label %for.cond.loopexit for.body3.lr.ph: ; preds = %for.body %arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv41 br label %for.body3 for.body3: ; preds = %for.body3.lr.ph, %for.inc %indvars.iv38 = phi i64 [ %indvars.iv, %for.body3.lr.ph ], [ %indvars.iv.next39, %for.inc ] %1 = load i32, ptr %arrayidx, align 4, !tbaa !7 %arrayidx5 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv38 %2 = load i32, ptr %arrayidx5, align 4, !tbaa !7 %cmp6 = icmp sgt i32 %1, %2 br i1 %cmp6, label %if.then, label %for.inc if.then: ; preds = %for.body3 store i32 %2, ptr %arrayidx, align 4, !tbaa !7 store i32 %1, ptr %arrayidx5, align 4, !tbaa !7 br label %for.inc for.inc: ; preds = %for.body3, %if.then %indvars.iv.next39 = add nuw nsw i64 %indvars.iv38, 1 %exitcond.not = icmp eq i64 %indvars.iv.next39, %wide.trip.count br i1 %exitcond.not, label %for.cond.loopexit, label %for.body3, !llvm.loop !11 for.end17: ; preds = %for.cond.loopexit, %entry ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @merge_int(ptr nocapture noundef %a, ptr nocapture noundef %b, i32 noundef %lower, i32 noundef %sep, i32 noundef %upper) local_unnamed_addr #2 { entry: %b158 = ptrtoint ptr %b to i64 %a137 = ptrtoint ptr %a to i64 %b136 = ptrtoint ptr %b to i64 %a130 = ptrtoint ptr %a to i64 %b129 = ptrtoint ptr %b to i64 %cmp80 = icmp slt i32 %lower, %sep %cmp181 = icmp slt i32 %sep, %upper %0 = and i1 %cmp80, %cmp181 br i1 %0, label %while.body, label %while.end while.body: ; preds = %entry, %while.body %indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ] %i_upper.083 = phi i32 [ %i_upper.1, %while.body ], [ %sep, %entry ] %i_lower.082 = phi i32 [ %i_lower.1, %while.body ], [ %lower, %entry ] %idxprom = sext i32 %i_lower.082 to i64 %arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom %1 = load i32, ptr %arrayidx, align 4, !tbaa !7 %idxprom2 = sext i32 %i_upper.083 to i64 %arrayidx3 = getelementptr inbounds i32, ptr %a, i64 %idxprom2 %2 = load i32, ptr %arrayidx3, align 4, !tbaa !7 %cmp4 = icmp slt i32 %1, %2 %.sink = tail call i32 @llvm.smin.i32(i32 %1, i32 %2) %inc = zext i1 %cmp4 to i32 %i_lower.1 = add nsw i32 %i_lower.082, %inc %not.cmp4 = xor i1 %cmp4, true %inc10 = zext i1 %not.cmp4 to i32 %i_upper.1 = add nsw i32 %i_upper.083, %inc10 %3 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv store i32 %.sink, ptr %3, align 4 %indvars.iv.next = add nuw i64 %indvars.iv, 1 %cmp = icmp slt i32 %i_lower.1, %sep %cmp1 = icmp slt i32 %i_upper.1, %upper %4 = select i1 %cmp, i1 %cmp1, i1 false br i1 %4, label %while.body, label %while.end.loopexit, !llvm.loop !12 while.end.loopexit: ; preds = %while.body %5 = trunc i64 %indvars.iv.next to i32 br i1 %cmp, label %while.cond29.preheader, label %while.cond18.preheader while.end: ; preds = %entry br i1 %cmp80, label %while.cond29.preheader, label %while.cond18.preheader while.cond18.preheader: ; preds = %while.end.loopexit, %while.end %i_b.0.lcssa128 = phi i32 [ %5, %while.end.loopexit ], [ 0, %while.end ] %i_upper.0.lcssa126 = phi i32 [ %i_upper.1, %while.end.loopexit ], [ %sep, %while.end ] %cmp1988 = icmp slt i32 %i_upper.0.lcssa126, %upper br i1 %cmp1988, label %while.body20.preheader, label %if.end39 while.body20.preheader: ; preds = %while.cond18.preheader %6 = zext i32 %i_b.0.lcssa128 to i64 %7 = sext i32 %i_upper.0.lcssa126 to i64 %wide.trip.count = sext i32 %upper to i64 %8 = sub nsw i64 %wide.trip.count, %7 %min.iters.check = icmp ult i64 %8, 12 br i1 %min.iters.check, label %while.body20.preheader176, label %vector.memcheck vector.memcheck: ; preds = %while.body20.preheader %9 = shl nuw nsw i64 %6, 2 %10 = add i64 %9, %b129 %11 = shl nsw i64 %7, 2 %12 = add i64 %11, %a130 %13 = sub i64 %10, %12 %diff.check = icmp ult i64 %13, 32 br i1 %diff.check, label %while.body20.preheader176, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %8, -8 %ind.end = add nsw i64 %n.vec, %7 %ind.end131 = add nsw i64 %n.vec, %6 %invariant.gep184 = getelementptr i32, ptr %a, i64 %7 %invariant.gep186 = getelementptr i32, ptr %b, i64 %6 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %gep185 = getelementptr i32, ptr %invariant.gep184, i64 %index %wide.load = load <4 x i32>, ptr %gep185, align 4, !tbaa !7 %14 = getelementptr inbounds i32, ptr %gep185, i64 4 %wide.load134 = load <4 x i32>, ptr %14, align 4, !tbaa !7 %gep187 = getelementptr i32, ptr %invariant.gep186, i64 %index store <4 x i32> %wide.load, ptr %gep187, align 4, !tbaa !7 %15 = getelementptr inbounds i32, ptr %gep187, i64 4 store <4 x i32> %wide.load134, ptr %15, align 4, !tbaa !7 %index.next = add nuw i64 %index, 8 %16 = icmp eq i64 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !13 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %8, %n.vec br i1 %cmp.n, label %if.end39.loopexit98, label %while.body20.preheader176 while.body20.preheader176: ; preds = %vector.memcheck, %while.body20.preheader, %middle.block %indvars.iv104.ph = phi i64 [ %7, %vector.memcheck ], [ %7, %while.body20.preheader ], [ %ind.end, %middle.block ] %indvars.iv102.ph = phi i64 [ %6, %vector.memcheck ], [ %6, %while.body20.preheader ], [ %ind.end131, %middle.block ] %17 = sub nsw i64 %wide.trip.count, %indvars.iv104.ph %18 = xor i64 %indvars.iv104.ph, -1 %19 = add nsw i64 %18, %wide.trip.count %xtraiter = and i64 %17, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.body20.prol.loopexit, label %while.body20.prol while.body20.prol: ; preds = %while.body20.preheader176, %while.body20.prol %indvars.iv104.prol = phi i64 [ %indvars.iv.next105.prol, %while.body20.prol ], [ %indvars.iv104.ph, %while.body20.preheader176 ] %indvars.iv102.prol = phi i64 [ %indvars.iv.next103.prol, %while.body20.prol ], [ %indvars.iv102.ph, %while.body20.preheader176 ] %prol.iter = phi i64 [ %prol.iter.next, %while.body20.prol ], [ 0, %while.body20.preheader176 ] %indvars.iv.next105.prol = add nsw i64 %indvars.iv104.prol, 1 %arrayidx23.prol = getelementptr inbounds i32, ptr %a, i64 %indvars.iv104.prol %20 = load i32, ptr %arrayidx23.prol, align 4, !tbaa !7 %indvars.iv.next103.prol = add nuw nsw i64 %indvars.iv102.prol, 1 %arrayidx26.prol = getelementptr inbounds i32, ptr %b, i64 %indvars.iv102.prol store i32 %20, ptr %arrayidx26.prol, align 4, !tbaa !7 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %while.body20.prol.loopexit, label %while.body20.prol, !llvm.loop !16 while.body20.prol.loopexit: ; preds = %while.body20.prol, %while.body20.preheader176 %indvars.iv.next103.lcssa177.unr = phi i64 [ undef, %while.body20.preheader176 ], [ %indvars.iv.next103.prol, %while.body20.prol ] %indvars.iv104.unr = phi i64 [ %indvars.iv104.ph, %while.body20.preheader176 ], [ %indvars.iv.next105.prol, %while.body20.prol ] %indvars.iv102.unr = phi i64 [ %indvars.iv102.ph, %while.body20.preheader176 ], [ %indvars.iv.next103.prol, %while.body20.prol ] %21 = icmp ult i64 %19, 3 br i1 %21, label %if.end39.loopexit98, label %while.body20.preheader176.new while.body20.preheader176.new: ; preds = %while.body20.prol.loopexit %invariant.gep188 = getelementptr i32, ptr %a, i64 1 %invariant.gep190 = getelementptr i32, ptr %b, i64 1 %invariant.gep192 = getelementptr i32, ptr %a, i64 2 %invariant.gep194 = getelementptr i32, ptr %b, i64 2 %invariant.gep196 = getelementptr i32, ptr %a, i64 3 %invariant.gep198 = getelementptr i32, ptr %b, i64 3 br label %while.body20 while.cond29.preheader: ; preds = %while.end.loopexit, %while.end %i_b.0.lcssa127 = phi i32 [ %5, %while.end.loopexit ], [ 0, %while.end ] %i_lower.0.lcssa125 = phi i32 [ %i_lower.1, %while.end.loopexit ], [ %lower, %while.end ] %cmp3092 = icmp slt i32 %i_lower.0.lcssa125, %sep br i1 %cmp3092, label %while.body31.preheader, label %if.end39 while.body31.preheader: ; preds = %while.cond29.preheader %22 = zext i32 %i_b.0.lcssa127 to i64 %23 = sext i32 %i_lower.0.lcssa125 to i64 %wide.trip.count117 = sext i32 %sep to i64 %24 = sub nsw i64 %wide.trip.count117, %23 %min.iters.check141 = icmp ult i64 %24, 12 br i1 %min.iters.check141, label %while.body31.preheader174, label %vector.memcheck135 vector.memcheck135: ; preds = %while.body31.preheader %25 = shl nuw nsw i64 %22, 2 %26 = add i64 %25, %b136 %27 = shl nsw i64 %23, 2 %28 = add i64 %27, %a137 %29 = sub i64 %26, %28 %diff.check138 = icmp ult i64 %29, 32 br i1 %diff.check138, label %while.body31.preheader174, label %vector.ph142 vector.ph142: ; preds = %vector.memcheck135 %n.vec144 = and i64 %24, -8 %ind.end145 = add nsw i64 %n.vec144, %23 %ind.end147 = add nsw i64 %n.vec144, %22 %invariant.gep200 = getelementptr i32, ptr %a, i64 %23 %invariant.gep202 = getelementptr i32, ptr %b, i64 %22 br label %vector.body150 vector.body150: ; preds = %vector.body150, %vector.ph142 %index151 = phi i64 [ 0, %vector.ph142 ], [ %index.next156, %vector.body150 ] %gep201 = getelementptr i32, ptr %invariant.gep200, i64 %index151 %wide.load154 = load <4 x i32>, ptr %gep201, align 4, !tbaa !7 %30 = getelementptr inbounds i32, ptr %gep201, i64 4 %wide.load155 = load <4 x i32>, ptr %30, align 4, !tbaa !7 %gep203 = getelementptr i32, ptr %invariant.gep202, i64 %index151 store <4 x i32> %wide.load154, ptr %gep203, align 4, !tbaa !7 %31 = getelementptr inbounds i32, ptr %gep203, i64 4 store <4 x i32> %wide.load155, ptr %31, align 4, !tbaa !7 %index.next156 = add nuw i64 %index151, 8 %32 = icmp eq i64 %index.next156, %n.vec144 br i1 %32, label %middle.block139, label %vector.body150, !llvm.loop !18 middle.block139: ; preds = %vector.body150 %cmp.n149 = icmp eq i64 %24, %n.vec144 br i1 %cmp.n149, label %if.end39.loopexit, label %while.body31.preheader174 while.body31.preheader174: ; preds = %vector.memcheck135, %while.body31.preheader, %middle.block139 %indvars.iv112.ph = phi i64 [ %23, %vector.memcheck135 ], [ %23, %while.body31.preheader ], [ %ind.end145, %middle.block139 ] %indvars.iv110.ph = phi i64 [ %22, %vector.memcheck135 ], [ %22, %while.body31.preheader ], [ %ind.end147, %middle.block139 ] %33 = sub nsw i64 %wide.trip.count117, %indvars.iv112.ph %34 = xor i64 %indvars.iv112.ph, -1 %35 = add nsw i64 %34, %wide.trip.count117 %xtraiter178 = and i64 %33, 3 %lcmp.mod179.not = icmp eq i64 %xtraiter178, 0 br i1 %lcmp.mod179.not, label %while.body31.prol.loopexit, label %while.body31.prol while.body31.prol: ; preds = %while.body31.preheader174, %while.body31.prol %indvars.iv112.prol = phi i64 [ %indvars.iv.next113.prol, %while.body31.prol ], [ %indvars.iv112.ph, %while.body31.preheader174 ] %indvars.iv110.prol = phi i64 [ %indvars.iv.next111.prol, %while.body31.prol ], [ %indvars.iv110.ph, %while.body31.preheader174 ] %prol.iter180 = phi i64 [ %prol.iter180.next, %while.body31.prol ], [ 0, %while.body31.preheader174 ] %indvars.iv.next113.prol = add nsw i64 %indvars.iv112.prol, 1 %arrayidx34.prol = getelementptr inbounds i32, ptr %a, i64 %indvars.iv112.prol %36 = load i32, ptr %arrayidx34.prol, align 4, !tbaa !7 %indvars.iv.next111.prol = add nuw nsw i64 %indvars.iv110.prol, 1 %arrayidx37.prol = getelementptr inbounds i32, ptr %b, i64 %indvars.iv110.prol store i32 %36, ptr %arrayidx37.prol, align 4, !tbaa !7 %prol.iter180.next = add i64 %prol.iter180, 1 %prol.iter180.cmp.not = icmp eq i64 %prol.iter180.next, %xtraiter178 br i1 %prol.iter180.cmp.not, label %while.body31.prol.loopexit, label %while.body31.prol, !llvm.loop !19 while.body31.prol.loopexit: ; preds = %while.body31.prol, %while.body31.preheader174 %indvars.iv.next111.lcssa175.unr = phi i64 [ undef, %while.body31.preheader174 ], [ %indvars.iv.next111.prol, %while.body31.prol ] %indvars.iv112.unr = phi i64 [ %indvars.iv112.ph, %while.body31.preheader174 ], [ %indvars.iv.next113.prol, %while.body31.prol ] %indvars.iv110.unr = phi i64 [ %indvars.iv110.ph, %while.body31.preheader174 ], [ %indvars.iv.next111.prol, %while.body31.prol ] %37 = icmp ult i64 %35, 3 br i1 %37, label %if.end39.loopexit, label %while.body31.preheader174.new while.body31.preheader174.new: ; preds = %while.body31.prol.loopexit %invariant.gep204 = getelementptr i32, ptr %a, i64 1 %invariant.gep206 = getelementptr i32, ptr %b, i64 1 %invariant.gep208 = getelementptr i32, ptr %a, i64 2 %invariant.gep210 = getelementptr i32, ptr %b, i64 2 %invariant.gep212 = getelementptr i32, ptr %a, i64 3 %invariant.gep214 = getelementptr i32, ptr %b, i64 3 br label %while.body31 while.body20: ; preds = %while.body20, %while.body20.preheader176.new %indvars.iv104 = phi i64 [ %indvars.iv104.unr, %while.body20.preheader176.new ], [ %indvars.iv.next105.3, %while.body20 ] %indvars.iv102 = phi i64 [ %indvars.iv102.unr, %while.body20.preheader176.new ], [ %indvars.iv.next103.3, %while.body20 ] %arrayidx23 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv104 %38 = load i32, ptr %arrayidx23, align 4, !tbaa !7 %arrayidx26 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv102 store i32 %38, ptr %arrayidx26, align 4, !tbaa !7 %gep189 = getelementptr i32, ptr %invariant.gep188, i64 %indvars.iv104 %39 = load i32, ptr %gep189, align 4, !tbaa !7 %gep191 = getelementptr i32, ptr %invariant.gep190, i64 %indvars.iv102 store i32 %39, ptr %gep191, align 4, !tbaa !7 %gep193 = getelementptr i32, ptr %invariant.gep192, i64 %indvars.iv104 %40 = load i32, ptr %gep193, align 4, !tbaa !7 %gep195 = getelementptr i32, ptr %invariant.gep194, i64 %indvars.iv102 store i32 %40, ptr %gep195, align 4, !tbaa !7 %indvars.iv.next105.3 = add nsw i64 %indvars.iv104, 4 %gep197 = getelementptr i32, ptr %invariant.gep196, i64 %indvars.iv104 %41 = load i32, ptr %gep197, align 4, !tbaa !7 %indvars.iv.next103.3 = add nuw nsw i64 %indvars.iv102, 4 %gep199 = getelementptr i32, ptr %invariant.gep198, i64 %indvars.iv102 store i32 %41, ptr %gep199, align 4, !tbaa !7 %exitcond.not.3 = icmp eq i64 %indvars.iv.next105.3, %wide.trip.count br i1 %exitcond.not.3, label %if.end39.loopexit98, label %while.body20, !llvm.loop !20 while.body31: ; preds = %while.body31, %while.body31.preheader174.new %indvars.iv112 = phi i64 [ %indvars.iv112.unr, %while.body31.preheader174.new ], [ %indvars.iv.next113.3, %while.body31 ] %indvars.iv110 = phi i64 [ %indvars.iv110.unr, %while.body31.preheader174.new ], [ %indvars.iv.next111.3, %while.body31 ] %arrayidx34 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv112 %42 = load i32, ptr %arrayidx34, align 4, !tbaa !7 %arrayidx37 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv110 store i32 %42, ptr %arrayidx37, align 4, !tbaa !7 %gep205 = getelementptr i32, ptr %invariant.gep204, i64 %indvars.iv112 %43 = load i32, ptr %gep205, align 4, !tbaa !7 %gep207 = getelementptr i32, ptr %invariant.gep206, i64 %indvars.iv110 store i32 %43, ptr %gep207, align 4, !tbaa !7 %gep209 = getelementptr i32, ptr %invariant.gep208, i64 %indvars.iv112 %44 = load i32, ptr %gep209, align 4, !tbaa !7 %gep211 = getelementptr i32, ptr %invariant.gep210, i64 %indvars.iv110 store i32 %44, ptr %gep211, align 4, !tbaa !7 %indvars.iv.next113.3 = add nsw i64 %indvars.iv112, 4 %gep213 = getelementptr i32, ptr %invariant.gep212, i64 %indvars.iv112 %45 = load i32, ptr %gep213, align 4, !tbaa !7 %indvars.iv.next111.3 = add nuw nsw i64 %indvars.iv110, 4 %gep215 = getelementptr i32, ptr %invariant.gep214, i64 %indvars.iv110 store i32 %45, ptr %gep215, align 4, !tbaa !7 %exitcond118.not.3 = icmp eq i64 %indvars.iv.next113.3, %wide.trip.count117 br i1 %exitcond118.not.3, label %if.end39.loopexit, label %while.body31, !llvm.loop !21 if.end39.loopexit: ; preds = %while.body31.prol.loopexit, %while.body31, %middle.block139 %indvars.iv.next111.lcssa = phi i64 [ %ind.end147, %middle.block139 ], [ %indvars.iv.next111.lcssa175.unr, %while.body31.prol.loopexit ], [ %indvars.iv.next111.3, %while.body31 ] %46 = trunc i64 %indvars.iv.next111.lcssa to i32 br label %if.end39 if.end39.loopexit98: ; preds = %while.body20.prol.loopexit, %while.body20, %middle.block %indvars.iv.next103.lcssa = phi i64 [ %ind.end131, %middle.block ], [ %indvars.iv.next103.lcssa177.unr, %while.body20.prol.loopexit ], [ %indvars.iv.next103.3, %while.body20 ] %47 = trunc i64 %indvars.iv.next103.lcssa to i32 br label %if.end39 if.end39: ; preds = %if.end39.loopexit98, %if.end39.loopexit, %while.cond18.preheader, %while.cond29.preheader %i_b.4 = phi i32 [ %i_b.0.lcssa127, %while.cond29.preheader ], [ %i_b.0.lcssa128, %while.cond18.preheader ], [ %46, %if.end39.loopexit ], [ %47, %if.end39.loopexit98 ] %cmp4096 = icmp sgt i32 %i_b.4, 0 br i1 %cmp4096, label %for.body.preheader, label %for.end for.body.preheader: ; preds = %if.end39 %48 = sext i32 %lower to i64 %wide.trip.count123 = zext i32 %i_b.4 to i64 %invariant.gep = getelementptr i32, ptr %a, i64 %48 %min.iters.check162 = icmp ult i32 %i_b.4, 12 br i1 %min.iters.check162, label %for.body.preheader173, label %vector.memcheck157 vector.memcheck157: ; preds = %for.body.preheader %49 = shl nsw i64 %48, 2 %50 = add i64 %49, %a137 %51 = sub i64 %50, %b158 %diff.check159 = icmp ult i64 %51, 32 br i1 %diff.check159, label %for.body.preheader173, label %vector.ph163 vector.ph163: ; preds = %vector.memcheck157 %n.vec165 = and i64 %wide.trip.count123, 4294967288 br label %vector.body168 vector.body168: ; preds = %vector.body168, %vector.ph163 %index169 = phi i64 [ 0, %vector.ph163 ], [ %index.next172, %vector.body168 ] %52 = getelementptr inbounds i32, ptr %b, i64 %index169 %wide.load170 = load <4 x i32>, ptr %52, align 4, !tbaa !7 %53 = getelementptr inbounds i32, ptr %52, i64 4 %wide.load171 = load <4 x i32>, ptr %53, align 4, !tbaa !7 %54 = getelementptr i32, ptr %invariant.gep, i64 %index169 store <4 x i32> %wide.load170, ptr %54, align 4, !tbaa !7 %55 = getelementptr i32, ptr %54, i64 4 store <4 x i32> %wide.load171, ptr %55, align 4, !tbaa !7 %index.next172 = add nuw i64 %index169, 8 %56 = icmp eq i64 %index.next172, %n.vec165 br i1 %56, label %middle.block160, label %vector.body168, !llvm.loop !22 middle.block160: ; preds = %vector.body168 %cmp.n167 = icmp eq i64 %n.vec165, %wide.trip.count123 br i1 %cmp.n167, label %for.end, label %for.body.preheader173 for.body.preheader173: ; preds = %vector.memcheck157, %for.body.preheader, %middle.block160 %indvars.iv119.ph = phi i64 [ 0, %vector.memcheck157 ], [ 0, %for.body.preheader ], [ %n.vec165, %middle.block160 ] %57 = xor i64 %indvars.iv119.ph, -1 %58 = add nsw i64 %57, %wide.trip.count123 %xtraiter181 = and i64 %wide.trip.count123, 3 %lcmp.mod182.not = icmp eq i64 %xtraiter181, 0 br i1 %lcmp.mod182.not, label %for.body.prol.loopexit, label %for.body.prol for.body.prol: ; preds = %for.body.preheader173, %for.body.prol %indvars.iv119.prol = phi i64 [ %indvars.iv.next120.prol, %for.body.prol ], [ %indvars.iv119.ph, %for.body.preheader173 ] %prol.iter183 = phi i64 [ %prol.iter183.next, %for.body.prol ], [ 0, %for.body.preheader173 ] %arrayidx42.prol = getelementptr inbounds i32, ptr %b, i64 %indvars.iv119.prol %59 = load i32, ptr %arrayidx42.prol, align 4, !tbaa !7 %gep.prol = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv119.prol store i32 %59, ptr %gep.prol, align 4, !tbaa !7 %indvars.iv.next120.prol = add nuw nsw i64 %indvars.iv119.prol, 1 %prol.iter183.next = add i64 %prol.iter183, 1 %prol.iter183.cmp.not = icmp eq i64 %prol.iter183.next, %xtraiter181 br i1 %prol.iter183.cmp.not, label %for.body.prol.loopexit, label %for.body.prol, !llvm.loop !23 for.body.prol.loopexit: ; preds = %for.body.prol, %for.body.preheader173 %indvars.iv119.unr = phi i64 [ %indvars.iv119.ph, %for.body.preheader173 ], [ %indvars.iv.next120.prol, %for.body.prol ] %60 = icmp ult i64 %58, 3 br i1 %60, label %for.end, label %for.body for.body: ; preds = %for.body.prol.loopexit, %for.body %indvars.iv119 = phi i64 [ %indvars.iv.next120.3, %for.body ], [ %indvars.iv119.unr, %for.body.prol.loopexit ] %arrayidx42 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv119 %61 = load i32, ptr %arrayidx42, align 4, !tbaa !7 %gep = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv119 store i32 %61, ptr %gep, align 4, !tbaa !7 %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1 %arrayidx42.1 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.next120 %62 = load i32, ptr %arrayidx42.1, align 4, !tbaa !7 %gep.1 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next120 store i32 %62, ptr %gep.1, align 4, !tbaa !7 %indvars.iv.next120.1 = add nuw nsw i64 %indvars.iv119, 2 %arrayidx42.2 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.next120.1 %63 = load i32, ptr %arrayidx42.2, align 4, !tbaa !7 %gep.2 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next120.1 store i32 %63, ptr %gep.2, align 4, !tbaa !7 %indvars.iv.next120.2 = add nuw nsw i64 %indvars.iv119, 3 %arrayidx42.3 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.next120.2 %64 = load i32, ptr %arrayidx42.3, align 4, !tbaa !7 %gep.3 = getelementptr i32, ptr %invariant.gep, i64 %indvars.iv.next120.2 store i32 %64, ptr %gep.3, align 4, !tbaa !7 %indvars.iv.next120.3 = add nuw nsw i64 %indvars.iv119, 4 %exitcond124.not.3 = icmp eq i64 %indvars.iv.next120.3, %wide.trip.count123 br i1 %exitcond124.not.3, label %for.end, label %for.body, !llvm.loop !24 for.end: ; preds = %for.body.prol.loopexit, %for.body, %middle.block160, %if.end39 ret void } ; Function Attrs: nofree nosync nounwind memory(argmem: readwrite) uwtable define dso_local void @merge_sort_int(ptr noundef %a, ptr noundef %b, i32 noundef %lower, i32 noundef %upper) local_unnamed_addr #2 { entry: %b48 = ptrtoint ptr %b to i64 %a27 = ptrtoint ptr %a to i64 %b26 = ptrtoint ptr %b to i64 %a20 = ptrtoint ptr %a to i64 %b19 = ptrtoint ptr %b to i64 %cmp = icmp eq i32 %lower, %upper %add = add nsw i32 %lower, 1 %cmp1 = icmp eq i32 %add, %upper %or.cond = select i1 %cmp, i1 true, i1 %cmp1 br i1 %or.cond, label %cleanup, label %if.end if.end: ; preds = %entry %add2 = add nsw i32 %upper, %lower %div = sdiv i32 %add2, 2 tail call void @merge_sort_int(ptr noundef %a, ptr noundef %b, i32 noundef %lower, i32 noundef %div) tail call void @merge_sort_int(ptr noundef %a, ptr noundef %b, i32 noundef %div, i32 noundef %upper) %cmp80.i = icmp sgt i32 %div, %lower %cmp181.i = icmp slt i32 %div, %upper %0 = and i1 %cmp80.i, %cmp181.i br i1 %0, label %while.body.i, label %while.end.i while.body.i: ; preds = %if.end, %while.body.i %indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.body.i ], [ 0, %if.end ] %i_upper.083.i = phi i32 [ %i_upper.1.i, %while.body.i ], [ %div, %if.end ] %i_lower.082.i = phi i32 [ %i_lower.1.i, %while.body.i ], [ %lower, %if.end ] %idxprom.i = sext i32 %i_lower.082.i to i64 %arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %idxprom.i %1 = load i32, ptr %arrayidx.i, align 4, !tbaa !7 %idxprom2.i = sext i32 %i_upper.083.i to i64 %arrayidx3.i = getelementptr inbounds i32, ptr %a, i64 %idxprom2.i %2 = load i32, ptr %arrayidx3.i, align 4, !tbaa !7 %cmp4.i = icmp slt i32 %1, %2 %.sink.i = tail call i32 @llvm.smin.i32(i32 %1, i32 %2) %inc.i = zext i1 %cmp4.i to i32 %i_lower.1.i = add nsw i32 %i_lower.082.i, %inc.i %not.cmp4.i = xor i1 %cmp4.i, true %inc10.i = zext i1 %not.cmp4.i to i32 %i_upper.1.i = add nsw i32 %i_upper.083.i, %inc10.i %3 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.i store i32 %.sink.i, ptr %3, align 4 %indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1 %cmp.i = icmp slt i32 %i_lower.1.i, %div %cmp1.i = icmp slt i32 %i_upper.1.i, %upper %4 = select i1 %cmp.i, i1 %cmp1.i, i1 false br i1 %4, label %while.body.i, label %while.end.loopexit.i, !llvm.loop !12 while.end.loopexit.i: ; preds = %while.body.i %5 = trunc i64 %indvars.iv.next.i to i32 br i1 %cmp.i, label %while.cond29.preheader.i, label %while.cond18.preheader.i while.end.i: ; preds = %if.end br i1 %cmp80.i, label %while.cond29.preheader.i, label %while.cond18.preheader.i while.cond18.preheader.i: ; preds = %while.end.i, %while.end.loopexit.i %i_b.0.lcssa128.i = phi i32 [ %5, %while.end.loopexit.i ], [ 0, %while.end.i ] %i_upper.0.lcssa126.i = phi i32 [ %i_upper.1.i, %while.end.loopexit.i ], [ %div, %while.end.i ] %cmp1988.i = icmp slt i32 %i_upper.0.lcssa126.i, %upper br i1 %cmp1988.i, label %while.body20.preheader.i, label %if.end39.i while.body20.preheader.i: ; preds = %while.cond18.preheader.i %6 = zext i32 %i_b.0.lcssa128.i to i64 %7 = sext i32 %i_upper.0.lcssa126.i to i64 %wide.trip.count.i = sext i32 %upper to i64 %8 = sub nsw i64 %wide.trip.count.i, %7 %min.iters.check = icmp ult i64 %8, 12 br i1 %min.iters.check, label %while.body20.i.preheader, label %vector.memcheck vector.memcheck: ; preds = %while.body20.preheader.i %9 = shl nuw nsw i64 %6, 2 %10 = add i64 %9, %b19 %11 = shl nsw i64 %7, 2 %12 = add i64 %11, %a20 %13 = sub i64 %10, %12 %diff.check = icmp ult i64 %13, 32 br i1 %diff.check, label %while.body20.i.preheader, label %vector.ph vector.ph: ; preds = %vector.memcheck %n.vec = and i64 %8, -8 %ind.end = add nsw i64 %n.vec, %7 %ind.end21 = add nsw i64 %n.vec, %6 %invariant.gep = getelementptr i32, ptr %a, i64 %7 %invariant.gep71 = getelementptr i32, ptr %b, i64 %6 br label %vector.body vector.body: ; preds = %vector.body, %vector.ph %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %gep = getelementptr i32, ptr %invariant.gep, i64 %index %wide.load = load <4 x i32>, ptr %gep, align 4, !tbaa !7 %14 = getelementptr inbounds i32, ptr %gep, i64 4 %wide.load24 = load <4 x i32>, ptr %14, align 4, !tbaa !7 %gep72 = getelementptr i32, ptr %invariant.gep71, i64 %index store <4 x i32> %wide.load, ptr %gep72, align 4, !tbaa !7 %15 = getelementptr inbounds i32, ptr %gep72, i64 4 store <4 x i32> %wide.load24, ptr %15, align 4, !tbaa !7 %index.next = add nuw i64 %index, 8 %16 = icmp eq i64 %index.next, %n.vec br i1 %16, label %middle.block, label %vector.body, !llvm.loop !25 middle.block: ; preds = %vector.body %cmp.n = icmp eq i64 %8, %n.vec br i1 %cmp.n, label %if.end39.loopexit98.i, label %while.body20.i.preheader while.body20.i.preheader: ; preds = %vector.memcheck, %while.body20.preheader.i, %middle.block %indvars.iv104.i.ph = phi i64 [ %7, %vector.memcheck ], [ %7, %while.body20.preheader.i ], [ %ind.end, %middle.block ] %indvars.iv102.i.ph = phi i64 [ %6, %vector.memcheck ], [ %6, %while.body20.preheader.i ], [ %ind.end21, %middle.block ] %17 = sub nsw i64 %wide.trip.count.i, %indvars.iv104.i.ph %18 = xor i64 %indvars.iv104.i.ph, -1 %19 = add nsw i64 %18, %wide.trip.count.i %xtraiter = and i64 %17, 3 %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %while.body20.i.prol.loopexit, label %while.body20.i.prol while.body20.i.prol: ; preds = %while.body20.i.preheader, %while.body20.i.prol %indvars.iv104.i.prol = phi i64 [ %indvars.iv.next105.i.prol, %while.body20.i.prol ], [ %indvars.iv104.i.ph, %while.body20.i.preheader ] %indvars.iv102.i.prol = phi i64 [ %indvars.iv.next103.i.prol, %while.body20.i.prol ], [ %indvars.iv102.i.ph, %while.body20.i.preheader ] %prol.iter = phi i64 [ %prol.iter.next, %while.body20.i.prol ], [ 0, %while.body20.i.preheader ] %indvars.iv.next105.i.prol = add nsw i64 %indvars.iv104.i.prol, 1 %arrayidx23.i.prol = getelementptr inbounds i32, ptr %a, i64 %indvars.iv104.i.prol %20 = load i32, ptr %arrayidx23.i.prol, align 4, !tbaa !7 %indvars.iv.next103.i.prol = add nuw nsw i64 %indvars.iv102.i.prol, 1 %arrayidx26.i.prol = getelementptr inbounds i32, ptr %b, i64 %indvars.iv102.i.prol store i32 %20, ptr %arrayidx26.i.prol, align 4, !tbaa !7 %prol.iter.next = add i64 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter br i1 %prol.iter.cmp.not, label %while.body20.i.prol.loopexit, label %while.body20.i.prol, !llvm.loop !26 while.body20.i.prol.loopexit: ; preds = %while.body20.i.prol, %while.body20.i.preheader %indvars.iv.next103.i.lcssa64.unr = phi i64 [ undef, %while.body20.i.preheader ], [ %indvars.iv.next103.i.prol, %while.body20.i.prol ] %indvars.iv104.i.unr = phi i64 [ %indvars.iv104.i.ph, %while.body20.i.preheader ], [ %indvars.iv.next105.i.prol, %while.body20.i.prol ] %indvars.iv102.i.unr = phi i64 [ %indvars.iv102.i.ph, %while.body20.i.preheader ], [ %indvars.iv.next103.i.prol, %while.body20.i.prol ] %21 = icmp ult i64 %19, 3 br i1 %21, label %if.end39.loopexit98.i, label %while.body20.i.preheader.new while.body20.i.preheader.new: ; preds = %while.body20.i.prol.loopexit %invariant.gep73 = getelementptr i32, ptr %a, i64 1 %invariant.gep75 = getelementptr i32, ptr %b, i64 1 %invariant.gep77 = getelementptr i32, ptr %a, i64 2 %invariant.gep79 = getelementptr i32, ptr %b, i64 2 %invariant.gep81 = getelementptr i32, ptr %a, i64 3 %invariant.gep83 = getelementptr i32, ptr %b, i64 3 br label %while.body20.i while.cond29.preheader.i: ; preds = %while.end.i, %while.end.loopexit.i %i_b.0.lcssa127.i = phi i32 [ %5, %while.end.loopexit.i ], [ 0, %while.end.i ] %i_lower.0.lcssa125.i = phi i32 [ %i_lower.1.i, %while.end.loopexit.i ], [ %lower, %while.end.i ] %cmp3092.i = icmp slt i32 %i_lower.0.lcssa125.i, %div br i1 %cmp3092.i, label %while.body31.preheader.i, label %if.end39.i while.body31.preheader.i: ; preds = %while.cond29.preheader.i %22 = zext i32 %i_b.0.lcssa127.i to i64 %23 = sext i32 %i_lower.0.lcssa125.i to i64 %wide.trip.count117.i = sext i32 %div to i64 %24 = sub nsw i64 %wide.trip.count117.i, %23 %min.iters.check31 = icmp ult i64 %24, 12 br i1 %min.iters.check31, label %while.body31.i.preheader, label %vector.memcheck25 vector.memcheck25: ; preds = %while.body31.preheader.i %25 = shl nuw nsw i64 %22, 2 %26 = add i64 %25, %b26 %27 = shl nsw i64 %23, 2 %28 = add i64 %27, %a27 %29 = sub i64 %26, %28 %diff.check28 = icmp ult i64 %29, 32 br i1 %diff.check28, label %while.body31.i.preheader, label %vector.ph32 vector.ph32: ; preds = %vector.memcheck25 %n.vec34 = and i64 %24, -8 %ind.end35 = add nsw i64 %n.vec34, %23 %ind.end37 = add nsw i64 %n.vec34, %22 %invariant.gep85 = getelementptr i32, ptr %a, i64 %23 %invariant.gep87 = getelementptr i32, ptr %b, i64 %22 br label %vector.body40 vector.body40: ; preds = %vector.body40, %vector.ph32 %index41 = phi i64 [ 0, %vector.ph32 ], [ %index.next46, %vector.body40 ] %gep86 = getelementptr i32, ptr %invariant.gep85, i64 %index41 %wide.load44 = load <4 x i32>, ptr %gep86, align 4, !tbaa !7 %30 = getelementptr inbounds i32, ptr %gep86, i64 4 %wide.load45 = load <4 x i32>, ptr %30, align 4, !tbaa !7 %gep88 = getelementptr i32, ptr %invariant.gep87, i64 %index41 store <4 x i32> %wide.load44, ptr %gep88, align 4, !tbaa !7 %31 = getelementptr inbounds i32, ptr %gep88, i64 4 store <4 x i32> %wide.load45, ptr %31, align 4, !tbaa !7 %index.next46 = add nuw i64 %index41, 8 %32 = icmp eq i64 %index.next46, %n.vec34 br i1 %32, label %middle.block29, label %vector.body40, !llvm.loop !27 middle.block29: ; preds = %vector.body40 %cmp.n39 = icmp eq i64 %24, %n.vec34 br i1 %cmp.n39, label %if.end39.loopexit.i, label %while.body31.i.preheader while.body31.i.preheader: ; preds = %vector.memcheck25, %while.body31.preheader.i, %middle.block29 %indvars.iv112.i.ph = phi i64 [ %23, %vector.memcheck25 ], [ %23, %while.body31.preheader.i ], [ %ind.end35, %middle.block29 ] %indvars.iv110.i.ph = phi i64 [ %22, %vector.memcheck25 ], [ %22, %while.body31.preheader.i ], [ %ind.end37, %middle.block29 ] %33 = sub nsw i64 %wide.trip.count117.i, %indvars.iv112.i.ph %34 = xor i64 %indvars.iv112.i.ph, -1 %35 = add nsw i64 %34, %wide.trip.count117.i %xtraiter65 = and i64 %33, 3 %lcmp.mod66.not = icmp eq i64 %xtraiter65, 0 br i1 %lcmp.mod66.not, label %while.body31.i.prol.loopexit, label %while.body31.i.prol while.body31.i.prol: ; preds = %while.body31.i.preheader, %while.body31.i.prol %indvars.iv112.i.prol = phi i64 [ %indvars.iv.next113.i.prol, %while.body31.i.prol ], [ %indvars.iv112.i.ph, %while.body31.i.preheader ] %indvars.iv110.i.prol = phi i64 [ %indvars.iv.next111.i.prol, %while.body31.i.prol ], [ %indvars.iv110.i.ph, %while.body31.i.preheader ] %prol.iter67 = phi i64 [ %prol.iter67.next, %while.body31.i.prol ], [ 0, %while.body31.i.preheader ] %indvars.iv.next113.i.prol = add nsw i64 %indvars.iv112.i.prol, 1 %arrayidx34.i.prol = getelementptr inbounds i32, ptr %a, i64 %indvars.iv112.i.prol %36 = load i32, ptr %arrayidx34.i.prol, align 4, !tbaa !7 %indvars.iv.next111.i.prol = add nuw nsw i64 %indvars.iv110.i.prol, 1 %arrayidx37.i.prol = getelementptr inbounds i32, ptr %b, i64 %indvars.iv110.i.prol store i32 %36, ptr %arrayidx37.i.prol, align 4, !tbaa !7 %prol.iter67.next = add i64 %prol.iter67, 1 %prol.iter67.cmp.not = icmp eq i64 %prol.iter67.next, %xtraiter65 br i1 %prol.iter67.cmp.not, label %while.body31.i.prol.loopexit, label %while.body31.i.prol, !llvm.loop !28 while.body31.i.prol.loopexit: ; preds = %while.body31.i.prol, %while.body31.i.preheader %indvars.iv.next111.i.lcssa63.unr = phi i64 [ undef, %while.body31.i.preheader ], [ %indvars.iv.next111.i.prol, %while.body31.i.prol ] %indvars.iv112.i.unr = phi i64 [ %indvars.iv112.i.ph, %while.body31.i.preheader ], [ %indvars.iv.next113.i.prol, %while.body31.i.prol ] %indvars.iv110.i.unr = phi i64 [ %indvars.iv110.i.ph, %while.body31.i.preheader ], [ %indvars.iv.next111.i.prol, %while.body31.i.prol ] %37 = icmp ult i64 %35, 3 br i1 %37, label %if.end39.loopexit.i, label %while.body31.i.preheader.new while.body31.i.preheader.new: ; preds = %while.body31.i.prol.loopexit %invariant.gep89 = getelementptr i32, ptr %a, i64 1 %invariant.gep91 = getelementptr i32, ptr %b, i64 1 %invariant.gep93 = getelementptr i32, ptr %a, i64 2 %invariant.gep95 = getelementptr i32, ptr %b, i64 2 %invariant.gep97 = getelementptr i32, ptr %a, i64 3 %invariant.gep99 = getelementptr i32, ptr %b, i64 3 br label %while.body31.i while.body20.i: ; preds = %while.body20.i, %while.body20.i.preheader.new %indvars.iv104.i = phi i64 [ %indvars.iv104.i.unr, %while.body20.i.preheader.new ], [ %indvars.iv.next105.i.3, %while.body20.i ] %indvars.iv102.i = phi i64 [ %indvars.iv102.i.unr, %while.body20.i.preheader.new ], [ %indvars.iv.next103.i.3, %while.body20.i ] %arrayidx23.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv104.i %38 = load i32, ptr %arrayidx23.i, align 4, !tbaa !7 %arrayidx26.i = getelementptr inbounds i32, ptr %b, i64 %indvars.iv102.i store i32 %38, ptr %arrayidx26.i, align 4, !tbaa !7 %gep74 = getelementptr i32, ptr %invariant.gep73, i64 %indvars.iv104.i %39 = load i32, ptr %gep74, align 4, !tbaa !7 %gep76 = getelementptr i32, ptr %invariant.gep75, i64 %indvars.iv102.i store i32 %39, ptr %gep76, align 4, !tbaa !7 %gep78 = getelementptr i32, ptr %invariant.gep77, i64 %indvars.iv104.i %40 = load i32, ptr %gep78, align 4, !tbaa !7 %gep80 = getelementptr i32, ptr %invariant.gep79, i64 %indvars.iv102.i store i32 %40, ptr %gep80, align 4, !tbaa !7 %indvars.iv.next105.i.3 = add nsw i64 %indvars.iv104.i, 4 %gep82 = getelementptr i32, ptr %invariant.gep81, i64 %indvars.iv104.i %41 = load i32, ptr %gep82, align 4, !tbaa !7 %indvars.iv.next103.i.3 = add nuw nsw i64 %indvars.iv102.i, 4 %gep84 = getelementptr i32, ptr %invariant.gep83, i64 %indvars.iv102.i store i32 %41, ptr %gep84, align 4, !tbaa !7 %exitcond.not.i.3 = icmp eq i64 %indvars.iv.next105.i.3, %wide.trip.count.i br i1 %exitcond.not.i.3, label %if.end39.loopexit98.i, label %while.body20.i, !llvm.loop !29 while.body31.i: ; preds = %while.body31.i, %while.body31.i.preheader.new %indvars.iv112.i = phi i64 [ %indvars.iv112.i.unr, %while.body31.i.preheader.new ], [ %indvars.iv.next113.i.3, %while.body31.i ] %indvars.iv110.i = phi i64 [ %indvars.iv110.i.unr, %while.body31.i.preheader.new ], [ %indvars.iv.next111.i.3, %while.body31.i ] %arrayidx34.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv112.i %42 = load i32, ptr %arrayidx34.i, align 4, !tbaa !7 %arrayidx37.i = getelementptr inbounds i32, ptr %b, i64 %indvars.iv110.i store i32 %42, ptr %arrayidx37.i, align 4, !tbaa !7 %gep90 = getelementptr i32, ptr %invariant.gep89, i64 %indvars.iv112.i %43 = load i32, ptr %gep90, align 4, !tbaa !7 %gep92 = getelementptr i32, ptr %invariant.gep91, i64 %indvars.iv110.i store i32 %43, ptr %gep92, align 4, !tbaa !7 %gep94 = getelementptr i32, ptr %invariant.gep93, i64 %indvars.iv112.i %44 = load i32, ptr %gep94, align 4, !tbaa !7 %gep96 = getelementptr i32, ptr %invariant.gep95, i64 %indvars.iv110.i store i32 %44, ptr %gep96, align 4, !tbaa !7 %indvars.iv.next113.i.3 = add nsw i64 %indvars.iv112.i, 4 %gep98 = getelementptr i32, ptr %invariant.gep97, i64 %indvars.iv112.i %45 = load i32, ptr %gep98, align 4, !tbaa !7 %indvars.iv.next111.i.3 = add nuw nsw i64 %indvars.iv110.i, 4 %gep100 = getelementptr i32, ptr %invariant.gep99, i64 %indvars.iv110.i store i32 %45, ptr %gep100, align 4, !tbaa !7 %exitcond118.not.i.3 = icmp eq i64 %indvars.iv.next113.i.3, %wide.trip.count117.i br i1 %exitcond118.not.i.3, label %if.end39.loopexit.i, label %while.body31.i, !llvm.loop !30 if.end39.loopexit.i: ; preds = %while.body31.i.prol.loopexit, %while.body31.i, %middle.block29 %indvars.iv.next111.i.lcssa = phi i64 [ %ind.end37, %middle.block29 ], [ %indvars.iv.next111.i.lcssa63.unr, %while.body31.i.prol.loopexit ], [ %indvars.iv.next111.i.3, %while.body31.i ] %46 = trunc i64 %indvars.iv.next111.i.lcssa to i32 br label %if.end39.i if.end39.loopexit98.i: ; preds = %while.body20.i.prol.loopexit, %while.body20.i, %middle.block %indvars.iv.next103.i.lcssa = phi i64 [ %ind.end21, %middle.block ], [ %indvars.iv.next103.i.lcssa64.unr, %while.body20.i.prol.loopexit ], [ %indvars.iv.next103.i.3, %while.body20.i ] %47 = trunc i64 %indvars.iv.next103.i.lcssa to i32 br label %if.end39.i if.end39.i: ; preds = %if.end39.loopexit98.i, %if.end39.loopexit.i, %while.cond29.preheader.i, %while.cond18.preheader.i %i_b.4.i = phi i32 [ %i_b.0.lcssa127.i, %while.cond29.preheader.i ], [ %i_b.0.lcssa128.i, %while.cond18.preheader.i ], [ %46, %if.end39.loopexit.i ], [ %47, %if.end39.loopexit98.i ] %cmp4096.i = icmp sgt i32 %i_b.4.i, 0 br i1 %cmp4096.i, label %for.body.preheader.i, label %cleanup for.body.preheader.i: ; preds = %if.end39.i %48 = sext i32 %lower to i64 %wide.trip.count123.i = zext i32 %i_b.4.i to i64 %invariant.gep.i = getelementptr i32, ptr %a, i64 %48 %min.iters.check52 = icmp ult i32 %i_b.4.i, 12 br i1 %min.iters.check52, label %for.body.i.preheader, label %vector.memcheck47 vector.memcheck47: ; preds = %for.body.preheader.i %49 = shl nsw i64 %48, 2 %50 = add i64 %49, %a27 %51 = sub i64 %50, %b48 %diff.check49 = icmp ult i64 %51, 32 br i1 %diff.check49, label %for.body.i.preheader, label %vector.ph53 vector.ph53: ; preds = %vector.memcheck47 %n.vec55 = and i64 %wide.trip.count123.i, 4294967288 br label %vector.body58 vector.body58: ; preds = %vector.body58, %vector.ph53 %index59 = phi i64 [ 0, %vector.ph53 ], [ %index.next62, %vector.body58 ] %52 = getelementptr inbounds i32, ptr %b, i64 %index59 %wide.load60 = load <4 x i32>, ptr %52, align 4, !tbaa !7 %53 = getelementptr inbounds i32, ptr %52, i64 4 %wide.load61 = load <4 x i32>, ptr %53, align 4, !tbaa !7 %54 = getelementptr i32, ptr %invariant.gep.i, i64 %index59 store <4 x i32> %wide.load60, ptr %54, align 4, !tbaa !7 %55 = getelementptr i32, ptr %54, i64 4 store <4 x i32> %wide.load61, ptr %55, align 4, !tbaa !7 %index.next62 = add nuw i64 %index59, 8 %56 = icmp eq i64 %index.next62, %n.vec55 br i1 %56, label %middle.block50, label %vector.body58, !llvm.loop !31 middle.block50: ; preds = %vector.body58 %cmp.n57 = icmp eq i64 %n.vec55, %wide.trip.count123.i br i1 %cmp.n57, label %cleanup, label %for.body.i.preheader for.body.i.preheader: ; preds = %vector.memcheck47, %for.body.preheader.i, %middle.block50 %indvars.iv119.i.ph = phi i64 [ 0, %vector.memcheck47 ], [ 0, %for.body.preheader.i ], [ %n.vec55, %middle.block50 ] %57 = xor i64 %indvars.iv119.i.ph, -1 %58 = add nsw i64 %57, %wide.trip.count123.i %xtraiter68 = and i64 %wide.trip.count123.i, 3 %lcmp.mod69.not = icmp eq i64 %xtraiter68, 0 br i1 %lcmp.mod69.not, label %for.body.i.prol.loopexit, label %for.body.i.prol for.body.i.prol: ; preds = %for.body.i.preheader, %for.body.i.prol %indvars.iv119.i.prol = phi i64 [ %indvars.iv.next120.i.prol, %for.body.i.prol ], [ %indvars.iv119.i.ph, %for.body.i.preheader ] %prol.iter70 = phi i64 [ %prol.iter70.next, %for.body.i.prol ], [ 0, %for.body.i.preheader ] %arrayidx42.i.prol = getelementptr inbounds i32, ptr %b, i64 %indvars.iv119.i.prol %59 = load i32, ptr %arrayidx42.i.prol, align 4, !tbaa !7 %gep.i.prol = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv119.i.prol store i32 %59, ptr %gep.i.prol, align 4, !tbaa !7 %indvars.iv.next120.i.prol = add nuw nsw i64 %indvars.iv119.i.prol, 1 %prol.iter70.next = add i64 %prol.iter70, 1 %prol.iter70.cmp.not = icmp eq i64 %prol.iter70.next, %xtraiter68 br i1 %prol.iter70.cmp.not, label %for.body.i.prol.loopexit, label %for.body.i.prol, !llvm.loop !32 for.body.i.prol.loopexit: ; preds = %for.body.i.prol, %for.body.i.preheader %indvars.iv119.i.unr = phi i64 [ %indvars.iv119.i.ph, %for.body.i.preheader ], [ %indvars.iv.next120.i.prol, %for.body.i.prol ] %60 = icmp ult i64 %58, 3 br i1 %60, label %cleanup, label %for.body.i for.body.i: ; preds = %for.body.i.prol.loopexit, %for.body.i %indvars.iv119.i = phi i64 [ %indvars.iv.next120.i.3, %for.body.i ], [ %indvars.iv119.i.unr, %for.body.i.prol.loopexit ] %arrayidx42.i = getelementptr inbounds i32, ptr %b, i64 %indvars.iv119.i %61 = load i32, ptr %arrayidx42.i, align 4, !tbaa !7 %gep.i = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv119.i store i32 %61, ptr %gep.i, align 4, !tbaa !7 %indvars.iv.next120.i = add nuw nsw i64 %indvars.iv119.i, 1 %arrayidx42.i.1 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.next120.i %62 = load i32, ptr %arrayidx42.i.1, align 4, !tbaa !7 %gep.i.1 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next120.i store i32 %62, ptr %gep.i.1, align 4, !tbaa !7 %indvars.iv.next120.i.1 = add nuw nsw i64 %indvars.iv119.i, 2 %arrayidx42.i.2 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.next120.i.1 %63 = load i32, ptr %arrayidx42.i.2, align 4, !tbaa !7 %gep.i.2 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next120.i.1 store i32 %63, ptr %gep.i.2, align 4, !tbaa !7 %indvars.iv.next120.i.2 = add nuw nsw i64 %indvars.iv119.i, 3 %arrayidx42.i.3 = getelementptr inbounds i32, ptr %b, i64 %indvars.iv.next120.i.2 %64 = load i32, ptr %arrayidx42.i.3, align 4, !tbaa !7 %gep.i.3 = getelementptr i32, ptr %invariant.gep.i, i64 %indvars.iv.next120.i.2 store i32 %64, ptr %gep.i.3, align 4, !tbaa !7 %indvars.iv.next120.i.3 = add nuw nsw i64 %indvars.iv119.i, 4 %exitcond124.not.i.3 = icmp eq i64 %indvars.iv.next120.i.3, %wide.trip.count123.i br i1 %exitcond124.not.i.3, label %cleanup, label %for.body.i, !llvm.loop !33 cleanup: ; preds = %for.body.i.prol.loopexit, %for.body.i, %middle.block50, %if.end39.i, %entry ret void } ; Function Attrs: nounwind uwtable define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #3 { entry: %n = alloca i32, align 4 %s = alloca [30001 x i8], align 16 %init_index = alloca [10 x i32], align 16 %end_index = alloca [10 x i32], align 16 %mid_index = alloca [10 x i32], align 16 call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #8 call void @llvm.lifetime.start.p0(i64 30001, ptr nonnull %s) #8 %0 = load ptr, ptr @stdin, align 8, !tbaa !34 %call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str, ptr noundef nonnull %n) #8 %1 = load ptr, ptr @stdin, align 8, !tbaa !34 %call1 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %1, ptr noundef nonnull @.str.1, ptr noundef nonnull %s) #8 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %init_index) #8 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %end_index) #8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %init_index, i8 -1, i64 40, i1 false), !tbaa !7 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %end_index, i8 -1, i64 40, i1 false), !tbaa !7 %2 = load i32, ptr %n, align 4, !tbaa !7 %cmp10112 = icmp sgt i32 %2, 0 br i1 %cmp10112, label %for.body12.preheader, label %for.cond28.preheader for.body12.preheader: ; preds = %entry %wide.trip.count = zext i32 %2 to i64 %xtraiter = and i64 %wide.trip.count, 1 %3 = icmp eq i32 %2, 1 br i1 %3, label %for.cond28.preheader.loopexit.unr-lcssa, label %for.body12.preheader.new for.body12.preheader.new: ; preds = %for.body12.preheader %unroll_iter = and i64 %wide.trip.count, 4294967294 br label %for.body12 for.cond28.preheader.loopexit.unr-lcssa: ; preds = %for.body12, %for.body12.preheader %indvars.iv.unr = phi i64 [ 0, %for.body12.preheader ], [ %indvars.iv.next.1, %for.body12 ] %lcmp.mod.not = icmp eq i64 %xtraiter, 0 br i1 %lcmp.mod.not, label %for.cond28.preheader, label %for.body12.epil for.body12.epil: ; preds = %for.cond28.preheader.loopexit.unr-lcssa %arrayidx14.epil = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %indvars.iv.unr %4 = load i8, ptr %arrayidx14.epil, align 1, !tbaa !36 %conv15.epil = sext i8 %4 to i64 %sub.epil = add nsw i64 %conv15.epil, -48 %arrayidx17.epil = getelementptr inbounds [10 x i32], ptr %end_index, i64 0, i64 %sub.epil %5 = trunc i64 %indvars.iv.unr to i32 store i32 %5, ptr %arrayidx17.epil, align 4, !tbaa !7 %arrayidx19.epil = getelementptr inbounds [10 x i32], ptr %init_index, i64 0, i64 %sub.epil %6 = load i32, ptr %arrayidx19.epil, align 4, !tbaa !7 %cmp20.epil = icmp slt i32 %6, 0 %spec.store.select.epil = select i1 %cmp20.epil, i32 %5, i32 %6 store i32 %spec.store.select.epil, ptr %arrayidx19.epil, align 4 br label %for.cond28.preheader for.cond28.preheader: ; preds = %for.body12.epil, %for.cond28.preheader.loopexit.unr-lcssa, %entry %arrayidx69.8.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %mid_index, i64 0, i64 8 %arrayidx69.9.phi.trans.insert = getelementptr inbounds [10 x i32], ptr %mid_index, i64 0, i64 9 br label %for.body31 for.body12: ; preds = %for.body12, %for.body12.preheader.new %indvars.iv = phi i64 [ 0, %for.body12.preheader.new ], [ %indvars.iv.next.1, %for.body12 ] %niter = phi i64 [ 0, %for.body12.preheader.new ], [ %niter.next.1, %for.body12 ] %arrayidx14 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %indvars.iv %7 = load i8, ptr %arrayidx14, align 2, !tbaa !36 %conv15 = sext i8 %7 to i64 %sub = add nsw i64 %conv15, -48 %arrayidx17 = getelementptr inbounds [10 x i32], ptr %end_index, i64 0, i64 %sub %8 = trunc i64 %indvars.iv to i32 store i32 %8, ptr %arrayidx17, align 4, !tbaa !7 %arrayidx19 = getelementptr inbounds [10 x i32], ptr %init_index, i64 0, i64 %sub %9 = load i32, ptr %arrayidx19, align 4, !tbaa !7 %cmp20 = icmp slt i32 %9, 0 %spec.store.select = select i1 %cmp20, i32 %8, i32 %9 store i32 %spec.store.select, ptr %arrayidx19, align 4 %indvars.iv.next = or i64 %indvars.iv, 1 %arrayidx14.1 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %indvars.iv.next %10 = load i8, ptr %arrayidx14.1, align 1, !tbaa !36 %conv15.1 = sext i8 %10 to i64 %sub.1 = add nsw i64 %conv15.1, -48 %arrayidx17.1 = getelementptr inbounds [10 x i32], ptr %end_index, i64 0, i64 %sub.1 %11 = trunc i64 %indvars.iv.next to i32 store i32 %11, ptr %arrayidx17.1, align 4, !tbaa !7 %arrayidx19.1 = getelementptr inbounds [10 x i32], ptr %init_index, i64 0, i64 %sub.1 %12 = load i32, ptr %arrayidx19.1, align 4, !tbaa !7 %cmp20.1 = icmp slt i32 %12, 0 %spec.store.select.1 = select i1 %cmp20.1, i32 %11, i32 %12 store i32 %spec.store.select.1, ptr %arrayidx19.1, align 4 %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.cond28.preheader.loopexit.unr-lcssa, label %for.body12, !llvm.loop !37 for.body31: ; preds = %for.cond28.preheader, %cleanup77 %indvars.iv137 = phi i64 [ 0, %for.cond28.preheader ], [ %indvars.iv.next138, %cleanup77 ] %ret.0121 = phi i32 [ 0, %for.cond28.preheader ], [ %ret.4, %cleanup77 ] %arrayidx33 = getelementptr inbounds [10 x i32], ptr %init_index, i64 0, i64 %indvars.iv137 %13 = load i32, ptr %arrayidx33, align 4, !tbaa !7 %cmp34 = icmp slt i32 %13, 0 br i1 %cmp34, label %cleanup77, label %for.cond38.preheader for.cond38.preheader: ; preds = %for.body31 %k.0114 = add nuw nsw i32 %13, 1 %14 = zext i32 %13 to i64 %15 = add nuw nsw i64 %14, 1 %16 = xor i32 %13, -1 br label %for.body41 for.body41: ; preds = %for.cond38.preheader, %cleanup %indvars.iv133 = phi i64 [ 0, %for.cond38.preheader ], [ %indvars.iv.next134, %cleanup ] %ret.1119 = phi i32 [ %ret.0121, %for.cond38.preheader ], [ %ret.3, %cleanup ] %arrayidx43 = getelementptr inbounds [10 x i32], ptr %end_index, i64 0, i64 %indvars.iv133 %17 = load i32, ptr %arrayidx43, align 4, !tbaa !7 %cmp44.not = icmp slt i32 %13, %17 br i1 %cmp44.not, label %if.end47, label %cleanup if.end47: ; preds = %for.body41 call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %mid_index) #8 call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %mid_index, i8 0, i64 40, i1 false) %cmp50115 = icmp slt i32 %k.0114, %17 br i1 %cmp50115, label %for.body52.preheader, label %for.cond64.preheader for.body52.preheader: ; preds = %if.end47 %18 = add i32 %17, %16 %reass.sub = sub i32 %17, %13 %19 = add i32 %reass.sub, -2 %xtraiter152 = and i32 %18, 3 %lcmp.mod153.not = icmp eq i32 %xtraiter152, 0 br i1 %lcmp.mod153.not, label %for.body52.prol.loopexit, label %for.body52.prol for.body52.prol: ; preds = %for.body52.preheader, %for.body52.prol %indvars.iv125.prol = phi i64 [ %indvars.iv.next126.prol, %for.body52.prol ], [ %15, %for.body52.preheader ] %prol.iter = phi i32 [ %prol.iter.next, %for.body52.prol ], [ 0, %for.body52.preheader ] %arrayidx55.prol = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %indvars.iv125.prol %20 = load i8, ptr %arrayidx55.prol, align 1, !tbaa !36 %conv56.prol = sext i8 %20 to i64 %sub57.prol = add nsw i64 %conv56.prol, -48 %arrayidx59.prol = getelementptr inbounds [10 x i32], ptr %mid_index, i64 0, i64 %sub57.prol store i32 1, ptr %arrayidx59.prol, align 4, !tbaa !7 %indvars.iv.next126.prol = add nuw nsw i64 %indvars.iv125.prol, 1 %prol.iter.next = add i32 %prol.iter, 1 %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter152 br i1 %prol.iter.cmp.not, label %for.body52.prol.loopexit, label %for.body52.prol, !llvm.loop !38 for.body52.prol.loopexit: ; preds = %for.body52.prol, %for.body52.preheader %indvars.iv125.unr = phi i64 [ %15, %for.body52.preheader ], [ %indvars.iv.next126.prol, %for.body52.prol ] %21 = icmp ult i32 %19, 3 br i1 %21, label %for.cond64.preheader.loopexit, label %for.body52 for.cond64.preheader.loopexit: ; preds = %for.body52, %for.body52.prol.loopexit %22 = load <8 x i32>, ptr %mid_index, align 16, !tbaa !7 %.pre148 = load i32, ptr %arrayidx69.8.phi.trans.insert, align 16, !tbaa !7 %.pre149 = load i32, ptr %arrayidx69.9.phi.trans.insert, align 4, !tbaa !7 br label %for.cond64.preheader for.cond64.preheader: ; preds = %for.cond64.preheader.loopexit, %if.end47 %23 = phi i32 [ %.pre149, %for.cond64.preheader.loopexit ], [ 0, %if.end47 ] %24 = phi i32 [ %.pre148, %for.cond64.preheader.loopexit ], [ 0, %if.end47 ] %25 = phi <8 x i32> [ %22, %for.cond64.preheader.loopexit ], [ zeroinitializer, %if.end47 ] %26 = call i32 @llvm.vector.reduce.add.v8i32(<8 x i32> %25) %op.rdx = add i32 %26, %24 %op.rdx150 = add i32 %23, %ret.1119 %op.rdx151 = add i32 %op.rdx, %op.rdx150 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %mid_index) #8 br label %cleanup for.body52: ; preds = %for.body52.prol.loopexit, %for.body52 %indvars.iv125 = phi i64 [ %indvars.iv.next126.3, %for.body52 ], [ %indvars.iv125.unr, %for.body52.prol.loopexit ] %arrayidx55 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %indvars.iv125 %27 = load i8, ptr %arrayidx55, align 1, !tbaa !36 %conv56 = sext i8 %27 to i64 %sub57 = add nsw i64 %conv56, -48 %arrayidx59 = getelementptr inbounds [10 x i32], ptr %mid_index, i64 0, i64 %sub57 store i32 1, ptr %arrayidx59, align 4, !tbaa !7 %indvars.iv.next126 = add nuw nsw i64 %indvars.iv125, 1 %arrayidx55.1 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %indvars.iv.next126 %28 = load i8, ptr %arrayidx55.1, align 1, !tbaa !36 %conv56.1 = sext i8 %28 to i64 %sub57.1 = add nsw i64 %conv56.1, -48 %arrayidx59.1 = getelementptr inbounds [10 x i32], ptr %mid_index, i64 0, i64 %sub57.1 store i32 1, ptr %arrayidx59.1, align 4, !tbaa !7 %indvars.iv.next126.1 = add nuw nsw i64 %indvars.iv125, 2 %arrayidx55.2 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %indvars.iv.next126.1 %29 = load i8, ptr %arrayidx55.2, align 1, !tbaa !36 %conv56.2 = sext i8 %29 to i64 %sub57.2 = add nsw i64 %conv56.2, -48 %arrayidx59.2 = getelementptr inbounds [10 x i32], ptr %mid_index, i64 0, i64 %sub57.2 store i32 1, ptr %arrayidx59.2, align 4, !tbaa !7 %indvars.iv.next126.2 = add nuw nsw i64 %indvars.iv125, 3 %arrayidx55.3 = getelementptr inbounds [30001 x i8], ptr %s, i64 0, i64 %indvars.iv.next126.2 %30 = load i8, ptr %arrayidx55.3, align 1, !tbaa !36 %conv56.3 = sext i8 %30 to i64 %sub57.3 = add nsw i64 %conv56.3, -48 %arrayidx59.3 = getelementptr inbounds [10 x i32], ptr %mid_index, i64 0, i64 %sub57.3 store i32 1, ptr %arrayidx59.3, align 4, !tbaa !7 %indvars.iv.next126.3 = add nuw nsw i64 %indvars.iv125, 4 %lftr.wideiv.3 = trunc i64 %indvars.iv.next126.3 to i32 %exitcond128.not.3 = icmp eq i32 %17, %lftr.wideiv.3 br i1 %exitcond128.not.3, label %for.cond64.preheader.loopexit, label %for.body52, !llvm.loop !39 cleanup: ; preds = %for.body41, %for.cond64.preheader %ret.3 = phi i32 [ %op.rdx151, %for.cond64.preheader ], [ %ret.1119, %for.body41 ] %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1 %exitcond136.not = icmp eq i64 %indvars.iv.next134, 10 br i1 %exitcond136.not, label %cleanup77, label %for.body41, !llvm.loop !40 cleanup77: ; preds = %cleanup, %for.body31 %ret.4 = phi i32 [ %ret.0121, %for.body31 ], [ %ret.3, %cleanup ] %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1 %exitcond140.not = icmp eq i64 %indvars.iv.next138, 10 br i1 %exitcond140.not, label %for.end82, label %for.body31, !llvm.loop !41 for.end82: ; preds = %cleanup77 %31 = load ptr, ptr @stdout, align 8, !tbaa !34 %call83 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.2, i32 noundef %ret.4) call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %end_index) #8 call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %init_index) #8 call void @llvm.lifetime.end.p0(i64 30001, ptr nonnull %s) #8 call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #8 ret i32 0 } declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #4 ; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write) declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5 ; Function Attrs: nofree nounwind declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #6 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.smin.i32(i32, i32) #7 ; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none) declare i32 @llvm.vector.reduce.add.v8i32(<8 x i32>) #7 attributes #0 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) } attributes #6 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) } attributes #8 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = 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, !15} !14 = !{!"llvm.loop.isvectorized", i32 1} !15 = !{!"llvm.loop.unroll.runtime.disable"} !16 = distinct !{!16, !17} !17 = !{!"llvm.loop.unroll.disable"} !18 = distinct !{!18, !6, !14, !15} !19 = distinct !{!19, !17} !20 = distinct !{!20, !6, !14} !21 = distinct !{!21, !6, !14} !22 = distinct !{!22, !6, !14, !15} !23 = distinct !{!23, !17} !24 = distinct !{!24, !6, !14} !25 = distinct !{!25, !6, !14, !15} !26 = distinct !{!26, !17} !27 = distinct !{!27, !6, !14, !15} !28 = distinct !{!28, !17} !29 = distinct !{!29, !6, !14} !30 = distinct !{!30, !6, !14} !31 = distinct !{!31, !6, !14, !15} !32 = distinct !{!32, !17} !33 = distinct !{!33, !6, !14} !34 = !{!35, !35, i64 0} !35 = !{!"any pointer", !9, i64 0} !36 = !{!9, !9, i64 0} !37 = distinct !{!37, !6} !38 = distinct !{!38, !17} !39 = distinct !{!39, !6} !40 = distinct !{!40, !6} !41 = distinct !{!41, !6}
#include <stdio.h> int main() { long long n; scanf("%lld",&n); printf("%lld",(n - 1) * n / 2); }
; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_158209/source.c' source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_158209/source.c" target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1 ; Function Attrs: nofree nounwind uwtable define dso_local i32 @main() local_unnamed_addr #0 { entry: %n = alloca i64, align 8 call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3 %call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n) %0 = load i64, ptr %n, align 8, !tbaa !5 %sub = add nsw i64 %0, -1 %mul = mul nsw i64 %sub, %0 %div = sdiv i64 %mul, 2 %call1 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %div) call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3 ret i32 0 } ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1 ; Function Attrs: nofree nounwind declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: nofree nounwind declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2 ; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1 attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) } attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" } attributes #3 = { nounwind } !llvm.module.flags = !{!0, !1, !2, !3} !llvm.ident = !{!4} !0 = !{i32 1, !"wchar_size", i32 4} !1 = !{i32 8, !"PIC Level", i32 2} !2 = !{i32 7, !"PIE Level", i32 2} !3 = !{i32 7, !"uwtable", i32 2} !4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"} !5 = !{!6, !6, i64 0} !6 = !{!"long long", !7, i64 0} !7 = !{!"omnipotent char", !8, i64 0} !8 = !{!"Simple C/C++ TBAA"}