Source_Code
stringlengths 69
484k
| IR_Original
stringlengths 2.05k
17.9M
|
---|---|
#include <stdio.h>
#include <math.h>
int pow2(int);
int main(){
int N,M;
scanf("%d%d",&N,&M);
int per = (N-M)*100;
int inper = M*1900;
int ans = (per+inper)*pow2(M);
printf("%d",ans);
}
int pow2(int x){
int ans=1;
for(int i =0;i<x;i++){
ans =ans*2;
}
return ans;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114353/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114353/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %M, align 4, !tbaa !5
%cmp3.i = icmp sgt i32 %1, 0
br i1 %cmp3.i, label %for.body.i.preheader, label %pow2.exit
for.body.i.preheader: ; preds = %entry
%xtraiter = and i32 %1, 7
%2 = icmp ult i32 %1, 8
br i1 %2, label %pow2.exit.loopexit.unr-lcssa, label %for.body.i.preheader.new
for.body.i.preheader.new: ; preds = %for.body.i.preheader
%unroll_iter = and i32 %1, -8
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.i.preheader.new
%ans.04.i = phi i32 [ 1, %for.body.i.preheader.new ], [ %mul.i, %for.body.i ]
%niter = phi i32 [ 0, %for.body.i.preheader.new ], [ %niter.next.7, %for.body.i ]
%mul.i = shl i32 %ans.04.i, 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 %pow2.exit.loopexit.unr-lcssa, label %for.body.i, !llvm.loop !9
pow2.exit.loopexit.unr-lcssa: ; preds = %for.body.i, %for.body.i.preheader
%mul.i.lcssa.ph = phi i32 [ undef, %for.body.i.preheader ], [ %mul.i, %for.body.i ]
%ans.04.i.unr = phi i32 [ 1, %for.body.i.preheader ], [ %mul.i, %for.body.i ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %pow2.exit, label %for.body.i.epil
for.body.i.epil: ; preds = %pow2.exit.loopexit.unr-lcssa, %for.body.i.epil
%ans.04.i.epil = phi i32 [ %mul.i.epil, %for.body.i.epil ], [ %ans.04.i.unr, %pow2.exit.loopexit.unr-lcssa ]
%epil.iter = phi i32 [ %epil.iter.next, %for.body.i.epil ], [ 0, %pow2.exit.loopexit.unr-lcssa ]
%mul.i.epil = shl nsw i32 %ans.04.i.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 %pow2.exit, label %for.body.i.epil, !llvm.loop !11
pow2.exit: ; preds = %pow2.exit.loopexit.unr-lcssa, %for.body.i.epil, %entry
%ans.0.lcssa.i = phi i32 [ 1, %entry ], [ %mul.i.lcssa.ph, %pow2.exit.loopexit.unr-lcssa ], [ %mul.i.epil, %for.body.i.epil ]
%sub = sub nsw i32 %0, %1
%mul = mul nsw i32 %sub, 100
%mul1 = mul nsw i32 %1, 1900
%add = add nsw i32 %mul, %mul1
%mul3 = mul nsw i32 %ans.0.lcssa.i, %add
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul3)
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 norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @pow2(i32 noundef %x) local_unnamed_addr #3 {
entry:
%cmp3 = icmp sgt i32 %x, 0
br i1 %cmp3, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i32 %x, 7
%0 = icmp ult i32 %x, 8
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i32 %x, -8
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%mul.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %mul, %for.body ]
%ans.04.unr = phi i32 [ 1, %for.body.preheader ], [ %mul, %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
%ans.04.epil = phi i32 [ %mul.epil, %for.body.epil ], [ %ans.04.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 i32 %ans.04.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 %for.cond.cleanup, label %for.body.epil, !llvm.loop !13
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil, %entry
%ans.0.lcssa = phi i32 [ 1, %entry ], [ %mul.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %mul.epil, %for.body.epil ]
ret i32 %ans.0.lcssa
for.body: ; preds = %for.body, %for.body.preheader.new
%ans.04 = phi i32 [ 1, %for.body.preheader.new ], [ %mul, %for.body ]
%niter = phi i32 [ 0, %for.body.preheader.new ], [ %niter.next.7, %for.body ]
%mul = shl i32 %ans.04, 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 %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
}
; 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, !12}
!12 = !{!"llvm.loop.unroll.disable"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
int main(){
int a,b,c,i,k=0;
scanf("%d %d %d",&a,&b,&c);
for(i=1;i<=100;i++){
if((b*i+c)%a==0){
printf("YES");
k++;
break;
}
}
if(k==0)
printf("NO");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114403/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114403/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %c, align 4, !tbaa !5
%2 = load i32, ptr %a, align 4, !tbaa !5
br label %for.body
for.cond: ; preds = %for.body
%inc3 = add nuw nsw i32 %i.011, 1
%mul.1 = mul nsw i32 %0, %inc3
%add.1 = add nsw i32 %mul.1, %1
%rem.1 = srem i32 %add.1, %2
%cmp1.1 = icmp eq i32 %rem.1, 0
br i1 %cmp1.1, label %if.end7, label %for.cond.1
for.cond.1: ; preds = %for.cond
%inc3.1 = add nuw nsw i32 %i.011, 2
%exitcond.1 = icmp eq i32 %inc3.1, 101
br i1 %exitcond.1, label %if.end7, label %for.body, !llvm.loop !9
for.body: ; preds = %for.cond.1, %entry
%i.011 = phi i32 [ 1, %entry ], [ %inc3.1, %for.cond.1 ]
%mul = mul nsw i32 %0, %i.011
%add = add nsw i32 %mul, %1
%rem = srem i32 %add, %2
%cmp1 = icmp eq i32 %rem, 0
br i1 %cmp1, label %if.end7, label %for.cond
if.end7: ; preds = %for.cond.1, %for.cond, %for.body
%.str.1.sink = phi ptr [ @.str.1, %for.body ], [ @.str.1, %for.cond ], [ @.str.2, %for.cond.1 ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main() {
int a,b,c,f=0;
scanf("%d%d%d",&a,&b,&c);
for (int i=0;i<b;i++)if((a*i)%b==c)f=1;
puts(f==1?"YES":"NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114447/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114447/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %b, align 4, !tbaa !5
%cmp6 = icmp sgt i32 %0, 0
br i1 %cmp6, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%1 = load i32, ptr %a, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
%xtraiter = and i32 %0, 1
%3 = icmp eq i32 %0, 1
br i1 %3, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.lr.ph.new
for.body.lr.ph.new: ; preds = %for.body.lr.ph
%unroll_iter = and i32 %0, -2
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.lr.ph
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.lr.ph ], [ %spec.select.1, %for.body ]
%i.08.unr = phi i32 [ 0, %for.body.lr.ph ], [ %inc.1, %for.body ]
%f.07.unr = phi i32 [ 0, %for.body.lr.ph ], [ %spec.select.1, %for.body ]
%lcmp.mod.not = icmp eq i32 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup.loopexit, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa
%mul.epil = mul nsw i32 %1, %i.08.unr
%rem.epil = srem i32 %mul.epil, %0
%cmp1.epil = icmp eq i32 %rem.epil, %2
%spec.select.epil = select i1 %cmp1.epil, i32 1, i32 %f.07.unr
br label %for.cond.cleanup.loopexit
for.cond.cleanup.loopexit: ; preds = %for.cond.cleanup.loopexit.unr-lcssa, %for.body.epil
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.cond.cleanup.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%4 = icmp eq i32 %spec.select.lcssa, 1
%5 = select i1 %4, ptr @.str.1, ptr @.str.2
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%f.0.lcssa = phi ptr [ @.str.2, %entry ], [ %5, %for.cond.cleanup.loopexit ]
%call3 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %f.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
for.body: ; preds = %for.body, %for.body.lr.ph.new
%i.08 = phi i32 [ 0, %for.body.lr.ph.new ], [ %inc.1, %for.body ]
%f.07 = phi i32 [ 0, %for.body.lr.ph.new ], [ %spec.select.1, %for.body ]
%niter = phi i32 [ 0, %for.body.lr.ph.new ], [ %niter.next.1, %for.body ]
%mul = mul nsw i32 %1, %i.08
%rem = srem i32 %mul, %0
%cmp1 = icmp eq i32 %rem, %2
%inc = or i32 %i.08, 1
%mul.1 = mul nsw i32 %1, %inc
%rem.1 = srem i32 %mul.1, %0
%cmp1.1 = icmp eq i32 %rem.1, %2
%6 = select i1 %cmp1.1, i1 true, i1 %cmp1
%spec.select.1 = select i1 %6, i32 1, i32 %f.07
%inc.1 = add nuw nsw i32 %i.08, 2
%niter.next.1 = add i32 %niter, 2
%niter.ncmp.1 = icmp eq i32 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void){
int a,b,c,i;
scanf("%d%d%d",&a,&b,&c);
for(i=a;i<a*b;i+=a){
if(i%b==c){
printf("YES");
return 0;
}
}
printf("NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114490/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114490/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%mul = mul nsw i32 %1, %0
%cmp9 = icmp slt i32 %0, %mul
br i1 %cmp9, label %for.body.lr.ph, label %cleanup
for.body.lr.ph: ; preds = %entry
%2 = load i32, ptr %c, align 4, !tbaa !5
br label %for.body
for.cond: ; preds = %for.body
%add = add nsw i32 %i.010, %0
%cmp = icmp slt i32 %add, %mul
br i1 %cmp, label %for.body, label %cleanup, !llvm.loop !9
for.body: ; preds = %for.body.lr.ph, %for.cond
%i.010 = phi i32 [ %0, %for.body.lr.ph ], [ %add, %for.cond ]
%rem = srem i32 %i.010, %1
%cmp1 = icmp eq i32 %rem, %2
br i1 %cmp1, label %cleanup, label %for.cond
cleanup: ; preds = %for.cond, %for.body, %entry
%.str.2.sink = phi ptr [ @.str.2, %entry ], [ @.str.1, %for.body ], [ @.str.2, %for.cond ]
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int a,b,c,sum=0,ans=0;
scanf("%d %d %d",&a,&b,&c);
while(sum!=-1){
sum=sum+a;
ans=sum%b;
if(ans==c){
printf("YES");
return 0;
}
if(sum>10000)sum=-1;
}
printf("NO");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114533/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114533/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%2 = load i32, ptr %c, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %entry, %if.end
%sum.014 = phi i32 [ 0, %entry ], [ %add, %if.end ]
%add = add nsw i32 %0, %sum.014
%rem = srem i32 %add, %1
%cmp1 = icmp eq i32 %rem, %2
br i1 %cmp1, label %cleanup, label %if.end
if.end: ; preds = %while.body
%cmp3 = icmp sgt i32 %add, 10000
%cmp.not15 = icmp eq i32 %add, -1
%cmp.not = or i1 %cmp3, %cmp.not15
br i1 %cmp.not, label %cleanup, label %while.body
cleanup: ; preds = %if.end, %while.body
%.str.2.sink = phi ptr [ @.str.1, %while.body ], [ @.str.2, %if.end ]
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int a, b, c;
scanf("%d %d %d", &a, &b, &c);
int m, n, p;
m=a;
n=b;
while(n!=0){
p=m%n;
m=n;
n=p;
}
if(c%m == 0){
printf("YES\n");
}else{
printf("NO\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114577/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114577/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NO\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"YES\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp.not9 = icmp eq i32 %1, 0
br i1 %cmp.not9, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%m.011 = phi i32 [ %n.010, %while.body ], [ %0, %entry ]
%n.010 = phi i32 [ %rem, %while.body ], [ %1, %entry ]
%rem = srem i32 %m.011, %n.010
%cmp.not = icmp eq i32 %rem, 0
br i1 %cmp.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%m.0.lcssa = phi i32 [ %0, %entry ], [ %n.010, %while.body ]
%2 = load i32, ptr %c, align 4, !tbaa !5
%rem1 = srem i32 %2, %m.0.lcssa
%cmp2 = icmp eq i32 %rem1, 0
%str.3.str = select i1 %cmp2, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#define NUMBER 100
void print_array(int array[],int num)
{
int i;
for(i = 0; i < num - 1; i++){
printf("%d ", array[i]);
}
printf("%d\n", array[i]);
}
void insertSort(int array[],int num)
{
int i, v, j;
for(i = 1; i <= num - 1; i++){
print_array(array, num);
v = array[i];
j = i - 1;
while(j >= 0 && array[j] > v){
array[j + 1] = array[j];
j--;
}
array[j + 1] = v;
}
}
int main(void)
{
int i, num;
int array[NUMBER];
scanf("%d", &num);
for(i = 0; i < num; i++)
{
scanf("%d", &array[i]);
}
insertSort(array , num);
print_array(array , num);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114627/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114627/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @print_array(ptr nocapture noundef readonly %array, i32 noundef %num) local_unnamed_addr #0 {
entry:
%sub = add i32 %num, -1
%cmp8 = icmp sgt i32 %num, 1
br i1 %cmp8, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %sub 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 ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%1 = zext i32 %sub to i64
br label %for.end
for.end: ; preds = %entry, %for.end.loopexit
%i.0.lcssa = phi i64 [ %1, %for.end.loopexit ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %array, i64 %i.0.lcssa
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertSort(ptr nocapture noundef %array, i32 noundef %num) local_unnamed_addr #0 {
entry:
%cmp.not.not31 = icmp sgt i32 %num, 1
br i1 %cmp.not.not31, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%sub.i = add nsw i32 %num, -1
%wide.trip.count.i = zext i32 %sub.i to i64
%arrayidx2.i.us = getelementptr inbounds i32, ptr %array, i64 %wide.trip.count.i
%wide.trip.count = zext i32 %num to i64
br label %for.body.us
for.body.us: ; preds = %while.end.us, %for.body.lr.ph
%indvars.iv = phi i64 [ %indvars.iv.next, %while.end.us ], [ 1, %for.body.lr.ph ]
br label %for.body.i.us
for.body.i.us: ; preds = %for.body.i.us, %for.body.us
%indvars.iv.i.us = phi i64 [ 0, %for.body.us ], [ %indvars.iv.next.i.us, %for.body.i.us ]
%arrayidx.i.us = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.i.us
%0 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %print_array.exit.loopexit.us, label %for.body.i.us, !llvm.loop !9
land.rhs.us: ; preds = %while.body.us, %print_array.exit.loopexit.us
%indvars.iv33 = phi i64 [ %indvars.iv.next34, %while.body.us ], [ %indvars.iv, %print_array.exit.loopexit.us ]
%indvars.iv.next34 = add nsw i64 %indvars.iv33, -1
%idxprom3.us = and i64 %indvars.iv.next34, 4294967295
%arrayidx4.us = getelementptr inbounds i32, ptr %array, i64 %idxprom3.us
%1 = load i32, ptr %arrayidx4.us, align 4, !tbaa !5
%cmp5.us = icmp sgt i32 %1, %4
br i1 %cmp5.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv33, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom11.us = ashr exact i64 %sext, 32
%arrayidx12.us = getelementptr inbounds i32, ptr %array, i64 %idxprom11.us
store i32 %4, ptr %arrayidx12.us, 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.us, !llvm.loop !11
while.body.us: ; preds = %land.rhs.us
%arrayidx9.us = getelementptr inbounds i32, ptr %array, i64 %indvars.iv33
store i32 %1, ptr %arrayidx9.us, align 4, !tbaa !5
%2 = icmp sgt i64 %indvars.iv33, 1
br i1 %2, label %land.rhs.us, label %while.end.us, !llvm.loop !12
print_array.exit.loopexit.us: ; preds = %for.body.i.us
%3 = load i32, ptr %arrayidx2.i.us, align 4, !tbaa !5
%call3.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%arrayidx.us = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%4 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
for.end: ; preds = %while.end.us, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
%array = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %array) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %num)
%0 = load i32, ptr %num, align 4, !tbaa !5
%cmp11 = icmp sgt i32 %0, 0
br i1 %cmp11, label %for.body, label %print_array.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %num, 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 !13
for.end: ; preds = %for.body
%cmp.not.not31.i = icmp sgt i32 %1, 1
br i1 %cmp.not.not31.i, label %for.body.lr.ph.i, label %print_array.exit
for.body.lr.ph.i: ; preds = %for.end
%sub.i.i = add nsw i32 %1, -1
%wide.trip.count.i.i = zext i32 %sub.i.i to i64
%arrayidx2.i.us.i = getelementptr inbounds i32, ptr %array, i64 %wide.trip.count.i.i
%wide.trip.count.i = zext i32 %1 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %while.end.us.i, %for.body.lr.ph.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %while.end.us.i ], [ 1, %for.body.lr.ph.i ]
br label %for.body.i.us.i
for.body.i.us.i: ; preds = %for.body.i.us.i, %for.body.us.i
%indvars.iv.i.us.i = phi i64 [ 0, %for.body.us.i ], [ %indvars.iv.next.i.us.i, %for.body.i.us.i ]
%arrayidx.i.us.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.i.us.i
%3 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %print_array.exit.loopexit.us.i, label %for.body.i.us.i, !llvm.loop !9
land.rhs.us.i: ; preds = %print_array.exit.loopexit.us.i, %while.body.us.i
%indvars.iv33.i = phi i64 [ %indvars.iv.next34.i, %while.body.us.i ], [ %indvars.iv.i, %print_array.exit.loopexit.us.i ]
%indvars.iv.next34.i = add nsw i64 %indvars.iv33.i, -1
%idxprom3.us.i = and i64 %indvars.iv.next34.i, 4294967295
%arrayidx4.us.i = getelementptr inbounds i32, ptr %array, i64 %idxprom3.us.i
%4 = load i32, ptr %arrayidx4.us.i, align 4, !tbaa !5
%cmp5.us.i = icmp sgt i32 %4, %7
br i1 %cmp5.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv33.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom11.us.i = ashr exact i64 %sext.i, 32
%arrayidx12.us.i = getelementptr inbounds i32, ptr %array, i64 %idxprom11.us.i
store i32 %7, ptr %arrayidx12.us.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %insertSort.exit, label %for.body.us.i, !llvm.loop !11
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx9.us.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv33.i
store i32 %4, ptr %arrayidx9.us.i, align 4, !tbaa !5
%5 = icmp sgt i64 %indvars.iv33.i, 1
br i1 %5, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12
print_array.exit.loopexit.us.i: ; preds = %for.body.i.us.i
%6 = load i32, ptr %arrayidx2.i.us.i, align 4, !tbaa !5
%call3.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %6)
%arrayidx.us.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
insertSort.exit: ; preds = %while.end.us.i
%.pr = load i32, ptr %num, align 4, !tbaa !5
%cmp8.i = icmp sgt i32 %.pr, 1
br i1 %cmp8.i, label %for.body.preheader.i, label %print_array.exit
for.body.preheader.i: ; preds = %insertSort.exit
%sub.i = add nsw i32 %.pr, -1
%wide.trip.count.i5 = zext i32 %sub.i to i64
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i6 = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i7, %for.body.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.i6
%8 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8)
%indvars.iv.next.i7 = add nuw nsw i64 %indvars.iv.i6, 1
%exitcond.not.i8 = icmp eq i64 %indvars.iv.next.i7, %wide.trip.count.i5
br i1 %exitcond.not.i8, label %print_array.exit, label %for.body.i, !llvm.loop !9
print_array.exit: ; preds = %for.body.i, %entry, %for.end, %insertSort.exit
%i.0.lcssa.i = phi i64 [ 0, %insertSort.exit ], [ 0, %for.end ], [ 0, %entry ], [ %wide.trip.count.i5, %for.body.i ]
%arrayidx2.i = getelementptr inbounds i32, ptr %array, i64 %i.0.lcssa.i
%9 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%call3.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %array) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %num) #3
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(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"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
void print(int a[], int N)
{
for (int i = 0; i < N; i++)
{
printf("%d", a[i]);
if (i != N - 1)
{
printf(" ");
}
}
printf("\n");
}
int main()
{
int a[100];
int key;
int N;
scanf("%d", &N);
for (int i = 0; i < N; i++)
{
scanf("%d", &a[i]);
}
print(a, N);
int j;
for (int i = 1; i < N; i++)
{
key = a[i];
j = i - 1;
while (j >= 0 && a[j] > key)
{
a[j + 1] = a[j];
j--;
}
a[j + 1] = key;
print(a, N);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114670/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114670/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 void @print(ptr nocapture noundef readonly %a, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp9 = icmp sgt i32 %N, 0
br i1 %cmp9, label %for.body.lr.ph, label %for.cond.cleanup
for.body.lr.ph: ; preds = %entry
%sub = add nsw i32 %N, -1
%0 = zext i32 %sub to i64
%wide.trip.count = zext i32 %N to i64
br label %for.body
for.cond.cleanup: ; preds = %for.inc, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
for.body: ; preds = %for.body.lr.ph, %for.inc
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%cmp1.not = icmp eq i64 %indvars.iv, %0
br i1 %cmp1.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%putchar8 = tail call i32 @putchar(i32 32)
br label %for.inc
for.inc: ; preds = %for.body, %if.then
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !9
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [100 x i32], align 16
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp52 = icmp sgt i32 %0, 0
br i1 %cmp52, label %for.body, label %print.exit
for.cond.cleanup: ; preds = %for.body
%cmp9.i = icmp sgt i32 %4, 0
br i1 %cmp9.i, label %for.body.lr.ph.i, label %print.exit
for.body.lr.ph.i: ; preds = %for.cond.cleanup
%sub.i = add nsw i32 %4, -1
%1 = zext i32 %sub.i to i64
%wide.trip.count.i = zext i32 %4 to i64
br label %for.body.i
for.body.i: ; preds = %for.inc.i, %for.body.lr.ph.i
%indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.inc.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%2 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%cmp1.not.i = icmp eq i64 %indvars.iv.i, %1
br i1 %cmp1.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%putchar8.i = call i32 @putchar(i32 32)
br label %for.inc.i
for.inc.i: ; preds = %if.then.i, %for.body.i
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %print.exit, label %for.body.i, !llvm.loop !9
print.exit: ; preds = %for.inc.i, %entry, %for.cond.cleanup
%putchar.i = call i32 @putchar(i32 10)
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp457 = icmp sgt i32 %3, 1
br i1 %cmp457, label %for.body6, label %for.cond.cleanup5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %N, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
for.cond.cleanup5: ; preds = %print.exit51, %print.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4
ret i32 0
for.body6: ; preds = %print.exit, %print.exit51
%indvars.iv61 = phi i64 [ %indvars.iv.next62, %print.exit51 ], [ 1, %print.exit ]
%6 = phi i32 [ %12, %print.exit51 ], [ %3, %print.exit ]
%arrayidx8 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv61
%7 = load i32, ptr %arrayidx8, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body6, %while.body
%indvars.iv63 = phi i64 [ %indvars.iv61, %for.body6 ], [ %indvars.iv.next64, %while.body ]
%indvars.iv.next64 = add nsw i64 %indvars.iv63, -1
%idxprom10 = and i64 %indvars.iv.next64, 4294967295
%arrayidx11 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom10
%8 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %8, %7
br i1 %cmp12, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx16 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv63
store i32 %8, ptr %arrayidx16, align 4, !tbaa !5
%9 = icmp sgt i64 %indvars.iv63, 1
br i1 %9, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv63, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom18 = ashr exact i64 %sext, 32
%arrayidx19 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom18
store i32 %7, ptr %arrayidx19, align 4, !tbaa !5
%cmp9.i36 = icmp sgt i32 %6, 0
br i1 %cmp9.i36, label %for.body.lr.ph.i38, label %print.exit51
for.body.lr.ph.i38: ; preds = %while.end
%sub.i39 = add nsw i32 %6, -1
%10 = zext i32 %sub.i39 to i64
%wide.trip.count.i40 = zext i32 %6 to i64
br label %for.body.i41
for.body.i41: ; preds = %for.inc.i48, %for.body.lr.ph.i38
%indvars.iv.i42 = phi i64 [ 0, %for.body.lr.ph.i38 ], [ %indvars.iv.next.i49, %for.inc.i48 ]
%arrayidx.i43 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i42
%11 = load i32, ptr %arrayidx.i43, align 4, !tbaa !5
%call.i44 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11)
%cmp1.not.i45 = icmp eq i64 %indvars.iv.i42, %10
br i1 %cmp1.not.i45, label %for.inc.i48, label %if.then.i46
if.then.i46: ; preds = %for.body.i41
%putchar8.i47 = call i32 @putchar(i32 32)
br label %for.inc.i48
for.inc.i48: ; preds = %if.then.i46, %for.body.i41
%indvars.iv.next.i49 = add nuw nsw i64 %indvars.iv.i42, 1
%exitcond.not.i50 = icmp eq i64 %indvars.iv.next.i49, %wide.trip.count.i40
br i1 %exitcond.not.i50, label %print.exit51, label %for.body.i41, !llvm.loop !9
print.exit51: ; preds = %for.inc.i48, %while.end
%putchar.i37 = call i32 @putchar(i32 10)
%indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
%12 = load i32, ptr %N, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp4 = icmp slt i64 %indvars.iv.next62, %13
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !13
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#define D(fmt,...) fprintf(stderr, fmt, ##__VA_ARGS__)
#define D(fmt,...)
#define P(fmt,...) fprintf(stdout, fmt, ##__VA_ARGS__)
#define MAX 100
#define BFSZ 5
void print(int array[], size_t size) {
int z;
for (z = 0; z < size-1; z++) {
P("%d ", array[z]);
}
P("%d\n", array[z]);
}
void insertionSort (int array[], size_t size)
{
int i = 0;
for (i = 1; i < size; i++) {
int v = array[i];
int j = i - 1;
while (j >= 0 && array[j] > v) {
array[j+1] = array[j];
j--;
}
array[j+1] = v;
print(array, size);
}
}
int main (int ac, char **av)
{
while (1) {
int size = 0;
fscanf(stdin, "%d\n", &size);
int array[MAX] = {0};
char buf[MAX * 5] = {0};
char *eof = fgets(buf, MAX*5, stdin);
if (eof == NULL) {
break;
}
int i = 0;
char numBuf[BFSZ] = {0};
int array_idx = 0;
int buf_idx = 0;
for (i = 0; i < size*BFSZ; i++) {
if (buf[i] == '\0') {
continue;
} else if (buf[i] == ' ') {
array[array_idx++] = atoi(numBuf);
buf_idx=0;
memset(numBuf, 0, BFSZ);
} else if (buf[i] == '\n') {
array[array_idx++] = atoi(numBuf);
memset(numBuf, 0, BFSZ);
break;
} else {
memcpy(numBuf+buf_idx++, buf+i, 1);
}
}
int j = 0;
print(array, size);
insertionSort(array, size);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114713/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114713/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@stdout = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local void @print(ptr nocapture noundef readonly %array, i64 noundef %size) local_unnamed_addr #0 {
entry:
%sub = add i64 %size, -1
%cmp9.not = icmp eq i64 %sub, 0
br i1 %cmp9.not, label %for.end, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%0 = load ptr, ptr @stdout, align 8, !tbaa !5
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !9
%call = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %0, ptr noundef nonnull @.str, i32 noundef %1)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %sub
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%2 = load ptr, ptr @stdout, align 8, !tbaa !5
%arrayidx3 = getelementptr inbounds i32, ptr %array, i64 %sub
%3 = load i32, ptr %arrayidx3, align 4, !tbaa !9
%call4 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %2, ptr noundef nonnull @.str.1, i32 noundef %3)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_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 void @insertionSort(ptr nocapture noundef %array, i64 noundef %size) local_unnamed_addr #0 {
entry:
%cmp33 = icmp ugt i64 %size, 1
br i1 %cmp33, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub.i = add i64 %size, -1
%arrayidx3.i = getelementptr inbounds i32, ptr %array, i64 %sub.i
br label %for.body
for.body: ; preds = %for.body.preheader, %print.exit.loopexit
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %print.exit.loopexit ]
%arrayidx = getelementptr inbounds i32, ptr %array, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !9
br label %land.rhs
land.rhs: ; preds = %for.body, %while.body
%indvars.iv37 = phi i64 [ %indvars.iv, %for.body ], [ %indvars.iv.next38, %while.body ]
%indvars.iv.next38 = add nsw i64 %indvars.iv37, -1
%idxprom4 = and i64 %indvars.iv.next38, 4294967295
%arrayidx5 = getelementptr inbounds i32, ptr %array, i64 %idxprom4
%1 = load i32, ptr %arrayidx5, align 4, !tbaa !9
%cmp6 = icmp sgt i32 %1, %0
br i1 %cmp6, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx11 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv37
store i32 %1, ptr %arrayidx11, align 4, !tbaa !9
%2 = icmp sgt i64 %indvars.iv37, 1
br i1 %2, label %land.rhs, label %while.end, !llvm.loop !13
while.end: ; preds = %while.body, %land.rhs
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv37, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom13 = ashr exact i64 %sext, 32
%arrayidx14 = getelementptr inbounds i32, ptr %array, i64 %idxprom13
store i32 %0, ptr %arrayidx14, align 4, !tbaa !9
br label %for.body.i
for.body.i: ; preds = %while.end, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %while.end ]
%3 = load ptr, ptr @stdout, align 8, !tbaa !5
%arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.i
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !9
%call.i = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %3, ptr noundef nonnull @.str, i32 noundef %4)
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %sub.i
br i1 %exitcond.not.i, label %print.exit.loopexit, label %for.body.i, !llvm.loop !11
print.exit.loopexit: ; preds = %for.body.i
%5 = load ptr, ptr @stdout, align 8, !tbaa !5
%6 = load i32, ptr %arrayidx3.i, align 4, !tbaa !9
%call4.i = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.1, i32 noundef %6)
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %size
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !14
for.end: ; preds = %print.exit.loopexit, %entry
ret void
}
; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %ac, ptr nocapture noundef readnone %av) local_unnamed_addr #3 {
entry:
%size = alloca i32, align 4
%array = alloca [100 x i32], align 16
%buf = alloca [500 x i8], align 16
%numBuf = alloca [5 x i8], align 1
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %size) #7
store i32 0, ptr %size, align 4, !tbaa !9
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call69 = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str.1, ptr noundef nonnull %size) #7
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %array) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %array, i8 0, i64 400, i1 false)
call void @llvm.lifetime.start.p0(i64 500, ptr nonnull %buf) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(500) %buf, i8 0, i64 500, i1 false)
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call170 = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 500, ptr noundef %1)
%cmp71 = icmp eq ptr %call170, null
br i1 %cmp71, label %while.end, label %if.end
if.end: ; preds = %entry, %cleanup
call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %numBuf) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %numBuf, i8 0, i64 5, i1 false)
%2 = load i32, ptr %size, align 4, !tbaa !9
%cmp265 = icmp sgt i32 %2, 0
br i1 %cmp265, label %for.body, label %for.end
for.body: ; preds = %if.end, %for.inc
%3 = phi i32 [ %5, %for.inc ], [ %2, %if.end ]
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %if.end ]
%buf_idx.068 = phi i32 [ %buf_idx.1, %for.inc ], [ 0, %if.end ]
%array_idx.067 = phi i32 [ %array_idx.1, %for.inc ], [ 0, %if.end ]
%arrayidx = getelementptr inbounds [500 x i8], ptr %buf, i64 0, i64 %indvars.iv
%4 = load i8, ptr %arrayidx, align 1
switch i8 %4, label %if.else30 [
i8 0, label %for.inc
i8 32, label %if.then11
i8 10, label %if.then23
]
if.then11: ; preds = %for.body
%call.i = call i64 @strtol(ptr nocapture noundef nonnull %numBuf, ptr noundef null, i32 noundef 10) #7
%conv.i = trunc i64 %call.i to i32
%inc = add nsw i32 %array_idx.067, 1
%idxprom14 = sext i32 %array_idx.067 to i64
%arrayidx15 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %idxprom14
store i32 %conv.i, ptr %arrayidx15, align 4, !tbaa !9
call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %numBuf, i8 0, i64 5, i1 false)
%.pre = load i32, ptr %size, align 4, !tbaa !9
br label %for.inc
if.then23: ; preds = %for.body
%call.i53 = call i64 @strtol(ptr nocapture noundef nonnull %numBuf, ptr noundef null, i32 noundef 10) #7
%conv.i54 = trunc i64 %call.i53 to i32
%idxprom27 = sext i32 %array_idx.067 to i64
%arrayidx28 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %idxprom27
store i32 %conv.i54, ptr %arrayidx28, align 4, !tbaa !9
%.pre74 = load i32, ptr %size, align 4, !tbaa !9
br label %for.end
if.else30: ; preds = %for.body
%inc32 = add nsw i32 %buf_idx.068, 1
%idx.ext = sext i32 %buf_idx.068 to i64
%add.ptr = getelementptr inbounds i8, ptr %numBuf, i64 %idx.ext
store i8 %4, ptr %add.ptr, align 1
br label %for.inc
for.inc: ; preds = %for.body, %if.else30, %if.then11
%5 = phi i32 [ %3, %for.body ], [ %.pre, %if.then11 ], [ %3, %if.else30 ]
%array_idx.1 = phi i32 [ %array_idx.067, %for.body ], [ %inc, %if.then11 ], [ %array_idx.067, %if.else30 ]
%buf_idx.1 = phi i32 [ %buf_idx.068, %for.body ], [ 0, %if.then11 ], [ %inc32, %if.else30 ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%mul = mul nsw i32 %5, 5
%6 = sext i32 %mul to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !15
for.end: ; preds = %for.inc, %if.end, %if.then23
%7 = phi i32 [ %2, %if.end ], [ %.pre74, %if.then23 ], [ %5, %for.inc ]
%conv41 = sext i32 %7 to i64
%sub.i = add nsw i64 %conv41, -1
%cmp9.not.i = icmp eq i64 %sub.i, 0
br i1 %cmp9.not.i, label %print.exit, label %for.body.i
for.body.i: ; preds = %for.end, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ 0, %for.end ]
%8 = load ptr, ptr @stdout, align 8, !tbaa !5
%arrayidx.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx.i, align 4, !tbaa !9
%call.i55 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %8, ptr noundef nonnull @.str, i32 noundef %9)
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %sub.i
br i1 %exitcond.not.i, label %print.exit, label %for.body.i, !llvm.loop !11
print.exit: ; preds = %for.body.i, %for.end
%10 = load ptr, ptr @stdout, align 8, !tbaa !5
%arrayidx3.i = getelementptr inbounds i32, ptr %array, i64 %sub.i
%11 = load i32, ptr %arrayidx3.i, align 4, !tbaa !9
%call4.i = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.1, i32 noundef %11)
%12 = load i32, ptr %size, align 4, !tbaa !9
%conv43 = sext i32 %12 to i64
%cmp33.i = icmp ugt i32 %12, 1
br i1 %cmp33.i, label %for.body.preheader.i, label %cleanup
for.body.preheader.i: ; preds = %print.exit
%sub.i.i = add nsw i64 %conv43, -1
%arrayidx3.i.i = getelementptr inbounds i32, ptr %array, i64 %sub.i.i
br label %for.body.i56
for.body.i56: ; preds = %print.exit.loopexit.i, %for.body.preheader.i
%indvars.iv.i57 = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i59, %print.exit.loopexit.i ]
%arrayidx.i58 = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.i57
%13 = load i32, ptr %arrayidx.i58, align 4, !tbaa !9
br label %land.rhs.i
land.rhs.i: ; preds = %while.body.i, %for.body.i56
%indvars.iv37.i = phi i64 [ %indvars.iv.i57, %for.body.i56 ], [ %indvars.iv.next38.i, %while.body.i ]
%indvars.iv.next38.i = add nsw i64 %indvars.iv37.i, -1
%idxprom4.i = and i64 %indvars.iv.next38.i, 4294967295
%arrayidx5.i = getelementptr inbounds i32, ptr %array, i64 %idxprom4.i
%14 = load i32, ptr %arrayidx5.i, align 4, !tbaa !9
%cmp6.i = icmp sgt i32 %14, %13
br i1 %cmp6.i, label %while.body.i, label %while.end.i
while.body.i: ; preds = %land.rhs.i
%arrayidx11.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv37.i
store i32 %14, ptr %arrayidx11.i, align 4, !tbaa !9
%15 = icmp sgt i64 %indvars.iv37.i, 1
br i1 %15, label %land.rhs.i, label %while.end.i, !llvm.loop !13
while.end.i: ; preds = %while.body.i, %land.rhs.i
%j.0.in.lcssa.i = phi i64 [ 0, %while.body.i ], [ %indvars.iv37.i, %land.rhs.i ]
%sext.i = shl i64 %j.0.in.lcssa.i, 32
%idxprom13.i = ashr exact i64 %sext.i, 32
%arrayidx14.i = getelementptr inbounds i32, ptr %array, i64 %idxprom13.i
store i32 %13, ptr %arrayidx14.i, align 4, !tbaa !9
br label %for.body.i.i
for.body.i.i: ; preds = %for.body.i.i, %while.end.i
%indvars.iv.i.i = phi i64 [ %indvars.iv.next.i.i, %for.body.i.i ], [ 0, %while.end.i ]
%16 = load ptr, ptr @stdout, align 8, !tbaa !5
%arrayidx.i.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.i.i
%17 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !9
%call.i.i = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %16, ptr noundef nonnull @.str, i32 noundef %17)
%indvars.iv.next.i.i = add nuw i64 %indvars.iv.i.i, 1
%exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %sub.i.i
br i1 %exitcond.not.i.i, label %print.exit.loopexit.i, label %for.body.i.i, !llvm.loop !11
print.exit.loopexit.i: ; preds = %for.body.i.i
%18 = load ptr, ptr @stdout, align 8, !tbaa !5
%19 = load i32, ptr %arrayidx3.i.i, align 4, !tbaa !9
%call4.i.i = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str.1, i32 noundef %19)
%indvars.iv.next.i59 = add nuw i64 %indvars.iv.i57, 1
%exitcond.not.i60 = icmp eq i64 %indvars.iv.next.i59, %conv43
br i1 %exitcond.not.i60, label %cleanup, label %for.body.i56, !llvm.loop !14
cleanup: ; preds = %print.exit.loopexit.i, %print.exit
call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %numBuf) #7
call void @llvm.lifetime.end.p0(i64 500, ptr nonnull %buf) #7
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %array) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %size) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %size) #7
store i32 0, ptr %size, align 4, !tbaa !9
%20 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %20, ptr noundef nonnull @.str.1, ptr noundef nonnull %size) #7
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %array) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %array, i8 0, i64 400, i1 false)
call void @llvm.lifetime.start.p0(i64 500, ptr nonnull %buf) #7
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(500) %buf, i8 0, i64 500, i1 false)
%21 = load ptr, ptr @stdin, align 8, !tbaa !5
%call1 = call ptr @fgets(ptr noundef nonnull %buf, i32 noundef 500, ptr noundef %21)
%cmp = icmp eq ptr %call1, null
br i1 %cmp, label %while.end, label %if.end
while.end: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 500, ptr nonnull %buf) #7
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %array) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %size) #7
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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 #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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
|
#include <stdio.h>
#define N 100
int main(void)
{
int i,v,k,j,n,m,a[N];
scanf("%d",&n);
for(m=0;m<n;m++){
scanf("%d",&a[m]);
}
for(k=0;k<n;k++){
printf("%d",a[k]);
if(k != n-1){
printf(" ");
}
}
printf("\n");
for(i=1;i<n;i++){
v = a[i];
int j = i-1;
while(j>=0 && a[j]>v){
a[j+1] = a[j];
j--;
}
a[j+1] = v;
for(k=0;k<n;k++){
printf("%d",a[k]);
if(k != n-1){
printf(" ");
}
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114793/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114793/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%a = 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 %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
%cmp71 = icmp sgt i32 %0, 0
br i1 %cmp71, label %for.body, label %for.end12
for.cond2.preheader: ; preds = %for.body
%1 = icmp sgt i32 %2, 0
br i1 %1, label %for.body4, label %for.end12
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.inc10
%indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.inc10 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv83
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4)
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%6 = zext i32 %sub to i64
%cmp8.not = icmp eq i64 %indvars.iv83, %6
br i1 %cmp8.not, label %for.inc10, label %if.then
if.then: ; preds = %for.body4
%putchar70 = call i32 @putchar(i32 32)
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc10
for.inc10: ; preds = %for.body4, %if.then
%7 = phi i32 [ %5, %for.body4 ], [ %.pre, %if.then ]
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%8 = sext i32 %7 to i64
%cmp3 = icmp slt i64 %indvars.iv.next84, %8
br i1 %cmp3, label %for.body4, label %for.end12, !llvm.loop !11
for.end12: ; preds = %for.inc10, %entry, %for.cond2.preheader
%putchar = call i32 @putchar(i32 10)
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp1580 = icmp sgt i32 %9, 1
br i1 %cmp1580, label %for.body16, label %for.end49
for.body16: ; preds = %for.end12, %for.end45
%10 = phi i32 [ %19, %for.end45 ], [ %9, %for.end12 ]
%indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.end45 ], [ 1, %for.end12 ]
%arrayidx18 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv86
%11 = load i32, ptr %arrayidx18, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body16, %while.body
%indvars.iv88 = phi i64 [ %indvars.iv86, %for.body16 ], [ %indvars.iv.next89, %while.body ]
%indvars.iv.next89 = add nsw i64 %indvars.iv88, -1
%idxprom22 = and i64 %indvars.iv.next89, 4294967295
%arrayidx23 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom22
%12 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %12, %11
br i1 %cmp24, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx28 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv88
store i32 %12, ptr %arrayidx28, align 4, !tbaa !5
%13 = icmp sgt i64 %indvars.iv88, 1
br i1 %13, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%j19.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv88, %land.rhs ]
%sext = shl i64 %j19.0.in.lcssa, 32
%idxprom30 = ashr exact i64 %sext, 32
%arrayidx31 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom30
store i32 %11, ptr %arrayidx31, align 4, !tbaa !5
%cmp3378 = icmp sgt i32 %10, 0
br i1 %cmp3378, label %for.body34, label %for.end45
for.body34: ; preds = %while.end, %for.inc43
%indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.inc43 ], [ 0, %while.end ]
%arrayidx36 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv91
%14 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14)
%15 = load i32, ptr %n, align 4, !tbaa !5
%sub38 = add nsw i32 %15, -1
%16 = zext i32 %sub38 to i64
%cmp39.not = icmp eq i64 %indvars.iv91, %16
br i1 %cmp39.not, label %for.inc43, label %if.then40
if.then40: ; preds = %for.body34
%putchar69 = call i32 @putchar(i32 32)
%.pre97 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc43
for.inc43: ; preds = %for.body34, %if.then40
%17 = phi i32 [ %15, %for.body34 ], [ %.pre97, %if.then40 ]
%indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
%18 = sext i32 %17 to i64
%cmp33 = icmp slt i64 %indvars.iv.next92, %18
br i1 %cmp33, label %for.body34, label %for.end45, !llvm.loop !13
for.end45: ; preds = %for.inc43, %while.end
%putchar68 = call i32 @putchar(i32 10)
%indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
%19 = load i32, ptr %n, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp15 = icmp slt i64 %indvars.iv.next87, %20
br i1 %cmp15, label %for.body16, label %for.end49, !llvm.loop !14
for.end49: ; preds = %for.end45, %for.end12
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: 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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
void trace(int A[], int N){
int i;
for(i = 0; i < N; i++){
if(i > 0) printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
void InsertionSort(int A[], int N){
int j, i, v;
for(i = 1; i < N; i++){
v = A[i];
j = i-1;
while( j >= 0 && A[j] > v){
A[j+1] = A[j];
j--;
}
A[j + 1] = v;
trace(A, N);
}
}
int main(){
int N,i,j;
int A[100];
scanf("%d", &N);
for(i = 0; i < N; i++) scanf("%d", &A[i]);
trace(A,N);
InsertionSort(A, N);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114836/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114836/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp8 = icmp sgt i32 %N, 0
br i1 %cmp8, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %N to i64
%.pre = load i32, ptr %A, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %N, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @InsertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp30 = icmp sgt i32 %N, 1
br i1 %cmp30, label %for.body.us.preheader, label %for.end
for.body.us.preheader: ; preds = %entry
%wide.trip.count.i = zext i32 %N to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %trace.exit.loopexit.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %trace.exit.loopexit.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next35 = add nsw i64 %indvars.iv34, -1
%idxprom2.us = and i64 %indvars.iv.next35, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us
%1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %1, %0
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv34, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom10.us = ashr exact i64 %sext, 32
%arrayidx11.us = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us
store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5
%.pre.i.us = load i32, ptr %A, align 4, !tbaa !5
%call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us)
br label %if.end.i.us
if.end.i.us: ; preds = %while.end.us, %if.end.i.us
%indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ]
%putchar7.i.us = tail call i32 @putchar(i32 32)
%arrayidx.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us
%2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %trace.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34
store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv34, 1
br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12
trace.exit.loopexit.us: ; preds = %if.end.i.us
%putchar.i.us = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i
br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13
for.end: ; preds = %trace.exit.loopexit.us, %entry
ret void
}
; 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
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %trace.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body
%cmp8.i = icmp sgt i32 %1, 0
br i1 %cmp8.i, label %if.end.peel.i, label %trace.exit
if.end.peel.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %1 to i64
%.pre.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %1, 1
br i1 %exitcond.peel.not.i, label %trace.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 1, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%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 %trace.exit, label %if.end.i, !llvm.loop !9
trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %4, 1
br i1 %cmp30.i, label %for.body.us.preheader.i, label %InsertionSort.exit
for.body.us.preheader.i: ; preds = %trace.exit
%wide.trip.count.i.i = zext i32 %4 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %trace.exit.loopexit.us.i, %for.body.us.preheader.i
%indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %trace.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i5
%5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i
%indvars.iv34.i = phi i64 [ %indvars.iv.next35.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ]
%indvars.iv.next35.i = add nsw i64 %indvars.iv34.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next35.i, 4294967295
%arrayidx3.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us.i
%6 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %6, %5
br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv34.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom10.us.i = ashr exact i64 %sext.i, 32
%arrayidx11.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us.i
store i32 %5, ptr %arrayidx11.us.i, align 4, !tbaa !5
%.pre.i.us.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i)
br label %if.end.i.us.i
if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i
%indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ]
%putchar7.i.us.i = call i32 @putchar(i32 32)
%arrayidx.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i
%7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %trace.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34.i
store i32 %6, ptr %arrayidx8.us.i, align 4, !tbaa !5
%8 = icmp sgt i64 %indvars.iv34.i, 1
br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12
trace.exit.loopexit.us.i: ; preds = %if.end.i.us.i
%putchar.i.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1
%exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i
br i1 %exitcond.not.i7, label %InsertionSort.exit, label %for.body.us.i, !llvm.loop !13
InsertionSort.exit: ; preds = %trace.exit.loopexit.us.i, %trace.exit
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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <stdlib.h>
int main()
{
int t;
scanf("%d", &t);
for (int i = 0; i < t; i ++)
{
int n;
scanf("%d", &n);
if (n <= 2)
{
printf("1\n");
}
else
{
printf("%d\n", (n / 2) + (n % 2));
}
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11488/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11488/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %if.end, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
for.body: ; preds = %entry, %if.end
%i.08 = phi i32 [ %inc, %if.end ], [ 0, %entry ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp slt i32 %1, 3
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %for.body
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %for.body
%div6 = lshr i32 %1, 1
%rem = and i32 %1, 1
%add = add nuw nsw i32 %div6, %rem
%call4 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %add)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
%inc = add nuw nsw i32 %i.08, 1
%2 = load i32, ptr %t, 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
static const int N = 1000;
void trace(int A[], int n){
int i;
for ( i = 1; i <= n; i++ ){
if ( i > 1 ) printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
int main(){
int n, i, j,a;
int A[N+1];
scanf("%d", &n);
for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);
trace(A, n);
/*
your code
*/
for(i=1;i<n;i++){
for(j=i+1;j>1;j--){
if(A[j]<A[j-1]){
a=A[j];
A[j]=A[j-1];
A[j-1]=a;
}
}
trace(A,n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114922/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114922/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not8 = icmp slt i32 %n, 1
br i1 %cmp.not8, label %for.end, label %if.end.peel
if.end.peel: ; preds = %entry
%0 = add nuw i32 %n, 1
%wide.trip.count = zext i32 %0 to i64
%arrayidx.peel.phi.trans.insert = getelementptr inbounds i32, ptr %A, i64 1
%.pre = load i32, ptr %arrayidx.peel.phi.trans.insert, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %0, 2
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 2, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%0 = tail call ptr @llvm.stacksave.p0()
%vla42 = alloca [1001 x i32], align 16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not59 = icmp slt i32 %1, 1
br i1 %cmp.not59, label %trace.exit, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla42, 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
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body
%cmp.not8.i = icmp slt i32 %2, 1
br i1 %cmp.not8.i, label %trace.exit, label %if.end.peel.i
if.end.peel.i: ; preds = %for.end
%4 = add nuw nsw i32 %2, 1
%wide.trip.count.i = zext i32 %4 to i64
%arrayidx.peel.phi.trans.insert.i = getelementptr inbounds i32, ptr %vla42, i64 1
%.pre.i = load i32, ptr %arrayidx.peel.phi.trans.insert.i, align 4, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %4, 2
br i1 %exitcond.peel.not.i, label %trace.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 2, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %vla42, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %trace.exit, label %if.end.i, !llvm.loop !9
trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp362 = icmp sgt i32 %6, 1
br i1 %cmp362, label %for.body4.lr.ph, label %for.end27
for.body4.lr.ph: ; preds = %trace.exit
%arrayidx.peel.phi.trans.insert.i46 = getelementptr inbounds i32, ptr %vla42, i64 1
br label %for.body4
for.body4: ; preds = %for.body4.lr.ph, %trace.exit58
%indvar = phi i64 [ 0, %for.body4.lr.ph ], [ %indvar.next, %trace.exit58 ]
%indvars.iv66 = phi i64 [ 2, %for.body4.lr.ph ], [ %indvars.iv.next67, %trace.exit58 ]
%7 = phi i32 [ %6, %for.body4.lr.ph ], [ %19, %trace.exit58 ]
%i.163 = phi i32 [ 1, %for.body4.lr.ph ], [ %add, %trace.exit58 ]
%8 = and i64 %indvar, 1
%lcmp.mod.not.not = icmp eq i64 %8, 0
br i1 %lcmp.mod.not.not, label %for.body7.prol, label %for.body7.prol.loopexit
for.body7.prol: ; preds = %for.body4
%arrayidx9.prol = getelementptr inbounds i32, ptr %vla42, i64 %indvars.iv66
%9 = load i32, ptr %arrayidx9.prol, align 4, !tbaa !5
%indvars.iv.next69.prol = add nsw i64 %indvars.iv66, -1
%idxprom10.prol = and i64 %indvars.iv.next69.prol, 4294967295
%arrayidx11.prol = getelementptr inbounds i32, ptr %vla42, i64 %idxprom10.prol
%10 = load i32, ptr %arrayidx11.prol, align 4, !tbaa !5
%cmp12.prol = icmp slt i32 %9, %10
br i1 %cmp12.prol, label %if.then.prol, label %for.body7.prol.loopexit
if.then.prol: ; preds = %for.body7.prol
store i32 %10, ptr %arrayidx9.prol, align 4, !tbaa !5
store i32 %9, ptr %arrayidx11.prol, align 4, !tbaa !5
br label %for.body7.prol.loopexit
for.body7.prol.loopexit: ; preds = %for.body7.prol, %if.then.prol, %for.body4
%indvars.iv68.unr = phi i64 [ %indvars.iv66, %for.body4 ], [ %indvars.iv.next69.prol, %if.then.prol ], [ %indvars.iv.next69.prol, %for.body7.prol ]
%11 = icmp eq i64 %indvar, 0
br i1 %11, label %for.end24, label %for.body7
for.body7: ; preds = %for.body7.prol.loopexit, %for.inc23.1
%indvars.iv68 = phi i64 [ %indvars.iv.next69.1, %for.inc23.1 ], [ %indvars.iv68.unr, %for.body7.prol.loopexit ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla42, i64 %indvars.iv68
%12 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%indvars.iv.next69 = add nsw i64 %indvars.iv68, -1
%idxprom10 = and i64 %indvars.iv.next69, 4294967295
%arrayidx11 = getelementptr inbounds i32, ptr %vla42, i64 %idxprom10
%13 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp slt i32 %12, %13
br i1 %cmp12, label %if.then, label %for.inc23
if.then: ; preds = %for.body7
store i32 %13, ptr %arrayidx9, align 4, !tbaa !5
store i32 %12, ptr %arrayidx11, align 4, !tbaa !5
br label %for.inc23
for.inc23: ; preds = %for.body7, %if.then
%arrayidx9.1 = getelementptr inbounds i32, ptr %vla42, i64 %indvars.iv.next69
%14 = load i32, ptr %arrayidx9.1, align 4, !tbaa !5
%indvars.iv.next69.1 = add nsw i64 %indvars.iv68, -2
%idxprom10.1 = and i64 %indvars.iv.next69.1, 4294967295
%arrayidx11.1 = getelementptr inbounds i32, ptr %vla42, i64 %idxprom10.1
%15 = load i32, ptr %arrayidx11.1, align 4, !tbaa !5
%cmp12.1 = icmp slt i32 %14, %15
br i1 %cmp12.1, label %if.then.1, label %for.inc23.1
if.then.1: ; preds = %for.inc23
store i32 %15, ptr %arrayidx9.1, align 4, !tbaa !5
store i32 %14, ptr %arrayidx11.1, align 4, !tbaa !5
br label %for.inc23.1
for.inc23.1: ; preds = %if.then.1, %for.inc23
%16 = icmp sgt i64 %indvars.iv68, 3
br i1 %16, label %for.body7, label %for.end24, !llvm.loop !13
for.end24: ; preds = %for.inc23.1, %for.body7.prol.loopexit
%add = add nuw nsw i32 %i.163, 1
%cmp.not8.i43 = icmp slt i32 %7, 1
br i1 %cmp.not8.i43, label %trace.exit58, label %if.end.peel.i44
if.end.peel.i44: ; preds = %for.end24
%17 = add nuw i32 %7, 1
%wide.trip.count.i45 = zext i32 %17 to i64
%.pre.i47 = load i32, ptr %arrayidx.peel.phi.trans.insert.i46, align 4, !tbaa !5
%call2.peel.i48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i47)
%exitcond.peel.not.i49 = icmp eq i32 %17, 2
br i1 %exitcond.peel.not.i49, label %trace.exit58, label %if.end.i50
if.end.i50: ; preds = %if.end.peel.i44, %if.end.i50
%indvars.iv.i51 = phi i64 [ %indvars.iv.next.i55, %if.end.i50 ], [ 2, %if.end.peel.i44 ]
%putchar7.i52 = call i32 @putchar(i32 32)
%arrayidx.i53 = getelementptr inbounds i32, ptr %vla42, i64 %indvars.iv.i51
%18 = load i32, ptr %arrayidx.i53, align 4, !tbaa !5
%call2.i54 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %18)
%indvars.iv.next.i55 = add nuw nsw i64 %indvars.iv.i51, 1
%exitcond.not.i56 = icmp eq i64 %indvars.iv.next.i55, %wide.trip.count.i45
br i1 %exitcond.not.i56, label %trace.exit58, label %if.end.i50, !llvm.loop !9
trace.exit58: ; preds = %if.end.i50, %for.end24, %if.end.peel.i44
%putchar.i57 = call i32 @putchar(i32 10)
%19 = load i32, ptr %n, align 4, !tbaa !5
%cmp3 = icmp slt i32 %add, %19
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%indvar.next = add i64 %indvar, 1
br i1 %cmp3, label %for.body4, label %for.end27, !llvm.loop !14
for.end27: ; preds = %trace.exit58, %trace.exit
call void @llvm.stackrestore.p0(ptr %0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; 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 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#define N 100
int main()
{
int i, j, k, n, v, arr[N];
while(1){
scanf("%d", &n);
if(n >= 1 || n <= 100) break;
}
for(i = 0; i < n; i++){
scanf("%d", &arr[i]);
if(arr[i] < 0 || arr[i] >1000) i--;
}
for(i = 0; i < n - 1; i++){
printf("%d ", arr[i]);
}
printf("%d\n", arr[i]);
for(i =1; i < n; i++){
v = arr[i];
j = i - 1;
while(j >= 0 && arr[j] > v){
arr[j + 1] = arr[j];
j--;
}
arr[j + 1] = v;
for(k = 0; k < n - 1; k++){
printf("%d ", arr[k]);
}
printf("%d\n", arr[k]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_114966/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_114966/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%arr = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %arr) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp285 = icmp sgt i32 %0, 0
br i1 %cmp285, label %for.body, label %for.end21
for.cond13.preheader: ; preds = %for.body
%1 = icmp sgt i32 %3, 1
br i1 %1, label %for.body15, label %for.end21
for.body: ; preds = %entry, %for.body
%i.086 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%idxprom = sext i32 %i.086 to i64
%arrayidx = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %idxprom
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%or.cond = icmp ugt i32 %2, 1000
%dec = sext i1 %or.cond to i32
%i.1 = add nsw i32 %i.086, 1
%inc = add nsw i32 %i.1, %dec
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc, %3
br i1 %cmp2, label %for.body, label %for.cond13.preheader, !llvm.loop !9
for.body15: ; preds = %for.cond13.preheader, %for.body15
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body15 ], [ 0, %for.cond13.preheader ]
%arrayidx17 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %indvars.iv
%4 = load i32, ptr %arrayidx17, align 4, !tbaa !5
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%6 = sext i32 %sub to i64
%cmp14 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp14, label %for.body15, label %for.end21.loopexit, !llvm.loop !11
for.end21.loopexit: ; preds = %for.body15
%7 = and i64 %indvars.iv.next, 4294967295
br label %for.end21
for.end21: ; preds = %entry, %for.end21.loopexit, %for.cond13.preheader
%i.2.lcssa = phi i64 [ 0, %for.cond13.preheader ], [ %7, %for.end21.loopexit ], [ 0, %entry ]
%arrayidx23 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %i.2.lcssa
%8 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp2697 = icmp sgt i32 %9, 1
br i1 %cmp2697, label %for.body27, label %for.end61
for.body27: ; preds = %for.end21, %for.end55
%10 = phi i32 [ %18, %for.end55 ], [ %9, %for.end21 ]
%indvars.iv100 = phi i64 [ %indvars.iv.next101, %for.end55 ], [ 1, %for.end21 ]
%arrayidx29 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %indvars.iv100
%11 = load i32, ptr %arrayidx29, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body27, %while.body36
%indvars.iv102 = phi i64 [ %indvars.iv100, %for.body27 ], [ %indvars.iv.next103, %while.body36 ]
%indvars.iv.next103 = add nsw i64 %indvars.iv102, -1
%idxprom33 = and i64 %indvars.iv.next103, 4294967295
%arrayidx34 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %idxprom33
%12 = load i32, ptr %arrayidx34, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %12, %11
br i1 %cmp35, label %while.body36, label %while.end42
while.body36: ; preds = %land.rhs
%arrayidx40 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %indvars.iv102
store i32 %12, ptr %arrayidx40, align 4, !tbaa !5
%13 = icmp sgt i64 %indvars.iv102, 1
br i1 %13, label %land.rhs, label %while.end42, !llvm.loop !12
while.end42: ; preds = %while.body36, %land.rhs
%j.0.in.lcssa = phi i64 [ 0, %while.body36 ], [ %indvars.iv102, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom44 = ashr exact i64 %sext, 32
%arrayidx45 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %idxprom44
store i32 %11, ptr %arrayidx45, align 4, !tbaa !5
%cmp4894 = icmp sgt i32 %10, 1
br i1 %cmp4894, label %for.body49, label %for.end55
for.body49: ; preds = %while.end42, %for.body49
%indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.body49 ], [ 0, %while.end42 ]
%arrayidx51 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %indvars.iv105
%14 = load i32, ptr %arrayidx51, align 4, !tbaa !5
%call52 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%sub47 = add nsw i32 %15, -1
%16 = sext i32 %sub47 to i64
%cmp48 = icmp slt i64 %indvars.iv.next106, %16
br i1 %cmp48, label %for.body49, label %for.end55, !llvm.loop !13
for.end55: ; preds = %for.body49, %while.end42
%k.0.lcssa = phi i64 [ 0, %while.end42 ], [ %indvars.iv.next106, %for.body49 ]
%idxprom56 = and i64 %k.0.lcssa, 4294967295
%arrayidx57 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %idxprom56
%17 = load i32, ptr %arrayidx57, align 4, !tbaa !5
%call58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%indvars.iv.next101 = add nuw nsw i64 %indvars.iv100, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp26 = icmp slt i64 %indvars.iv.next101, %19
br i1 %cmp26, label %for.body27, label %for.end61, !llvm.loop !14
for.end61: ; preds = %for.end55, %for.end21
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %arr) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
static const int N = 1000;
void trace(int A[], int n){
int i;
for ( i = 1; i <= n; i++ ){
if ( i > 1 ) printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
int main(){
int n, i, j;
int v;
int A[N+1];
scanf("%d", &n);
for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);
//trace(A, n);
/*my code*/
for(i=1;i<=n;i++){
// trace(A, n);
v=A[i];
j=i-1;
// printf("%d\n",i);
while(j>=0 && A[j]>v){
A[j+1]=A[j];
j--;
}
A[j+1]=v;
trace(A, n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115008/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115008/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not8 = icmp slt i32 %n, 1
br i1 %cmp.not8, label %for.end, label %if.end.peel
if.end.peel: ; preds = %entry
%0 = add nuw i32 %n, 1
%wide.trip.count = zext i32 %0 to i64
%arrayidx.peel.phi.trans.insert = getelementptr inbounds i32, ptr %A, i64 1
%.pre = load i32, ptr %arrayidx.peel.phi.trans.insert, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %0, 2
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 2, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%0 = tail call ptr @llvm.stacksave.p0()
%vla33 = alloca [1001 x i32], align 16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not34 = icmp slt i32 %1, 1
br i1 %cmp.not34, label %for.end20, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp3.not39 = icmp slt i32 %2, 1
br i1 %cmp3.not39, label %for.end20, label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %for.cond2.preheader
%arrayidx.peel.phi.trans.insert.i = getelementptr inbounds i32, ptr %vla33, i64 1
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla33, 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
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !12
for.body4: ; preds = %for.body4.lr.ph, %trace.exit
%indvars.iv43 = phi i64 [ 1, %for.body4.lr.ph ], [ %indvars.iv.next44, %trace.exit ]
%4 = phi i32 [ %2, %for.body4.lr.ph ], [ %.pr, %trace.exit ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla33, i64 %indvars.iv43
%5 = load i32, ptr %arrayidx6, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body4, %while.body
%indvars.iv45 = phi i64 [ %indvars.iv43, %for.body4 ], [ %indvars.iv.next46, %while.body ]
%indvars.iv.next46 = add nsw i64 %indvars.iv45, -1
%idxprom8 = and i64 %indvars.iv.next46, 4294967295
%arrayidx9 = getelementptr inbounds i32, ptr %vla33, i64 %idxprom8
%6 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %6, %5
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx14 = getelementptr inbounds i32, ptr %vla33, i64 %indvars.iv45
store i32 %6, ptr %arrayidx14, align 4, !tbaa !5
%7 = icmp sgt i64 %indvars.iv45, 1
br i1 %7, label %land.rhs, label %while.end, !llvm.loop !13
while.end: ; preds = %while.body, %land.rhs
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv45, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom16 = ashr exact i64 %sext, 32
%arrayidx17 = getelementptr inbounds i32, ptr %vla33, i64 %idxprom16
store i32 %5, ptr %arrayidx17, align 4, !tbaa !5
%cmp.not8.i = icmp slt i32 %4, 1
br i1 %cmp.not8.i, label %trace.exit, label %if.end.peel.i
if.end.peel.i: ; preds = %while.end
%8 = add nuw i32 %4, 1
%wide.trip.count.i = zext i32 %8 to i64
%.pre.i = load i32, ptr %arrayidx.peel.phi.trans.insert.i, align 4, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %8, 2
br i1 %exitcond.peel.not.i, label %trace.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 2, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %vla33, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9)
%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 %trace.exit, label %if.end.i, !llvm.loop !9
trace.exit: ; preds = %if.end.i, %while.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
%.pr = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %.pr to i64
%cmp3.not.not = icmp slt i64 %indvars.iv43, %10
br i1 %cmp3.not.not, label %for.body4, label %for.end20, !llvm.loop !14
for.end20: ; preds = %trace.exit, %entry, %for.cond2.preheader
call void @llvm.stackrestore.p0(ptr %0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; 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 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void printArray(int *a,int n);
void insertSort(int *a,int n);
int main(void) {
int i,n;
int a[100];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
printArray(a,n);
insertSort(a,n);
return 0;
}
void insertSort(int *a,int n){
int i,j,v;
for(i=1;i<n;i++){
v = *(a+i);
j = i - 1;
while(j>=0 && *(a+j)>v){
*(a+j+1) = *(a+j);
j--;
}
*(a+j+1) = v;
printArray(a,n);
}
}
void printArray(int *a,int n){
int i;
for(i=0;i<n-1;i++){
printf("%d ",*(a+i));
}
printf("%d\n",*(a+n-1));
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115066/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115066/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%a = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %0, 0
br i1 %cmp9, label %for.body, label %printArray.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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
%cmp9.i = icmp sgt i32 %1, 1
br i1 %cmp9.i, label %for.body.preheader.i, label %printArray.exit
for.body.preheader.i: ; preds = %for.end
%sub.i = add nsw i32 %1, -1
%wide.trip.count.i = zext i32 %sub.i to i64
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ]
%add.ptr.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%3 = load i32, ptr %add.ptr.i, align 4, !tbaa !5
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%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 %printArray.exit, label %for.body.i, !llvm.loop !11
printArray.exit: ; preds = %for.body.i, %entry, %for.end
%.lcssa18 = phi i32 [ %1, %for.end ], [ %0, %entry ], [ %1, %for.body.i ]
%idx.ext1.i = sext i32 %.lcssa18 to i64
%add.ptr2.i = getelementptr inbounds i32, ptr %a, i64 %idx.ext1.i
%add.ptr3.i = getelementptr inbounds i32, ptr %add.ptr2.i, i64 -1
%4 = load i32, ptr %add.ptr3.i, align 4, !tbaa !5
%call4.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4)
%5 = load i32, ptr %n, align 4, !tbaa !5
%invariant.gep.i = getelementptr inbounds i32, ptr %a, i64 1
%cmp32.i = icmp sgt i32 %5, 1
br i1 %cmp32.i, label %for.body.lr.ph.i, label %insertSort.exit
for.body.lr.ph.i: ; preds = %printArray.exit
%invariant.gep30.i = getelementptr i32, ptr %a, i64 -1
%sub.i.i = add nsw i32 %5, -1
%wide.trip.count.i.i = zext i32 %sub.i.i to i64
%idx.ext1.i.i = zext i32 %5 to i64
%gep31.i = getelementptr i32, ptr %invariant.gep30.i, i64 %idx.ext1.i.i
br label %for.body.us.i
for.body.us.i: ; preds = %printArray.exit.loopexit.us.i, %for.body.lr.ph.i
%indvars.iv.i6 = phi i64 [ %indvars.iv.next.i7, %printArray.exit.loopexit.us.i ], [ 1, %for.body.lr.ph.i ]
%add.ptr.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i6
%6 = load i32, ptr %add.ptr.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i
%indvars.iv13 = phi i64 [ %indvars.iv.next14, %while.body.us.i ], [ %indvars.iv.i6, %for.body.us.i ]
%indvars.iv.next14 = add nsw i64 %indvars.iv13, -1
%idx.ext2.us.i = and i64 %indvars.iv.next14, 4294967295
%add.ptr3.us.i = getelementptr inbounds i32, ptr %a, i64 %idx.ext2.us.i
%7 = load i32, ptr %add.ptr3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %7, %6
br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%j.0.lcssa.us.i = phi i64 [ -1, %while.body.us.i ], [ %indvars.iv.next14, %land.rhs.us.i ]
%sext = shl i64 %j.0.lcssa.us.i, 32
%idx.ext10.us.i = ashr exact i64 %sext, 32
%gep.us.i = getelementptr i32, ptr %invariant.gep.i, i64 %idx.ext10.us.i
store i32 %6, ptr %gep.us.i, align 4, !tbaa !5
br label %for.body.i.us.i
for.body.i.us.i: ; preds = %for.body.i.us.i, %while.end.us.i
%indvars.iv.i.us.i = phi i64 [ 0, %while.end.us.i ], [ %indvars.iv.next.i.us.i, %for.body.i.us.i ]
%add.ptr.i.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us.i
%8 = load i32, ptr %add.ptr.i.us.i, align 4, !tbaa !5
%call.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %printArray.exit.loopexit.us.i, label %for.body.i.us.i, !llvm.loop !11
while.body.us.i: ; preds = %land.rhs.us.i
%add.ptr9.us.i = getelementptr inbounds i32, ptr %add.ptr3.us.i, i64 1
store i32 %7, ptr %add.ptr9.us.i, align 4, !tbaa !5
%cmp1.us.i = icmp sgt i64 %indvars.iv13, 1
br i1 %cmp1.us.i, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12
printArray.exit.loopexit.us.i: ; preds = %for.body.i.us.i
%9 = load i32, ptr %gep31.i, align 4, !tbaa !5
%call4.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9)
%indvars.iv.next.i7 = add nuw nsw i64 %indvars.iv.i6, 1
%exitcond.not.i8 = icmp eq i64 %indvars.iv.next.i7, %idx.ext1.i.i
br i1 %exitcond.not.i8, label %insertSort.exit, label %for.body.us.i, !llvm.loop !13
insertSort.exit: ; preds = %printArray.exit.loopexit.us.i, %printArray.exit
call void @llvm.lifetime.end.p0(i64 400, 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 uwtable
define dso_local void @printArray(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp9 = icmp sgt i32 %n, 1
br i1 %cmp9, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%sub = add nsw i32 %n, -1
%wide.trip.count = zext i32 %sub 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
%0 = load i32, ptr %add.ptr, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%idx.ext1 = sext i32 %n to i64
%add.ptr2 = getelementptr inbounds i32, ptr %a, i64 %idx.ext1
%add.ptr3 = getelementptr inbounds i32, ptr %add.ptr2, i64 -1
%1 = load i32, ptr %add.ptr3, align 4, !tbaa !5
%call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertSort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%invariant.gep = getelementptr i32, ptr %a, i64 1
%cmp32 = icmp sgt i32 %n, 1
br i1 %cmp32, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%invariant.gep30 = getelementptr i32, ptr %a, i64 -1
%sub.i = add nsw i32 %n, -1
%wide.trip.count.i = zext i32 %sub.i to i64
%idx.ext1.i = zext i32 %n to i64
%gep31 = getelementptr i32, ptr %invariant.gep30, i64 %idx.ext1.i
%wide.trip.count = zext i32 %n to i64
br label %for.body.us
for.body.us: ; preds = %printArray.exit.loopexit.us, %for.body.lr.ph
%indvars.iv = phi i64 [ %indvars.iv.next, %printArray.exit.loopexit.us ], [ 1, %for.body.lr.ph ]
%add.ptr.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %add.ptr.us, align 4, !tbaa !5
%1 = trunc i64 %indvars.iv to i32
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%j.029.us.in = phi i32 [ %1, %for.body.us ], [ %j.029.us, %while.body.us ]
%j.029.us = add i32 %j.029.us.in, -1
%idx.ext2.us = zext i32 %j.029.us to i64
%add.ptr3.us = getelementptr inbounds i32, ptr %a, i64 %idx.ext2.us
%2 = load i32, ptr %add.ptr3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %2, %0
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.lcssa.us = phi i32 [ -1, %while.body.us ], [ %j.029.us, %land.rhs.us ]
%idx.ext10.us = sext i32 %j.0.lcssa.us to i64
%gep.us = getelementptr i32, ptr %invariant.gep, i64 %idx.ext10.us
store i32 %0, ptr %gep.us, align 4, !tbaa !5
br label %for.body.i.us
for.body.i.us: ; preds = %for.body.i.us, %while.end.us
%indvars.iv.i.us = phi i64 [ 0, %while.end.us ], [ %indvars.iv.next.i.us, %for.body.i.us ]
%add.ptr.i.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us
%3 = load i32, ptr %add.ptr.i.us, align 4, !tbaa !5
%call.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %printArray.exit.loopexit.us, label %for.body.i.us, !llvm.loop !11
while.body.us: ; preds = %land.rhs.us
%add.ptr9.us = getelementptr inbounds i32, ptr %add.ptr3.us, i64 1
store i32 %2, ptr %add.ptr9.us, align 4, !tbaa !5
%cmp1.us = icmp sgt i32 %j.029.us, 0
br i1 %cmp1.us, label %land.rhs.us, label %while.end.us, !llvm.loop !12
printArray.exit.loopexit.us: ; preds = %for.body.i.us
%4 = load i32, ptr %gep31, align 4, !tbaa !5
%call4.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %4)
%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.us, !llvm.loop !13
for.end: ; preds = %printArray.exit.loopexit.us, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree 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"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void){
int i,j,v,A[20000],k,n;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
for(i=0;i<n;i++){
v=A[i];
j=i-1;
while(j>=0&&A[j]>v){
A[j+1]=A[j];
j--;
A[j+1]=v;
}
for(k=0;k<n-1;k++){
printf("%d ",A[k]);
}
printf("%d",A[n-1]);
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115109/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115109/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [20000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 80000, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp51 = icmp sgt i32 %0, 0
br i1 %cmp51, label %for.body, label %for.end35
for.cond2.preheader: ; preds = %for.body
%cmp360 = icmp sgt i32 %1, 0
br i1 %cmp360, label %for.body4, label %for.end35
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [20000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.end27
%3 = phi i32 [ %11, %for.end27 ], [ %1, %for.cond2.preheader ]
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.end27 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [20000 x i32], ptr %A, i64 0, i64 %indvars.iv64
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp754.not = icmp eq i64 %indvars.iv64, 0
br i1 %cmp754.not, label %while.end, label %land.rhs
land.rhs: ; preds = %for.body4, %while.body
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %while.body ], [ %indvars.iv64, %for.body4 ]
%indvars.iv.next67 = add nsw i64 %indvars.iv66, -1
%idxprom8 = and i64 %indvars.iv.next67, 4294967295
%arrayidx9 = getelementptr inbounds [20000 x i32], ptr %A, i64 0, i64 %idxprom8
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %5, %4
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx14 = getelementptr inbounds [20000 x i32], ptr %A, i64 0, i64 %indvars.iv66
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
store i32 %4, ptr %arrayidx9, align 4, !tbaa !5
%6 = icmp sgt i64 %indvars.iv66, 1
br i1 %6, label %land.rhs, label %while.end, !llvm.loop !11
while.end: ; preds = %land.rhs, %while.body, %for.body4
%cmp2058 = icmp sgt i32 %3, 1
br i1 %cmp2058, label %for.body21, label %while.end.for.end27_crit_edge
while.end.for.end27_crit_edge: ; preds = %while.end
%sub1957 = add nsw i32 %3, -1
%.pre = sext i32 %sub1957 to i64
br label %for.end27
for.body21: ; preds = %while.end, %for.body21
%indvars.iv69 = phi i64 [ %indvars.iv.next70, %for.body21 ], [ 0, %while.end ]
%arrayidx23 = getelementptr inbounds [20000 x i32], ptr %A, i64 0, i64 %indvars.iv69
%7 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%sub19 = add nsw i32 %8, -1
%9 = sext i32 %sub19 to i64
%cmp20 = icmp slt i64 %indvars.iv.next70, %9
br i1 %cmp20, label %for.body21, label %for.end27, !llvm.loop !12
for.end27: ; preds = %for.body21, %while.end.for.end27_crit_edge
%idxprom29.pre-phi = phi i64 [ %.pre, %while.end.for.end27_crit_edge ], [ %9, %for.body21 ]
%arrayidx30 = getelementptr inbounds [20000 x i32], ptr %A, i64 0, i64 %idxprom29.pre-phi
%10 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp3 = icmp slt i64 %indvars.iv.next65, %12
br i1 %cmp3, label %for.body4, label %for.end35, !llvm.loop !13
for.end35: ; preds = %for.end27, %entry, %for.cond2.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 80000, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int s[110];
void shunxushuchu(int a[],int n){
int i;
for(i=0;i<n;i++){
if(i>0)printf(" ");
printf("%d",a[i]);
}printf("\n");
}
void charupaixu(int a[],int n){
int j,i,v;
for(i=1;i<n;i++){
v=a[i];
j=i-1;
while(j>=0&&a[j]>v){
a[j+1]=a[j];
j--;
}a[j+1]=v;
shunxushuchu(a,n);
}
}
int main(){
int n,i;
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",&s[i]);
shunxushuchu(s,n);
charupaixu(s,n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115152/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115152/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@s = dso_local global [110 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local void @shunxushuchu(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp8 = icmp sgt i32 %n, 0
br i1 %cmp8, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%.pre = load i32, ptr %a, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %n, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @charupaixu(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp30 = icmp sgt i32 %n, 1
br i1 %cmp30, label %for.body.us.preheader, label %for.end
for.body.us.preheader: ; preds = %entry
%wide.trip.count.i = zext i32 %n to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %shunxushuchu.exit.loopexit.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %shunxushuchu.exit.loopexit.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next35 = add nsw i64 %indvars.iv34, -1
%idxprom2.us = and i64 %indvars.iv.next35, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %a, i64 %idxprom2.us
%1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %1, %0
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv34, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom10.us = ashr exact i64 %sext, 32
%arrayidx11.us = getelementptr inbounds i32, ptr %a, i64 %idxprom10.us
store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5
%.pre.i.us = load i32, ptr %a, align 4, !tbaa !5
%call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us)
br label %if.end.i.us
if.end.i.us: ; preds = %while.end.us, %if.end.i.us
%indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ]
%putchar7.i.us = tail call i32 @putchar(i32 32)
%arrayidx.i.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us
%2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %shunxushuchu.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv34
store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv34, 1
br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12
shunxushuchu.exit.loopexit.us: ; preds = %if.end.i.us
%putchar.i.us = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i
br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13
for.end: ; preds = %shunxushuchu.exit.loopexit.us, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %0, 0
br i1 %cmp7, label %for.body, label %shunxushuchu.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [110 x i32], ptr @s, 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 !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body
%cmp8.i = icmp sgt i32 %1, 0
br i1 %cmp8.i, label %if.end.peel.i, label %shunxushuchu.exit
if.end.peel.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %1 to i64
%.pre.i = load i32, ptr @s, align 16, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %1, 1
br i1 %exitcond.peel.not.i, label %shunxushuchu.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 1, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr @s, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%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 %shunxushuchu.exit, label %if.end.i, !llvm.loop !9
shunxushuchu.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %4, 1
br i1 %cmp30.i, label %for.body.us.preheader.i, label %charupaixu.exit
for.body.us.preheader.i: ; preds = %shunxushuchu.exit
%wide.trip.count.i.i = zext i32 %4 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %shunxushuchu.exit.loopexit.us.i, %for.body.us.preheader.i
%indvars.iv.i4 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i5, %shunxushuchu.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr @s, i64 %indvars.iv.i4
%5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i
%indvars.iv34.i = phi i64 [ %indvars.iv.next35.i, %while.body.us.i ], [ %indvars.iv.i4, %for.body.us.i ]
%indvars.iv.next35.i = add nsw i64 %indvars.iv34.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next35.i, 4294967295
%arrayidx3.us.i = getelementptr inbounds i32, ptr @s, i64 %idxprom2.us.i
%6 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %6, %5
br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv34.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom10.us.i = ashr exact i64 %sext.i, 32
%arrayidx11.us.i = getelementptr inbounds i32, ptr @s, i64 %idxprom10.us.i
store i32 %5, ptr %arrayidx11.us.i, align 4, !tbaa !5
%.pre.i.us.i = load i32, ptr @s, align 16, !tbaa !5
%call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i)
br label %if.end.i.us.i
if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i
%indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ]
%putchar7.i.us.i = call i32 @putchar(i32 32)
%arrayidx.i.us.i = getelementptr inbounds i32, ptr @s, i64 %indvars.iv.i.us.i
%7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %shunxushuchu.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr @s, i64 %indvars.iv34.i
store i32 %6, ptr %arrayidx8.us.i, align 4, !tbaa !5
%8 = icmp sgt i64 %indvars.iv34.i, 1
br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12
shunxushuchu.exit.loopexit.us.i: ; preds = %if.end.i.us.i
%putchar.i.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i5 = add nuw nsw i64 %indvars.iv.i4, 1
%exitcond.not.i6 = icmp eq i64 %indvars.iv.next.i5, %wide.trip.count.i.i
br i1 %exitcond.not.i6, label %charupaixu.exit, label %for.body.us.i, !llvm.loop !13
charupaixu.exit: ; preds = %shunxushuchu.exit.loopexit.us.i, %shunxushuchu.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
static const int N = 100;
void trace(int A[],int n){
int i;
for(i=1;i<=n;i++){
if(i>1)
printf(" ");
printf("%d",A[i]);
}
printf("\n");
}
int main(){
int n,i,j,key;
int A[N+1];
scanf("%d",&n);
for(i=1;i<=n;i++)
scanf("%d",&A[i]);
trace(A,n);
for(j=2;j<=n;j++){
key=A[j];
i=j-1;
while(i>0 && A[i]>key){
A[i+1]=A[i];
i--;
}
A[i+1]=key;
trace(A,n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115196/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115196/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not8 = icmp slt i32 %n, 1
br i1 %cmp.not8, label %for.end, label %if.end.peel
if.end.peel: ; preds = %entry
%0 = add nuw i32 %n, 1
%wide.trip.count = zext i32 %0 to i64
%arrayidx.peel.phi.trans.insert = getelementptr inbounds i32, ptr %A, i64 1
%.pre = load i32, ptr %arrayidx.peel.phi.trans.insert, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %0, 2
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 2, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%0 = tail call ptr @llvm.stacksave.p0()
%vla34 = alloca [101 x i32], align 16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not51 = icmp slt i32 %1, 1
br i1 %cmp.not51, label %trace.exit, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla34, 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
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body
%cmp.not8.i = icmp slt i32 %2, 1
br i1 %cmp.not8.i, label %trace.exit, label %if.end.peel.i
if.end.peel.i: ; preds = %for.end
%4 = add nuw nsw i32 %2, 1
%wide.trip.count.i = zext i32 %4 to i64
%arrayidx.peel.phi.trans.insert.i = getelementptr inbounds i32, ptr %vla34, i64 1
%.pre.i = load i32, ptr %arrayidx.peel.phi.trans.insert.i, align 4, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %4, 2
br i1 %exitcond.peel.not.i, label %trace.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 2, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %trace.exit, label %if.end.i, !llvm.loop !9
trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp3.not56 = icmp slt i32 %6, 2
br i1 %cmp3.not56, label %for.end20, label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %trace.exit
%arrayidx.peel.phi.trans.insert.i38 = getelementptr inbounds i32, ptr %vla34, i64 1
br label %for.body4
for.body4: ; preds = %for.body4.lr.ph, %trace.exit50
%indvars.iv60 = phi i64 [ 2, %for.body4.lr.ph ], [ %indvars.iv.next61, %trace.exit50 ]
%7 = phi i32 [ %6, %for.body4.lr.ph ], [ %13, %trace.exit50 ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv60
%8 = load i32, ptr %arrayidx6, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body4, %while.body
%indvars.iv62 = phi i64 [ %indvars.iv60, %for.body4 ], [ %indvars.iv.next63, %while.body ]
%indvars.iv.next63 = add nsw i64 %indvars.iv62, -1
%idxprom8 = and i64 %indvars.iv.next63, 4294967295
%arrayidx9 = getelementptr inbounds i32, ptr %vla34, i64 %idxprom8
%9 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %9, %8
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx14 = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv62
store i32 %9, ptr %arrayidx14, align 4, !tbaa !5
%10 = icmp sgt i64 %indvars.iv62, 2
br i1 %10, label %land.rhs, label %while.end, !llvm.loop !13
while.end: ; preds = %while.body, %land.rhs
%i.1.in.lcssa = phi i64 [ 1, %while.body ], [ %indvars.iv62, %land.rhs ]
%sext = shl i64 %i.1.in.lcssa, 32
%idxprom16 = ashr exact i64 %sext, 32
%arrayidx17 = getelementptr inbounds i32, ptr %vla34, i64 %idxprom16
store i32 %8, ptr %arrayidx17, align 4, !tbaa !5
%cmp.not8.i35 = icmp slt i32 %7, 1
br i1 %cmp.not8.i35, label %trace.exit50, label %if.end.peel.i36
if.end.peel.i36: ; preds = %while.end
%11 = add nuw i32 %7, 1
%wide.trip.count.i37 = zext i32 %11 to i64
%.pre.i39 = load i32, ptr %arrayidx.peel.phi.trans.insert.i38, align 4, !tbaa !5
%call2.peel.i40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i39)
%exitcond.peel.not.i41 = icmp eq i32 %11, 2
br i1 %exitcond.peel.not.i41, label %trace.exit50, label %if.end.i42
if.end.i42: ; preds = %if.end.peel.i36, %if.end.i42
%indvars.iv.i43 = phi i64 [ %indvars.iv.next.i47, %if.end.i42 ], [ 2, %if.end.peel.i36 ]
%putchar7.i44 = call i32 @putchar(i32 32)
%arrayidx.i45 = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv.i43
%12 = load i32, ptr %arrayidx.i45, align 4, !tbaa !5
%call2.i46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12)
%indvars.iv.next.i47 = add nuw nsw i64 %indvars.iv.i43, 1
%exitcond.not.i48 = icmp eq i64 %indvars.iv.next.i47, %wide.trip.count.i37
br i1 %exitcond.not.i48, label %trace.exit50, label %if.end.i42, !llvm.loop !9
trace.exit50: ; preds = %if.end.i42, %while.end, %if.end.peel.i36
%putchar.i49 = call i32 @putchar(i32 10)
%indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
%13 = load i32, ptr %n, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv60, %14
br i1 %cmp3.not.not, label %for.body4, label %for.end20, !llvm.loop !14
for.end20: ; preds = %trace.exit50, %trace.exit
call void @llvm.stackrestore.p0(ptr %0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; 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 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main(){
int a[1000];
int n,i,j,alt;
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",&a[i]);
for(i=0;i<n;i++){
alt=a[i];
j=i-1;
while(j>=0&&a[j]>alt){
a[j+1]=a[j];
j--;
}
a[j+1]=alt;
for(j=0;j<n-1;j++){
printf("%d ",a[j]);
}
printf("%d\n",a[j]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115239/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115239/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca [1000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #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 %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %for.end33
for.cond2.preheader: ; preds = %for.body
%cmp361 = icmp sgt i32 %1, 0
br i1 %cmp361, label %for.body4, label %for.end33
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.end27
%3 = phi i32 [ %11, %for.end27 ], [ %1, %for.cond2.preheader ]
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.end27 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv64
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp753.not = icmp eq i64 %indvars.iv64, 0
br i1 %cmp753.not, label %while.end, label %land.rhs
land.rhs: ; preds = %for.body4, %while.body
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %while.body ], [ %indvars.iv64, %for.body4 ]
%indvars.iv.next67 = add nsw i64 %indvars.iv66, -1
%idxprom8 = and i64 %indvars.iv.next67, 4294967295
%arrayidx9 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %idxprom8
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %5, %4
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx14 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv66
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
%6 = icmp sgt i64 %indvars.iv66, 1
br i1 %6, label %land.rhs, label %while.end, !llvm.loop !11
while.end: ; preds = %land.rhs, %while.body, %for.body4
%j.0.in.lcssa = phi i64 [ 0, %for.body4 ], [ 0, %while.body ], [ %indvars.iv66, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom16 = ashr exact i64 %sext, 32
%arrayidx17 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %idxprom16
store i32 %4, ptr %arrayidx17, align 4, !tbaa !5
%cmp2058 = icmp sgt i32 %3, 1
br i1 %cmp2058, label %for.body21, label %for.end27
for.body21: ; preds = %while.end, %for.body21
%indvars.iv69 = phi i64 [ %indvars.iv.next70, %for.body21 ], [ 0, %while.end ]
%arrayidx23 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv69
%7 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%sub19 = add nsw i32 %8, -1
%9 = sext i32 %sub19 to i64
%cmp20 = icmp slt i64 %indvars.iv.next70, %9
br i1 %cmp20, label %for.body21, label %for.end27, !llvm.loop !12
for.end27: ; preds = %for.body21, %while.end
%j.1.lcssa = phi i64 [ 0, %while.end ], [ %indvars.iv.next70, %for.body21 ]
%idxprom28 = and i64 %j.1.lcssa, 4294967295
%arrayidx29 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %idxprom28
%10 = load i32, ptr %arrayidx29, align 4, !tbaa !5
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10)
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp3 = icmp slt i64 %indvars.iv.next65, %12
br i1 %cmp3, label %for.body4, label %for.end33, !llvm.loop !13
for.end33: ; preds = %for.end27, %entry, %for.cond2.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main()
{
int stack[1000003];
int top=0;
int pos=1;
char ch=1;
while(scanf("%c",&ch)!=EOF && ch!='\n' && ch!='\0')
{
if(ch=='l')
{
stack[top++]=pos;
}
else
printf("%d\n",pos);
pos++;
}
while(top>0)
{
top--;
printf("%d\n",stack[top]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11529/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11529/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%stack = alloca [1000003 x i32], align 16
%ch = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 4000012, ptr nonnull %stack) #3
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %ch) #3
store i8 1, ptr %ch, align 1, !tbaa !5
%call25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp26 = icmp ne i32 %call25, -1
%0 = load i8, ptr %ch, align 1
%cmp127 = icmp ne i8 %0, 10
%or.cond28 = select i1 %cmp26, i1 %cmp127, i1 false
%cmp429 = icmp ne i8 %0, 0
%or.cond1930 = select i1 %or.cond28, i1 %cmp429, i1 false
br i1 %or.cond1930, label %while.body, label %while.end18
while.cond11.preheader: ; preds = %if.end
%cmp1233 = icmp sgt i32 %top.1, 0
br i1 %cmp1233, label %while.body14.preheader, label %while.end18
while.body14.preheader: ; preds = %while.cond11.preheader
%1 = zext i32 %top.1 to i64
br label %while.body14
while.body: ; preds = %entry, %if.end
%2 = phi i8 [ %3, %if.end ], [ %0, %entry ]
%pos.032 = phi i32 [ %inc10, %if.end ], [ 1, %entry ]
%top.031 = phi i32 [ %top.1, %if.end ], [ 0, %entry ]
%cmp7 = icmp eq i8 %2, 108
br i1 %cmp7, label %if.then, label %if.else
if.then: ; preds = %while.body
%inc = add nsw i32 %top.031, 1
%idxprom = sext i32 %top.031 to i64
%arrayidx = getelementptr inbounds [1000003 x i32], ptr %stack, i64 0, i64 %idxprom
store i32 %pos.032, ptr %arrayidx, align 4, !tbaa !8
br label %if.end
if.else: ; preds = %while.body
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %pos.032)
br label %if.end
if.end: ; preds = %if.else, %if.then
%top.1 = phi i32 [ %inc, %if.then ], [ %top.031, %if.else ]
%inc10 = add nuw nsw i32 %pos.032, 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %ch)
%cmp = icmp ne i32 %call, -1
%3 = load i8, ptr %ch, align 1
%cmp1 = icmp ne i8 %3, 10
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%cmp4 = icmp ne i8 %3, 0
%or.cond19 = select i1 %or.cond, i1 %cmp4, i1 false
br i1 %or.cond19, label %while.body, label %while.cond11.preheader, !llvm.loop !10
while.body14: ; preds = %while.body14.preheader, %while.body14
%indvars.iv = phi i64 [ %1, %while.body14.preheader ], [ %indvars.iv.next, %while.body14 ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%idxprom15 = and i64 %indvars.iv.next, 4294967295
%arrayidx16 = getelementptr inbounds [1000003 x i32], ptr %stack, i64 0, i64 %idxprom15
%4 = load i32, ptr %arrayidx16, align 4, !tbaa !8
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%cmp12 = icmp ugt i64 %indvars.iv, 1
br i1 %cmp12, label %while.body14, label %while.end18, !llvm.loop !12
while.end18: ; preds = %while.body14, %entry, %while.cond11.preheader
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %ch) #3
call void @llvm.lifetime.end.p0(i64 4000012, ptr nonnull %stack) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
|
#include<stdio.h>
static const int N = 1000;
void trace(int A[], int n){
int i;
for ( i = 1; i <= n; i++ ){
if ( i > 1 ) printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
int main(){
int n, i, j,v;
int A[N+1];
scanf("%d", &n);
for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);
for(i=1; i<=n; i++){
v=A[i];
j=i-1;
while(j>=0 && A[j]>v){
A[j+1]=A[j];
j--;
A[j+1]=v;
}
trace(A, n);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115332/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115332/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not8 = icmp slt i32 %n, 1
br i1 %cmp.not8, label %for.end, label %if.end.peel
if.end.peel: ; preds = %entry
%0 = add nuw i32 %n, 1
%wide.trip.count = zext i32 %0 to i64
%arrayidx.peel.phi.trans.insert = getelementptr inbounds i32, ptr %A, i64 1
%.pre = load i32, ptr %arrayidx.peel.phi.trans.insert, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %0, 2
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 2, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%0 = tail call ptr @llvm.stacksave.p0()
%vla34 = alloca [1001 x i32], align 16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not35 = icmp slt i32 %1, 1
br i1 %cmp.not35, label %for.end20, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp3.not40 = icmp slt i32 %2, 1
br i1 %cmp3.not40, label %for.end20, label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %for.cond2.preheader
%arrayidx.peel.phi.trans.insert.i = getelementptr inbounds i32, ptr %vla34, i64 1
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla34, 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
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !12
for.body4: ; preds = %for.body4.lr.ph, %trace.exit
%indvars.iv44 = phi i64 [ 1, %for.body4.lr.ph ], [ %indvars.iv.next45, %trace.exit ]
%4 = phi i32 [ %2, %for.body4.lr.ph ], [ %.pr, %trace.exit ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv44
%5 = load i32, ptr %arrayidx6, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body4, %while.body
%indvars.iv46 = phi i64 [ %indvars.iv44, %for.body4 ], [ %indvars.iv.next47, %while.body ]
%indvars.iv.next47 = add nsw i64 %indvars.iv46, -1
%idxprom8 = and i64 %indvars.iv.next47, 4294967295
%arrayidx9 = getelementptr inbounds i32, ptr %vla34, i64 %idxprom8
%6 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %6, %5
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx14 = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv46
store i32 %6, ptr %arrayidx14, align 4, !tbaa !5
store i32 %5, ptr %arrayidx9, align 4, !tbaa !5
%7 = icmp sgt i64 %indvars.iv46, 1
br i1 %7, label %land.rhs, label %while.end, !llvm.loop !13
while.end: ; preds = %while.body, %land.rhs
%cmp.not8.i = icmp slt i32 %4, 1
br i1 %cmp.not8.i, label %trace.exit, label %if.end.peel.i
if.end.peel.i: ; preds = %while.end
%8 = add nuw i32 %4, 1
%wide.trip.count.i = zext i32 %8 to i64
%.pre.i = load i32, ptr %arrayidx.peel.phi.trans.insert.i, align 4, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %8, 2
br i1 %exitcond.peel.not.i, label %trace.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 2, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv.i
%9 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9)
%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 %trace.exit, label %if.end.i, !llvm.loop !9
trace.exit: ; preds = %if.end.i, %while.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
%.pr = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %.pr to i64
%cmp3.not.not = icmp slt i64 %indvars.iv44, %10
br i1 %cmp3.not.not, label %for.body4, label %for.end20, !llvm.loop !14
for.end20: ; preds = %trace.exit, %entry, %for.cond2.preheader
call void @llvm.stackrestore.p0(ptr %0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; 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 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
void trance(int A[], int N){
int i;
for( i =0; i < N; i++ ){
if( i > 0 ) printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
void insertionSort(int A[], int N){
int i, j, v;
for( i = 1; i < N; i++ ){
v = A[i];
j = i - 1;
while( j >= 0 && A[j] > v ){
A[j + 1] = A[j];
j--;
}
A[j + 1] = v;
trance(A, N);
}
}
int main(void){
int N, i, j;
int A[100];
scanf("%d", &N);
for( i = 0; i < N; i++ ) scanf("%d", &A[i]);
trance(A, N);
insertionSort(A, N);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115376/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115376/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @trance(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp8 = icmp sgt i32 %N, 0
br i1 %cmp8, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %N to i64
%.pre = load i32, ptr %A, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %N, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp30 = icmp sgt i32 %N, 1
br i1 %cmp30, label %for.body.us.preheader, label %for.end
for.body.us.preheader: ; preds = %entry
%wide.trip.count.i = zext i32 %N to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %trance.exit.loopexit.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %trance.exit.loopexit.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next35 = add nsw i64 %indvars.iv34, -1
%idxprom2.us = and i64 %indvars.iv.next35, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us
%1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %1, %0
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv34, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom10.us = ashr exact i64 %sext, 32
%arrayidx11.us = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us
store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5
%.pre.i.us = load i32, ptr %A, align 4, !tbaa !5
%call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us)
br label %if.end.i.us
if.end.i.us: ; preds = %while.end.us, %if.end.i.us
%indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ]
%putchar7.i.us = tail call i32 @putchar(i32 32)
%arrayidx.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us
%2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %trance.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34
store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv34, 1
br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12
trance.exit.loopexit.us: ; preds = %if.end.i.us
%putchar.i.us = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i
br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13
for.end: ; preds = %trance.exit.loopexit.us, %entry
ret void
}
; 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
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %trance.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body
%cmp8.i = icmp sgt i32 %1, 0
br i1 %cmp8.i, label %if.end.peel.i, label %trance.exit
if.end.peel.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %1 to i64
%.pre.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %1, 1
br i1 %exitcond.peel.not.i, label %trance.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 1, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%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 %trance.exit, label %if.end.i, !llvm.loop !9
trance.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %4, 1
br i1 %cmp30.i, label %for.body.us.preheader.i, label %insertionSort.exit
for.body.us.preheader.i: ; preds = %trance.exit
%wide.trip.count.i.i = zext i32 %4 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %trance.exit.loopexit.us.i, %for.body.us.preheader.i
%indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %trance.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i5
%5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i
%indvars.iv34.i = phi i64 [ %indvars.iv.next35.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ]
%indvars.iv.next35.i = add nsw i64 %indvars.iv34.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next35.i, 4294967295
%arrayidx3.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us.i
%6 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %6, %5
br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv34.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom10.us.i = ashr exact i64 %sext.i, 32
%arrayidx11.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us.i
store i32 %5, ptr %arrayidx11.us.i, align 4, !tbaa !5
%.pre.i.us.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i)
br label %if.end.i.us.i
if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i
%indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ]
%putchar7.i.us.i = call i32 @putchar(i32 32)
%arrayidx.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i
%7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %trance.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34.i
store i32 %6, ptr %arrayidx8.us.i, align 4, !tbaa !5
%8 = icmp sgt i64 %indvars.iv34.i, 1
br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12
trance.exit.loopexit.us.i: ; preds = %if.end.i.us.i
%putchar.i.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1
%exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i
br i1 %exitcond.not.i7, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !13
insertionSort.exit: ; preds = %trance.exit.loopexit.us.i, %trance.exit
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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
//#include <iostream>
#include <stdio.h>
void display(int a[],int n){
int i;
for (i = 0; i < n; ++i) {
if (i>0)
printf(" ");
printf("%d",a[i]);
}
printf("\n");
}
void insertionSort(int a[],int n){
int v,i,j;
for (i = 1; i < n; ++i) {
v=a[i];
for (j = i-1; j >=0&&a[j]>v ; --j) {
a[j+1]=a[j];
}
a[j+1]=v;
display(a,n);
}
}
int main() {
int n,i;
int a[150];
scanf("%d",&n);
for (i = 0; i < n; ++i) {
scanf("%d",&a[i]);
}
display(a,n);
insertionSort(a,n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115426/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115426/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @display(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp8 = icmp sgt i32 %n, 0
br i1 %cmp8, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%.pre = load i32, ptr %a, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %n, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertionSort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp34 = icmp sgt i32 %n, 1
br i1 %cmp34, label %for.body.us.preheader, label %for.end15
for.body.us.preheader: ; preds = %entry
%wide.trip.count.i = zext i32 %n to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %display.exit.loopexit.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %display.exit.loopexit.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %for.body6.us, %for.body.us
%indvars.iv38 = phi i64 [ %indvars.iv.next39, %for.body6.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next39 = add nsw i64 %indvars.iv38, -1
%idxprom3.us = and i64 %indvars.iv.next39, 4294967295
%arrayidx4.us = getelementptr inbounds i32, ptr %a, i64 %idxprom3.us
%1 = load i32, ptr %arrayidx4.us, align 4, !tbaa !5
%cmp5.us = icmp sgt i32 %1, %0
br i1 %cmp5.us, label %for.body6.us, label %for.end.us
for.end.us: ; preds = %for.body6.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %for.body6.us ], [ %indvars.iv38, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom12.us = ashr exact i64 %sext, 32
%arrayidx13.us = getelementptr inbounds i32, ptr %a, i64 %idxprom12.us
store i32 %0, ptr %arrayidx13.us, align 4, !tbaa !5
%.pre.i.us = load i32, ptr %a, align 4, !tbaa !5
%call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us)
br label %if.end.i.us
if.end.i.us: ; preds = %for.end.us, %if.end.i.us
%indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %for.end.us ]
%putchar7.i.us = tail call i32 @putchar(i32 32)
%arrayidx.i.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us
%2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %display.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9
for.body6.us: ; preds = %land.rhs.us
%arrayidx10.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv38
store i32 %1, ptr %arrayidx10.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv38, 1
br i1 %3, label %land.rhs.us, label %for.end.us, !llvm.loop !12
display.exit.loopexit.us: ; preds = %if.end.i.us
%putchar.i.us = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i
br i1 %exitcond.not, label %for.end15, label %for.body.us, !llvm.loop !13
for.end15: ; preds = %display.exit.loopexit.us, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [150 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 600, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %display.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [150 x i32], 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 !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body
%cmp8.i = icmp sgt i32 %1, 0
br i1 %cmp8.i, label %if.end.peel.i, label %display.exit
if.end.peel.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %1 to i64
%.pre.i = load i32, ptr %a, align 16, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %1, 1
br i1 %exitcond.peel.not.i, label %display.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 1, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%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 %display.exit, label %if.end.i, !llvm.loop !9
display.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp34.i = icmp sgt i32 %4, 1
br i1 %cmp34.i, label %for.body.us.preheader.i, label %insertionSort.exit
for.body.us.preheader.i: ; preds = %display.exit
%wide.trip.count.i.i = zext i32 %4 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %display.exit.loopexit.us.i, %for.body.us.preheader.i
%indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %display.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i5
%5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %for.body6.us.i, %for.body.us.i
%indvars.iv38.i = phi i64 [ %indvars.iv.next39.i, %for.body6.us.i ], [ %indvars.iv.i5, %for.body.us.i ]
%indvars.iv.next39.i = add nsw i64 %indvars.iv38.i, -1
%idxprom3.us.i = and i64 %indvars.iv.next39.i, 4294967295
%arrayidx4.us.i = getelementptr inbounds i32, ptr %a, i64 %idxprom3.us.i
%6 = load i32, ptr %arrayidx4.us.i, align 4, !tbaa !5
%cmp5.us.i = icmp sgt i32 %6, %5
br i1 %cmp5.us.i, label %for.body6.us.i, label %for.end.us.i
for.end.us.i: ; preds = %for.body6.us.i, %land.rhs.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %for.body6.us.i ], [ %indvars.iv38.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom12.us.i = ashr exact i64 %sext.i, 32
%arrayidx13.us.i = getelementptr inbounds i32, ptr %a, i64 %idxprom12.us.i
store i32 %5, ptr %arrayidx13.us.i, align 4, !tbaa !5
%.pre.i.us.i = load i32, ptr %a, align 16, !tbaa !5
%call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i)
br label %if.end.i.us.i
if.end.i.us.i: ; preds = %if.end.i.us.i, %for.end.us.i
%indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %for.end.us.i ]
%putchar7.i.us.i = call i32 @putchar(i32 32)
%arrayidx.i.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us.i
%7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %display.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9
for.body6.us.i: ; preds = %land.rhs.us.i
%arrayidx10.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv38.i
store i32 %6, ptr %arrayidx10.us.i, align 4, !tbaa !5
%8 = icmp sgt i64 %indvars.iv38.i, 1
br i1 %8, label %land.rhs.us.i, label %for.end.us.i, !llvm.loop !12
display.exit.loopexit.us.i: ; preds = %if.end.i.us.i
%putchar.i.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1
%exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i
br i1 %exitcond.not.i7, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !13
insertionSort.exit: ; preds = %display.exit.loopexit.us.i, %display.exit
call void @llvm.lifetime.end.p0(i64 600, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main()
{
char s[50],t[50];
scanf("%s%s",s,t);
int i=0,ct=0,j=0;
while(t[i])
{
if(t[i]==s[j])
{
ct++;
j++;
}
i++;
}
printf("%d\n",ct+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11547/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11547/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [50 x i8], align 16
%t = alloca [50 x i8], align 16
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %t)
%0 = load i8, ptr %t, align 16, !tbaa !5
%tobool.not15 = icmp eq i8 %0, 0
br i1 %tobool.not15, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%indvars.iv = phi i64 [ %indvars.iv.next, %while.body ], [ 0, %entry ]
%1 = phi i8 [ %3, %while.body ], [ %0, %entry ]
%j.018 = phi i32 [ %j.1, %while.body ], [ 0, %entry ]
%ct.017 = phi i32 [ %ct.1, %while.body ], [ 0, %entry ]
%idxprom4 = zext i32 %j.018 to i64
%arrayidx5 = getelementptr inbounds [50 x i8], ptr %s, i64 0, i64 %idxprom4
%2 = load i8, ptr %arrayidx5, align 1, !tbaa !5
%cmp = icmp eq i8 %1, %2
%inc = zext i1 %cmp to i32
%ct.1 = add nuw nsw i32 %ct.017, %inc
%j.1 = add nuw nsw i32 %j.018, %inc
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx = getelementptr inbounds [50 x i8], ptr %t, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx, align 1, !tbaa !5
%tobool.not = icmp eq i8 %3, 0
br i1 %tobool.not, label %while.end.loopexit, label %while.body, !llvm.loop !8
while.end.loopexit: ; preds = %while.body
%4 = add nuw nsw i32 %ct.1, 1
br label %while.end
while.end: ; preds = %while.end.loopexit, %entry
%ct.0.lcssa = phi i32 [ 1, %entry ], [ %4, %while.end.loopexit ]
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %ct.0.lcssa)
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
void show(int a[], int n){
int i;
for(i=0; i<n-1; i++){
printf("%d ", a[i]);
}
printf("%d", a[n-1]);
printf("\n");
return ;
}
void insertion(int a[], int n){
int i, j, temp;
for(i=1; i<n; i++){
temp = a[i];
j = i - 1;
while(j>=0 && a[j]>temp){
a[j+1] = a[j];
j--;
}
a[j+1] = temp;
show(a, n);
}
}
int main(){
int n, i;
int a[101];
scanf("%d", &n);
for(i=0; i<n; i++){
scanf("%d", &a[i]);
}
show(a, n);
insertion(a, n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115512/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115512/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @show(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%sub = add i32 %n, -1
%cmp10 = icmp sgt i32 %n, 1
br i1 %cmp10, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %sub 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 ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%idxprom2 = sext i32 %sub to i64
%arrayidx3 = getelementptr inbounds i32, ptr %a, i64 %idxprom2
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertion(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp30 = icmp sgt i32 %n, 1
br i1 %cmp30, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%sub.i = add nsw i32 %n, -1
%wide.trip.count.i = zext i32 %sub.i to i64
%idxprom2.i = zext i32 %sub.i to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %a, i64 %idxprom2.i
%wide.trip.count = zext i32 %n to i64
br label %for.body.us
for.body.us: ; preds = %show.exit.loopexit.us, %for.body.lr.ph
%indvars.iv = phi i64 [ %indvars.iv.next, %show.exit.loopexit.us ], [ 1, %for.body.lr.ph ]
%arrayidx.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%indvars.iv32 = phi i64 [ %indvars.iv.next33, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next33 = add nsw i64 %indvars.iv32, -1
%idxprom2.us = and i64 %indvars.iv.next33, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %a, i64 %idxprom2.us
%1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %1, %0
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv32, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom10.us = ashr exact i64 %sext, 32
%arrayidx11.us = getelementptr inbounds i32, ptr %a, i64 %idxprom10.us
store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5
br label %for.body.i.us
for.body.i.us: ; preds = %for.body.i.us, %while.end.us
%indvars.iv.i.us = phi i64 [ 0, %while.end.us ], [ %indvars.iv.next.i.us, %for.body.i.us ]
%arrayidx.i.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us
%2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %show.exit.loopexit.us, label %for.body.i.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv32
store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv32, 1
br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !11
show.exit.loopexit.us: ; preds = %for.body.i.us
%4 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%call4.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%putchar.i.us = tail call i32 @putchar(i32 10)
%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.us, !llvm.loop !12
for.end: ; preds = %show.exit.loopexit.us, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %0, 0
br i1 %cmp9, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%sub.i14 = add i32 %0, -1
br label %show.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], 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 !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 !13
for.end: ; preds = %for.body
%sub.i = add i32 %1, -1
%cmp10.i = icmp sgt i32 %1, 1
br i1 %cmp10.i, label %for.body.preheader.i, label %show.exit
for.body.preheader.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %sub.i to i64
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3)
%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 %show.exit, label %for.body.i, !llvm.loop !9
show.exit: ; preds = %for.body.i, %for.end.thread, %for.end
%sub.i16 = phi i32 [ %sub.i14, %for.end.thread ], [ %sub.i, %for.end ], [ %sub.i, %for.body.i ]
%idxprom2.i = sext i32 %sub.i16 to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %a, i64 %idxprom2.i
%4 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%call4.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%putchar.i = call i32 @putchar(i32 10)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %5, 1
br i1 %cmp30.i, label %for.body.lr.ph.i, label %insertion.exit
for.body.lr.ph.i: ; preds = %show.exit
%sub.i.i = add nsw i32 %5, -1
%wide.trip.count.i.i = zext i32 %sub.i.i to i64
%arrayidx3.i.i = getelementptr inbounds i32, ptr %a, i64 %wide.trip.count.i.i
%wide.trip.count.i5 = zext i32 %5 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %show.exit.loopexit.us.i, %for.body.lr.ph.i
%indvars.iv.i6 = phi i64 [ %indvars.iv.next.i7, %show.exit.loopexit.us.i ], [ 1, %for.body.lr.ph.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i6
%6 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i
%indvars.iv32.i = phi i64 [ %indvars.iv.next33.i, %while.body.us.i ], [ %indvars.iv.i6, %for.body.us.i ]
%indvars.iv.next33.i = add nsw i64 %indvars.iv32.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next33.i, 4294967295
%arrayidx3.us.i = getelementptr inbounds i32, ptr %a, i64 %idxprom2.us.i
%7 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %7, %6
br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv32.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom10.us.i = ashr exact i64 %sext.i, 32
%arrayidx11.us.i = getelementptr inbounds i32, ptr %a, i64 %idxprom10.us.i
store i32 %6, ptr %arrayidx11.us.i, align 4, !tbaa !5
br label %for.body.i.us.i
for.body.i.us.i: ; preds = %for.body.i.us.i, %while.end.us.i
%indvars.iv.i.us.i = phi i64 [ 0, %while.end.us.i ], [ %indvars.iv.next.i.us.i, %for.body.i.us.i ]
%arrayidx.i.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i.us.i
%8 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %show.exit.loopexit.us.i, label %for.body.i.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv32.i
store i32 %7, ptr %arrayidx8.us.i, align 4, !tbaa !5
%9 = icmp sgt i64 %indvars.iv32.i, 1
br i1 %9, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !11
show.exit.loopexit.us.i: ; preds = %for.body.i.us.i
%10 = load i32, ptr %arrayidx3.i.i, align 4, !tbaa !5
%call4.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10)
%putchar.i.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i7 = add nuw nsw i64 %indvars.iv.i6, 1
%exitcond.not.i8 = icmp eq i64 %indvars.iv.next.i7, %wide.trip.count.i5
br i1 %exitcond.not.i8, label %insertion.exit, label %for.body.us.i, !llvm.loop !12
insertion.exit: ; preds = %show.exit.loopexit.us.i, %show.exit
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
void Process(int A[ ], int n){
int i;
for(i=0;i<n-1;i++)
printf("%d ",A[i]);
printf("%d\n",A[i]);
}
void InsertionSort(int A[ ], int n){
int i,j,v;
for(i=1;i<n;i++){
v = A[i];
j = i - 1;
while(j>=0 && A[j]>v){
A[j+1] = A[j];
j--;
}
A[j+1] = v;
Process(A, n);
}
}
int main(void){
int i,N;
scanf("%d",&N);
int A[100];
for(i=0;i<N;i++)
scanf("%d",&A[i]);
Process(A, N);
InsertionSort(A, N);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115563/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115563/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @Process(ptr nocapture noundef readonly %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%sub = add i32 %n, -1
%cmp8 = icmp sgt i32 %n, 1
br i1 %cmp8, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %sub 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 ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%1 = zext i32 %sub to i64
br label %for.end
for.end: ; preds = %entry, %for.end.loopexit
%i.0.lcssa = phi i64 [ %1, %for.end.loopexit ], [ 0, %entry ]
%arrayidx2 = getelementptr inbounds i32, ptr %A, i64 %i.0.lcssa
%2 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%call3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @InsertionSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp30 = icmp sgt i32 %n, 1
br i1 %cmp30, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%sub.i = add nsw i32 %n, -1
%wide.trip.count.i = zext i32 %sub.i to i64
%arrayidx2.i.us = getelementptr inbounds i32, ptr %A, i64 %wide.trip.count.i
%wide.trip.count = zext i32 %n to i64
br label %for.body.us
for.body.us: ; preds = %Process.exit.loopexit.us, %for.body.lr.ph
%indvars.iv = phi i64 [ %indvars.iv.next, %Process.exit.loopexit.us ], [ 1, %for.body.lr.ph ]
%arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%indvars.iv32 = phi i64 [ %indvars.iv.next33, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next33 = add nsw i64 %indvars.iv32, -1
%idxprom2.us = and i64 %indvars.iv.next33, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us
%1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %1, %0
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv32, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom10.us = ashr exact i64 %sext, 32
%arrayidx11.us = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us
store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5
br label %for.body.i.us
for.body.i.us: ; preds = %for.body.i.us, %while.end.us
%indvars.iv.i.us = phi i64 [ 0, %while.end.us ], [ %indvars.iv.next.i.us, %for.body.i.us ]
%arrayidx.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us
%2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %Process.exit.loopexit.us, label %for.body.i.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv32
store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv32, 1
br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !11
Process.exit.loopexit.us: ; preds = %for.body.i.us
%4 = load i32, ptr %arrayidx2.i.us, align 4, !tbaa !5
%call3.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%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.us, !llvm.loop !12
for.end: ; preds = %Process.exit.loopexit.us, %entry
ret void
}
; 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) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %N)
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #3
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp9 = icmp sgt i32 %0, 0
br i1 %cmp9, label %for.body, label %Process.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, 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 !13
for.end: ; preds = %for.body
%cmp8.i = icmp sgt i32 %1, 1
br i1 %cmp8.i, label %for.body.preheader.i, label %Process.exit
for.body.preheader.i: ; preds = %for.end
%sub.i = add nsw i32 %1, -1
%wide.trip.count.i = zext i32 %sub.i to i64
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %3)
%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 %Process.exit, label %for.body.i, !llvm.loop !9
Process.exit: ; preds = %for.body.i, %entry, %for.end
%i.0.lcssa.i = phi i64 [ 0, %for.end ], [ 0, %entry ], [ %wide.trip.count.i, %for.body.i ]
%arrayidx2.i = getelementptr inbounds i32, ptr %A, i64 %i.0.lcssa.i
%4 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%call3.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%5 = load i32, ptr %N, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %5, 1
br i1 %cmp30.i, label %for.body.lr.ph.i, label %InsertionSort.exit
for.body.lr.ph.i: ; preds = %Process.exit
%sub.i.i = add nsw i32 %5, -1
%wide.trip.count.i.i = zext i32 %sub.i.i to i64
%arrayidx2.i.us.i = getelementptr inbounds i32, ptr %A, i64 %wide.trip.count.i.i
%wide.trip.count.i5 = zext i32 %5 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %Process.exit.loopexit.us.i, %for.body.lr.ph.i
%indvars.iv.i6 = phi i64 [ %indvars.iv.next.i7, %Process.exit.loopexit.us.i ], [ 1, %for.body.lr.ph.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i6
%6 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i
%indvars.iv32.i = phi i64 [ %indvars.iv.next33.i, %while.body.us.i ], [ %indvars.iv.i6, %for.body.us.i ]
%indvars.iv.next33.i = add nsw i64 %indvars.iv32.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next33.i, 4294967295
%arrayidx3.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us.i
%7 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %7, %6
br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv32.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom10.us.i = ashr exact i64 %sext.i, 32
%arrayidx11.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us.i
store i32 %6, ptr %arrayidx11.us.i, align 4, !tbaa !5
br label %for.body.i.us.i
for.body.i.us.i: ; preds = %for.body.i.us.i, %while.end.us.i
%indvars.iv.i.us.i = phi i64 [ 0, %while.end.us.i ], [ %indvars.iv.next.i.us.i, %for.body.i.us.i ]
%arrayidx.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i
%8 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %Process.exit.loopexit.us.i, label %for.body.i.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv32.i
store i32 %7, ptr %arrayidx8.us.i, align 4, !tbaa !5
%9 = icmp sgt i64 %indvars.iv32.i, 1
br i1 %9, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !11
Process.exit.loopexit.us.i: ; preds = %for.body.i.us.i
%10 = load i32, ptr %arrayidx2.i.us.i, align 4, !tbaa !5
%call3.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10)
%indvars.iv.next.i7 = add nuw nsw i64 %indvars.iv.i6, 1
%exitcond.not.i8 = icmp eq i64 %indvars.iv.next.i7, %wide.trip.count.i5
br i1 %exitcond.not.i8, label %InsertionSort.exit, label %for.body.us.i, !llvm.loop !12
InsertionSort.exit: ; preds = %Process.exit.loopexit.us.i, %Process.exit
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(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"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
#define N 100
int main(){
int n,A[N+1],k;
int i;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
for(k=0;k<n;k++){
if(k>0)printf(" ");
printf("%d",A[k]);
}
printf("\n");
int j,v;
for(i=1;i<n;i++){
v=A[i];
j=i-1;
while(j>=0 && A[j]>v){
A[j+1]=A[j];
j--;
A[j+1]=v;
}
for(k=0;k<n;k++){
if(k>0)printf(" ");
printf("%d",A[k]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115613/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115613/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%A = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 404, 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
%cmp70 = icmp sgt i32 %0, 0
br i1 %cmp70, label %for.body, label %for.end12
for.cond2.preheader: ; preds = %for.body
%1 = icmp sgt i32 %3, 0
br i1 %1, label %if.end.peel, label %for.end12
if.end.peel: ; preds = %for.cond2.preheader
%.pre = load i32, ptr %A, align 16, !tbaa !5
%call9.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%2 = load i32, ptr %n, align 4, !tbaa !5
%cmp3.peel = icmp sgt i32 %2, 1
br i1 %cmp3.peel, label %if.end, label %for.end12
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv82 = phi i64 [ %indvars.iv.next83, %if.end ], [ 1, %if.end.peel ]
%putchar69 = call i32 @putchar(i32 32)
%arrayidx8 = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %indvars.iv82
%5 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp3 = icmp slt i64 %indvars.iv.next83, %7
br i1 %cmp3, label %if.end, label %for.end12, !llvm.loop !11
for.end12: ; preds = %if.end, %entry, %if.end.peel, %for.cond2.preheader
%putchar = call i32 @putchar(i32 10)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp1579 = icmp sgt i32 %8, 1
br i1 %cmp1579, label %for.body16, label %for.end46
for.body16: ; preds = %for.end12, %for.end42
%9 = phi i32 [ %17, %for.end42 ], [ %8, %for.end12 ]
%indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.end42 ], [ 1, %for.end12 ]
%arrayidx18 = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %indvars.iv86
%10 = load i32, ptr %arrayidx18, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body16, %while.body
%indvars.iv88 = phi i64 [ %indvars.iv86, %for.body16 ], [ %indvars.iv.next89, %while.body ]
%indvars.iv.next89 = add nsw i64 %indvars.iv88, -1
%idxprom20 = and i64 %indvars.iv.next89, 4294967295
%arrayidx21 = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %idxprom20
%11 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %11, %10
br i1 %cmp22, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx26 = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %indvars.iv88
store i32 %11, ptr %arrayidx26, align 4, !tbaa !5
store i32 %10, ptr %arrayidx21, align 4, !tbaa !5
%12 = icmp sgt i64 %indvars.iv88, 1
br i1 %12, label %land.rhs, label %while.end, !llvm.loop !13
while.end: ; preds = %while.body, %land.rhs
%cmp3177 = icmp sgt i32 %9, 0
br i1 %cmp3177, label %if.end36.peel, label %for.end42
if.end36.peel: ; preds = %while.end
%.pre98 = load i32, ptr %A, align 16, !tbaa !5
%call39.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre98)
%13 = load i32, ptr %n, align 4, !tbaa !5
%cmp31.peel = icmp sgt i32 %13, 1
br i1 %cmp31.peel, label %if.end36, label %for.end42
if.end36: ; preds = %if.end36.peel, %if.end36
%indvars.iv91 = phi i64 [ %indvars.iv.next92, %if.end36 ], [ 1, %if.end36.peel ]
%putchar68 = call i32 @putchar(i32 32)
%arrayidx38 = getelementptr inbounds [101 x i32], ptr %A, i64 0, i64 %indvars.iv91
%14 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14)
%indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp31 = icmp slt i64 %indvars.iv.next92, %16
br i1 %cmp31, label %if.end36, label %for.end42, !llvm.loop !14
for.end42: ; preds = %if.end36, %if.end36.peel, %while.end
%putchar67 = call i32 @putchar(i32 10)
%indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp15 = icmp slt i64 %indvars.iv.next87, %18
br i1 %cmp15, label %for.body16, label %for.end46, !llvm.loop !15
for.end46: ; preds = %for.end42, %for.end12
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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.peeled.count", i32 1}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12}
!15 = distinct !{!15, !10}
|
// ALDS1_1_A: Insertion Sort
// 2018.3.14
#include <stdio.h>
int
main (void)
{
int N;
int A[100] = {};
int i, j, v, k;
scanf ("%d\n", &N);
scanf ("%d", &A[0]);
for(i = 1; i < N; i++)
{
scanf (" %d", &A[i]);
}
// 1st line
printf ("%d", A[0]);
for (k = 1; k < N; k++)
{
printf (" %d", A[k]);
}
printf ("\n");
//insertionSort(A, N) // N個の要素を含む0-オリジンの配列A
for(i = 1; i < N; i++)
{
v = A[i];
j = i - 1;
while (j >= 0 && A[j] > v)
{
A[j+1] = A[j];
j--;
}
A[j+1] = v;
// lest lines
printf ("%d", A[0]);
for (k = 1; k < N; k++)
{
printf (" %d", A[k]);
}
printf ("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115657/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115657/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%A = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %A, i8 0, i64 400, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %A)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp65 = icmp sgt i32 %0, 1
br i1 %cmp65, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx2 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%3 = load i32, ptr %A, align 16, !tbaa !5
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp767 = icmp sgt i32 %4, 1
br i1 %cmp767, label %for.body8, label %for.end14
for.body8: ; preds = %for.end, %for.body8
%indvars.iv77 = phi i64 [ %indvars.iv.next78, %for.body8 ], [ 1, %for.end ]
%arrayidx10 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv77
%5 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5)
%indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp7 = icmp slt i64 %indvars.iv.next78, %7
br i1 %cmp7, label %for.body8, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.body8, %for.end
%putchar = call i32 @putchar(i32 10)
%8 = load i32, ptr %N, align 4, !tbaa !5
%cmp1774 = icmp sgt i32 %8, 1
br i1 %cmp1774, label %for.body18, label %for.end46
for.body18: ; preds = %for.end14, %for.end42
%indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.end42 ], [ 1, %for.end14 ]
%arrayidx20 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv80
%9 = load i32, ptr %arrayidx20, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body18, %while.body
%indvars.iv82 = phi i64 [ %indvars.iv80, %for.body18 ], [ %indvars.iv.next83, %while.body ]
%indvars.iv.next83 = add nsw i64 %indvars.iv82, -1
%idxprom22 = and i64 %indvars.iv.next83, 4294967295
%arrayidx23 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom22
%10 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %10, %9
br i1 %cmp24, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx28 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv82
store i32 %10, ptr %arrayidx28, align 4, !tbaa !5
%11 = icmp sgt i64 %indvars.iv82, 1
br i1 %11, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv82, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom30 = ashr exact i64 %sext, 32
%arrayidx31 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom30
store i32 %9, ptr %arrayidx31, align 4, !tbaa !5
%12 = load i32, ptr %A, align 16, !tbaa !5
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12)
%13 = load i32, ptr %N, align 4, !tbaa !5
%cmp3572 = icmp sgt i32 %13, 1
br i1 %cmp3572, label %for.body36, label %for.end42
for.body36: ; preds = %while.end, %for.body36
%indvars.iv85 = phi i64 [ %indvars.iv.next86, %for.body36 ], [ 1, %while.end ]
%arrayidx38 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv85
%14 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
%15 = load i32, ptr %N, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp35 = icmp slt i64 %indvars.iv.next86, %16
br i1 %cmp35, label %for.body36, label %for.end42, !llvm.loop !13
for.end42: ; preds = %for.body36, %while.end
%putchar64 = call i32 @putchar(i32 10)
%indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
%17 = load i32, ptr %N, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp17 = icmp slt i64 %indvars.iv.next81, %18
br i1 %cmp17, label %for.body18, label %for.end46, !llvm.loop !14
for.end46: ; preds = %for.end42, %for.end14
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
//B. Roadside Trees (Simplified Edition)
#include<stdio.h>
int main()
{
int n,time=0;
scanf("%d",&n);
int i,j,h[n+1];
for(i=0;i<n;i++)
{
scanf("%d",&h[i]);
}
time=h[0]+1;
for(i=1;i<n;i++)
{
if(h[i-1]>=h[i])
{
time += (h[i-1]-h[i])+2;
}
else if(h[i]>h[i-1])
{
time += (h[i]-h[i-1]) +2;
}
}
printf("%d\n",time);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11570/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11570/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp56 = icmp sgt i32 %3, 0
call void @llvm.assume(i1 %cmp56)
br label %for.body
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.end, !llvm.loop !9
for.end: ; preds = %for.body
%.pre = load i32, ptr %vla, align 16, !tbaa !5
%add3 = add nsw i32 %.pre, 1
%cmp558 = icmp sgt i32 %4, 1
br i1 %cmp558, label %for.body6.preheader, label %for.end38
for.body6.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %4 to i64
%6 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %4, 9
br i1 %min.iters.check, label %for.body6.preheader73, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %6, -8
%ind.end = or i64 %n.vec, 1
%vector.recur.init = insertelement <4 x i32> poison, i32 %.pre, i64 3
%7 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %add3, i64 0
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load72, %vector.body ]
%vec.phi = phi <4 x i32> [ %7, %vector.ph ], [ %18, %vector.body ]
%vec.phi71 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%offset.idx = or i64 %index, 1
%8 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %8, align 4, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
%wide.load72 = load <4 x i32>, ptr %9, align 4, !tbaa !5
%10 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%11 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load72, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%12 = sub nsw <4 x i32> %10, %wide.load
%13 = sub nsw <4 x i32> %11, %wide.load72
%14 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %12, i1 true)
%15 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %13, i1 true)
%16 = add <4 x i32> %vec.phi, <i32 2, i32 2, i32 2, i32 2>
%17 = add <4 x i32> %vec.phi71, <i32 2, i32 2, i32 2, i32 2>
%18 = add <4 x i32> %16, %14
%19 = add <4 x i32> %17, %15
%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 %6, %n.vec
%vector.recur.extract = extractelement <4 x i32> %wide.load72, i64 3
br i1 %cmp.n, label %for.end38, label %for.body6.preheader73
for.body6.preheader73: ; preds = %for.body6.preheader, %middle.block
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ %.pre, %for.body6.preheader ]
%indvars.iv64.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body6.preheader ]
%time.060.ph = phi i32 [ %21, %middle.block ], [ %add3, %for.body6.preheader ]
br label %for.body6
for.body6: ; preds = %for.body6.preheader73, %for.body6
%scalar.recur = phi i32 [ %22, %for.body6 ], [ %scalar.recur.ph, %for.body6.preheader73 ]
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.body6 ], [ %indvars.iv64.ph, %for.body6.preheader73 ]
%time.060 = phi i32 [ %time.1, %for.body6 ], [ %time.060.ph, %for.body6.preheader73 ]
%arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv64
%22 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%sub17 = sub nsw i32 %scalar.recur, %22
%add18.pn.in = call i32 @llvm.abs.i32(i32 %sub17, i1 true)
%add18.pn = add i32 %time.060, 2
%time.1 = add i32 %add18.pn, %add18.pn.in
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%exitcond.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count
br i1 %exitcond.not, label %for.end38, label %for.body6, !llvm.loop !14
for.end38: ; preds = %for.body6, %middle.block, %for.end
%time.0.lcssa = phi i32 [ %add3, %for.end ], [ %21, %middle.block ], [ %time.1, %for.body6 ]
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %time.0.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include<stdio.h>
int main() {
int n, j, key;
int arr[1000+5];
scanf("%d", &n);
for(int i = 0; i < n; i++) scanf("%d",&arr[i]);
for ( int i = 0; i < n; i++ ) {
j = i - 1;
key = arr[i];
while( j >= 0 && arr[j] > key) {
arr[j+1] = arr[j];
j--;
}
arr[j+1] = key;
for(int k = 0; k < n; k++) {
if( k > 0 ) printf(" ");
printf("%d", arr[k]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115743/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115743/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%arr = alloca [1005 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4020, ptr nonnull %arr) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp51 = icmp sgt i32 %0, 0
br i1 %cmp51, label %for.body, label %for.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp460 = icmp sgt i32 %1, 0
br i1 %cmp460, label %for.body6, label %for.cond.cleanup5
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1005 x i32], ptr %arr, 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.cond3.preheader, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.cond.cleanup22, %entry, %for.cond3.preheader
call void @llvm.lifetime.end.p0(i64 4020, ptr nonnull %arr) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body6: ; preds = %for.cond3.preheader, %for.cond.cleanup22
%3 = phi i32 [ %8, %for.cond.cleanup22 ], [ %1, %for.cond3.preheader ]
%indvars.iv63 = phi i64 [ %indvars.iv.next64, %for.cond.cleanup22 ], [ 0, %for.cond3.preheader ]
%arrayidx8 = getelementptr inbounds [1005 x i32], ptr %arr, i64 0, i64 %indvars.iv63
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp954.not = icmp eq i64 %indvars.iv63, 0
br i1 %cmp954.not, label %while.end, label %land.rhs
land.rhs: ; preds = %for.body6, %while.body
%indvars.iv65 = phi i64 [ %indvars.iv.next66, %while.body ], [ %indvars.iv63, %for.body6 ]
%indvars.iv.next66 = add nsw i64 %indvars.iv65, -1
%idxprom10 = and i64 %indvars.iv.next66, 4294967295
%arrayidx11 = getelementptr inbounds [1005 x i32], ptr %arr, i64 0, i64 %idxprom10
%5 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp sgt i32 %5, %4
br i1 %cmp12, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx16 = getelementptr inbounds [1005 x i32], ptr %arr, i64 0, i64 %indvars.iv65
store i32 %5, ptr %arrayidx16, align 4, !tbaa !5
%6 = icmp sgt i64 %indvars.iv65, 1
br i1 %6, label %land.rhs, label %while.end, !llvm.loop !11
while.end: ; preds = %land.rhs, %while.body, %for.body6
%j.0.in.lcssa = phi i64 [ 0, %for.body6 ], [ 0, %while.body ], [ %indvars.iv65, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom18 = ashr exact i64 %sext, 32
%arrayidx19 = getelementptr inbounds [1005 x i32], ptr %arr, i64 0, i64 %idxprom18
store i32 %4, ptr %arrayidx19, align 4, !tbaa !5
%cmp2158 = icmp sgt i32 %3, 0
br i1 %cmp2158, label %if.end.peel, label %for.cond.cleanup22
if.end.peel: ; preds = %while.end
%.pre = load i32, ptr %arr, align 16, !tbaa !5
%call28.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp21.peel = icmp sgt i32 %7, 1
br i1 %cmp21.peel, label %if.end, label %for.cond.cleanup22
for.cond.cleanup22: ; preds = %if.end, %if.end.peel, %while.end
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp4 = icmp slt i64 %indvars.iv.next64, %9
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !12
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %if.end ], [ 1, %if.end.peel ]
%putchar50 = call i32 @putchar(i32 32)
%arrayidx27 = getelementptr inbounds [1005 x i32], ptr %arr, i64 0, i64 %indvars.iv68
%10 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%call28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp21 = icmp slt i64 %indvars.iv.next69, %12
br i1 %cmp21, label %if.end, label %for.cond.cleanup22, !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: 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 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
int main(){
int i;
int j;
int k;
int key;
int n;
scanf("%d",&n);
int A[n];
for(i=0; i<n; i++)
scanf("%d",&A[i]);
for(k=0; k<n-1; k++)
printf("%d ",A[k]);
printf("%d\n",A[k]);
for(i = 1; i<n; i++){
key = A[i];
j = i-1;
while(j >= 0 && A[j] > key){
A[j+1] = A[j];
j--;
}
A[j+1] = key;
for(k=0; k<n-1; k++)
printf("%d ",A[k]);
printf("%d\n",A[k]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115787/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115787/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp66 = icmp sgt i32 %3, 0
br i1 %cmp66, label %for.body, label %for.end10
for.cond2.preheader: ; preds = %for.body
%4 = icmp sgt i32 %5, 1
br i1 %4, label %for.body4, label %for.end10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv81
%7 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %8, -1
%9 = sext i32 %sub to i64
%cmp3 = icmp slt i64 %indvars.iv.next82, %9
br i1 %cmp3, label %for.body4, label %for.end10.loopexit, !llvm.loop !11
for.end10.loopexit: ; preds = %for.body4
%10 = and i64 %indvars.iv.next82, 4294967295
br label %for.end10
for.end10: ; preds = %entry, %for.end10.loopexit, %for.cond2.preheader
%k.0.lcssa = phi i64 [ 0, %for.cond2.preheader ], [ %10, %for.end10.loopexit ], [ 0, %entry ]
%arrayidx12 = getelementptr inbounds i32, ptr %vla, i64 %k.0.lcssa
%11 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
%12 = load i32, ptr %n, align 4, !tbaa !5
%cmp1578 = icmp sgt i32 %12, 1
br i1 %cmp1578, label %for.body16, label %for.end46
for.body16: ; preds = %for.end10, %for.end40
%13 = phi i32 [ %21, %for.end40 ], [ %12, %for.end10 ]
%indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.end40 ], [ 1, %for.end10 ]
%arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv84
%14 = load i32, ptr %arrayidx18, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body16, %while.body
%indvars.iv86 = phi i64 [ %indvars.iv84, %for.body16 ], [ %indvars.iv.next87, %while.body ]
%indvars.iv.next87 = add nsw i64 %indvars.iv86, -1
%idxprom21 = and i64 %indvars.iv.next87, 4294967295
%arrayidx22 = getelementptr inbounds i32, ptr %vla, i64 %idxprom21
%15 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %15, %14
br i1 %cmp23, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx27 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv86
store i32 %15, ptr %arrayidx27, align 4, !tbaa !5
%16 = icmp sgt i64 %indvars.iv86, 1
br i1 %16, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv86, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom29 = ashr exact i64 %sext, 32
%arrayidx30 = getelementptr inbounds i32, ptr %vla, i64 %idxprom29
store i32 %14, ptr %arrayidx30, align 4, !tbaa !5
%cmp3375 = icmp sgt i32 %13, 1
br i1 %cmp3375, label %for.body34, label %for.end40
for.body34: ; preds = %while.end, %for.body34
%indvars.iv89 = phi i64 [ %indvars.iv.next90, %for.body34 ], [ 0, %while.end ]
%arrayidx36 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv89
%17 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17)
%indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%sub32 = add nsw i32 %18, -1
%19 = sext i32 %sub32 to i64
%cmp33 = icmp slt i64 %indvars.iv.next90, %19
br i1 %cmp33, label %for.body34, label %for.end40, !llvm.loop !13
for.end40: ; preds = %for.body34, %while.end
%k.1.lcssa = phi i64 [ 0, %while.end ], [ %indvars.iv.next90, %for.body34 ]
%idxprom41 = and i64 %k.1.lcssa, 4294967295
%arrayidx42 = getelementptr inbounds i32, ptr %vla, i64 %idxprom41
%20 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %20)
%indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
%21 = load i32, ptr %n, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp15 = icmp slt i64 %indvars.iv.next85, %22
br i1 %cmp15, label %for.body16, label %for.end46, !llvm.loop !14
for.end46: ; preds = %for.end40, %for.end10
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int a[10000000];
int main()
{
int i,n,sum=0,top,cur=0;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
top=a[i];
if(top>cur)
{
sum+=top-cur;
}
else
{
sum+=cur-top;
}
cur=top;
sum++;
}
printf("%d\n",sum+n-1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11583/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11583/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@a = dso_local global [10000000 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, label %for.body, label %for.end13
for.cond2.preheader: ; preds = %for.body
%cmp333 = icmp sgt i32 %15, 0
br i1 %cmp333, label %for.body4.preheader, label %for.end13
for.body4.preheader: ; preds = %for.cond2.preheader
%wide.trip.count = zext i32 %15 to i64
%min.iters.check = icmp ult i32 %15, 8
br i1 %min.iters.check, label %for.body4.preheader48, label %vector.ph
vector.ph: ; preds = %for.body4.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vector.recur = phi <4 x i32> [ <i32 poison, i32 poison, i32 poison, i32 0>, %vector.ph ], [ %wide.load47, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%1 = getelementptr inbounds [10000000 x i32], ptr @a, 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 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%4 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load47, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
%5 = sub nsw <4 x i32> %wide.load, %3
%6 = sub nsw <4 x i32> %wide.load47, %4
%7 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %5, i1 true)
%8 = call <4 x i32> @llvm.abs.v4i32(<4 x i32> %6, i1 true)
%9 = add <4 x i32> %vec.phi, <i32 1, i32 1, i32 1, i32 1>
%10 = add <4 x i32> %vec.phi46, <i32 1, i32 1, i32 1, i32 1>
%11 = add <4 x i32> %9, %7
%12 = add <4 x i32> %10, %8
%index.next = add nuw i64 %index, 8
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %12, %11
%14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
%vector.recur.extract = extractelement <4 x i32> %wide.load47, i64 3
br i1 %cmp.n, label %for.end13, label %for.body4.preheader48
for.body4.preheader48: ; preds = %for.body4.preheader, %middle.block
%indvars.iv40.ph = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body4.preheader ]
%scalar.recur.ph = phi i32 [ %vector.recur.extract, %middle.block ], [ 0, %for.body4.preheader ]
%sum.034.ph = phi i32 [ %14, %middle.block ], [ 0, %for.body4.preheader ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10000000 x i32], ptr @a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%16 = sext i32 %15 to i64
%cmp = icmp slt i64 %indvars.iv.next, %16
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader48, %for.body4
%indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body4 ], [ %indvars.iv40.ph, %for.body4.preheader48 ]
%scalar.recur = phi i32 [ %17, %for.body4 ], [ %scalar.recur.ph, %for.body4.preheader48 ]
%sum.034 = phi i32 [ %inc10, %for.body4 ], [ %sum.034.ph, %for.body4.preheader48 ]
%arrayidx6 = getelementptr inbounds [10000000 x i32], ptr @a, i64 0, i64 %indvars.iv40
%17 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%sub = sub nsw i32 %17, %scalar.recur
%sub.pn = call i32 @llvm.abs.i32(i32 %sub, i1 true)
%sum.1 = add i32 %sum.034, 1
%inc10 = add i32 %sum.1, %sub.pn
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%exitcond.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count
br i1 %exitcond.not, label %for.end13, label %for.body4, !llvm.loop !14
for.end13: ; preds = %for.body4, %middle.block, %entry, %for.cond2.preheader
%.lcssa45 = phi i32 [ %15, %for.cond2.preheader ], [ %0, %entry ], [ %15, %middle.block ], [ %15, %for.body4 ]
%sum.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %entry ], [ %14, %middle.block ], [ %inc10, %for.body4 ]
%add14 = add i32 %.lcssa45, -1
%sub15 = add i32 %add14, %sum.0.lcssa
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub15)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x i32> @llvm.abs.v4i32(<4 x i32>, i1 immarg) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main(){
int num,i=0,j=0,k=0,key;
scanf("%d",&num);
int stuck[num];
for(i=0;i<num;i++){
scanf("%d",&stuck[i]);
}
for(k=0;k<num;k++){
if(k==num-1) printf("%d\n",stuck[k]);
else printf("%d ",stuck[k]);
}
for(i=1;i<num;i++){
key=stuck[i];
j=i-1;
while(j>=0 && stuck[j]>key){
stuck[j+1]=stuck[j];
j--;
}
stuck[j+1]=key;
for(k=0;k<num;k++){
if(k==num-1)printf("%d\n",stuck[k]);
else printf("%d ",stuck[k]);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115873/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115873/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%num = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%0 = load i32, ptr %num, 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 %num, align 4, !tbaa !5
%cmp75 = icmp sgt i32 %3, 0
br i1 %cmp75, label %for.body, label %for.end51
for.cond2.preheader: ; preds = %for.body
%cmp377 = icmp sgt i32 %4, 0
br i1 %cmp377, label %for.body4, label %for.end51
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 %num, 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.cond15.preheader: ; preds = %for.body4
%cmp1684 = icmp sgt i32 %9, 1
br i1 %cmp1684, label %for.body17, label %for.end51
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.body4 ], [ 0, %for.cond2.preheader ]
%6 = phi i32 [ %9, %for.body4 ], [ %4, %for.cond2.preheader ]
%sub = add nsw i32 %6, -1
%7 = zext i32 %sub to i64
%cmp5 = icmp eq i64 %indvars.iv87, %7
%arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87
%8 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%.str.1..str.2 = select i1 %cmp5, ptr @.str.1, ptr @.str.2
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i32 noundef %8)
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%9 = load i32, ptr %num, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp3 = icmp slt i64 %indvars.iv.next88, %10
br i1 %cmp3, label %for.body4, label %for.cond15.preheader, !llvm.loop !11
for.body17: ; preds = %for.cond15.preheader, %for.inc49
%11 = phi i32 [ %20, %for.inc49 ], [ %9, %for.cond15.preheader ]
%indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.inc49 ], [ 1, %for.cond15.preheader ]
%arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv90
%12 = load i32, ptr %arrayidx19, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body17, %while.body
%indvars.iv92 = phi i64 [ %indvars.iv90, %for.body17 ], [ %indvars.iv.next93, %while.body ]
%indvars.iv.next93 = add nsw i64 %indvars.iv92, -1
%idxprom22 = and i64 %indvars.iv.next93, 4294967295
%arrayidx23 = getelementptr inbounds i32, ptr %vla, i64 %idxprom22
%13 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %13, %12
br i1 %cmp24, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx28 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv92
store i32 %13, ptr %arrayidx28, align 4, !tbaa !5
%14 = icmp sgt i64 %indvars.iv92, 1
br i1 %14, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv92, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom30 = ashr exact i64 %sext, 32
%arrayidx31 = getelementptr inbounds i32, ptr %vla, i64 %idxprom30
store i32 %12, ptr %arrayidx31, align 4, !tbaa !5
%cmp3382 = icmp sgt i32 %11, 0
br i1 %cmp3382, label %for.body34, label %while.end.for.inc49_crit_edge
while.end.for.inc49_crit_edge: ; preds = %while.end
%.pre = sext i32 %11 to i64
br label %for.inc49
for.body34: ; preds = %while.end, %for.body34
%indvars.iv95 = phi i64 [ %indvars.iv.next96, %for.body34 ], [ 0, %while.end ]
%15 = phi i32 [ %18, %for.body34 ], [ %11, %while.end ]
%sub35 = add nsw i32 %15, -1
%16 = zext i32 %sub35 to i64
%cmp36 = icmp eq i64 %indvars.iv95, %16
%arrayidx39 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv95
%17 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%.str.1..str.2107 = select i1 %cmp36, ptr @.str.1, ptr @.str.2
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2107, i32 noundef %17)
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%18 = load i32, ptr %num, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp33 = icmp slt i64 %indvars.iv.next96, %19
br i1 %cmp33, label %for.body34, label %for.inc49, !llvm.loop !13
for.inc49: ; preds = %for.body34, %while.end.for.inc49_crit_edge
%.pre-phi = phi i64 [ %.pre, %while.end.for.inc49_crit_edge ], [ %19, %for.body34 ]
%20 = phi i32 [ %11, %while.end.for.inc49_crit_edge ], [ %18, %for.body34 ]
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%cmp16 = icmp slt i64 %indvars.iv.next91, %.pre-phi
br i1 %cmp16, label %for.body17, label %for.end51, !llvm.loop !14
for.end51: ; preds = %for.inc49, %entry, %for.cond2.preheader, %for.cond15.preheader
call void @llvm.stackrestore.p0(ptr %2)
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: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main()
{
int a[1000], n, i, j, k, v;
scanf("%d", &n);
for(k = 0; k < n; k++)
{
scanf("%d",&a[k]);
}
for(k = 0; k < n-1; k++)
{
printf("%d ",a[k]);
}
printf("%d", a[n-1]);
printf("\n");
for(i = 1; i < n; i++)
{
v = a[i];
j = i - 1;
while (j >= 0 && a[j] > v)
{
a[j+1] = a[j];
j--;
a[j+1] = v;
}
for(k = 0; k < n-1; k++)
{
printf("%d ",a[k]);
}
printf("%d", a[n-1]);
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115916/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115916/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [1000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp70 = icmp sgt i32 %0, 0
br i1 %cmp70, label %for.body, label %for.cond2.preheader.for.end10_crit_edge
for.cond2.preheader: ; preds = %for.body
%cmp373 = icmp sgt i32 %2, 1
br i1 %cmp373, label %for.body4, label %for.cond2.preheader.for.end10_crit_edge
for.cond2.preheader.for.end10_crit_edge: ; preds = %entry, %for.cond2.preheader
%1 = phi i32 [ %2, %for.cond2.preheader ], [ %0, %entry ]
%sub72 = add nsw i32 %1, -1
%.pre = sext i32 %sub72 to i64
br label %for.end10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv87
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%6 = sext i32 %sub to i64
%cmp3 = icmp slt i64 %indvars.iv.next88, %6
br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.body4, %for.cond2.preheader.for.end10_crit_edge
%idxprom12.pre-phi = phi i64 [ %.pre, %for.cond2.preheader.for.end10_crit_edge ], [ %6, %for.body4 ]
%arrayidx13 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %idxprom12.pre-phi
%7 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7)
%putchar = call i32 @putchar(i32 10)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp1782 = icmp sgt i32 %8, 1
br i1 %cmp1782, label %for.body18, label %for.end50
for.body18: ; preds = %for.end10, %for.end42
%9 = phi i32 [ %17, %for.end42 ], [ %8, %for.end10 ]
%indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.end42 ], [ 1, %for.end10 ]
%arrayidx20 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv90
%10 = load i32, ptr %arrayidx20, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body18, %while.body
%indvars.iv92 = phi i64 [ %indvars.iv90, %for.body18 ], [ %indvars.iv.next93, %while.body ]
%indvars.iv.next93 = add nsw i64 %indvars.iv92, -1
%idxprom23 = and i64 %indvars.iv.next93, 4294967295
%arrayidx24 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %idxprom23
%11 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%cmp25 = icmp sgt i32 %11, %10
br i1 %cmp25, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx29 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv92
store i32 %11, ptr %arrayidx29, align 4, !tbaa !5
store i32 %10, ptr %arrayidx24, align 4, !tbaa !5
%12 = icmp sgt i64 %indvars.iv92, 1
br i1 %12, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%cmp3579 = icmp sgt i32 %9, 1
br i1 %cmp3579, label %for.body36, label %while.end.for.end42_crit_edge
while.end.for.end42_crit_edge: ; preds = %while.end
%sub3478 = add nsw i32 %9, -1
%.pre101 = sext i32 %sub3478 to i64
br label %for.end42
for.body36: ; preds = %while.end, %for.body36
%indvars.iv95 = phi i64 [ %indvars.iv.next96, %for.body36 ], [ 0, %while.end ]
%arrayidx38 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv95
%13 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %13)
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%sub34 = add nsw i32 %14, -1
%15 = sext i32 %sub34 to i64
%cmp35 = icmp slt i64 %indvars.iv.next96, %15
br i1 %cmp35, label %for.body36, label %for.end42, !llvm.loop !13
for.end42: ; preds = %for.body36, %while.end.for.end42_crit_edge
%idxprom44.pre-phi = phi i64 [ %.pre101, %while.end.for.end42_crit_edge ], [ %15, %for.body36 ]
%arrayidx45 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %idxprom44.pre-phi
%16 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
%putchar69 = call i32 @putchar(i32 10)
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp17 = icmp slt i64 %indvars.iv.next91, %18
br i1 %cmp17, label %for.body18, label %for.end50, !llvm.loop !14
for.end50: ; preds = %for.end42, %for.end10
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#include<string.h>
int main()
{
int n,i,j;
char s[50],t[50];
scanf("%s",s);
scanf("%s",t);
j=0;
for(i=0;i<strlen(t);i++)
{
if(t[i]==s[j])
j++;
}
printf("%d\n",j+1);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11596/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11596/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca [50 x i8], align 16
%t = alloca [50 x i8], align 16
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%call4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %t) #5
%cmp18.not = icmp eq i64 %call4, 0
br i1 %cmp18.not, label %for.end, label %for.body.preheader
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %call4, 3
%0 = icmp ult i64 %call4, 4
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 %call4, -4
br label %for.body
for.body: ; preds = %for.body, %for.body.preheader.new
%indvars.iv = phi i64 [ 0, %for.body.preheader.new ], [ %indvars.iv.next.3, %for.body ]
%j.020 = phi i32 [ 0, %for.body.preheader.new ], [ %spec.select.3, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.3, %for.body ]
%arrayidx = getelementptr inbounds [50 x i8], ptr %t, i64 0, i64 %indvars.iv
%1 = load i8, ptr %arrayidx, align 4, !tbaa !5
%idxprom7 = zext i32 %j.020 to i64
%arrayidx8 = getelementptr inbounds [50 x i8], ptr %s, i64 0, i64 %idxprom7
%2 = load i8, ptr %arrayidx8, align 1, !tbaa !5
%cmp10 = icmp eq i8 %1, %2
%inc = zext i1 %cmp10 to i32
%spec.select = add nuw nsw i32 %j.020, %inc
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx.1 = getelementptr inbounds [50 x i8], ptr %t, i64 0, i64 %indvars.iv.next
%3 = load i8, ptr %arrayidx.1, align 1, !tbaa !5
%idxprom7.1 = zext i32 %spec.select to i64
%arrayidx8.1 = getelementptr inbounds [50 x i8], ptr %s, i64 0, i64 %idxprom7.1
%4 = load i8, ptr %arrayidx8.1, align 1, !tbaa !5
%cmp10.1 = icmp eq i8 %3, %4
%inc.1 = zext i1 %cmp10.1 to i32
%spec.select.1 = add nuw nsw i32 %spec.select, %inc.1
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%arrayidx.2 = getelementptr inbounds [50 x i8], ptr %t, i64 0, i64 %indvars.iv.next.1
%5 = load i8, ptr %arrayidx.2, align 2, !tbaa !5
%idxprom7.2 = zext i32 %spec.select.1 to i64
%arrayidx8.2 = getelementptr inbounds [50 x i8], ptr %s, i64 0, i64 %idxprom7.2
%6 = load i8, ptr %arrayidx8.2, align 1, !tbaa !5
%cmp10.2 = icmp eq i8 %5, %6
%inc.2 = zext i1 %cmp10.2 to i32
%spec.select.2 = add nuw nsw i32 %spec.select.1, %inc.2
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%arrayidx.3 = getelementptr inbounds [50 x i8], ptr %t, i64 0, i64 %indvars.iv.next.2
%7 = load i8, ptr %arrayidx.3, align 1, !tbaa !5
%idxprom7.3 = zext i32 %spec.select.2 to i64
%arrayidx8.3 = getelementptr inbounds [50 x i8], ptr %s, i64 0, i64 %idxprom7.3
%8 = load i8, ptr %arrayidx8.3, align 1, !tbaa !5
%cmp10.3 = icmp eq i8 %7, %8
%inc.3 = zext i1 %cmp10.3 to i32
%spec.select.3 = add nuw nsw i32 %spec.select.2, %inc.3
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
%niter.next.3 = add i64 %niter, 4
%niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
br i1 %niter.ncmp.3, label %for.end.loopexit.unr-lcssa, label %for.body, !llvm.loop !8
for.end.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%spec.select.lcssa.ph = phi i32 [ undef, %for.body.preheader ], [ %spec.select.3, %for.body ]
%indvars.iv.unr = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next.3, %for.body ]
%j.020.unr = phi i32 [ 0, %for.body.preheader ], [ %spec.select.3, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end.loopexit, label %for.body.epil
for.body.epil: ; preds = %for.end.loopexit.unr-lcssa, %for.body.epil
%indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %for.body.epil ], [ %indvars.iv.unr, %for.end.loopexit.unr-lcssa ]
%j.020.epil = phi i32 [ %spec.select.epil, %for.body.epil ], [ %j.020.unr, %for.end.loopexit.unr-lcssa ]
%epil.iter = phi i64 [ %epil.iter.next, %for.body.epil ], [ 0, %for.end.loopexit.unr-lcssa ]
%arrayidx.epil = getelementptr inbounds [50 x i8], ptr %t, i64 0, i64 %indvars.iv.epil
%9 = load i8, ptr %arrayidx.epil, align 1, !tbaa !5
%idxprom7.epil = zext i32 %j.020.epil to i64
%arrayidx8.epil = getelementptr inbounds [50 x i8], ptr %s, i64 0, i64 %idxprom7.epil
%10 = load i8, ptr %arrayidx8.epil, align 1, !tbaa !5
%cmp10.epil = icmp eq i8 %9, %10
%inc.epil = zext i1 %cmp10.epil to i32
%spec.select.epil = add nuw nsw i32 %j.020.epil, %inc.epil
%indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
%epil.iter.next = add i64 %epil.iter, 1
%epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
br i1 %epil.iter.cmp.not, label %for.end.loopexit, label %for.body.epil, !llvm.loop !10
for.end.loopexit: ; preds = %for.body.epil, %for.end.loopexit.unr-lcssa
%spec.select.lcssa = phi i32 [ %spec.select.lcssa.ph, %for.end.loopexit.unr-lcssa ], [ %spec.select.epil, %for.body.epil ]
%11 = add nuw nsw i32 %spec.select.lcssa, 1
br label %for.end
for.end: ; preds = %for.end.loopexit, %entry
%j.0.lcssa = phi i32 [ 1, %entry ], [ %11, %for.end.loopexit ]
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %j.0.lcssa)
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.unroll.disable"}
|
#include<stdio.h>
int main(){
int n, i, j, k, v;
int A[1000];
scanf("%d\n",&n);
for(i = 0 ; i < n ; i++){
scanf("%d",&A[i]);
}
for(k = 0 ; k < n ; k++){
if(k == n - 1)printf("%d",A[k]);
else printf("%d ",A[k]);
}
printf("\n");
for(i = 1 ; i < n ; i++){
v = A[i];
j = i - 1;
while(j >= 0 && A[j] > v){
A[j + 1] = A[j];
j--;
A[j + 1] = v;
}
for(k = 0 ; k < n ; k++){
if(k == n - 1)printf("%d",A[k]);
else printf("%d ",A[k]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116001/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116001/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%A = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp79 = icmp sgt i32 %0, 0
br i1 %cmp79, label %for.body, label %for.end14
for.cond2.preheader: ; preds = %for.body
%cmp381 = icmp sgt i32 %1, 0
br i1 %cmp381, label %for.body4, label %for.end14
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], 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 !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.body4 ], [ 0, %for.cond2.preheader ]
%3 = phi i32 [ %6, %for.body4 ], [ %1, %for.cond2.preheader ]
%sub = add nsw i32 %3, -1
%4 = zext i32 %sub to i64
%cmp5 = icmp eq i64 %indvars.iv91, %4
%arrayidx7 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv91
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%.str.1..str.2 = select i1 %cmp5, ptr @.str.1, ptr @.str.2
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i32 noundef %5)
%indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp3 = icmp slt i64 %indvars.iv.next92, %7
br i1 %cmp3, label %for.body4, label %for.end14, !llvm.loop !11
for.end14: ; preds = %for.body4, %entry, %for.cond2.preheader
%putchar = call i32 @putchar(i32 10)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp1788 = icmp sgt i32 %8, 1
br i1 %cmp1788, label %for.body18, label %for.end53
for.body18: ; preds = %for.end14, %for.end49
%9 = phi i32 [ %18, %for.end49 ], [ %8, %for.end14 ]
%indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.end49 ], [ 1, %for.end14 ]
%arrayidx20 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv94
%10 = load i32, ptr %arrayidx20, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body18, %while.body
%indvars.iv96 = phi i64 [ %indvars.iv94, %for.body18 ], [ %indvars.iv.next97, %while.body ]
%indvars.iv.next97 = add nsw i64 %indvars.iv96, -1
%idxprom23 = and i64 %indvars.iv.next97, 4294967295
%arrayidx24 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom23
%11 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%cmp25 = icmp sgt i32 %11, %10
br i1 %cmp25, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx29 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv96
store i32 %11, ptr %arrayidx29, align 4, !tbaa !5
store i32 %10, ptr %arrayidx24, align 4, !tbaa !5
%12 = icmp sgt i64 %indvars.iv96, 1
br i1 %12, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%cmp3486 = icmp sgt i32 %9, 0
br i1 %cmp3486, label %for.body35, label %for.end49
for.body35: ; preds = %while.end, %for.body35
%indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.body35 ], [ 0, %while.end ]
%13 = phi i32 [ %16, %for.body35 ], [ %9, %while.end ]
%sub36 = add nsw i32 %13, -1
%14 = zext i32 %sub36 to i64
%cmp37 = icmp eq i64 %indvars.iv99, %14
%arrayidx40 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv99
%15 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%.str.1..str.2107 = select i1 %cmp37, ptr @.str.1, ptr @.str.2
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2107, i32 noundef %15)
%indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp34 = icmp slt i64 %indvars.iv.next100, %17
br i1 %cmp34, label %for.body35, label %for.end49, !llvm.loop !13
for.end49: ; preds = %for.body35, %while.end
%putchar78 = call i32 @putchar(i32 10)
%indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp17 = icmp slt i64 %indvars.iv.next95, %19
br i1 %cmp17, label %for.body18, label %for.end53, !llvm.loop !14
for.end53: ; preds = %for.end49, %for.end14
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main(){
int j,i,N,key;
int A[100];
scanf("%d",&N); /*the number of elements*/
for(j=0; j<N; j++){
/* insert A[j] into the sorted sequence A[1,...,j-1] */
scanf("%d",&A[j]);
}
/*The output first line*/
for(j=0; j<N; j++){
printf("%d",A[j]);
if(j < N-1){
printf(" ");
}
}
printf("\n");
for(j=1; j<N; j++){
key=A[j];
i=j-1;
while((i >= 0) && (A[i] >key)){
A[i+1]=A[i];
i=i-1;
}
A[i+1]=key;
for(i=0; i<N; i++){
printf("%d",A[i]);
if(i < N-1){
printf(" ");
}
}
printf("\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116045/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116045/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%A = 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 %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
%cmp73 = icmp sgt i32 %0, 0
br i1 %cmp73, label %for.body, label %for.end12
for.cond2.preheader: ; preds = %for.body
%1 = icmp sgt i32 %2, 0
br i1 %1, label %for.body4, label %for.end12
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.inc10
%indvars.iv85 = phi i64 [ %indvars.iv.next86, %for.inc10 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv85
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %4)
%5 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%6 = sext i32 %sub to i64
%cmp8 = icmp slt i64 %indvars.iv85, %6
br i1 %cmp8, label %if.then, label %for.inc10
if.then: ; preds = %for.body4
%putchar72 = call i32 @putchar(i32 32)
%.pre = load i32, ptr %N, align 4, !tbaa !5
br label %for.inc10
for.inc10: ; preds = %for.body4, %if.then
%7 = phi i32 [ %5, %for.body4 ], [ %.pre, %if.then ]
%indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
%8 = sext i32 %7 to i64
%cmp3 = icmp slt i64 %indvars.iv.next86, %8
br i1 %cmp3, label %for.body4, label %for.end12, !llvm.loop !11
for.end12: ; preds = %for.inc10, %entry, %for.cond2.preheader
%putchar = call i32 @putchar(i32 10)
%9 = load i32, ptr %N, align 4, !tbaa !5
%cmp1582 = icmp sgt i32 %9, 1
br i1 %cmp1582, label %for.body16, label %for.end49
for.body16: ; preds = %for.end12, %for.end45
%10 = phi i32 [ %19, %for.end45 ], [ %9, %for.end12 ]
%indvars.iv88 = phi i64 [ %indvars.iv.next89, %for.end45 ], [ 1, %for.end12 ]
%arrayidx18 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv88
%11 = load i32, ptr %arrayidx18, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body16, %while.body
%indvars.iv90 = phi i64 [ %indvars.iv88, %for.body16 ], [ %indvars.iv.next91, %while.body ]
%indvars.iv.next91 = add nsw i64 %indvars.iv90, -1
%idxprom21 = and i64 %indvars.iv.next91, 4294967295
%arrayidx22 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom21
%12 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %12, %11
br i1 %cmp23, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx27 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv90
store i32 %12, ptr %arrayidx27, align 4, !tbaa !5
%13 = icmp sgt i64 %indvars.iv90, 1
br i1 %13, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%i.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv90, %land.rhs ]
%sext = shl i64 %i.0.in.lcssa, 32
%idxprom30 = ashr exact i64 %sext, 32
%arrayidx31 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom30
store i32 %11, ptr %arrayidx31, align 4, !tbaa !5
%cmp3380 = icmp sgt i32 %10, 0
br i1 %cmp3380, label %for.body34, label %for.end45
for.body34: ; preds = %while.end, %for.inc43
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.inc43 ], [ 0, %while.end ]
%arrayidx36 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv93
%14 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14)
%15 = load i32, ptr %N, align 4, !tbaa !5
%sub38 = add nsw i32 %15, -1
%16 = sext i32 %sub38 to i64
%cmp39 = icmp slt i64 %indvars.iv93, %16
br i1 %cmp39, label %if.then40, label %for.inc43
if.then40: ; preds = %for.body34
%putchar71 = call i32 @putchar(i32 32)
%.pre99 = load i32, ptr %N, align 4, !tbaa !5
br label %for.inc43
for.inc43: ; preds = %for.body34, %if.then40
%17 = phi i32 [ %15, %for.body34 ], [ %.pre99, %if.then40 ]
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%18 = sext i32 %17 to i64
%cmp33 = icmp slt i64 %indvars.iv.next94, %18
br i1 %cmp33, label %for.body34, label %for.end45, !llvm.loop !13
for.end45: ; preds = %for.inc43, %while.end
%putchar70 = call i32 @putchar(i32 10)
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%19 = load i32, ptr %N, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp15 = icmp slt i64 %indvars.iv.next89, %20
br i1 %cmp15, label %for.body16, label %for.end49, !llvm.loop !14
for.end49: ; preds = %for.end45, %for.end12
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: 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 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#define N 100
int main(){
int i,j,k,n,key,A[N];
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",&A[i]);
for(i=0;i<n-1;i++) printf("%d ",A[i]);
printf("%d\n",A[i]);
for(i=1;i<n;i++){
key = A[i];
j = i - 1;
while(j>=0 && A[j]>key){
A[j+1] = A[j];
j--;
}
A[j+1] = key;
for(k=0;k<n-1;k++) printf("%d ",A[k]);
printf("%d\n",A[k]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116089/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116089/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%A = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.end10
for.cond2.preheader: ; preds = %for.body
%1 = icmp sgt i32 %2, 1
br i1 %1, label %for.body4, label %for.end10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv81 = phi i64 [ %indvars.iv.next82, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv81
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%indvars.iv.next82 = add nuw nsw i64 %indvars.iv81, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%6 = sext i32 %sub to i64
%cmp3 = icmp slt i64 %indvars.iv.next82, %6
br i1 %cmp3, label %for.body4, label %for.end10.loopexit, !llvm.loop !11
for.end10.loopexit: ; preds = %for.body4
%7 = and i64 %indvars.iv.next82, 4294967295
br label %for.end10
for.end10: ; preds = %entry, %for.end10.loopexit, %for.cond2.preheader
%i.1.lcssa = phi i64 [ 0, %for.cond2.preheader ], [ %7, %for.end10.loopexit ], [ 0, %entry ]
%arrayidx12 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %i.1.lcssa
%8 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%9 = load i32, ptr %n, align 4, !tbaa !5
%cmp1578 = icmp sgt i32 %9, 1
br i1 %cmp1578, label %for.body16, label %for.end46
for.body16: ; preds = %for.end10, %for.end40
%10 = phi i32 [ %18, %for.end40 ], [ %9, %for.end10 ]
%indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.end40 ], [ 1, %for.end10 ]
%arrayidx18 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv84
%11 = load i32, ptr %arrayidx18, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body16, %while.body
%indvars.iv86 = phi i64 [ %indvars.iv84, %for.body16 ], [ %indvars.iv.next87, %while.body ]
%indvars.iv.next87 = add nsw i64 %indvars.iv86, -1
%idxprom21 = and i64 %indvars.iv.next87, 4294967295
%arrayidx22 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom21
%12 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %12, %11
br i1 %cmp23, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx27 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv86
store i32 %12, ptr %arrayidx27, align 4, !tbaa !5
%13 = icmp sgt i64 %indvars.iv86, 1
br i1 %13, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv86, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom29 = ashr exact i64 %sext, 32
%arrayidx30 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom29
store i32 %11, ptr %arrayidx30, align 4, !tbaa !5
%cmp3375 = icmp sgt i32 %10, 1
br i1 %cmp3375, label %for.body34, label %for.end40
for.body34: ; preds = %while.end, %for.body34
%indvars.iv89 = phi i64 [ %indvars.iv.next90, %for.body34 ], [ 0, %while.end ]
%arrayidx36 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv89
%14 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
%indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
%15 = load i32, ptr %n, align 4, !tbaa !5
%sub32 = add nsw i32 %15, -1
%16 = sext i32 %sub32 to i64
%cmp33 = icmp slt i64 %indvars.iv.next90, %16
br i1 %cmp33, label %for.body34, label %for.end40, !llvm.loop !13
for.end40: ; preds = %for.body34, %while.end
%k.0.lcssa = phi i64 [ 0, %while.end ], [ %indvars.iv.next90, %for.body34 ]
%idxprom41 = and i64 %k.0.lcssa, 4294967295
%arrayidx42 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom41
%17 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%call43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
%indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp15 = icmp slt i64 %indvars.iv.next85, %19
br i1 %cmp15, label %for.body16, label %for.end46, !llvm.loop !14
for.end46: ; preds = %for.end40, %for.end10
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#define N 101
void Printing(int arr[], int n){
int i;
for(i = 0; i < n-1; i++){
printf("%d ", arr[i]);
}
printf("%d\n", arr[n-1]);
}
void insertion(int arr[], int n) {
int key, i, j;
Printing(arr, n);
for (i = 1; i < n; i++) {
key = arr[i];
j = i - 1;
while(j >= 0 && key < arr[j]){
arr[j+1] = arr[j];
j--;
}
arr[j+1] = key;
Printing(arr, n);
}
}
int main() {
int n, i, arr[N];
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
insertion(arr, n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116146/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116146/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @Printing(ptr nocapture noundef readonly %arr, i32 noundef %n) local_unnamed_addr #0 {
entry:
%sub = add i32 %n, -1
%cmp9 = icmp sgt i32 %n, 1
br i1 %cmp9, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %sub 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 ]
%arrayidx = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%idxprom2 = sext i32 %sub to i64
%arrayidx3 = getelementptr inbounds i32, ptr %arr, i64 %idxprom2
%1 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%call4 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertion(ptr nocapture noundef %arr, i32 noundef %n) local_unnamed_addr #0 {
entry:
%sub.i = add i32 %n, -1
%cmp9.i = icmp sgt i32 %n, 1
br i1 %cmp9.i, label %for.body.preheader.i, label %Printing.exit.thread
Printing.exit.thread: ; preds = %entry
%idxprom2.i53 = sext i32 %sub.i to i64
%arrayidx3.i54 = getelementptr inbounds i32, ptr %arr, i64 %idxprom2.i53
%0 = load i32, ptr %arrayidx3.i54, align 4, !tbaa !5
%call4.i55 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
br label %for.end
for.body.preheader.i: ; preds = %entry
%wide.trip.count.i = zext i32 %sub.i to i64
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 0, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv.i
%1 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%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 %Printing.exit, label %for.body.i, !llvm.loop !9
Printing.exit: ; preds = %for.body.i
%idxprom2.i = sext i32 %sub.i to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %arr, i64 %idxprom2.i
%2 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%call4.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
br i1 %cmp9.i, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %Printing.exit
%wide.trip.count.i35 = zext i32 %sub.i to i64
%wide.trip.count = zext i32 %n to i64
br label %for.body.us
for.body.us: ; preds = %Printing.exit42.loopexit.us, %for.body.lr.ph
%indvars.iv = phi i64 [ %indvars.iv.next, %Printing.exit42.loopexit.us ], [ 1, %for.body.lr.ph ]
%arrayidx.us = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%3 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%indvars.iv48 = phi i64 [ %indvars.iv.next49, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next49 = add nsw i64 %indvars.iv48, -1
%idxprom2.us = and i64 %indvars.iv.next49, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %arr, i64 %idxprom2.us
%4 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp slt i32 %3, %4
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv48, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom10.us = ashr exact i64 %sext, 32
%arrayidx11.us = getelementptr inbounds i32, ptr %arr, i64 %idxprom10.us
store i32 %3, ptr %arrayidx11.us, align 4, !tbaa !5
br label %for.body.i36.us
for.body.i36.us: ; preds = %for.body.i36.us, %while.end.us
%indvars.iv.i37.us = phi i64 [ 0, %while.end.us ], [ %indvars.iv.next.i40.us, %for.body.i36.us ]
%arrayidx.i38.us = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv.i37.us
%5 = load i32, ptr %arrayidx.i38.us, align 4, !tbaa !5
%call.i39.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%indvars.iv.next.i40.us = add nuw nsw i64 %indvars.iv.i37.us, 1
%exitcond.not.i41.us = icmp eq i64 %indvars.iv.next.i40.us, %wide.trip.count.i35
br i1 %exitcond.not.i41.us, label %Printing.exit42.loopexit.us, label %for.body.i36.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv48
store i32 %4, ptr %arrayidx8.us, align 4, !tbaa !5
%6 = icmp sgt i64 %indvars.iv48, 1
br i1 %6, label %land.rhs.us, label %while.end.us, !llvm.loop !11
Printing.exit42.loopexit.us: ; preds = %for.body.i36.us
%7 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%call4.i33.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%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.us, !llvm.loop !12
for.end: ; preds = %Printing.exit42.loopexit.us, %Printing.exit.thread, %Printing.exit
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%arr = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %arr) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %0, 0
br i1 %cmp4, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [101 x i32], ptr %arr, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, 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 !13
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @insertion(ptr noundef nonnull %arr, i32 noundef %.lcssa)
call void @llvm.lifetime.end.p0(i64 404, ptr nonnull %arr) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(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"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int main() {
int N;
scanf("%d", &N);
int* A = (int*)malloc(sizeof(int) * N);
for (int i = 0; i < N; i++) {
scanf("%d", &A[i]);
}
for (int i = 0; i < N; i++) {
int v = A[i], j;
for (j = i - 1; j >= 0 && A[j] > v; j--) {
A[j + 1] = A[j];
}
A[j + 1] = v;
for (int k = 0; k < N; k++) {
if (k) printf(" ");
printf("%d", A[k]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116197/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116197/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #6
%cmp66 = icmp sgt i32 %0, 0
br i1 %cmp66, label %for.body, label %for.cond.cleanup8
for.cond5.preheader: ; preds = %for.body
%cmp675 = icmp sgt i32 %1, 0
br i1 %cmp675, label %for.body9, label %for.cond.cleanup8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !9
for.cond.cleanup8: ; preds = %for.cond.cleanup32, %entry, %for.cond5.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
for.body9: ; preds = %for.cond5.preheader, %for.cond.cleanup32
%3 = phi i32 [ %8, %for.cond.cleanup32 ], [ %1, %for.cond5.preheader ]
%indvars.iv78 = phi i64 [ %indvars.iv.next79, %for.cond.cleanup32 ], [ 0, %for.cond5.preheader ]
%arrayidx11 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv78
%4 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp1369.not = icmp eq i64 %indvars.iv78, 0
br i1 %cmp1369.not, label %for.end25, label %land.rhs
land.rhs: ; preds = %for.body9, %for.body19
%indvars.iv80 = phi i64 [ %indvars.iv.next81, %for.body19 ], [ %indvars.iv78, %for.body9 ]
%indvars.iv.next81 = add nsw i64 %indvars.iv80, -1
%idxprom15 = and i64 %indvars.iv.next81, 4294967295
%arrayidx16 = getelementptr inbounds i32, ptr %call1, i64 %idxprom15
%5 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %5, %4
br i1 %cmp17, label %for.body19, label %for.end25
for.body19: ; preds = %land.rhs
%arrayidx23 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv80
store i32 %5, ptr %arrayidx23, align 4, !tbaa !5
%6 = icmp sgt i64 %indvars.iv80, 1
br i1 %6, label %land.rhs, label %for.end25, !llvm.loop !11
for.end25: ; preds = %land.rhs, %for.body19, %for.body9
%j.0.in.lcssa = phi i64 [ 0, %for.body9 ], [ 0, %for.body19 ], [ %indvars.iv80, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom27 = ashr exact i64 %sext, 32
%arrayidx28 = getelementptr inbounds i32, ptr %call1, i64 %idxprom27
store i32 %4, ptr %arrayidx28, align 4, !tbaa !5
%cmp3073 = icmp sgt i32 %3, 0
br i1 %cmp3073, label %if.end.peel, label %for.cond.cleanup32
if.end.peel: ; preds = %for.end25
%.pre = load i32, ptr %call1, align 4, !tbaa !5
%call37.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%7 = load i32, ptr %N, align 4, !tbaa !5
%cmp30.peel = icmp sgt i32 %7, 1
br i1 %cmp30.peel, label %if.end, label %for.cond.cleanup32
for.cond.cleanup32: ; preds = %if.end, %if.end.peel, %for.end25
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%8 = load i32, ptr %N, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp6 = icmp slt i64 %indvars.iv.next79, %9
br i1 %cmp6, label %for.body9, label %for.cond.cleanup8, !llvm.loop !12
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv83 = phi i64 [ %indvars.iv.next84, %if.end ], [ 1, %if.end.peel ]
%putchar65 = call i32 @putchar(i32 32)
%arrayidx36 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv83
%10 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%11 = load i32, ptr %N, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp30 = icmp slt i64 %indvars.iv.next84, %12
br i1 %cmp30, label %if.end, label %for.cond.cleanup32, !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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10, !14}
!14 = !{!"llvm.loop.peeled.count", i32 1}
|
#include<stdio.h>
#include<math.h>
int main (void) {
long long int b,count=0;
int i;
scanf("%lld",&b);
for(i=1;i<sqrt(b);i++) {
if(b%i==0)
count+=2;
}
if(i-sqrt(b)<0.00001)
count++;
printf("%lld\n",count);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11624/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11624/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i64, ptr %b, align 8, !tbaa !5
%conv121 = sitofp i64 %0 to double
%call222 = call double @sqrt(double noundef %conv121) #4
%cmp23 = fcmp ogt double %call222, 1.000000e+00
br i1 %cmp23, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%count.024 = phi i64 [ %spec.select, %for.body ], [ 0, %entry ]
%1 = load i64, ptr %b, align 8, !tbaa !5
%rem = srem i64 %1, %indvars.iv
%cmp5 = icmp eq i64 %rem, 0
%add = add nsw i64 %count.024, 2
%spec.select = select i1 %cmp5, i64 %add, i64 %count.024
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%2 = trunc i64 %indvars.iv.next to i32
%conv = sitofp i32 %2 to double
%conv1 = sitofp i64 %1 to double
%call2 = call double @sqrt(double noundef %conv1) #4
%cmp = fcmp ogt double %call2, %conv
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%count.0.lcssa = phi i64 [ 0, %entry ], [ %spec.select, %for.body ]
%conv.lcssa = phi double [ 1.000000e+00, %entry ], [ %conv, %for.body ]
%3 = load i64, ptr %b, align 8, !tbaa !5
%conv8 = sitofp i64 %3 to double
%call9 = call double @sqrt(double noundef %conv8) #4
%sub = fsub double %conv.lcssa, %call9
%cmp10 = fcmp olt double %sub, 1.000000e-05
%inc13 = zext i1 %cmp10 to i64
%count.2 = add nsw i64 %count.0.lcssa, %inc13
%call15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %count.2)
call void @llvm.lifetime.end.p0(i64 8, 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 nofree nounwind willreturn memory(write)
declare double @sqrt(double 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(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int i,j=0,N=0,v,x;
scanf("%d",&N);
int A[N];
for(i=0;i<N;i++) scanf("%d",&A[i]);
for(i=0;i<N-1;i++) printf("%d ",A[i]);
printf("%d",A[N-1]);
printf("\n");
for(i=1;i<N;i++){
v = A[i];
j=i-1;
while(j >=0 && A[j] > v){
A[j+1] = A[j];
j--;
}
A[j+1] = v;
for(x=0;x<N-1;x++){
printf("%d ",A[x]);
}
printf("%d",A[N-1]);
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116283/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116283/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; 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
store i32 0, ptr %N, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%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
%cmp69 = icmp sgt i32 %3, 0
br i1 %cmp69, label %for.body, label %for.cond2.preheader.for.end10_crit_edge
for.cond2.preheader: ; preds = %for.body
%cmp372 = icmp sgt i32 %5, 1
br i1 %cmp372, label %for.body4, label %for.cond2.preheader.for.end10_crit_edge
for.cond2.preheader.for.end10_crit_edge: ; preds = %entry, %for.cond2.preheader
%4 = phi i32 [ %5, %for.cond2.preheader ], [ %3, %entry ]
%sub71 = add nsw i32 %4, -1
%.pre = sext i32 %sub71 to i64
br label %for.end10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv86
%7 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
%8 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %8, -1
%9 = sext i32 %sub to i64
%cmp3 = icmp slt i64 %indvars.iv.next87, %9
br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.body4, %for.cond2.preheader.for.end10_crit_edge
%idxprom12.pre-phi = phi i64 [ %.pre, %for.cond2.preheader.for.end10_crit_edge ], [ %9, %for.body4 ]
%arrayidx13 = getelementptr inbounds i32, ptr %vla, i64 %idxprom12.pre-phi
%10 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
%putchar = call i32 @putchar(i32 10)
%11 = load i32, ptr %N, align 4, !tbaa !5
%cmp1781 = icmp sgt i32 %11, 1
br i1 %cmp1781, label %for.body18, label %for.end50
for.body18: ; preds = %for.end10, %for.end42
%12 = phi i32 [ %20, %for.end42 ], [ %11, %for.end10 ]
%indvars.iv89 = phi i64 [ %indvars.iv.next90, %for.end42 ], [ 1, %for.end10 ]
%arrayidx20 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv89
%13 = load i32, ptr %arrayidx20, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body18, %while.body
%indvars.iv91 = phi i64 [ %indvars.iv89, %for.body18 ], [ %indvars.iv.next92, %while.body ]
%indvars.iv.next92 = add nsw i64 %indvars.iv91, -1
%idxprom23 = and i64 %indvars.iv.next92, 4294967295
%arrayidx24 = getelementptr inbounds i32, ptr %vla, i64 %idxprom23
%14 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%cmp25 = icmp sgt i32 %14, %13
br i1 %cmp25, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx29 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv91
store i32 %14, ptr %arrayidx29, align 4, !tbaa !5
%15 = icmp sgt i64 %indvars.iv91, 1
br i1 %15, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv91, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom31 = ashr exact i64 %sext, 32
%arrayidx32 = getelementptr inbounds i32, ptr %vla, i64 %idxprom31
store i32 %13, ptr %arrayidx32, align 4, !tbaa !5
%cmp3578 = icmp sgt i32 %12, 1
br i1 %cmp3578, label %for.body36, label %while.end.for.end42_crit_edge
while.end.for.end42_crit_edge: ; preds = %while.end
%sub3477 = add nsw i32 %12, -1
%.pre100 = sext i32 %sub3477 to i64
br label %for.end42
for.body36: ; preds = %while.end, %for.body36
%indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.body36 ], [ 0, %while.end ]
%arrayidx38 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv94
%16 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16)
%indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
%17 = load i32, ptr %N, align 4, !tbaa !5
%sub34 = add nsw i32 %17, -1
%18 = sext i32 %sub34 to i64
%cmp35 = icmp slt i64 %indvars.iv.next95, %18
br i1 %cmp35, label %for.body36, label %for.end42, !llvm.loop !13
for.end42: ; preds = %for.body36, %while.end.for.end42_crit_edge
%idxprom44.pre-phi = phi i64 [ %.pre100, %while.end.for.end42_crit_edge ], [ %18, %for.body36 ]
%arrayidx45 = getelementptr inbounds i32, ptr %vla, i64 %idxprom44.pre-phi
%19 = load i32, ptr %arrayidx45, align 4, !tbaa !5
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %19)
%putchar68 = call i32 @putchar(i32 10)
%indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
%20 = load i32, ptr %N, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp17 = icmp slt i64 %indvars.iv.next90, %21
br i1 %cmp17, label %for.body18, label %for.end50, !llvm.loop !14
for.end50: ; preds = %for.end42, %for.end10
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
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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = distinct !{!14, !10}
|
#include <stdio.h>
int main()
{
int N, //数列の長さを表す整数 N
A[1000], key, i, j, k;
/*入力*/
scanf("%d", &N);
if(N < 1 || 100 < N)
printf("ERROR:1以上100以下の数列の長さを入力してください。");
for(i = 0; i < N; i++)
scanf("%d", &A[i]);
/*挿入ソート*/
for(i = 0; i < N; i++) //i が 1 から N-1 まで
{
key = A[i];
j = i - 1;
while(j >= 0 && A[j] > key)
{
A[j + 1] = A[j];
j--;
A[j + 1] = key;
}
for(k = 0; k < N - 1; k++)
{
printf("%d ", A[k]);
}
printf("%d\n", A[k]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116326/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116326/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [71 x i8] c"ERROR:1\E4\BB\A5\E4\B8\8A100\E4\BB\A5\E4\B8\8B\E3\81\AE\E6\95\B0\E5\88\97\E3\81\AE\E9\95\B7\E3\81\95\E3\82\92\E5\85\A5\E5\8A\9B\E3\81\97\E3\81\A6\E3\81\8F\E3\81\A0\E3\81\95\E3\81\84\E3\80\82\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%A = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #3
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4
%1 = add i32 %0, -101
%or.cond = icmp ult i32 %1, -100
br i1 %or.cond, label %if.end, label %for.body.preheader
if.end: ; preds = %entry
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%.pre = load i32, ptr %N, align 4, !tbaa !5
%cmp353 = icmp sgt i32 %.pre, 0
br i1 %cmp353, label %for.body.preheader, label %for.end36
for.body.preheader: ; preds = %entry, %if.end
br label %for.body
for.cond5.preheader: ; preds = %for.body
%cmp662 = icmp sgt i32 %2, 0
br i1 %cmp662, label %for.body7, label %for.end36
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %N, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp3 = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp3, label %for.body, label %for.cond5.preheader, !llvm.loop !9
for.body7: ; preds = %for.cond5.preheader, %for.end30
%4 = phi i32 [ %12, %for.end30 ], [ %2, %for.cond5.preheader ]
%indvars.iv65 = phi i64 [ %indvars.iv.next66, %for.end30 ], [ 0, %for.cond5.preheader ]
%arrayidx9 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv65
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp1056.not = icmp eq i64 %indvars.iv65, 0
br i1 %cmp1056.not, label %while.end, label %land.rhs
land.rhs: ; preds = %for.body7, %while.body
%indvars.iv67 = phi i64 [ %indvars.iv.next68, %while.body ], [ %indvars.iv65, %for.body7 ]
%indvars.iv.next68 = add nsw i64 %indvars.iv67, -1
%idxprom11 = and i64 %indvars.iv.next68, 4294967295
%arrayidx12 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom11
%6 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp sgt i32 %6, %5
br i1 %cmp13, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx17 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv67
store i32 %6, ptr %arrayidx17, align 4, !tbaa !5
store i32 %5, ptr %arrayidx12, align 4, !tbaa !5
%7 = icmp sgt i64 %indvars.iv67, 1
br i1 %7, label %land.rhs, label %while.end, !llvm.loop !11
while.end: ; preds = %land.rhs, %while.body, %for.body7
%cmp2360 = icmp sgt i32 %4, 1
br i1 %cmp2360, label %for.body24, label %for.end30
for.body24: ; preds = %while.end, %for.body24
%indvars.iv70 = phi i64 [ %indvars.iv.next71, %for.body24 ], [ 0, %while.end ]
%arrayidx26 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv70
%8 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
%9 = load i32, ptr %N, align 4, !tbaa !5
%sub22 = add nsw i32 %9, -1
%10 = sext i32 %sub22 to i64
%cmp23 = icmp slt i64 %indvars.iv.next71, %10
br i1 %cmp23, label %for.body24, label %for.end30, !llvm.loop !12
for.end30: ; preds = %for.body24, %while.end
%k.0.lcssa = phi i64 [ 0, %while.end ], [ %indvars.iv.next71, %for.body24 ]
%idxprom31 = and i64 %k.0.lcssa, 4294967295
%arrayidx32 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom31
%11 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %11)
%indvars.iv.next66 = add nuw nsw i64 %indvars.iv65, 1
%12 = load i32, ptr %N, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp6 = icmp slt i64 %indvars.iv.next66, %13
br i1 %cmp6, label %for.body7, label %for.end36, !llvm.loop !13
for.end36: ; preds = %for.end30, %if.end, %for.cond5.preheader
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
typedef long long int lli;
int main(void)
{
lli b,count=0;
scanf("%lld",&b);
for(lli y=2;y*y<=b;y++)
{
if(b%y==0)
count+=2;
if(y*y==b)
{
count-=1;
}
}
if(b==1)
printf("1\n");
else
printf("%lld\n",count+2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11637/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11637/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\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:
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %b)
%0 = load i64, ptr %b, align 8, !tbaa !5
%cmp.not19 = icmp slt i64 %0, 4
br i1 %cmp.not19, label %for.cond.cleanup, label %for.body
for.cond.cleanup.loopexit: ; preds = %for.body
%1 = add nsw i64 %count.2, 2
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.cond.cleanup.loopexit, %entry
%count.0.lcssa = phi i64 [ 2, %entry ], [ %1, %for.cond.cleanup.loopexit ]
%cmp6 = icmp eq i64 %0, 1
br i1 %cmp6, label %if.then7, label %if.else
for.body: ; preds = %entry, %for.body
%mul22 = phi i64 [ %mul, %for.body ], [ 4, %entry ]
%y.021 = phi i64 [ %inc, %for.body ], [ 2, %entry ]
%count.020 = phi i64 [ %count.2, %for.body ], [ 0, %entry ]
%rem = srem i64 %0, %y.021
%cmp1 = icmp eq i64 %rem, 0
%add = add nsw i64 %count.020, 2
%spec.select = select i1 %cmp1, i64 %add, i64 %count.020
%cmp3 = icmp eq i64 %mul22, %0
%sub = sext i1 %cmp3 to i64
%count.2 = add nsw i64 %spec.select, %sub
%inc = add nuw nsw i64 %y.021, 1
%mul = mul nsw i64 %inc, %inc
%cmp.not = icmp sgt i64 %mul, %0
br i1 %cmp.not, label %for.cond.cleanup.loopexit, label %for.body, !llvm.loop !9
if.then7: ; preds = %for.cond.cleanup
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end11
if.else: ; preds = %for.cond.cleanup
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %count.0.lcssa)
br label %if.end11
if.end11: ; preds = %if.else, %if.then7
call void @llvm.lifetime.end.p0(i64 8, 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
void PrintAll(int A[],int N){
int i;
for(i=0; i<N; i++){
if(i != 0) printf(" ");
printf("%d",A[i]);
}
printf("\n");
}
void insertionSort(int A[],int N){
int i,j,v;
for(i=1; i<N; i++){
v = A[i];
j = i-1;
while(j>=0 && A[j] > v){
A[j+1] = A[j];
j--;
A[j+1] = v;
}
PrintAll(A,N);
}
}
int main(){
int i,N;
int A[1000];
scanf("%d",&N);
for(i=0; i<N; i++) scanf("%d",&A[i]);
PrintAll(A,N);
insertionSort(A,N);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116412/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116412/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @PrintAll(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp8 = icmp sgt i32 %N, 0
br i1 %cmp8, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %N to i64
%.pre = load i32, ptr %A, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %N, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp31 = icmp sgt i32 %N, 1
br i1 %cmp31, label %for.body.us.preheader, label %for.end
for.body.us.preheader: ; preds = %entry
%wide.trip.count.i = zext i32 %N to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %PrintAll.exit.loopexit.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %PrintAll.exit.loopexit.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%indvars.iv35 = phi i64 [ %indvars.iv.next36, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next36 = add nsw i64 %indvars.iv35, -1
%idxprom2.us = and i64 %indvars.iv.next36, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us
%1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %1, %0
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%.pre.i.us = load i32, ptr %A, align 4, !tbaa !5
%call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us)
br label %if.end.i.us
if.end.i.us: ; preds = %while.end.us, %if.end.i.us
%indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ]
%putchar7.i.us = tail call i32 @putchar(i32 32)
%arrayidx.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us
%2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %PrintAll.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv35
store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5
store i32 %0, ptr %arrayidx3.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv35, 1
br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12
PrintAll.exit.loopexit.us: ; preds = %if.end.i.us
%putchar.i.us = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i
br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13
for.end: ; preds = %PrintAll.exit.loopexit.us, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%A = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %PrintAll.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], 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 !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body
%cmp8.i = icmp sgt i32 %1, 0
br i1 %cmp8.i, label %if.end.peel.i, label %PrintAll.exit
if.end.peel.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %1 to i64
%.pre.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %1, 1
br i1 %exitcond.peel.not.i, label %PrintAll.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 1, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%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 %PrintAll.exit, label %if.end.i, !llvm.loop !9
PrintAll.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp31.i = icmp sgt i32 %4, 1
br i1 %cmp31.i, label %for.body.us.preheader.i, label %insertionSort.exit
for.body.us.preheader.i: ; preds = %PrintAll.exit
%wide.trip.count.i.i = zext i32 %4 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %PrintAll.exit.loopexit.us.i, %for.body.us.preheader.i
%indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %PrintAll.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i5
%5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i
%indvars.iv35.i = phi i64 [ %indvars.iv.next36.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ]
%indvars.iv.next36.i = add nsw i64 %indvars.iv35.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next36.i, 4294967295
%arrayidx3.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us.i
%6 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %6, %5
br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%.pre.i.us.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i)
br label %if.end.i.us.i
if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i
%indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ]
%putchar7.i.us.i = call i32 @putchar(i32 32)
%arrayidx.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i
%7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %PrintAll.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv35.i
store i32 %6, ptr %arrayidx8.us.i, align 4, !tbaa !5
store i32 %5, ptr %arrayidx3.us.i, align 4, !tbaa !5
%8 = icmp sgt i64 %indvars.iv35.i, 1
br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12
PrintAll.exit.loopexit.us.i: ; preds = %if.end.i.us.i
%putchar.i.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1
%exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i
br i1 %exitcond.not.i7, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !13
insertionSort.exit: ; preds = %PrintAll.exit.loopexit.us.i, %PrintAll.exit
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main()
{
int i,v,j,num,N,k;
scanf("%d",&N);
int A[N];
for(i=0;i<N;i++)
{
scanf("%d",&num);
A[i]=num;
}
for(i=1;i<N;i++)
{
for(k=0;k<N-1;k++)
{
printf("%d ",A[k]);
}
printf("%d\n",A[N-1]);
v=A[i];
j=i-1;
while(j>=0 && A[j]>v)
{
A[j+1]=A[j];
j--;
}
A[j+1]=v;
}
for(k=0;k<N-1;k++)
{
printf("%d ",A[k]);
}
printf("%d\n",A[N-1]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116456/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116456/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%num = alloca i32, align 4
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %num) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp66 = icmp sgt i32 %3, 0
br i1 %cmp66, label %for.body, label %for.cond35.preheader.for.end44_crit_edge
for.cond2.preheader: ; preds = %for.body
%cmp374 = icmp sgt i32 %5, 1
br i1 %cmp374, label %for.cond5.preheader, label %for.cond35.preheader.for.end44_crit_edge
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%4 = load i32, ptr %num, align 4, !tbaa !5
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
store i32 %4, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.cond5.preheader: ; preds = %for.cond2.preheader, %while.end
%7 = phi i32 [ %16, %while.end ], [ %5, %for.cond2.preheader ]
%indvars.iv86 = phi i64 [ %indvars.iv.next87, %while.end ], [ 1, %for.cond2.preheader ]
%cmp669 = icmp sgt i32 %7, 1
br i1 %cmp669, label %for.body7, label %for.cond5.preheader.for.end13_crit_edge
for.cond5.preheader.for.end13_crit_edge: ; preds = %for.cond5.preheader
%sub68 = add nsw i32 %7, -1
%.pre = sext i32 %sub68 to i64
br label %for.end13
for.cond35.preheader: ; preds = %while.end
%cmp3777 = icmp sgt i32 %16, 1
br i1 %cmp3777, label %for.body38, label %for.cond35.preheader.for.end44_crit_edge
for.cond35.preheader.for.end44_crit_edge: ; preds = %entry, %for.cond2.preheader, %for.cond35.preheader
%8 = phi i32 [ %16, %for.cond35.preheader ], [ %5, %for.cond2.preheader ], [ %3, %entry ]
%sub3676 = add nsw i32 %8, -1
%.pre97 = sext i32 %sub3676 to i64
br label %for.end44
for.body7: ; preds = %for.cond5.preheader, %for.body7
%indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body7 ], [ 0, %for.cond5.preheader ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv83
%9 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %9)
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%10 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %10, -1
%11 = sext i32 %sub to i64
%cmp6 = icmp slt i64 %indvars.iv.next84, %11
br i1 %cmp6, label %for.body7, label %for.end13, !llvm.loop !11
for.end13: ; preds = %for.body7, %for.cond5.preheader.for.end13_crit_edge
%idxprom15.pre-phi = phi i64 [ %.pre, %for.cond5.preheader.for.end13_crit_edge ], [ %11, %for.body7 ]
%arrayidx16 = getelementptr inbounds i32, ptr %vla, i64 %idxprom15.pre-phi
%12 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %12)
%arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv86
%13 = load i32, ptr %arrayidx19, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.end13, %while.body
%indvars.iv88 = phi i64 [ %indvars.iv86, %for.end13 ], [ %indvars.iv.next89, %while.body ]
%indvars.iv.next89 = add nsw i64 %indvars.iv88, -1
%idxprom22 = and i64 %indvars.iv.next89, 4294967295
%arrayidx23 = getelementptr inbounds i32, ptr %vla, i64 %idxprom22
%14 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %14, %13
br i1 %cmp24, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx28 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv88
store i32 %14, ptr %arrayidx28, align 4, !tbaa !5
%15 = icmp sgt i64 %indvars.iv88, 1
br i1 %15, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv88, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom30 = ashr exact i64 %sext, 32
%arrayidx31 = getelementptr inbounds i32, ptr %vla, i64 %idxprom30
store i32 %13, ptr %arrayidx31, align 4, !tbaa !5
%indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
%16 = load i32, ptr %N, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp3 = icmp slt i64 %indvars.iv.next87, %17
br i1 %cmp3, label %for.cond5.preheader, label %for.cond35.preheader, !llvm.loop !13
for.body38: ; preds = %for.cond35.preheader, %for.body38
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body38 ], [ 0, %for.cond35.preheader ]
%arrayidx40 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv93
%18 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %18)
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%19 = load i32, ptr %N, align 4, !tbaa !5
%sub36 = add nsw i32 %19, -1
%20 = sext i32 %sub36 to i64
%cmp37 = icmp slt i64 %indvars.iv.next94, %20
br i1 %cmp37, label %for.body38, label %for.end44, !llvm.loop !14
for.end44: ; preds = %for.body38, %for.cond35.preheader.for.end44_crit_edge
%idxprom46.pre-phi = phi i64 [ %.pre97, %for.cond35.preheader.for.end44_crit_edge ], [ %20, %for.body38 ]
%arrayidx47 = getelementptr inbounds i32, ptr %vla, i64 %idxprom46.pre-phi
%21 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, 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: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main() {
int t;
scanf("%d",&t);
while (t--)
{
long long int a, b, x, y, z;
scanf("%lld%lld",&a, &b);
if(b == 1) {
printf("NO\n");
continue;
}
z = a * b * 2;
x = a;
y = z - a;
printf("YES\n");
printf("%lld %lld %lld\n", x, y, z);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_1165/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_1165/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%lld%lld\00", align 1
@.str.4 = private unnamed_addr constant [16 x i8] c"%lld %lld %lld\0A\00", align 1
@str = private unnamed_addr constant [4 x i8] c"YES\00", align 1
@str.5 = private unnamed_addr constant [3 x i8] c"NO\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%a = alloca i64, align 8
%b = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec13 = add nsw i32 %0, -1
store i32 %dec13, ptr %t, align 4, !tbaa !5
%tobool.not14 = icmp eq i32 %0, 0
br i1 %tobool.not14, label %while.end, label %while.body
while.body: ; preds = %entry, %cleanup
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i64, ptr %b, align 8, !tbaa !9
%cmp = icmp eq i64 %1, 1
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %while.body
%puts12 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %cleanup, !llvm.loop !11
if.end: ; preds = %while.body
%2 = load i64, ptr %a, align 8, !tbaa !9
%mul = shl i64 %1, 1
%mul3 = mul i64 %mul, %2
%sub = sub nsw i64 %mul3, %2
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %2, i64 noundef %sub, i64 noundef %mul3)
br label %cleanup
cleanup: ; preds = %if.end, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
%3 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %3, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %3, 0
br i1 %tobool.not, label %while.end, label %while.body
while.end: ; preds = %cleanup, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(void)
{
int n,i,j,k,v,a[100];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i=0;i<n;i++){
v= a[i];
j=i-1;
while(j>=0 && a[j]>v){
a[j+1]=a[j];
j--;
}
a[j+1]=v;
for(k=0;k<n;k++){
if(k>0){
printf(" ");
}
printf("%d",a[k]);
if(k==n-1){
printf("\n");
}
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116542/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116542/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%a = 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 %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
%cmp54 = icmp sgt i32 %0, 0
br i1 %cmp54, label %for.body, label %for.end36
for.cond2.preheader: ; preds = %for.body
%cmp363 = icmp sgt i32 %1, 0
br i1 %cmp363, label %for.body4, label %for.end36
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.inc34
%3 = phi i32 [ %14, %for.inc34 ], [ %1, %for.cond2.preheader ]
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.inc34 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv66
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp757.not = icmp eq i64 %indvars.iv66, 0
br i1 %cmp757.not, label %while.end, label %land.rhs
land.rhs: ; preds = %for.body4, %while.body
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %while.body ], [ %indvars.iv66, %for.body4 ]
%indvars.iv.next69 = add nsw i64 %indvars.iv68, -1
%idxprom8 = and i64 %indvars.iv.next69, 4294967295
%arrayidx9 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom8
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %5, %4
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx14 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv68
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
%6 = icmp sgt i64 %indvars.iv68, 1
br i1 %6, label %land.rhs, label %while.end, !llvm.loop !11
while.end: ; preds = %land.rhs, %while.body, %for.body4
%j.0.in.lcssa = phi i64 [ 0, %for.body4 ], [ 0, %while.body ], [ %indvars.iv68, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom16 = ashr exact i64 %sext, 32
%arrayidx17 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom16
store i32 %4, ptr %arrayidx17, align 4, !tbaa !5
%cmp1961 = icmp sgt i32 %3, 0
br i1 %cmp1961, label %if.end.peel, label %for.inc34
if.end.peel: ; preds = %while.end
%.pre = load i32, ptr %a, align 16, !tbaa !5
%call25.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp27.peel = icmp eq i32 %7, 1
br i1 %cmp27.peel, label %if.then28.peel, label %for.inc31.peel
if.then28.peel: ; preds = %if.end.peel
%putchar53.peel = call i32 @putchar(i32 10)
%.pre78 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc31.peel
for.inc31.peel: ; preds = %if.then28.peel, %if.end.peel
%8 = phi i32 [ %.pre78, %if.then28.peel ], [ %7, %if.end.peel ]
%cmp19.peel = icmp sgt i32 %8, 1
br i1 %cmp19.peel, label %if.end, label %for.inc34
if.end: ; preds = %for.inc31.peel, %for.inc31
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.inc31 ], [ 1, %for.inc31.peel ]
%putchar = call i32 @putchar(i32 32)
%arrayidx24 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv71
%9 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %9)
%10 = load i32, ptr %n, align 4, !tbaa !5
%sub26 = add nsw i32 %10, -1
%11 = zext i32 %sub26 to i64
%cmp27 = icmp eq i64 %indvars.iv71, %11
br i1 %cmp27, label %if.then28, label %for.inc31
if.then28: ; preds = %if.end
%putchar53 = call i32 @putchar(i32 10)
%.pre79 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc31
for.inc31: ; preds = %if.end, %if.then28
%12 = phi i32 [ %10, %if.end ], [ %.pre79, %if.then28 ]
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%13 = sext i32 %12 to i64
%cmp19 = icmp slt i64 %indvars.iv.next72, %13
br i1 %cmp19, label %if.end, label %for.inc34, !llvm.loop !12
for.inc34: ; preds = %for.inc31, %for.inc31.peel, %while.end
%14 = phi i32 [ %3, %while.end ], [ %8, %for.inc31.peel ], [ %12, %for.inc31 ]
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%15 = sext i32 %14 to i64
%cmp3 = icmp slt i64 %indvars.iv.next67, %15
br i1 %cmp3, label %for.body4, label %for.end36, !llvm.loop !14
for.end36: ; preds = %for.inc34, %entry, %for.cond2.preheader
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: 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 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
#include <stdlib.h>
#define BUFSIZE (1024)
char buf[BUFSIZE];
long
readnum()
{
long ret;
char *bp;
bp = fgets(buf, BUFSIZE, stdin);
if (bp == NULL) goto err;
ret = atol(buf);
return ret;
err:
perror("error fgets");
exit(EXIT_FAILURE);
}
void
print_arr(int *arr, int sz)
{
int idx;
printf("%d", arr[0]);
for (idx = 1; idx < sz; ++idx) {
printf(" %d", arr[idx]);
}
puts("");
}
#define MAX(a, b) ((a) < (b) ? (b) : (a))
#define MIN(a, b) ((a) > (b) ? (b) : (a))
int
main()
{
long num;
int na[100];
long tn;
int idx;
char *rp;
char *nrp;
int ic;
int rv;
tn = readnum();
rp = fgets(buf, BUFSIZE, stdin);
for (idx = 0; idx < tn; ++idx) {
num = strtol(rp, &nrp, 10);
na[idx] = num;
if (rp == nrp) goto err;
rp = nrp;
}
print_arr(na, tn);
for (ic = 1; ic < tn; ++ic) {
rv = na[ic];
for (idx = ic; 0 < idx; --idx) {
if (na[idx - 1] < rv) break;
na[idx] = na[idx - 1];
}
na[idx] = rv;
print_arr(na, tn);
}
exit(EXIT_SUCCESS);
err:
exit(EXIT_FAILURE);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116593/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116593/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@buf = dso_local global [1024 x i8] zeroinitializer, align 16
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [12 x i8] c"error fgets\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
; Function Attrs: nounwind uwtable
define dso_local i64 @readnum() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 1024, ptr noundef %0)
%cmp = icmp eq ptr %call, null
br i1 %cmp, label %err, label %if.end
if.end: ; preds = %entry
%call.i = tail call i64 @strtol(ptr nocapture noundef nonnull @buf, ptr noundef null, i32 noundef 10) #9
ret i64 %call.i
err: ; preds = %entry
tail call void @perror(ptr noundef nonnull @.str) #10
tail call void @exit(i32 noundef 1) #11
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: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare void @perror(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @print_arr(ptr nocapture noundef readonly %arr, i32 noundef %sz) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %arr, align 4, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%cmp7 = icmp sgt i32 %sz, 1
br i1 %cmp7, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %sz to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%arrayidx1 = getelementptr inbounds i32, ptr %arr, i64 %indvars.iv
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !9
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: noreturn nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #5 {
entry:
%na = alloca [100 x i32], align 16
%nrp = alloca ptr, align 8
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %na) #9
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %nrp) #9
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call.i = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 1024, ptr noundef %0)
%cmp.i = icmp eq ptr %call.i, null
br i1 %cmp.i, label %err.i, label %readnum.exit
err.i: ; preds = %entry
tail call void @perror(ptr noundef nonnull @.str) #10
tail call void @exit(i32 noundef 1) #11
unreachable
readnum.exit: ; preds = %entry
%call.i.i = tail call i64 @strtol(ptr nocapture noundef nonnull @buf, ptr noundef null, i32 noundef 10) #9
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call1 = tail call ptr @fgets(ptr noundef nonnull @buf, i32 noundef 1024, ptr noundef %1)
%cmp69 = icmp sgt i64 %call.i.i, 0
tail call void @llvm.assume(i1 %cmp69)
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, %call.i.i
br i1 %exitcond.not, label %for.end.loopexit, label %for.body, !llvm.loop !13
for.body: ; preds = %readnum.exit, %for.cond
%indvars.iv = phi i64 [ %indvars.iv.next, %for.cond ], [ 0, %readnum.exit ]
%rp.070 = phi ptr [ %2, %for.cond ], [ %call1, %readnum.exit ]
%call3 = call i64 @strtol(ptr noundef %rp.070, ptr noundef nonnull %nrp, i32 noundef 10) #9
%conv4 = trunc i64 %call3 to i32
%arrayidx = getelementptr inbounds [100 x i32], ptr %na, i64 0, i64 %indvars.iv
store i32 %conv4, ptr %arrayidx, align 4, !tbaa !9
%2 = load ptr, ptr %nrp, align 8, !tbaa !5
%cmp5 = icmp eq ptr %rp.070, %2
br i1 %cmp5, label %err, label %for.cond
for.end.loopexit: ; preds = %for.cond
%.pre = load i32, ptr %na, align 16, !tbaa !9
%conv7 = trunc i64 %call.i.i to i32
%call.i56 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%cmp7.i = icmp sgt i32 %conv7, 1
br i1 %cmp7.i, label %for.body.preheader.i, label %print_arr.exit.thread
for.body.preheader.i: ; preds = %for.end.loopexit
%wide.trip.count.i = and i64 %call.i.i, 4294967295
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ 1, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.body.i ]
%arrayidx1.i = getelementptr inbounds i32, ptr %na, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx1.i, align 4, !tbaa !9
%call2.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %3)
%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 %print_arr.exit, label %for.body.i, !llvm.loop !11
print_arr.exit: ; preds = %for.body.i
%putchar.i = tail call i32 @putchar(i32 10)
%cmp1074 = icmp ugt i64 %call.i.i, 1
br i1 %cmp1074, label %for.body12.lr.ph, label %for.end38
print_arr.exit.thread: ; preds = %for.end.loopexit
%putchar.i98 = tail call i32 @putchar(i32 10)
%cmp107499 = icmp ugt i64 %call.i.i, 1
br i1 %cmp107499, label %for.body12.preheader, label %for.end38
for.body12.lr.ph: ; preds = %print_arr.exit
%wide.trip.count.i61 = and i64 %call.i.i, 4294967295
br i1 %cmp7.i, label %for.body12.us, label %for.body12.preheader
for.body12.preheader: ; preds = %print_arr.exit.thread, %for.body12.lr.ph
br label %for.body12
for.body12.us: ; preds = %for.body12.lr.ph, %print_arr.exit68.loopexit.us
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %print_arr.exit68.loopexit.us ], [ 1, %for.body12.lr.ph ]
%arrayidx14.us = getelementptr inbounds [100 x i32], ptr %na, i64 0, i64 %indvars.iv87
%4 = load i32, ptr %arrayidx14.us, align 4, !tbaa !9
br label %for.body18.us
for.body18.us: ; preds = %if.end24.us, %for.body12.us
%indvars.iv89 = phi i64 [ %indvars.iv.next90, %if.end24.us ], [ %indvars.iv87, %for.body12.us ]
%indvars.iv.next90 = add nsw i64 %indvars.iv89, -1
%idxprom19.us = and i64 %indvars.iv.next90, 4294967295
%arrayidx20.us = getelementptr inbounds [100 x i32], ptr %na, i64 0, i64 %idxprom19.us
%5 = load i32, ptr %arrayidx20.us, align 4, !tbaa !9
%cmp21.us = icmp slt i32 %5, %4
br i1 %cmp21.us, label %for.end31.us, label %if.end24.us
if.end24.us: ; preds = %for.body18.us
%arrayidx29.us = getelementptr inbounds [100 x i32], ptr %na, i64 0, i64 %indvars.iv89
store i32 %5, ptr %arrayidx29.us, align 4, !tbaa !9
%6 = icmp sgt i64 %indvars.iv89, 1
br i1 %6, label %for.body18.us, label %for.end31.us, !llvm.loop !14
for.end31.us: ; preds = %if.end24.us, %for.body18.us
%idx.1.lcssa.us = phi i64 [ %indvars.iv89, %for.body18.us ], [ 0, %if.end24.us ]
%sext97 = shl i64 %idx.1.lcssa.us, 32
%idxprom32.us = ashr exact i64 %sext97, 32
%arrayidx33.us = getelementptr inbounds [100 x i32], ptr %na, i64 0, i64 %idxprom32.us
store i32 %4, ptr %arrayidx33.us, align 4, !tbaa !9
%7 = load i32, ptr %na, align 16, !tbaa !9
%call.i57.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
br label %for.body.i62.us
for.body.i62.us: ; preds = %for.body.i62.us, %for.end31.us
%indvars.iv.i63.us = phi i64 [ 1, %for.end31.us ], [ %indvars.iv.next.i66.us, %for.body.i62.us ]
%arrayidx1.i64.us = getelementptr inbounds i32, ptr %na, i64 %indvars.iv.i63.us
%8 = load i32, ptr %arrayidx1.i64.us, align 4, !tbaa !9
%call2.i65.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%indvars.iv.next.i66.us = add nuw nsw i64 %indvars.iv.i63.us, 1
%exitcond.not.i67.us = icmp eq i64 %indvars.iv.next.i66.us, %wide.trip.count.i61
br i1 %exitcond.not.i67.us, label %print_arr.exit68.loopexit.us, label %for.body.i62.us, !llvm.loop !11
print_arr.exit68.loopexit.us: ; preds = %for.body.i62.us
%putchar.i59.us = tail call i32 @putchar(i32 10)
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%exitcond96.not = icmp eq i64 %indvars.iv.next88, %call.i.i
br i1 %exitcond96.not, label %for.end38, label %for.body12.us, !llvm.loop !15
for.body12: ; preds = %for.body12.preheader, %for.end31
%indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.end31 ], [ 1, %for.body12.preheader ]
%arrayidx14 = getelementptr inbounds [100 x i32], ptr %na, i64 0, i64 %indvars.iv79
%9 = load i32, ptr %arrayidx14, align 4, !tbaa !9
br label %for.body18
for.body18: ; preds = %for.body12, %if.end24
%indvars.iv81 = phi i64 [ %indvars.iv79, %for.body12 ], [ %indvars.iv.next82, %if.end24 ]
%indvars.iv.next82 = add nsw i64 %indvars.iv81, -1
%idxprom19 = and i64 %indvars.iv.next82, 4294967295
%arrayidx20 = getelementptr inbounds [100 x i32], ptr %na, i64 0, i64 %idxprom19
%10 = load i32, ptr %arrayidx20, align 4, !tbaa !9
%cmp21 = icmp slt i32 %10, %9
br i1 %cmp21, label %for.end31, label %if.end24
if.end24: ; preds = %for.body18
%arrayidx29 = getelementptr inbounds [100 x i32], ptr %na, i64 0, i64 %indvars.iv81
store i32 %10, ptr %arrayidx29, align 4, !tbaa !9
%11 = icmp sgt i64 %indvars.iv81, 1
br i1 %11, label %for.body18, label %for.end31, !llvm.loop !14
for.end31: ; preds = %for.body18, %if.end24
%idx.1.lcssa = phi i64 [ %indvars.iv81, %for.body18 ], [ 0, %if.end24 ]
%sext = shl i64 %idx.1.lcssa, 32
%idxprom32 = ashr exact i64 %sext, 32
%arrayidx33 = getelementptr inbounds [100 x i32], ptr %na, i64 0, i64 %idxprom32
store i32 %9, ptr %arrayidx33, align 4, !tbaa !9
%12 = load i32, ptr %na, align 16, !tbaa !9
%call.i57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12)
%putchar.i59 = tail call i32 @putchar(i32 10)
%indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
%exitcond86.not = icmp eq i64 %indvars.iv.next80, %call.i.i
br i1 %exitcond86.not, label %for.end38, label %for.body12, !llvm.loop !15
for.end38: ; preds = %for.end31, %print_arr.exit68.loopexit.us, %print_arr.exit.thread, %print_arr.exit
tail call void @exit(i32 noundef 0) #11
unreachable
err: ; preds = %for.body
tail call void @exit(i32 noundef 1) #11
unreachable
}
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #6
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #7
; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #8
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-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 = { 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 #6 = { 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 #7 = { nofree nounwind }
attributes #8 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write) }
attributes #9 = { nounwind }
attributes #10 = { cold }
attributes #11 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
|
#include<stdio.h>
void trace(int A[], int N){
int i;
for(i=0; i<N; i++){
if(i>0) printf(" ");
printf("%d",A[i]);
}
printf("\n");
}
void insertionSort(int A[],int N){
int j,i,v;
for (i=1; i<N; i++){
v=A[i];
j=i-1;
while(j>=0 && A[j]>v){
A[j+1]=A[j];
j--;
}
A[j+1]=v;
trace(A,N);
}
}
int main(void){
int N,i;
int A[100];
scanf("%d",&N);
for(i=0;i<N;i++) scanf("%d",&A[i]);
trace(A, N);
insertionSort(A, N);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116636/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116636/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp8 = icmp sgt i32 %N, 0
br i1 %cmp8, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %N to i64
%.pre = load i32, ptr %A, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %N, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp30 = icmp sgt i32 %N, 1
br i1 %cmp30, label %for.body.us.preheader, label %for.end
for.body.us.preheader: ; preds = %entry
%wide.trip.count.i = zext i32 %N to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %trace.exit.loopexit.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %trace.exit.loopexit.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next35 = add nsw i64 %indvars.iv34, -1
%idxprom2.us = and i64 %indvars.iv.next35, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us
%1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %1, %0
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv34, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom10.us = ashr exact i64 %sext, 32
%arrayidx11.us = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us
store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5
%.pre.i.us = load i32, ptr %A, align 4, !tbaa !5
%call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us)
br label %if.end.i.us
if.end.i.us: ; preds = %while.end.us, %if.end.i.us
%indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ]
%putchar7.i.us = tail call i32 @putchar(i32 32)
%arrayidx.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us
%2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %trace.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34
store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv34, 1
br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12
trace.exit.loopexit.us: ; preds = %if.end.i.us
%putchar.i.us = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i
br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13
for.end: ; preds = %trace.exit.loopexit.us, %entry
ret void
}
; 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
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %trace.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body
%cmp8.i = icmp sgt i32 %1, 0
br i1 %cmp8.i, label %if.end.peel.i, label %trace.exit
if.end.peel.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %1 to i64
%.pre.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %1, 1
br i1 %exitcond.peel.not.i, label %trace.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 1, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%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 %trace.exit, label %if.end.i, !llvm.loop !9
trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %4, 1
br i1 %cmp30.i, label %for.body.us.preheader.i, label %insertionSort.exit
for.body.us.preheader.i: ; preds = %trace.exit
%wide.trip.count.i.i = zext i32 %4 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %trace.exit.loopexit.us.i, %for.body.us.preheader.i
%indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %trace.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i5
%5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i
%indvars.iv34.i = phi i64 [ %indvars.iv.next35.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ]
%indvars.iv.next35.i = add nsw i64 %indvars.iv34.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next35.i, 4294967295
%arrayidx3.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us.i
%6 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %6, %5
br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv34.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom10.us.i = ashr exact i64 %sext.i, 32
%arrayidx11.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us.i
store i32 %5, ptr %arrayidx11.us.i, align 4, !tbaa !5
%.pre.i.us.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i)
br label %if.end.i.us.i
if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i
%indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ]
%putchar7.i.us.i = call i32 @putchar(i32 32)
%arrayidx.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i
%7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %trace.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34.i
store i32 %6, ptr %arrayidx8.us.i, align 4, !tbaa !5
%8 = icmp sgt i64 %indvars.iv34.i, 1
br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12
trace.exit.loopexit.us.i: ; preds = %if.end.i.us.i
%putchar.i.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1
%exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i
br i1 %exitcond.not.i7, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !13
insertionSort.exit: ; preds = %trace.exit.loopexit.us.i, %trace.exit
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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main()
{
int N, i ,k , v, j, sort;
int A[100];
scanf("%d",&N);
for(i = 0;i < N;i++){
scanf("%d",&A[i]);
}
for(i = 0;i < N;i++){
v = A[i];
j = i - 1;
while(j >= 0 && A[j] > v){
sort = A[j+1];
A[j+1] = A[j];
A[j] = sort;
j--;
}
A[j+1] = v;
for(k = 0;k < N;k++){
if(k)printf(" ");
printf("%d",A[k]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116722/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116722/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%A = 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 %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
%cmp55 = icmp sgt i32 %0, 0
br i1 %cmp55, label %for.body, label %for.end36
for.cond2.preheader: ; preds = %for.body
%cmp364 = icmp sgt i32 %1, 0
br i1 %cmp364, label %for.body4, label %for.end36
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.end32
%3 = phi i32 [ %12, %for.end32 ], [ %1, %for.cond2.preheader ]
%indvars.iv67 = phi i64 [ %indvars.iv.next68, %for.end32 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv67
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp758.not = icmp eq i64 %indvars.iv67, 0
br i1 %cmp758.not, label %while.end, label %land.rhs
land.rhs: ; preds = %for.body4, %while.body
%indvars.iv69 = phi i64 [ %indvars.iv.next70, %while.body ], [ %indvars.iv67, %for.body4 ]
%indvars.iv.next70 = add nsw i64 %indvars.iv69, -1
%idxprom8 = and i64 %indvars.iv.next70, 4294967295
%arrayidx9 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom8
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %5, %4
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx12 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv69
%6 = load i32, ptr %arrayidx12, align 4, !tbaa !5
store i32 %5, ptr %arrayidx12, align 4, !tbaa !5
store i32 %6, ptr %arrayidx9, align 4, !tbaa !5
%7 = icmp sgt i64 %indvars.iv69, 1
br i1 %7, label %land.rhs, label %while.end, !llvm.loop !11
while.end: ; preds = %land.rhs, %while.body, %for.body4
%j.0.in.lcssa = phi i64 [ 0, %for.body4 ], [ 0, %while.body ], [ %indvars.iv69, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom21 = ashr exact i64 %sext, 32
%arrayidx22 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %idxprom21
store i32 %4, ptr %arrayidx22, align 4, !tbaa !5
%cmp2462 = icmp sgt i32 %3, 0
br i1 %cmp2462, label %if.end.peel, label %for.end32
if.end.peel: ; preds = %while.end
%.pre = load i32, ptr %A, align 16, !tbaa !5
%call29.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%8 = load i32, ptr %N, align 4, !tbaa !5
%cmp24.peel = icmp sgt i32 %8, 1
br i1 %cmp24.peel, label %if.end, label %for.end32
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv72 = phi i64 [ %indvars.iv.next73, %if.end ], [ 1, %if.end.peel ]
%putchar54 = call i32 @putchar(i32 32)
%arrayidx28 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv72
%9 = load i32, ptr %arrayidx28, align 4, !tbaa !5
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %9)
%indvars.iv.next73 = add nuw nsw i64 %indvars.iv72, 1
%10 = load i32, ptr %N, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp24 = icmp slt i64 %indvars.iv.next73, %11
br i1 %cmp24, label %if.end, label %for.end32, !llvm.loop !12
for.end32: ; preds = %if.end, %if.end.peel, %while.end
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%12 = load i32, ptr %N, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp3 = icmp slt i64 %indvars.iv.next68, %13
br i1 %cmp3, label %for.body4, label %for.end36, !llvm.loop !14
for.end36: ; preds = %for.end32, %entry, %for.cond2.preheader
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: 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 = distinct !{!12, !10, !13}
!13 = !{!"llvm.loop.peeled.count", i32 1}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
static const int N = 100;
void trace(int A[], int n){
int i;
for ( i = 1; i <= n; i++ ){
if ( i > 1 ) printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
int main(){
int n, i, j,key;
int A[N+1];
scanf("%d", &n);
for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);
trace(A, n);
for(i = 2; i <= n; i++){
key = A[i];
j = i - 1;
while(j > 0 && A[j] > key){
A[j + 1] = A[j];
j--;
}
A[j + 1] = key;
trace(A,n);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116766/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116766/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not8 = icmp slt i32 %n, 1
br i1 %cmp.not8, label %for.end, label %if.end.peel
if.end.peel: ; preds = %entry
%0 = add nuw i32 %n, 1
%wide.trip.count = zext i32 %0 to i64
%arrayidx.peel.phi.trans.insert = getelementptr inbounds i32, ptr %A, i64 1
%.pre = load i32, ptr %arrayidx.peel.phi.trans.insert, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %0, 2
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 2, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%0 = tail call ptr @llvm.stacksave.p0()
%vla34 = alloca [101 x i32], align 16
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not51 = icmp slt i32 %1, 1
br i1 %cmp.not51, label %trace.exit, label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla34, 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
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %3
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body
%cmp.not8.i = icmp slt i32 %2, 1
br i1 %cmp.not8.i, label %trace.exit, label %if.end.peel.i
if.end.peel.i: ; preds = %for.end
%4 = add nuw nsw i32 %2, 1
%wide.trip.count.i = zext i32 %4 to i64
%arrayidx.peel.phi.trans.insert.i = getelementptr inbounds i32, ptr %vla34, i64 1
%.pre.i = load i32, ptr %arrayidx.peel.phi.trans.insert.i, align 4, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %4, 2
br i1 %exitcond.peel.not.i, label %trace.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 2, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %trace.exit, label %if.end.i, !llvm.loop !9
trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp3.not56 = icmp slt i32 %6, 2
br i1 %cmp3.not56, label %for.end20, label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %trace.exit
%arrayidx.peel.phi.trans.insert.i38 = getelementptr inbounds i32, ptr %vla34, i64 1
br label %for.body4
for.body4: ; preds = %for.body4.lr.ph, %trace.exit50
%indvars.iv60 = phi i64 [ 2, %for.body4.lr.ph ], [ %indvars.iv.next61, %trace.exit50 ]
%7 = phi i32 [ %6, %for.body4.lr.ph ], [ %13, %trace.exit50 ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv60
%8 = load i32, ptr %arrayidx6, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body4, %while.body
%indvars.iv62 = phi i64 [ %indvars.iv60, %for.body4 ], [ %indvars.iv.next63, %while.body ]
%indvars.iv.next63 = add nsw i64 %indvars.iv62, -1
%idxprom8 = and i64 %indvars.iv.next63, 4294967295
%arrayidx9 = getelementptr inbounds i32, ptr %vla34, i64 %idxprom8
%9 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %9, %8
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx14 = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv62
store i32 %9, ptr %arrayidx14, align 4, !tbaa !5
%10 = icmp sgt i64 %indvars.iv62, 2
br i1 %10, label %land.rhs, label %while.end, !llvm.loop !13
while.end: ; preds = %while.body, %land.rhs
%j.0.in.lcssa = phi i64 [ 1, %while.body ], [ %indvars.iv62, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom16 = ashr exact i64 %sext, 32
%arrayidx17 = getelementptr inbounds i32, ptr %vla34, i64 %idxprom16
store i32 %8, ptr %arrayidx17, align 4, !tbaa !5
%cmp.not8.i35 = icmp slt i32 %7, 1
br i1 %cmp.not8.i35, label %trace.exit50, label %if.end.peel.i36
if.end.peel.i36: ; preds = %while.end
%11 = add nuw i32 %7, 1
%wide.trip.count.i37 = zext i32 %11 to i64
%.pre.i39 = load i32, ptr %arrayidx.peel.phi.trans.insert.i38, align 4, !tbaa !5
%call2.peel.i40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i39)
%exitcond.peel.not.i41 = icmp eq i32 %11, 2
br i1 %exitcond.peel.not.i41, label %trace.exit50, label %if.end.i42
if.end.i42: ; preds = %if.end.peel.i36, %if.end.i42
%indvars.iv.i43 = phi i64 [ %indvars.iv.next.i47, %if.end.i42 ], [ 2, %if.end.peel.i36 ]
%putchar7.i44 = call i32 @putchar(i32 32)
%arrayidx.i45 = getelementptr inbounds i32, ptr %vla34, i64 %indvars.iv.i43
%12 = load i32, ptr %arrayidx.i45, align 4, !tbaa !5
%call2.i46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %12)
%indvars.iv.next.i47 = add nuw nsw i64 %indvars.iv.i43, 1
%exitcond.not.i48 = icmp eq i64 %indvars.iv.next.i47, %wide.trip.count.i37
br i1 %exitcond.not.i48, label %trace.exit50, label %if.end.i42, !llvm.loop !9
trace.exit50: ; preds = %if.end.i42, %while.end, %if.end.peel.i36
%putchar.i49 = call i32 @putchar(i32 10)
%indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
%13 = load i32, ptr %n, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp3.not.not = icmp slt i64 %indvars.iv60, %14
br i1 %cmp3.not.not, label %for.body4, label %for.end20, !llvm.loop !14
for.end20: ; preds = %trace.exit50, %trace.exit
call void @llvm.stackrestore.p0(ptr %0)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; 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 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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
void change(int A[], int n){
int i;
for(i=0;i<n;i++){
if(i > 0) printf(" ");
printf("%d",A[i]);
}
printf("\n");
}
void insert(int A[], int n){
int j,i,v;
for(i=1;i<n;i++){
v = A[i];
j = i - 1;
while(j >= 0 && A[j] > v){
A[j+1] = A[j];
j--;
}
A[j+1] = v;
change(A,n);
}
}
int main(){
int n,i,j;
int A[100];
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&A[i]);
change(A,n);
insert(A,n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116809/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116809/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @change(ptr nocapture noundef readonly %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp8 = icmp sgt i32 %n, 0
br i1 %cmp8, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
%.pre = load i32, ptr %A, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %n, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insert(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp30 = icmp sgt i32 %n, 1
br i1 %cmp30, label %for.body.us.preheader, label %for.end
for.body.us.preheader: ; preds = %entry
%wide.trip.count.i = zext i32 %n to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %change.exit.loopexit.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %change.exit.loopexit.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next35 = add nsw i64 %indvars.iv34, -1
%idxprom2.us = and i64 %indvars.iv.next35, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us
%1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %1, %0
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv34, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom10.us = ashr exact i64 %sext, 32
%arrayidx11.us = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us
store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5
%.pre.i.us = load i32, ptr %A, align 4, !tbaa !5
%call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us)
br label %if.end.i.us
if.end.i.us: ; preds = %while.end.us, %if.end.i.us
%indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ]
%putchar7.i.us = tail call i32 @putchar(i32 32)
%arrayidx.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us
%2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %change.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34
store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv34, 1
br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12
change.exit.loopexit.us: ; preds = %if.end.i.us
%putchar.i.us = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i
br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13
for.end: ; preds = %change.exit.loopexit.us, %entry
ret void
}
; 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
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %change.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body
%cmp8.i = icmp sgt i32 %1, 0
br i1 %cmp8.i, label %if.end.peel.i, label %change.exit
if.end.peel.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %1 to i64
%.pre.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %1, 1
br i1 %exitcond.peel.not.i, label %change.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 1, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%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 %change.exit, label %if.end.i, !llvm.loop !9
change.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %4, 1
br i1 %cmp30.i, label %for.body.us.preheader.i, label %insert.exit
for.body.us.preheader.i: ; preds = %change.exit
%wide.trip.count.i.i = zext i32 %4 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %change.exit.loopexit.us.i, %for.body.us.preheader.i
%indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %change.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i5
%5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i
%indvars.iv34.i = phi i64 [ %indvars.iv.next35.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ]
%indvars.iv.next35.i = add nsw i64 %indvars.iv34.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next35.i, 4294967295
%arrayidx3.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us.i
%6 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %6, %5
br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv34.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom10.us.i = ashr exact i64 %sext.i, 32
%arrayidx11.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us.i
store i32 %5, ptr %arrayidx11.us.i, align 4, !tbaa !5
%.pre.i.us.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i)
br label %if.end.i.us.i
if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i
%indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ]
%putchar7.i.us.i = call i32 @putchar(i32 32)
%arrayidx.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i
%7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %change.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34.i
store i32 %6, ptr %arrayidx8.us.i, align 4, !tbaa !5
%8 = icmp sgt i64 %indvars.iv34.i, 1
br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12
change.exit.loopexit.us.i: ; preds = %if.end.i.us.i
%putchar.i.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1
%exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i
br i1 %exitcond.not.i7, label %insert.exit, label %for.body.us.i, !llvm.loop !13
insert.exit: ; preds = %change.exit.loopexit.us.i, %change.exit
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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main(){
int arr[100],n,i,j,k,key;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&arr[i]);
if(i>0) printf(" ");
printf("%-d",arr[i]);
}
printf("\n");
for(i=1;i<n;i++){
key = arr[i];
j = i-1;
for(k=0;k<n;k++){
while(j >= 0 && arr[j] > key){
arr[j+1] = arr[j];
j--;
}
arr[j+1] = key;
if(k>0) printf(" ");
printf("%-d",arr[k]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116852/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116852/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%-d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%arr = alloca [100 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %arr) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp61 = icmp sgt i32 %0, 0
br i1 %cmp61, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%call1.peel = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arr)
%.pre = load i32, ptr %arr, align 16, !tbaa !5
%call6.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.pre)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.peel = icmp sgt i32 %1, 1
br i1 %cmp.peel, label %if.end, label %for.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%putchar60 = call i32 @putchar(i32 32)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call6 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %2)
%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 %if.end, label %for.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = call i32 @putchar(i32 10)
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp969 = icmp sgt i32 %5, 1
br i1 %cmp969, label %for.body10, label %for.end40
for.body10: ; preds = %for.end, %for.end36
%6 = phi i32 [ %14, %for.end36 ], [ %5, %for.end ]
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.end36 ], [ 1, %for.end ]
%arrayidx12 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %indvars.iv76
%7 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp1466 = icmp sgt i32 %6, 0
br i1 %cmp1466, label %while.cond.preheader.preheader, label %for.end36
while.cond.preheader.preheader: ; preds = %for.body10
%8 = trunc i64 %indvars.iv76 to i32
%9 = add i32 %8, -1
br label %while.cond.preheader
while.cond.preheader: ; preds = %while.cond.preheader.preheader, %if.end30
%indvars.iv73 = phi i64 [ 0, %while.cond.preheader.preheader ], [ %indvars.iv.next74, %if.end30 ]
%j.067 = phi i32 [ %9, %while.cond.preheader.preheader ], [ %j.1.lcssa, %if.end30 ]
%cmp1663 = icmp sgt i32 %j.067, -1
br i1 %cmp1663, label %land.rhs, label %while.end
land.rhs: ; preds = %while.cond.preheader, %while.body
%j.164 = phi i32 [ %dec, %while.body ], [ %j.067, %while.cond.preheader ]
%idxprom17 = zext i32 %j.164 to i64
%arrayidx18 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %idxprom17
%10 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%cmp19 = icmp sgt i32 %10, %7
br i1 %cmp19, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%add = add nuw nsw i32 %j.164, 1
%idxprom22 = zext i32 %add to i64
%arrayidx23 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %idxprom22
store i32 %10, ptr %arrayidx23, align 4, !tbaa !5
%dec = add nsw i32 %j.164, -1
%cmp16 = icmp sgt i32 %j.164, 0
br i1 %cmp16, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %land.rhs, %while.body, %while.cond.preheader
%j.1.lcssa = phi i32 [ %j.067, %while.cond.preheader ], [ -1, %while.body ], [ %j.164, %land.rhs ]
%add24 = add nsw i32 %j.1.lcssa, 1
%idxprom25 = sext i32 %add24 to i64
%arrayidx26 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %idxprom25
store i32 %7, ptr %arrayidx26, align 4, !tbaa !5
%cmp27.not = icmp eq i64 %indvars.iv73, 0
br i1 %cmp27.not, label %if.end30, label %if.then28
if.then28: ; preds = %while.end
%putchar59 = call i32 @putchar(i32 32)
br label %if.end30
if.end30: ; preds = %if.then28, %while.end
%arrayidx32 = getelementptr inbounds [100 x i32], ptr %arr, i64 0, i64 %indvars.iv73
%11 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %11)
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp14 = icmp slt i64 %indvars.iv.next74, %13
br i1 %cmp14, label %while.cond.preheader, label %for.end36, !llvm.loop !13
for.end36: ; preds = %if.end30, %for.body10
%putchar58 = call i32 @putchar(i32 10)
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp9 = icmp slt i64 %indvars.iv.next77, %15
br i1 %cmp9, label %for.body10, label %for.end40, !llvm.loop !14
for.end40: ; preds = %for.end36, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %arr) #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
#define N 1000
int main(void){
int i,j,n,A[N];
int v;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
for(j=0;j<n-1;j++) printf("%d ",A[j]);
printf("%d\n",A[n-1]);
for(i=1;i<n;i++){
v = A[i];
j = i - 1;
while(j>=0 && A[j]>v){
A[j+1] = A[j];
j--;
}
A[j+1] = v;
for(j=0;j<n-1;j++) printf("%d ",A[j]);
printf("%d\n",A[n-1]);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116896/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116896/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%A = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %A) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp67 = icmp sgt i32 %0, 0
br i1 %cmp67, label %for.body, label %for.cond2.preheader.for.end10_crit_edge
for.cond2.preheader: ; preds = %for.body
%cmp370 = icmp sgt i32 %2, 1
br i1 %cmp370, label %for.body4, label %for.cond2.preheader.for.end10_crit_edge
for.cond2.preheader.for.end10_crit_edge: ; preds = %entry, %for.cond2.preheader
%1 = phi i32 [ %2, %for.cond2.preheader ], [ %0, %entry ]
%sub69 = add nsw i32 %1, -1
%.pre = sext i32 %sub69 to i64
br label %for.end10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv84
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%6 = sext i32 %sub to i64
%cmp3 = icmp slt i64 %indvars.iv.next85, %6
br i1 %cmp3, label %for.body4, label %for.end10, !llvm.loop !11
for.end10: ; preds = %for.body4, %for.cond2.preheader.for.end10_crit_edge
%idxprom12.pre-phi = phi i64 [ %.pre, %for.cond2.preheader.for.end10_crit_edge ], [ %6, %for.body4 ]
%arrayidx13 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom12.pre-phi
%7 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %7)
%8 = load i32, ptr %n, align 4, !tbaa !5
%cmp1679 = icmp sgt i32 %8, 1
br i1 %cmp1679, label %for.body17, label %for.end48
for.body17: ; preds = %for.end10, %for.end41
%9 = phi i32 [ %17, %for.end41 ], [ %8, %for.end10 ]
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.end41 ], [ 1, %for.end10 ]
%arrayidx19 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv87
%10 = load i32, ptr %arrayidx19, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body17, %while.body
%indvars.iv89 = phi i64 [ %indvars.iv87, %for.body17 ], [ %indvars.iv.next90, %while.body ]
%indvars.iv.next90 = add nsw i64 %indvars.iv89, -1
%idxprom22 = and i64 %indvars.iv.next90, 4294967295
%arrayidx23 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom22
%11 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24 = icmp sgt i32 %11, %10
br i1 %cmp24, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx28 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv89
store i32 %11, ptr %arrayidx28, align 4, !tbaa !5
%12 = icmp sgt i64 %indvars.iv89, 1
br i1 %12, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%j.1.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv89, %land.rhs ]
%sext = shl i64 %j.1.in.lcssa, 32
%idxprom30 = ashr exact i64 %sext, 32
%arrayidx31 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom30
store i32 %10, ptr %arrayidx31, align 4, !tbaa !5
%cmp3476 = icmp sgt i32 %9, 1
br i1 %cmp3476, label %for.body35, label %while.end.for.end41_crit_edge
while.end.for.end41_crit_edge: ; preds = %while.end
%sub3375 = add nsw i32 %9, -1
%.pre98 = sext i32 %sub3375 to i64
br label %for.end41
for.body35: ; preds = %while.end, %for.body35
%indvars.iv92 = phi i64 [ %indvars.iv.next93, %for.body35 ], [ 0, %while.end ]
%arrayidx37 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv92
%13 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %13)
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%sub33 = add nsw i32 %14, -1
%15 = sext i32 %sub33 to i64
%cmp34 = icmp slt i64 %indvars.iv.next93, %15
br i1 %cmp34, label %for.body35, label %for.end41, !llvm.loop !13
for.end41: ; preds = %for.body35, %while.end.for.end41_crit_edge
%idxprom43.pre-phi = phi i64 [ %.pre98, %while.end.for.end41_crit_edge ], [ %15, %for.body35 ]
%arrayidx44 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom43.pre-phi
%16 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %16)
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp16 = icmp slt i64 %indvars.iv.next88, %18
br i1 %cmp16, label %for.body17, label %for.end48, !llvm.loop !14
for.end48: ; preds = %for.end41, %for.end10
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
void trace(int A[], int N) {
int i;
for (i = 0; i < N; i++) {
if (i > 0) {
printf(" ");
}
printf("%d", A[i]);
}
printf("\n");
}
void insertionSort(int A[], int N) {
int j, i, v;
for (i = 1; i < N; i++) {
v = A[i];
j = i - 1;
while (j >= 0 && A[j] > v) {
A[j + 1] = A[j];
j--;
}
A[j + 1] = v;
trace(A, N);
}
}
int main() {
int N, i, j;
int A[100];
scanf("%d", &N);
for (i = 0; i < N; i++) {
scanf("%d", &A[i]);
}
trace(A, N);
insertionSort(A, N);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116939/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116939/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp8 = icmp sgt i32 %N, 0
br i1 %cmp8, label %if.end.peel, label %for.end
if.end.peel: ; preds = %entry
%wide.trip.count = zext i32 %N to i64
%.pre = load i32, ptr %A, align 4, !tbaa !5
%call2.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre)
%exitcond.peel.not = icmp eq i32 %N, 1
br i1 %exitcond.peel.not, label %for.end, label %if.end
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 1, %if.end.peel ]
%putchar7 = tail call i32 @putchar(i32 32)
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.end, !llvm.loop !9
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp30 = icmp sgt i32 %N, 1
br i1 %cmp30, label %for.body.us.preheader, label %for.end
for.body.us.preheader: ; preds = %entry
%wide.trip.count.i = zext i32 %N to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %trace.exit.loopexit.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %trace.exit.loopexit.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body.us
%indvars.iv34 = phi i64 [ %indvars.iv.next35, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next35 = add nsw i64 %indvars.iv34, -1
%idxprom2.us = and i64 %indvars.iv.next35, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us
%1 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %1, %0
br i1 %cmp4.us, label %while.body.us, label %while.end.us
while.end.us: ; preds = %while.body.us, %land.rhs.us
%j.0.in.lcssa.us = phi i64 [ 0, %while.body.us ], [ %indvars.iv34, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom10.us = ashr exact i64 %sext, 32
%arrayidx11.us = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us
store i32 %0, ptr %arrayidx11.us, align 4, !tbaa !5
%.pre.i.us = load i32, ptr %A, align 4, !tbaa !5
%call2.peel.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us)
br label %if.end.i.us
if.end.i.us: ; preds = %while.end.us, %if.end.i.us
%indvars.iv.i.us = phi i64 [ %indvars.iv.next.i.us, %if.end.i.us ], [ 1, %while.end.us ]
%putchar7.i.us = tail call i32 @putchar(i32 32)
%arrayidx.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us
%2 = load i32, ptr %arrayidx.i.us, align 4, !tbaa !5
%call2.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %2)
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count.i
br i1 %exitcond.not.i.us, label %trace.exit.loopexit.us, label %if.end.i.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34
store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv34, 1
br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !12
trace.exit.loopexit.us: ; preds = %if.end.i.us
%putchar.i.us = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i
br i1 %exitcond.not, label %for.end, label %for.body.us, !llvm.loop !13
for.end: ; preds = %trace.exit.loopexit.us, %entry
ret void
}
; 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
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp8 = icmp sgt i32 %0, 0
br i1 %cmp8, label %for.body, label %trace.exit
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !14
for.end: ; preds = %for.body
%cmp8.i = icmp sgt i32 %1, 0
br i1 %cmp8.i, label %if.end.peel.i, label %trace.exit
if.end.peel.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %1 to i64
%.pre.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %1, 1
br i1 %exitcond.peel.not.i, label %trace.exit, label %if.end.i
if.end.i: ; preds = %if.end.peel.i, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 1, %if.end.peel.i ]
%putchar7.i = call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%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 %trace.exit, label %if.end.i, !llvm.loop !9
trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%4 = load i32, ptr %N, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %4, 1
br i1 %cmp30.i, label %for.body.us.preheader.i, label %insertionSort.exit
for.body.us.preheader.i: ; preds = %trace.exit
%wide.trip.count.i.i = zext i32 %4 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %trace.exit.loopexit.us.i, %for.body.us.preheader.i
%indvars.iv.i5 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i6, %trace.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i5
%5 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body.us.i
%indvars.iv34.i = phi i64 [ %indvars.iv.next35.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ]
%indvars.iv.next35.i = add nsw i64 %indvars.iv34.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next35.i, 4294967295
%arrayidx3.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us.i
%6 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %6, %5
br i1 %cmp4.us.i, label %while.body.us.i, label %while.end.us.i
while.end.us.i: ; preds = %while.body.us.i, %land.rhs.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %while.body.us.i ], [ %indvars.iv34.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom10.us.i = ashr exact i64 %sext.i, 32
%arrayidx11.us.i = getelementptr inbounds i32, ptr %A, i64 %idxprom10.us.i
store i32 %5, ptr %arrayidx11.us.i, align 4, !tbaa !5
%.pre.i.us.i = load i32, ptr %A, align 16, !tbaa !5
%call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i.us.i)
br label %if.end.i.us.i
if.end.i.us.i: ; preds = %if.end.i.us.i, %while.end.us.i
%indvars.iv.i.us.i = phi i64 [ %indvars.iv.next.i.us.i, %if.end.i.us.i ], [ 1, %while.end.us.i ]
%putchar7.i.us.i = call i32 @putchar(i32 32)
%arrayidx.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i
%7 = load i32, ptr %arrayidx.i.us.i, align 4, !tbaa !5
%call2.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%indvars.iv.next.i.us.i = add nuw nsw i64 %indvars.iv.i.us.i, 1
%exitcond.not.i.us.i = icmp eq i64 %indvars.iv.next.i.us.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.us.i, label %trace.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34.i
store i32 %6, ptr %arrayidx8.us.i, align 4, !tbaa !5
%8 = icmp sgt i64 %indvars.iv34.i, 1
br i1 %8, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !12
trace.exit.loopexit.us.i: ; preds = %if.end.i.us.i
%putchar.i.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i6 = add nuw nsw i64 %indvars.iv.i5, 1
%exitcond.not.i7 = icmp eq i64 %indvars.iv.next.i6, %wide.trip.count.i.i
br i1 %exitcond.not.i7, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !13
insertionSort.exit: ; preds = %trace.exit.loopexit.us.i, %trace.exit
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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #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, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.peeled.count", i32 1}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
typedef struct
{
int n, e, w, s, t, b;
} dice;
void dice_scan(dice *x)
{
scanf("%d %d %d %d %d %d", &x->t, &x->s, &x->e, &x->w, &x->n, &x->b);
}
void dice_rorate_n(dice *x)
{
int temp;
temp = x->n;
x->n = x->t;
x->t = x->s;
x->s = x->b;
x->b = temp;
}
void dice_rorate_e(dice *x)
{
int temp;
temp = x->e;
x->e = x->t;
x->t = x->w;
x->w = x->b;
x->b = temp;
}
void dice_rorate_r(dice *x)
{
int temp;
temp = x->n;
x->n = x->w;
x->w = x->s;
x->s = x->e;
x->e = temp;
}
int dice_equal(const dice *d1, const dice *d2)
{
if(d1->n != d2->n) { return 0; }
if(d1->e != d2->e) { return 0; }
if(d1->w != d2->w) { return 0; }
if(d1->s != d2->s) { return 0; }
if(d1->t != d2->t) { return 0; }
if(d1->b != d2->b) { return 0; }
return 1;
}
int main()
{
dice d1, d2;
int ok;
dice_scan(&d1);
dice_scan(&d2);
ok = 0;
for(int i = 0; i < 4; ++i)
{
for(int j = 0; j < 4; ++j)
{
ok += dice_equal(&d1, &d2);
dice_rorate_n(&d1);
}
dice_rorate_e(&d1);
}
for(int i = 0; i < 4; ++i)
{
for(int j = 0; j < 4; ++j)
{
ok += dice_equal(&d1, &d2);
dice_rorate_n(&d1);
}
dice_rorate_r(&d1);
}
printf("%s\n", ok ? "Yes" : "No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116982/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116982/source.c"
target datalayout = "e-m:e-p270: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.dice = type { i32, i32, i32, i32, i32, i32 }
@.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @dice_scan(ptr noundef %x) local_unnamed_addr #0 {
entry:
%t = getelementptr inbounds %struct.dice, ptr %x, i64 0, i32 4
%s = getelementptr inbounds %struct.dice, ptr %x, i64 0, i32 3
%e = getelementptr inbounds %struct.dice, ptr %x, i64 0, i32 1
%w = getelementptr inbounds %struct.dice, ptr %x, i64 0, i32 2
%b = getelementptr inbounds %struct.dice, ptr %x, i64 0, i32 5
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t, ptr noundef nonnull %s, ptr noundef nonnull %e, ptr noundef nonnull %w, ptr noundef %x, ptr noundef nonnull %b)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @dice_rorate_n(ptr nocapture noundef %x) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%t = getelementptr inbounds %struct.dice, ptr %x, i64 0, i32 4
%1 = load i32, ptr %t, align 4, !tbaa !10
store i32 %1, ptr %x, align 4, !tbaa !5
%s = getelementptr inbounds %struct.dice, ptr %x, i64 0, i32 3
%2 = load i32, ptr %s, align 4, !tbaa !11
store i32 %2, ptr %t, align 4, !tbaa !10
%b = getelementptr inbounds %struct.dice, ptr %x, i64 0, i32 5
%3 = load i32, ptr %b, align 4, !tbaa !12
store i32 %3, ptr %s, align 4, !tbaa !11
store i32 %0, ptr %b, align 4, !tbaa !12
ret void
}
; 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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @dice_rorate_e(ptr nocapture noundef %x) local_unnamed_addr #2 {
entry:
%e = getelementptr inbounds %struct.dice, ptr %x, i64 0, i32 1
%t = getelementptr inbounds %struct.dice, ptr %x, i64 0, i32 4
%0 = load <2 x i32>, ptr %t, align 4, !tbaa !13
%1 = load <2 x i32>, ptr %e, align 4, !tbaa !13
store <2 x i32> %0, ptr %e, align 4, !tbaa !13
%2 = shufflevector <2 x i32> %1, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
store <2 x i32> %2, ptr %t, align 4, !tbaa !13
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @dice_rorate_r(ptr nocapture noundef %x) local_unnamed_addr #2 {
entry:
%0 = load <4 x i32>, ptr %x, align 4, !tbaa !13
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 2, i32 0, i32 3, i32 1>
store <4 x i32> %1, ptr %x, align 4, !tbaa !13
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @dice_equal(ptr nocapture noundef readonly %d1, ptr nocapture noundef readonly %d2) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %d1, align 4, !tbaa !5
%1 = load i32, ptr %d2, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %1
br i1 %cmp.not, label %if.end, label %return
if.end: ; preds = %entry
%e = getelementptr inbounds %struct.dice, ptr %d1, i64 0, i32 1
%2 = load i32, ptr %e, align 4, !tbaa !14
%e2 = getelementptr inbounds %struct.dice, ptr %d2, i64 0, i32 1
%3 = load i32, ptr %e2, align 4, !tbaa !14
%cmp3.not = icmp eq i32 %2, %3
br i1 %cmp3.not, label %if.end5, label %return
if.end5: ; preds = %if.end
%w = getelementptr inbounds %struct.dice, ptr %d1, i64 0, i32 2
%4 = load i32, ptr %w, align 4, !tbaa !15
%w6 = getelementptr inbounds %struct.dice, ptr %d2, i64 0, i32 2
%5 = load i32, ptr %w6, align 4, !tbaa !15
%cmp7.not = icmp eq i32 %4, %5
br i1 %cmp7.not, label %if.end9, label %return
if.end9: ; preds = %if.end5
%s = getelementptr inbounds %struct.dice, ptr %d1, i64 0, i32 3
%6 = load i32, ptr %s, align 4, !tbaa !11
%s10 = getelementptr inbounds %struct.dice, ptr %d2, i64 0, i32 3
%7 = load i32, ptr %s10, align 4, !tbaa !11
%cmp11.not = icmp eq i32 %6, %7
br i1 %cmp11.not, label %if.end13, label %return
if.end13: ; preds = %if.end9
%t = getelementptr inbounds %struct.dice, ptr %d1, i64 0, i32 4
%8 = load i32, ptr %t, align 4, !tbaa !10
%t14 = getelementptr inbounds %struct.dice, ptr %d2, i64 0, i32 4
%9 = load i32, ptr %t14, align 4, !tbaa !10
%cmp15.not = icmp eq i32 %8, %9
br i1 %cmp15.not, label %if.end17, label %return
if.end17: ; preds = %if.end13
%b = getelementptr inbounds %struct.dice, ptr %d1, i64 0, i32 5
%10 = load i32, ptr %b, align 4, !tbaa !12
%b18 = getelementptr inbounds %struct.dice, ptr %d2, i64 0, i32 5
%11 = load i32, ptr %b18, align 4, !tbaa !12
%cmp19.not = icmp eq i32 %10, %11
%. = zext i1 %cmp19.not to i32
br label %return
return: ; preds = %if.end17, %if.end13, %if.end9, %if.end5, %if.end, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %if.end ], [ 0, %if.end5 ], [ 0, %if.end9 ], [ 0, %if.end13 ], [ %., %if.end17 ]
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%d1 = alloca %struct.dice, align 16
%d2 = alloca %struct.dice, align 4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %d1) #7
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %d2) #7
%t.i = getelementptr inbounds %struct.dice, ptr %d1, i64 0, i32 4
%s.i = getelementptr inbounds %struct.dice, ptr %d1, i64 0, i32 3
%e.i = getelementptr inbounds %struct.dice, ptr %d1, i64 0, i32 1
%w.i = getelementptr inbounds %struct.dice, ptr %d1, i64 0, i32 2
%b.i = getelementptr inbounds %struct.dice, ptr %d1, i64 0, i32 5
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t.i, ptr noundef nonnull %s.i, ptr noundef nonnull %e.i, ptr noundef nonnull %w.i, ptr noundef nonnull %d1, ptr noundef nonnull %b.i)
%t.i33 = getelementptr inbounds %struct.dice, ptr %d2, i64 0, i32 4
%s.i34 = getelementptr inbounds %struct.dice, ptr %d2, i64 0, i32 3
%e.i35 = getelementptr inbounds %struct.dice, ptr %d2, i64 0, i32 1
%w.i36 = getelementptr inbounds %struct.dice, ptr %d2, i64 0, i32 2
%b.i37 = getelementptr inbounds %struct.dice, ptr %d2, i64 0, i32 5
%call.i38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t.i33, ptr noundef nonnull %s.i34, ptr noundef nonnull %e.i35, ptr noundef nonnull %w.i36, ptr noundef nonnull %d2, ptr noundef nonnull %b.i37)
%0 = load i32, ptr %d2, align 4, !tbaa !5
%1 = load i32, ptr %e.i35, align 4
%2 = load i32, ptr %w.i36, align 4
%3 = load i32, ptr %s.i34, align 4
%4 = load i32, ptr %t.i33, align 4
%5 = load i32, ptr %b.i37, align 4
%6 = load <2 x i32>, ptr %t.i, align 16, !tbaa !13
%7 = load <4 x i32>, ptr %d1, align 16
%8 = extractelement <4 x i32> %7, i64 1
%cmp3.not.i = icmp eq i32 %8, %1
%cmp3.not.i.fr = freeze i1 %cmp3.not.i
br i1 %cmp3.not.i.fr, label %for.cond1.preheader.split.us, label %for.cond.cleanup3
for.cond1.preheader.split.us: ; preds = %entry
%9 = extractelement <4 x i32> %7, i64 2
%cmp7.not.i = icmp eq i32 %9, %2
%cmp7.not.i.fr = freeze i1 %cmp7.not.i
br i1 %cmp7.not.i.fr, label %for.body4.us.us.preheader, label %for.cond.cleanup3
for.body4.us.us.preheader: ; preds = %for.cond1.preheader.split.us
%10 = shufflevector <4 x i32> %7, <4 x i32> poison, <4 x i32> <i32 poison, i32 0, i32 3, i32 poison>
%11 = shufflevector <2 x i32> %6, <2 x i32> poison, <4 x i32> <i32 0, i32 poison, i32 poison, i32 1>
%12 = shufflevector <4 x i32> %11, <4 x i32> %10, <4 x i32> <i32 0, i32 5, i32 6, i32 3>
%13 = insertelement <4 x i32> poison, i32 %0, i64 0
%14 = shufflevector <4 x i32> %13, <4 x i32> poison, <4 x i32> zeroinitializer
%15 = icmp eq <4 x i32> %12, %14
%16 = shufflevector <4 x i32> %7, <4 x i32> %12, <4 x i32> <i32 7, i32 3, i32 0, i32 4>
%17 = insertelement <4 x i32> poison, i32 %3, i64 0
%18 = shufflevector <4 x i32> %17, <4 x i32> poison, <4 x i32> zeroinitializer
%19 = icmp eq <4 x i32> %16, %18
%20 = select <4 x i1> %15, <4 x i1> %19, <4 x i1> zeroinitializer
%21 = shufflevector <4 x i32> %7, <4 x i32> %12, <4 x i32> <i32 3, i32 4, i32 7, i32 0>
%22 = insertelement <4 x i32> poison, i32 %4, i64 0
%23 = shufflevector <4 x i32> %22, <4 x i32> poison, <4 x i32> zeroinitializer
%24 = icmp eq <4 x i32> %21, %23
%25 = select <4 x i1> %20, <4 x i1> %24, <4 x i1> zeroinitializer
%26 = shufflevector <4 x i32> %7, <4 x i32> %12, <4 x i32> <i32 0, i32 7, i32 4, i32 3>
%27 = insertelement <4 x i32> poison, i32 %5, i64 0
%28 = shufflevector <4 x i32> %27, <4 x i32> poison, <4 x i32> zeroinitializer
%29 = icmp eq <4 x i32> %26, %28
%30 = select <4 x i1> %25, <4 x i1> %29, <4 x i1> zeroinitializer
%31 = bitcast <4 x i1> %30 to i4
%32 = call i4 @llvm.ctpop.i4(i4 %31), !range !16
%33 = zext i4 %32 to i32
br label %for.cond.cleanup3
for.cond.cleanup3: ; preds = %for.cond1.preheader.split.us, %entry, %for.body4.us.us.preheader
%.us-phi89 = phi i32 [ %33, %for.body4.us.us.preheader ], [ 0, %entry ], [ 0, %for.cond1.preheader.split.us ]
%34 = extractelement <2 x i32> %6, i64 0
%cmp3.not.i.1 = icmp eq i32 %34, %1
%cmp3.not.i.fr.1 = freeze i1 %cmp3.not.i.1
br i1 %cmp3.not.i.fr.1, label %for.cond1.preheader.split.us.1, label %for.cond.cleanup3.1
for.cond1.preheader.split.us.1: ; preds = %for.cond.cleanup3
%35 = extractelement <2 x i32> %6, i64 1
%cmp7.not.i.1 = icmp eq i32 %35, %2
%cmp7.not.i.fr.1 = freeze i1 %cmp7.not.i.1
br i1 %cmp7.not.i.fr.1, label %for.body4.us.us.preheader.1, label %for.cond.cleanup3.1
for.body4.us.us.preheader.1: ; preds = %for.cond1.preheader.split.us.1
%36 = insertelement <4 x i32> poison, i32 %0, i64 0
%37 = shufflevector <4 x i32> %36, <4 x i32> poison, <4 x i32> zeroinitializer
%38 = icmp eq <4 x i32> %7, %37
%39 = insertelement <4 x i32> poison, i32 %3, i64 0
%40 = shufflevector <4 x i32> %39, <4 x i32> poison, <4 x i32> zeroinitializer
%41 = icmp eq <4 x i32> %7, %40
%42 = shufflevector <4 x i1> %41, <4 x i1> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%43 = select <4 x i1> %38, <4 x i1> %42, <4 x i1> zeroinitializer
%44 = insertelement <4 x i32> poison, i32 %4, i64 0
%45 = shufflevector <4 x i32> %44, <4 x i32> poison, <4 x i32> zeroinitializer
%46 = icmp eq <4 x i32> %7, %45
%47 = shufflevector <4 x i1> %46, <4 x i1> poison, <4 x i32> <i32 2, i32 0, i32 3, i32 1>
%48 = select <4 x i1> %43, <4 x i1> %47, <4 x i1> zeroinitializer
%49 = insertelement <4 x i32> poison, i32 %5, i64 0
%50 = shufflevector <4 x i32> %49, <4 x i32> poison, <4 x i32> zeroinitializer
%51 = icmp eq <4 x i32> %7, %50
%52 = shufflevector <4 x i1> %51, <4 x i1> poison, <4 x i32> <i32 1, i32 3, i32 0, i32 2>
%53 = select <4 x i1> %48, <4 x i1> %52, <4 x i1> zeroinitializer
%54 = bitcast <4 x i1> %53 to i4
%55 = call i4 @llvm.ctpop.i4(i4 %54), !range !16
%56 = zext i4 %55 to i32
%op.rdx235 = add nuw nsw i32 %.us-phi89, %56
br label %for.cond.cleanup3.1
for.cond.cleanup3.1: ; preds = %for.cond1.preheader.split.us.1, %for.cond.cleanup3, %for.body4.us.us.preheader.1
%.us-phi89.1 = phi i32 [ %op.rdx235, %for.body4.us.us.preheader.1 ], [ %.us-phi89, %for.cond.cleanup3 ], [ %.us-phi89, %for.cond1.preheader.split.us.1 ]
%57 = extractelement <4 x i32> %7, i64 2
%cmp3.not.i.2 = icmp eq i32 %57, %1
%cmp3.not.i.fr.2 = freeze i1 %cmp3.not.i.2
br i1 %cmp3.not.i.fr.2, label %for.cond1.preheader.split.us.2, label %for.cond.cleanup3.2
for.cond1.preheader.split.us.2: ; preds = %for.cond.cleanup3.1
%cmp7.not.i.2 = icmp eq i32 %8, %2
%cmp7.not.i.fr.2 = freeze i1 %cmp7.not.i.2
br i1 %cmp7.not.i.fr.2, label %for.body4.us.us.preheader.2, label %for.cond.cleanup3.2
for.body4.us.us.preheader.2: ; preds = %for.cond1.preheader.split.us.2
%58 = shufflevector <4 x i32> %7, <4 x i32> poison, <4 x i32> <i32 0, i32 poison, i32 3, i32 poison>
%59 = shufflevector <2 x i32> %6, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
%60 = shufflevector <4 x i32> %58, <4 x i32> %59, <4 x i32> <i32 0, i32 5, i32 2, i32 4>
%61 = insertelement <4 x i32> poison, i32 %0, i64 0
%62 = shufflevector <4 x i32> %61, <4 x i32> poison, <4 x i32> zeroinitializer
%63 = icmp eq <4 x i32> %60, %62
%64 = shufflevector <4 x i32> %7, <4 x i32> %60, <4 x i32> <i32 3, i32 7, i32 0, i32 5>
%65 = insertelement <4 x i32> poison, i32 %3, i64 0
%66 = shufflevector <4 x i32> %65, <4 x i32> poison, <4 x i32> zeroinitializer
%67 = icmp eq <4 x i32> %64, %66
%68 = select <4 x i1> %63, <4 x i1> %67, <4 x i1> zeroinitializer
%69 = shufflevector <4 x i32> %7, <4 x i32> %60, <4 x i32> <i32 5, i32 3, i32 7, i32 0>
%70 = insertelement <4 x i32> poison, i32 %4, i64 0
%71 = shufflevector <4 x i32> %70, <4 x i32> poison, <4 x i32> zeroinitializer
%72 = icmp eq <4 x i32> %69, %71
%73 = select <4 x i1> %68, <4 x i1> %72, <4 x i1> zeroinitializer
%74 = shufflevector <4 x i32> %7, <4 x i32> %60, <4 x i32> <i32 7, i32 0, i32 5, i32 3>
%75 = insertelement <4 x i32> poison, i32 %5, i64 0
%76 = shufflevector <4 x i32> %75, <4 x i32> poison, <4 x i32> zeroinitializer
%77 = icmp eq <4 x i32> %74, %76
%78 = select <4 x i1> %73, <4 x i1> %77, <4 x i1> zeroinitializer
%79 = bitcast <4 x i1> %78 to i4
%80 = call i4 @llvm.ctpop.i4(i4 %79), !range !16
%81 = zext i4 %80 to i32
%op.rdx234 = add nsw i32 %.us-phi89.1, %81
br label %for.cond.cleanup3.2
for.cond.cleanup3.2: ; preds = %for.cond1.preheader.split.us.2, %for.cond.cleanup3.1, %for.body4.us.us.preheader.2
%.us-phi89.2 = phi i32 [ %op.rdx234, %for.body4.us.us.preheader.2 ], [ %.us-phi89.1, %for.cond.cleanup3.1 ], [ %.us-phi89.1, %for.cond1.preheader.split.us.2 ]
%82 = extractelement <2 x i32> %6, i64 1
%cmp3.not.i.3 = icmp eq i32 %82, %1
%cmp3.not.i.fr.3 = freeze i1 %cmp3.not.i.3
br i1 %cmp3.not.i.fr.3, label %for.cond1.preheader.split.us.3, label %for.cond.cleanup3.3
for.cond1.preheader.split.us.3: ; preds = %for.cond.cleanup3.2
%cmp7.not.i.3 = icmp eq i32 %34, %2
%cmp7.not.i.fr.3 = freeze i1 %cmp7.not.i.3
br i1 %cmp7.not.i.fr.3, label %for.body4.us.us.preheader.3, label %for.cond.cleanup3.3
for.body4.us.us.preheader.3: ; preds = %for.cond1.preheader.split.us.3
%83 = insertelement <4 x i32> poison, i32 %0, i64 0
%84 = shufflevector <4 x i32> %83, <4 x i32> poison, <4 x i32> zeroinitializer
%85 = icmp eq <4 x i32> %7, %84
%86 = insertelement <4 x i32> poison, i32 %3, i64 0
%87 = shufflevector <4 x i32> %86, <4 x i32> poison, <4 x i32> zeroinitializer
%88 = icmp eq <4 x i32> %7, %87
%89 = shufflevector <4 x i1> %88, <4 x i1> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%90 = insertelement <4 x i32> poison, i32 %4, i64 0
%91 = shufflevector <4 x i32> %90, <4 x i32> poison, <4 x i32> zeroinitializer
%92 = icmp eq <4 x i32> %7, %91
%93 = shufflevector <4 x i1> %92, <4 x i1> poison, <4 x i32> <i32 1, i32 3, i32 0, i32 2>
%94 = insertelement <4 x i32> poison, i32 %5, i64 0
%95 = shufflevector <4 x i32> %94, <4 x i32> poison, <4 x i32> zeroinitializer
%96 = icmp eq <4 x i32> %7, %95
%97 = shufflevector <4 x i1> %96, <4 x i1> poison, <4 x i32> <i32 2, i32 0, i32 3, i32 1>
%98 = select <4 x i1> %85, <4 x i1> %89, <4 x i1> zeroinitializer
%99 = select <4 x i1> %98, <4 x i1> %93, <4 x i1> zeroinitializer
%100 = select <4 x i1> %99, <4 x i1> %97, <4 x i1> zeroinitializer
%101 = bitcast <4 x i1> %100 to i4
%102 = call i4 @llvm.ctpop.i4(i4 %101), !range !16
%103 = zext i4 %102 to i32
%op.rdx = add nsw i32 %.us-phi89.2, %103
br label %for.cond.cleanup3.3
for.cond.cleanup3.3: ; preds = %for.cond1.preheader.split.us.3, %for.cond.cleanup3.2, %for.body4.us.us.preheader.3
%.us-phi89.3 = phi i32 [ %op.rdx, %for.body4.us.us.preheader.3 ], [ %.us-phi89.2, %for.cond.cleanup3.2 ], [ %.us-phi89.2, %for.cond1.preheader.split.us.3 ]
br i1 %cmp3.not.i.fr, label %for.cond14.preheader.split.us, label %for.cond.cleanup16
for.cond14.preheader.split.us: ; preds = %for.cond.cleanup3.3
%cmp7.not.i63 = icmp eq i32 %57, %2
%cmp7.not.i63.fr = freeze i1 %cmp7.not.i63
br i1 %cmp7.not.i63.fr, label %for.body17.us.us.preheader, label %for.cond.cleanup16
for.body17.us.us.preheader: ; preds = %for.cond14.preheader.split.us
%104 = extractelement <4 x i32> %7, i64 0
%cmp.not.i54.us.us = icmp eq i32 %104, %0
%105 = extractelement <4 x i32> %7, i64 3
%cmp11.not.i67.us.us = icmp eq i32 %105, %3
%or.cond146 = select i1 %cmp.not.i54.us.us, i1 %cmp11.not.i67.us.us, i1 false
%cmp15.not.i71.us.us = icmp eq i32 %34, %4
%or.cond147 = select i1 %or.cond146, i1 %cmp15.not.i71.us.us, i1 false
%cmp19.not.i75.us.us = icmp eq i32 %82, %5
%narrow148 = select i1 %or.cond147, i1 %cmp19.not.i75.us.us, i1 false
%retval.0.i55.us.us = zext i1 %narrow148 to i32
%add19.us.us = add nuw nsw i32 %.us-phi89.3, %retval.0.i55.us.us
%cmp.not.i54.us.us.1 = icmp eq i32 %34, %0
%cmp11.not.i67.us.us.1 = icmp eq i32 %82, %3
%or.cond146.1 = select i1 %cmp.not.i54.us.us.1, i1 %cmp11.not.i67.us.us.1, i1 false
%cmp15.not.i71.us.us.1 = icmp eq i32 %105, %4
%or.cond147.1 = select i1 %or.cond146.1, i1 %cmp15.not.i71.us.us.1, i1 false
%cmp19.not.i75.us.us.1 = icmp eq i32 %104, %5
%narrow148.1 = select i1 %or.cond147.1, i1 %cmp19.not.i75.us.us.1, i1 false
%retval.0.i55.us.us.1 = zext i1 %narrow148.1 to i32
%add19.us.us.1 = add nuw nsw i32 %add19.us.us, %retval.0.i55.us.us.1
%cmp.not.i54.us.us.2 = icmp eq i32 %105, %0
%cmp11.not.i67.us.us.2 = icmp eq i32 %104, %3
%or.cond146.2 = select i1 %cmp.not.i54.us.us.2, i1 %cmp11.not.i67.us.us.2, i1 false
%cmp15.not.i71.us.us.2 = icmp eq i32 %82, %4
%or.cond147.2 = select i1 %or.cond146.2, i1 %cmp15.not.i71.us.us.2, i1 false
%cmp19.not.i75.us.us.2 = icmp eq i32 %34, %5
%narrow148.2 = select i1 %or.cond147.2, i1 %cmp19.not.i75.us.us.2, i1 false
%retval.0.i55.us.us.2 = zext i1 %narrow148.2 to i32
%add19.us.us.2 = add nuw nsw i32 %add19.us.us.1, %retval.0.i55.us.us.2
%cmp.not.i54.us.us.3 = icmp eq i32 %82, %0
%cmp11.not.i67.us.us.3 = icmp eq i32 %34, %3
%or.cond146.3 = select i1 %cmp.not.i54.us.us.3, i1 %cmp11.not.i67.us.us.3, i1 false
%cmp15.not.i71.us.us.3 = icmp eq i32 %104, %4
%or.cond147.3 = select i1 %or.cond146.3, i1 %cmp15.not.i71.us.us.3, i1 false
%cmp19.not.i75.us.us.3 = icmp eq i32 %105, %5
%narrow148.3 = select i1 %or.cond147.3, i1 %cmp19.not.i75.us.us.3, i1 false
%retval.0.i55.us.us.3 = zext i1 %narrow148.3 to i32
%add19.us.us.3 = add nuw nsw i32 %add19.us.us.2, %retval.0.i55.us.us.3
br label %for.cond.cleanup16
for.cond.cleanup16: ; preds = %for.cond14.preheader.split.us, %for.cond.cleanup3.3, %for.body17.us.us.preheader
%.us-phi121 = phi i32 [ %add19.us.us.3, %for.body17.us.us.preheader ], [ %.us-phi89.3, %for.cond.cleanup3.3 ], [ %.us-phi89.3, %for.cond14.preheader.split.us ]
%106 = extractelement <4 x i32> %7, i64 0
%cmp3.not.i59.1 = icmp eq i32 %106, %1
%cmp3.not.i59.fr.1 = freeze i1 %cmp3.not.i59.1
br i1 %cmp3.not.i59.fr.1, label %for.cond14.preheader.split.us.1, label %for.cond.cleanup16.1
for.cond14.preheader.split.us.1: ; preds = %for.cond.cleanup16
%107 = extractelement <4 x i32> %7, i64 3
%cmp7.not.i63.1 = icmp eq i32 %107, %2
%cmp7.not.i63.fr.1 = freeze i1 %cmp7.not.i63.1
br i1 %cmp7.not.i63.fr.1, label %for.body17.us.us.preheader.1, label %for.cond.cleanup16.1
for.body17.us.us.preheader.1: ; preds = %for.cond14.preheader.split.us.1
%cmp.not.i54.us.us.1207 = icmp eq i32 %57, %0
%cmp11.not.i67.us.us.1208 = icmp eq i32 %8, %3
%or.cond146.1209 = select i1 %cmp.not.i54.us.us.1207, i1 %cmp11.not.i67.us.us.1208, i1 false
%cmp15.not.i71.us.us.1210 = icmp eq i32 %34, %4
%or.cond147.1211 = select i1 %or.cond146.1209, i1 %cmp15.not.i71.us.us.1210, i1 false
%cmp19.not.i75.us.us.1212 = icmp eq i32 %82, %5
%narrow148.1213 = select i1 %or.cond147.1211, i1 %cmp19.not.i75.us.us.1212, i1 false
%retval.0.i55.us.us.1214 = zext i1 %narrow148.1213 to i32
%add19.us.us.1215 = add nuw nsw i32 %.us-phi121, %retval.0.i55.us.us.1214
%cmp.not.i54.us.us.1.1 = icmp eq i32 %34, %0
%cmp11.not.i67.us.us.1.1 = icmp eq i32 %82, %3
%or.cond146.1.1 = select i1 %cmp.not.i54.us.us.1.1, i1 %cmp11.not.i67.us.us.1.1, i1 false
%cmp15.not.i71.us.us.1.1 = icmp eq i32 %8, %4
%or.cond147.1.1 = select i1 %or.cond146.1.1, i1 %cmp15.not.i71.us.us.1.1, i1 false
%cmp19.not.i75.us.us.1.1 = icmp eq i32 %57, %5
%narrow148.1.1 = select i1 %or.cond147.1.1, i1 %cmp19.not.i75.us.us.1.1, i1 false
%retval.0.i55.us.us.1.1 = zext i1 %narrow148.1.1 to i32
%add19.us.us.1.1 = add nuw nsw i32 %add19.us.us.1215, %retval.0.i55.us.us.1.1
%cmp.not.i54.us.us.2.1 = icmp eq i32 %8, %0
%cmp11.not.i67.us.us.2.1 = icmp eq i32 %57, %3
%or.cond146.2.1 = select i1 %cmp.not.i54.us.us.2.1, i1 %cmp11.not.i67.us.us.2.1, i1 false
%cmp15.not.i71.us.us.2.1 = icmp eq i32 %82, %4
%or.cond147.2.1 = select i1 %or.cond146.2.1, i1 %cmp15.not.i71.us.us.2.1, i1 false
%cmp19.not.i75.us.us.2.1 = icmp eq i32 %34, %5
%narrow148.2.1 = select i1 %or.cond147.2.1, i1 %cmp19.not.i75.us.us.2.1, i1 false
%retval.0.i55.us.us.2.1 = zext i1 %narrow148.2.1 to i32
%add19.us.us.2.1 = add nuw nsw i32 %add19.us.us.1.1, %retval.0.i55.us.us.2.1
%cmp.not.i54.us.us.3.1 = icmp eq i32 %82, %0
%cmp11.not.i67.us.us.3.1 = icmp eq i32 %34, %3
%or.cond146.3.1 = select i1 %cmp.not.i54.us.us.3.1, i1 %cmp11.not.i67.us.us.3.1, i1 false
%cmp15.not.i71.us.us.3.1 = icmp eq i32 %57, %4
%or.cond147.3.1 = select i1 %or.cond146.3.1, i1 %cmp15.not.i71.us.us.3.1, i1 false
%cmp19.not.i75.us.us.3.1 = icmp eq i32 %8, %5
%narrow148.3.1 = select i1 %or.cond147.3.1, i1 %cmp19.not.i75.us.us.3.1, i1 false
%retval.0.i55.us.us.3.1 = zext i1 %narrow148.3.1 to i32
%add19.us.us.3.1 = add nuw nsw i32 %add19.us.us.2.1, %retval.0.i55.us.us.3.1
br label %for.cond.cleanup16.1
for.cond.cleanup16.1: ; preds = %for.cond14.preheader.split.us.1, %for.cond.cleanup16, %for.body17.us.us.preheader.1
%.us-phi121.1 = phi i32 [ %add19.us.us.3.1, %for.body17.us.us.preheader.1 ], [ %.us-phi121, %for.cond.cleanup16 ], [ %.us-phi121, %for.cond14.preheader.split.us.1 ]
br i1 %cmp3.not.i.fr.2, label %for.cond14.preheader.split.us.2, label %for.cond.cleanup16.2
for.cond14.preheader.split.us.2: ; preds = %for.cond.cleanup16.1
%cmp7.not.i63.2 = icmp eq i32 %8, %2
%cmp7.not.i63.fr.2 = freeze i1 %cmp7.not.i63.2
br i1 %cmp7.not.i63.fr.2, label %for.body17.us.us.preheader.2, label %for.cond.cleanup16.2
for.body17.us.us.preheader.2: ; preds = %for.cond14.preheader.split.us.2
%108 = extractelement <4 x i32> %7, i64 3
%cmp.not.i54.us.us.2216 = icmp eq i32 %108, %0
%cmp11.not.i67.us.us.2217 = icmp eq i32 %106, %3
%or.cond146.2218 = select i1 %cmp.not.i54.us.us.2216, i1 %cmp11.not.i67.us.us.2217, i1 false
%cmp15.not.i71.us.us.2219 = icmp eq i32 %34, %4
%or.cond147.2220 = select i1 %or.cond146.2218, i1 %cmp15.not.i71.us.us.2219, i1 false
%cmp19.not.i75.us.us.2221 = icmp eq i32 %82, %5
%narrow148.2222 = select i1 %or.cond147.2220, i1 %cmp19.not.i75.us.us.2221, i1 false
%retval.0.i55.us.us.2223 = zext i1 %narrow148.2222 to i32
%add19.us.us.2224 = add nuw nsw i32 %.us-phi121.1, %retval.0.i55.us.us.2223
%cmp.not.i54.us.us.1.2 = icmp eq i32 %34, %0
%cmp11.not.i67.us.us.1.2 = icmp eq i32 %82, %3
%or.cond146.1.2 = select i1 %cmp.not.i54.us.us.1.2, i1 %cmp11.not.i67.us.us.1.2, i1 false
%cmp15.not.i71.us.us.1.2 = icmp eq i32 %106, %4
%or.cond147.1.2 = select i1 %or.cond146.1.2, i1 %cmp15.not.i71.us.us.1.2, i1 false
%cmp19.not.i75.us.us.1.2 = icmp eq i32 %108, %5
%narrow148.1.2 = select i1 %or.cond147.1.2, i1 %cmp19.not.i75.us.us.1.2, i1 false
%retval.0.i55.us.us.1.2 = zext i1 %narrow148.1.2 to i32
%add19.us.us.1.2 = add nuw nsw i32 %add19.us.us.2224, %retval.0.i55.us.us.1.2
%cmp.not.i54.us.us.2.2 = icmp eq i32 %106, %0
%cmp11.not.i67.us.us.2.2 = icmp eq i32 %108, %3
%or.cond146.2.2 = select i1 %cmp.not.i54.us.us.2.2, i1 %cmp11.not.i67.us.us.2.2, i1 false
%cmp15.not.i71.us.us.2.2 = icmp eq i32 %82, %4
%or.cond147.2.2 = select i1 %or.cond146.2.2, i1 %cmp15.not.i71.us.us.2.2, i1 false
%cmp19.not.i75.us.us.2.2 = icmp eq i32 %34, %5
%narrow148.2.2 = select i1 %or.cond147.2.2, i1 %cmp19.not.i75.us.us.2.2, i1 false
%retval.0.i55.us.us.2.2 = zext i1 %narrow148.2.2 to i32
%add19.us.us.2.2 = add nuw nsw i32 %add19.us.us.1.2, %retval.0.i55.us.us.2.2
%cmp.not.i54.us.us.3.2 = icmp eq i32 %82, %0
%cmp11.not.i67.us.us.3.2 = icmp eq i32 %34, %3
%or.cond146.3.2 = select i1 %cmp.not.i54.us.us.3.2, i1 %cmp11.not.i67.us.us.3.2, i1 false
%cmp15.not.i71.us.us.3.2 = icmp eq i32 %108, %4
%or.cond147.3.2 = select i1 %or.cond146.3.2, i1 %cmp15.not.i71.us.us.3.2, i1 false
%cmp19.not.i75.us.us.3.2 = icmp eq i32 %106, %5
%narrow148.3.2 = select i1 %or.cond147.3.2, i1 %cmp19.not.i75.us.us.3.2, i1 false
%retval.0.i55.us.us.3.2 = zext i1 %narrow148.3.2 to i32
%add19.us.us.3.2 = add nuw nsw i32 %add19.us.us.2.2, %retval.0.i55.us.us.3.2
br label %for.cond.cleanup16.2
for.cond.cleanup16.2: ; preds = %for.cond14.preheader.split.us.2, %for.cond.cleanup16.1, %for.body17.us.us.preheader.2
%.us-phi121.2 = phi i32 [ %add19.us.us.3.2, %for.body17.us.us.preheader.2 ], [ %.us-phi121.1, %for.cond.cleanup16.1 ], [ %.us-phi121.1, %for.cond14.preheader.split.us.2 ]
%109 = extractelement <4 x i32> %7, i64 3
%cmp3.not.i59.3 = icmp eq i32 %109, %1
%cmp3.not.i59.fr.3 = freeze i1 %cmp3.not.i59.3
br i1 %cmp3.not.i59.fr.3, label %for.cond14.preheader.split.us.3, label %for.cond.cleanup16.3
for.cond14.preheader.split.us.3: ; preds = %for.cond.cleanup16.2
%cmp7.not.i63.3 = icmp eq i32 %106, %2
%cmp7.not.i63.fr.3 = freeze i1 %cmp7.not.i63.3
br i1 %cmp7.not.i63.fr.3, label %for.body17.us.us.preheader.3, label %for.cond.cleanup16.3
for.body17.us.us.preheader.3: ; preds = %for.cond14.preheader.split.us.3
%cmp.not.i54.us.us.3225 = icmp eq i32 %8, %0
%cmp11.not.i67.us.us.3226 = icmp eq i32 %57, %3
%or.cond146.3227 = select i1 %cmp.not.i54.us.us.3225, i1 %cmp11.not.i67.us.us.3226, i1 false
%cmp15.not.i71.us.us.3228 = icmp eq i32 %34, %4
%or.cond147.3229 = select i1 %or.cond146.3227, i1 %cmp15.not.i71.us.us.3228, i1 false
%cmp19.not.i75.us.us.3230 = icmp eq i32 %82, %5
%narrow148.3231 = select i1 %or.cond147.3229, i1 %cmp19.not.i75.us.us.3230, i1 false
%retval.0.i55.us.us.3232 = zext i1 %narrow148.3231 to i32
%add19.us.us.3233 = add nuw nsw i32 %.us-phi121.2, %retval.0.i55.us.us.3232
%cmp.not.i54.us.us.1.3 = icmp eq i32 %34, %0
%cmp11.not.i67.us.us.1.3 = icmp eq i32 %82, %3
%or.cond146.1.3 = select i1 %cmp.not.i54.us.us.1.3, i1 %cmp11.not.i67.us.us.1.3, i1 false
%cmp15.not.i71.us.us.1.3 = icmp eq i32 %57, %4
%or.cond147.1.3 = select i1 %or.cond146.1.3, i1 %cmp15.not.i71.us.us.1.3, i1 false
%cmp19.not.i75.us.us.1.3 = icmp eq i32 %8, %5
%narrow148.1.3 = select i1 %or.cond147.1.3, i1 %cmp19.not.i75.us.us.1.3, i1 false
%retval.0.i55.us.us.1.3 = zext i1 %narrow148.1.3 to i32
%add19.us.us.1.3 = add nuw nsw i32 %add19.us.us.3233, %retval.0.i55.us.us.1.3
%cmp.not.i54.us.us.2.3 = icmp eq i32 %57, %0
%cmp11.not.i67.us.us.2.3 = icmp eq i32 %8, %3
%or.cond146.2.3 = select i1 %cmp.not.i54.us.us.2.3, i1 %cmp11.not.i67.us.us.2.3, i1 false
%cmp15.not.i71.us.us.2.3 = icmp eq i32 %82, %4
%or.cond147.2.3 = select i1 %or.cond146.2.3, i1 %cmp15.not.i71.us.us.2.3, i1 false
%cmp19.not.i75.us.us.2.3 = icmp eq i32 %34, %5
%narrow148.2.3 = select i1 %or.cond147.2.3, i1 %cmp19.not.i75.us.us.2.3, i1 false
%retval.0.i55.us.us.2.3 = zext i1 %narrow148.2.3 to i32
%add19.us.us.2.3 = add nuw nsw i32 %add19.us.us.1.3, %retval.0.i55.us.us.2.3
%cmp.not.i54.us.us.3.3 = icmp eq i32 %82, %0
%cmp11.not.i67.us.us.3.3 = icmp eq i32 %34, %3
%or.cond146.3.3 = select i1 %cmp.not.i54.us.us.3.3, i1 %cmp11.not.i67.us.us.3.3, i1 false
%cmp15.not.i71.us.us.3.3 = icmp eq i32 %8, %4
%or.cond147.3.3 = select i1 %or.cond146.3.3, i1 %cmp15.not.i71.us.us.3.3, i1 false
%cmp19.not.i75.us.us.3.3 = icmp eq i32 %57, %5
%narrow148.3.3 = select i1 %or.cond147.3.3, i1 %cmp19.not.i75.us.us.3.3, i1 false
%retval.0.i55.us.us.3.3 = zext i1 %narrow148.3.3 to i32
%add19.us.us.3.3 = add nuw nsw i32 %add19.us.us.2.3, %retval.0.i55.us.us.3.3
br label %for.cond.cleanup16.3
for.cond.cleanup16.3: ; preds = %for.cond14.preheader.split.us.3, %for.cond.cleanup16.2, %for.body17.us.us.preheader.3
%.us-phi121.3 = phi i32 [ %add19.us.us.3.3, %for.body17.us.us.preheader.3 ], [ %.us-phi121.2, %for.cond.cleanup16.2 ], [ %.us-phi121.2, %for.cond14.preheader.split.us.3 ]
%tobool.not = icmp eq i32 %.us-phi121.3, 0
%cond = select i1 %tobool.not, ptr @.str.3, ptr @.str.2
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %cond)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %d2) #7
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %d1) #7
ret i32 0
}
; 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 i4 @llvm.ctpop.i4(i4) #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 = { nofree nounwind "no-trapping-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: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree 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 = { 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 16}
!11 = !{!6, !7, i64 12}
!12 = !{!6, !7, i64 20}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !7, i64 4}
!15 = !{!6, !7, i64 8}
!16 = !{i4 0, i4 5}
|
#include <stdio.h>
#include <string.h>
typedef struct Dice {
int north,south,east,west,top,bottom;
} Dice;
typedef void (*DiceCmd)(Dice* dp);
void turn_north(Dice* dp){
int tmp;
tmp = dp->top;
dp->top = dp->south;
dp->south = dp->bottom;
dp->bottom = dp->north;
dp->north = tmp;
}
void turn_south(Dice* dp){
int tmp;
tmp = dp->top;
dp->top = dp->north;
dp->north = dp->bottom;
dp->bottom = dp->south;
dp->south = tmp;
}
void turn_east(Dice* dp){
int tmp;
tmp = dp->top;
dp->top = dp->west;
dp->west = dp->bottom;
dp->bottom = dp->east;
dp->east = tmp;
}
void turn_west(Dice* dp){
int tmp;
tmp = dp->top;
dp->top = dp->east;
dp->east = dp->bottom;
dp->bottom = dp->west;
dp->west = tmp;
}
void clockwise(Dice* dp){
int tmp;
tmp = dp->south;
dp->south = dp->east;
dp->east = dp->north;
dp->north = dp->west;
dp->west = tmp;
}
void anticlockwise(Dice* dp){
int tmp;
tmp = dp->south;
dp->south = dp->west;
dp->west = dp->north;
dp->north = dp->east;
dp->east = tmp;
}
void input_dice(Dice *dp){
scanf("%d",&dp->top);
scanf("%d",&dp->south);
scanf("%d",&dp->east);
scanf("%d",&dp->west);
scanf("%d",&dp->north);
scanf("%d",&dp->bottom);
}
int main(int argc, char** argv){
Dice d0,d[2];
int q_cnt,q_top,q_south;
DiceCmd dice_cmd[6][3] = {
{ turn_north, NULL, NULL }, // South -> Top
{ turn_south, NULL, NULL }, // North -> Top
{ turn_east, NULL, NULL }, // West -> Top
{ turn_west, NULL, NULL }, // Eas -> Top
{ NULL, NULL, NULL }, // Top -> Top
{ turn_north, turn_north, NULL }, // Bottom -> Top
};
int i,j;
int yes;
// Input
for(i=0;i<=1;i++){
input_dice(&d[i]);
}
// Solve
yes = 0;
for(i=0;i<=5;i++){
// Reset
memcpy( &d0, &d[0], sizeof(Dice) );
// Turn
for(j=0; dice_cmd[i][j]!=NULL; j++){
dice_cmd[i][j](&d0);
}
// Turn & Check
j=1;
for(;;){
if( memcmp(&d0, &d[1], sizeof(Dice)) == 0 ){
yes = 1;
break;
} else if( j<4 ){
clockwise(&d0);
j++;
} else {
break;
}
}
if( yes ) {
break;
}
}
// Output
if( yes ){
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117024/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117024/source.c"
target datalayout = "e-m:e-p270: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.Dice = type { i32, i32, i32, i32, i32, i32 }
@.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 norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @turn_north(ptr nocapture noundef %dp) local_unnamed_addr #0 {
entry:
%top = getelementptr inbounds %struct.Dice, ptr %dp, i64 0, i32 4
%0 = load <2 x i32>, ptr %top, align 4, !tbaa !5
%1 = load <2 x i32>, ptr %dp, align 4, !tbaa !5
%2 = shufflevector <2 x i32> %1, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
store <2 x i32> %2, ptr %top, align 4, !tbaa !5
store <2 x i32> %0, ptr %dp, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @turn_south(ptr nocapture noundef %dp) local_unnamed_addr #0 {
entry:
%top = getelementptr inbounds %struct.Dice, ptr %dp, i64 0, i32 4
%0 = load <2 x i32>, ptr %top, align 4, !tbaa !5
%1 = load <2 x i32>, ptr %dp, align 4, !tbaa !5
store <2 x i32> %1, ptr %top, align 4, !tbaa !5
%2 = shufflevector <2 x i32> %0, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
store <2 x i32> %2, ptr %dp, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @turn_east(ptr nocapture noundef %dp) local_unnamed_addr #0 {
entry:
%east = getelementptr inbounds %struct.Dice, ptr %dp, i64 0, i32 2
%0 = load <4 x i32>, ptr %east, align 4, !tbaa !5
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 2, i32 3, i32 1, i32 0>
store <4 x i32> %1, ptr %east, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @turn_west(ptr nocapture noundef %dp) local_unnamed_addr #0 {
entry:
%east = getelementptr inbounds %struct.Dice, ptr %dp, i64 0, i32 2
%0 = load <4 x i32>, ptr %east, align 4, !tbaa !5
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 0, i32 1>
store <4 x i32> %1, ptr %east, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @clockwise(ptr nocapture noundef %dp) local_unnamed_addr #0 {
entry:
%0 = load <4 x i32>, ptr %dp, align 4, !tbaa !5
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 0, i32 1>
store <4 x i32> %1, ptr %dp, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @anticlockwise(ptr nocapture noundef %dp) local_unnamed_addr #0 {
entry:
%0 = load <4 x i32>, ptr %dp, align 4, !tbaa !5
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 2, i32 3, i32 1, i32 0>
store <4 x i32> %1, ptr %dp, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @input_dice(ptr noundef %dp) local_unnamed_addr #2 {
entry:
%top = getelementptr inbounds %struct.Dice, ptr %dp, i64 0, i32 4
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %top)
%south = getelementptr inbounds %struct.Dice, ptr %dp, i64 0, i32 1
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %south)
%east = getelementptr inbounds %struct.Dice, ptr %dp, i64 0, i32 2
%call2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %east)
%west = getelementptr inbounds %struct.Dice, ptr %dp, i64 0, i32 3
%call3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %west)
%call4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %dp)
%bottom = getelementptr inbounds %struct.Dice, ptr %dp, i64 0, i32 5
%call5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %bottom)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #2 {
for.cond19.preheader:
%d0 = alloca %struct.Dice, align 8
%d = alloca [2 x %struct.Dice], align 16
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %d0) #7
call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %d) #7
%top.i = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 0, i32 4
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %top.i)
%south.i = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 0, i32 1
%call1.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %south.i)
%east.i = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 0, i32 2
%call2.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %east.i)
%west.i = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 0, i32 3
%call3.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %west.i)
%call4.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d)
%bottom.i = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 0, i32 5
%call5.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %bottom.i)
%arrayidx.1 = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 1
%top.i.1 = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 1, i32 4
%call.i.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %top.i.1)
%south.i.1 = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 1, i32 1
%call1.i.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %south.i.1)
%east.i.1 = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 1, i32 2
%call2.i.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %east.i.1)
%west.i.1 = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 1, i32 3
%call3.i.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %west.i.1)
%call4.i.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%bottom.i.1 = getelementptr inbounds [2 x %struct.Dice], ptr %d, i64 0, i64 1, i32 5
%call5.i.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %bottom.i.1)
%south.i51 = getelementptr inbounds %struct.Dice, ptr %d0, i64 0, i32 1
%east.i52 = getelementptr inbounds %struct.Dice, ptr %d0, i64 0, i32 2
%west.i53 = getelementptr inbounds %struct.Dice, ptr %d0, i64 0, i32 3
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %d0, ptr noundef nonnull align 16 dereferenceable(24) %d, i64 24, i1 false)
%top.i74 = getelementptr inbounds %struct.Dice, ptr %d0, i64 0, i32 4
%0 = load i32, ptr %top.i74, align 8, !tbaa !9
%bottom.i76 = getelementptr inbounds %struct.Dice, ptr %d0, i64 0, i32 5
%1 = load i32, ptr %bottom.i76, align 4, !tbaa !11
%2 = load <2 x i32>, ptr %d0, align 8, !tbaa !5
store i32 %1, ptr %south.i51, align 4, !tbaa !12
%3 = shufflevector <2 x i32> %2, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
store <2 x i32> %3, ptr %top.i74, align 8, !tbaa !5
store i32 %0, ptr %d0, align 8, !tbaa !13
%bcmp58 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not59.not = icmp eq i32 %bcmp58, 0
br i1 %cmp21.not59.not, label %if.then34, label %if.then23.lr.ph
for.cond19.preheader.1: ; preds = %for.end27
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %d0, ptr noundef nonnull align 16 dereferenceable(24) %d, i64 24, i1 false)
%4 = load i32, ptr %top.i74, align 8, !tbaa !9
%5 = load i32, ptr %bottom.i76, align 4, !tbaa !11
%6 = load <2 x i32>, ptr %d0, align 8, !tbaa !5
store i32 %5, ptr %d0, align 8, !tbaa !13
store <2 x i32> %6, ptr %top.i74, align 8, !tbaa !5
store i32 %4, ptr %south.i51, align 4, !tbaa !12
%bcmp58.1 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not59.1.not = icmp eq i32 %bcmp58.1, 0
br i1 %cmp21.not59.1.not, label %if.then34, label %if.then23.lr.ph.1
if.then23.lr.ph.1: ; preds = %for.cond19.preheader.1
%east.i52.promoted.1 = load i32, ptr %east.i52, align 8, !tbaa !14
%west.i53.promoted.1 = load i32, ptr %west.i53, align 4, !tbaa !15
br label %if.then23.1
if.then23.1: ; preds = %if.then23.1, %if.then23.lr.ph.1
%7 = phi i32 [ %west.i53.promoted.1, %if.then23.lr.ph.1 ], [ %9, %if.then23.1 ]
%8 = phi i32 [ %east.i52.promoted.1, %if.then23.lr.ph.1 ], [ %10, %if.then23.1 ]
%9 = phi i32 [ %4, %if.then23.lr.ph.1 ], [ %8, %if.then23.1 ]
%j.160.1 = phi i32 [ 1, %if.then23.lr.ph.1 ], [ %inc24.1, %if.then23.1 ]
%10 = phi i32 [ %5, %if.then23.lr.ph.1 ], [ %7, %if.then23.1 ]
store i32 %8, ptr %south.i51, align 4, !tbaa !12
store i32 %10, ptr %east.i52, align 8, !tbaa !14
store i32 %7, ptr %d0, align 8, !tbaa !13
store i32 %9, ptr %west.i53, align 4, !tbaa !15
%inc24.1 = add nuw nsw i32 %j.160.1, 1
%bcmp.1 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not.1 = icmp ne i32 %bcmp.1, 0
%cmp22.1 = icmp ult i32 %j.160.1, 3
%or.cond.1 = select i1 %cmp21.not.1, i1 %cmp22.1, i1 false
br i1 %or.cond.1, label %if.then23.1, label %for.end27.1
for.end27.1: ; preds = %if.then23.1
br i1 %cmp21.not.1, label %for.cond19.preheader.2, label %if.then34
for.cond19.preheader.2: ; preds = %for.end27.1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %d0, ptr noundef nonnull align 16 dereferenceable(24) %d, i64 24, i1 false)
%11 = load <4 x i32>, ptr %east.i52, align 8, !tbaa !5
%12 = shufflevector <4 x i32> %11, <4 x i32> poison, <4 x i32> <i32 2, i32 3, i32 1, i32 0>
store <4 x i32> %12, ptr %east.i52, align 8, !tbaa !5
%bcmp58.2 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not59.2.not = icmp eq i32 %bcmp58.2, 0
br i1 %cmp21.not59.2.not, label %if.then34, label %if.then23.lr.ph.2
if.then23.lr.ph.2: ; preds = %for.cond19.preheader.2
%d0.promoted.2 = load i32, ptr %d0, align 8, !tbaa !13
%south.i51.promoted.2 = load i32, ptr %south.i51, align 4, !tbaa !12
%13 = extractelement <4 x i32> %11, i64 2
%14 = extractelement <4 x i32> %11, i64 3
br label %if.then23.2
if.then23.2: ; preds = %if.then23.2, %if.then23.lr.ph.2
%15 = phi i32 [ %14, %if.then23.lr.ph.2 ], [ %17, %if.then23.2 ]
%16 = phi i32 [ %13, %if.then23.lr.ph.2 ], [ %18, %if.then23.2 ]
%17 = phi i32 [ %south.i51.promoted.2, %if.then23.lr.ph.2 ], [ %16, %if.then23.2 ]
%j.160.2 = phi i32 [ 1, %if.then23.lr.ph.2 ], [ %inc24.2, %if.then23.2 ]
%18 = phi i32 [ %d0.promoted.2, %if.then23.lr.ph.2 ], [ %15, %if.then23.2 ]
store i32 %16, ptr %south.i51, align 4, !tbaa !12
store i32 %18, ptr %east.i52, align 8, !tbaa !14
store i32 %15, ptr %d0, align 8, !tbaa !13
store i32 %17, ptr %west.i53, align 4, !tbaa !15
%inc24.2 = add nuw nsw i32 %j.160.2, 1
%bcmp.2 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not.2 = icmp ne i32 %bcmp.2, 0
%cmp22.2 = icmp ult i32 %j.160.2, 3
%or.cond.2 = select i1 %cmp21.not.2, i1 %cmp22.2, i1 false
br i1 %or.cond.2, label %if.then23.2, label %for.end27.2
for.end27.2: ; preds = %if.then23.2
br i1 %cmp21.not.2, label %for.cond19.preheader.3, label %if.then34
for.cond19.preheader.3: ; preds = %for.end27.2
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %d0, ptr noundef nonnull align 16 dereferenceable(24) %d, i64 24, i1 false)
%19 = load <4 x i32>, ptr %east.i52, align 8, !tbaa !5
%20 = shufflevector <4 x i32> %19, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 0, i32 1>
store <4 x i32> %20, ptr %east.i52, align 8, !tbaa !5
%bcmp58.3 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not59.3.not = icmp eq i32 %bcmp58.3, 0
br i1 %cmp21.not59.3.not, label %if.then34, label %if.then23.lr.ph.3
if.then23.lr.ph.3: ; preds = %for.cond19.preheader.3
%d0.promoted.3 = load i32, ptr %d0, align 8, !tbaa !13
%south.i51.promoted.3 = load i32, ptr %south.i51, align 4, !tbaa !12
%21 = extractelement <4 x i32> %19, i64 2
%22 = extractelement <4 x i32> %19, i64 3
br label %if.then23.3
if.then23.3: ; preds = %if.then23.3, %if.then23.lr.ph.3
%23 = phi i32 [ %21, %if.then23.lr.ph.3 ], [ %25, %if.then23.3 ]
%24 = phi i32 [ %22, %if.then23.lr.ph.3 ], [ %26, %if.then23.3 ]
%25 = phi i32 [ %south.i51.promoted.3, %if.then23.lr.ph.3 ], [ %24, %if.then23.3 ]
%j.160.3 = phi i32 [ 1, %if.then23.lr.ph.3 ], [ %inc24.3, %if.then23.3 ]
%26 = phi i32 [ %d0.promoted.3, %if.then23.lr.ph.3 ], [ %23, %if.then23.3 ]
store i32 %24, ptr %south.i51, align 4, !tbaa !12
store i32 %26, ptr %east.i52, align 8, !tbaa !14
store i32 %23, ptr %d0, align 8, !tbaa !13
store i32 %25, ptr %west.i53, align 4, !tbaa !15
%inc24.3 = add nuw nsw i32 %j.160.3, 1
%bcmp.3 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not.3 = icmp ne i32 %bcmp.3, 0
%cmp22.3 = icmp ult i32 %j.160.3, 3
%or.cond.3 = select i1 %cmp21.not.3, i1 %cmp22.3, i1 false
br i1 %or.cond.3, label %if.then23.3, label %for.end27.3
for.end27.3: ; preds = %if.then23.3
br i1 %cmp21.not.3, label %for.cond19.preheader.4, label %if.then34
for.cond19.preheader.4: ; preds = %for.end27.3
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %d0, ptr noundef nonnull align 16 dereferenceable(24) %d, i64 24, i1 false)
%bcmp58.4 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not59.4.not = icmp eq i32 %bcmp58.4, 0
br i1 %cmp21.not59.4.not, label %if.then34, label %if.then23.lr.ph.4
if.then23.lr.ph.4: ; preds = %for.cond19.preheader.4
%d0.promoted.4 = load i32, ptr %d0, align 8, !tbaa !13
%south.i51.promoted.4 = load i32, ptr %south.i51, align 4, !tbaa !12
%east.i52.promoted.4 = load i32, ptr %east.i52, align 8, !tbaa !14
%west.i53.promoted.4 = load i32, ptr %west.i53, align 4, !tbaa !15
br label %if.then23.4
if.then23.4: ; preds = %if.then23.4, %if.then23.lr.ph.4
%27 = phi i32 [ %west.i53.promoted.4, %if.then23.lr.ph.4 ], [ %29, %if.then23.4 ]
%28 = phi i32 [ %east.i52.promoted.4, %if.then23.lr.ph.4 ], [ %30, %if.then23.4 ]
%29 = phi i32 [ %south.i51.promoted.4, %if.then23.lr.ph.4 ], [ %28, %if.then23.4 ]
%j.160.4 = phi i32 [ 1, %if.then23.lr.ph.4 ], [ %inc24.4, %if.then23.4 ]
%30 = phi i32 [ %d0.promoted.4, %if.then23.lr.ph.4 ], [ %27, %if.then23.4 ]
store i32 %28, ptr %south.i51, align 4, !tbaa !12
store i32 %30, ptr %east.i52, align 8, !tbaa !14
store i32 %27, ptr %d0, align 8, !tbaa !13
store i32 %29, ptr %west.i53, align 4, !tbaa !15
%inc24.4 = add nuw nsw i32 %j.160.4, 1
%bcmp.4 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not.4 = icmp ne i32 %bcmp.4, 0
%cmp22.4 = icmp ult i32 %j.160.4, 3
%or.cond.4 = select i1 %cmp21.not.4, i1 %cmp22.4, i1 false
br i1 %or.cond.4, label %if.then23.4, label %for.end27.4
for.end27.4: ; preds = %if.then23.4
br i1 %cmp21.not.4, label %for.cond19.preheader.5, label %if.then34
for.cond19.preheader.5: ; preds = %for.end27.4
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %d0, ptr noundef nonnull align 16 dereferenceable(24) %d, i64 24, i1 false)
%31 = load i32, ptr %south.i51, align 4, !tbaa !12
%32 = load i32, ptr %d0, align 8, !tbaa !13
store i32 %32, ptr %south.i51, align 4, !tbaa !12
%33 = load <2 x i32>, ptr %top.i74, align 8, !tbaa !5
%34 = shufflevector <2 x i32> %33, <2 x i32> poison, <2 x i32> <i32 1, i32 0>
store <2 x i32> %34, ptr %top.i74, align 8, !tbaa !5
store i32 %31, ptr %d0, align 8, !tbaa !13
%bcmp58.5 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not59.5.not = icmp eq i32 %bcmp58.5, 0
br i1 %cmp21.not59.5.not, label %if.then34, label %if.then23.lr.ph.5
if.then23.lr.ph.5: ; preds = %for.cond19.preheader.5
%east.i52.promoted.5 = load i32, ptr %east.i52, align 8, !tbaa !14
%west.i53.promoted.5 = load i32, ptr %west.i53, align 4, !tbaa !15
br label %if.then23.5
if.then23.5: ; preds = %if.then23.5, %if.then23.lr.ph.5
%35 = phi i32 [ %west.i53.promoted.5, %if.then23.lr.ph.5 ], [ %37, %if.then23.5 ]
%36 = phi i32 [ %east.i52.promoted.5, %if.then23.lr.ph.5 ], [ %38, %if.then23.5 ]
%37 = phi i32 [ %32, %if.then23.lr.ph.5 ], [ %36, %if.then23.5 ]
%j.160.5 = phi i32 [ 1, %if.then23.lr.ph.5 ], [ %inc24.5, %if.then23.5 ]
%38 = phi i32 [ %31, %if.then23.lr.ph.5 ], [ %35, %if.then23.5 ]
store i32 %36, ptr %south.i51, align 4, !tbaa !12
store i32 %38, ptr %east.i52, align 8, !tbaa !14
store i32 %35, ptr %d0, align 8, !tbaa !13
store i32 %37, ptr %west.i53, align 4, !tbaa !15
%inc24.5 = add nuw nsw i32 %j.160.5, 1
%bcmp.5 = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not.5 = icmp ne i32 %bcmp.5, 0
%cmp22.5 = icmp ult i32 %j.160.5, 3
%or.cond.5 = select i1 %cmp21.not.5, i1 %cmp22.5, i1 false
br i1 %or.cond.5, label %if.then23.5, label %for.end27.5
for.end27.5: ; preds = %if.then23.5
br i1 %cmp21.not.5, label %if.end38, label %if.then34
if.then23.lr.ph: ; preds = %for.cond19.preheader
%east.i52.promoted = load i32, ptr %east.i52, align 8, !tbaa !14
%west.i53.promoted = load i32, ptr %west.i53, align 4, !tbaa !15
br label %if.then23
if.then23: ; preds = %if.then23.lr.ph, %if.then23
%39 = phi i32 [ %west.i53.promoted, %if.then23.lr.ph ], [ %41, %if.then23 ]
%40 = phi i32 [ %east.i52.promoted, %if.then23.lr.ph ], [ %42, %if.then23 ]
%41 = phi i32 [ %1, %if.then23.lr.ph ], [ %40, %if.then23 ]
%j.160 = phi i32 [ 1, %if.then23.lr.ph ], [ %inc24, %if.then23 ]
%42 = phi i32 [ %0, %if.then23.lr.ph ], [ %39, %if.then23 ]
store i32 %40, ptr %south.i51, align 4, !tbaa !12
store i32 %42, ptr %east.i52, align 8, !tbaa !14
store i32 %39, ptr %d0, align 8, !tbaa !13
store i32 %41, ptr %west.i53, align 4, !tbaa !15
%inc24 = add nuw nsw i32 %j.160, 1
%bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(24) %d0, ptr noundef nonnull dereferenceable(24) %arrayidx.1, i64 24)
%cmp21.not = icmp ne i32 %bcmp, 0
%cmp22 = icmp ult i32 %j.160, 3
%or.cond = select i1 %cmp21.not, i1 %cmp22, i1 false
br i1 %or.cond, label %if.then23, label %for.end27
for.end27: ; preds = %if.then23
br i1 %cmp21.not, label %for.cond19.preheader.1, label %if.then34
if.then34: ; preds = %for.cond19.preheader, %for.cond19.preheader.5, %for.cond19.preheader.4, %for.cond19.preheader.3, %for.cond19.preheader.2, %for.cond19.preheader.1, %for.end27.5, %for.end27.4, %for.end27.3, %for.end27.2, %for.end27.1, %for.end27
br label %if.end38
if.end38: ; preds = %for.end27.5, %if.then34
%str.sink = phi ptr [ @str.3, %if.then34 ], [ @str, %for.end27.5 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %d) #7
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %d0) #7
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) #4
; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind willreturn memory(argmem: read) }
attributes #6 = { nofree nounwind }
attributes #7 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"Dice", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!11 = !{!10, !6, i64 20}
!12 = !{!10, !6, i64 4}
!13 = !{!10, !6, i64 0}
!14 = !{!10, !6, i64 8}
!15 = !{!10, !6, i64 12}
|
#include <stdio.h>
#include <string.h>
typedef struct{
int top,front,right,left,back,bottom;
}Dice;
void roll(char c,Dice* d){
int tmp;
switch(c){
case 'N':
tmp=d->top;
d->top=d->front;
d->front=d->bottom;
d->bottom=d->back;
d->back=tmp;
break;
case 'S':
tmp=d->top;
d->top=d->back;
d->back=d->bottom;
d->bottom=d->front;
d->front=tmp;
break;
case 'E':
tmp=d->top;
d->top=d->left;
d->left=d->bottom;
d->bottom=d->right;
d->right=tmp;
break;
case 'W':
tmp=d->top;
d->top=d->right;
d->right=d->bottom;
d->bottom=d->left;
d->left=tmp;
break;
}
return;
}
int main(void){
int i;
Dice d1;
scanf("%d%d%d%d%d%d",&d1.top,&d1.front,&d1.right,&d1.left,&d1.back,&d1.bottom);
Dice d2;
scanf("%d%d%d%d%d%d",&d2.top,&d2.front,&d2.right,&d2.left,&d2.back,&d2.bottom);
if(d1.front==d2.top){
roll('S',&d2);
}
else if(d1.front==d2.bottom){
roll('N',&d2);
}
else if(d1.front==d2.right){
roll('W',&d2);
roll('S',&d2);
}
else if(d1.front==d2.left){
roll('E',&d2);
roll('S',&d2);
}
else if(d1.front==d2.back){
roll('S',&d2);
roll('S',&d2);
}
for(i=0;i<4;i++){
if(d1.top==d2.top&&
d1.bottom==d2.bottom&&
d1.right==d2.right&&
d1.left==d2.left&&
d1.back==d2.back){
printf("Yes\n");
return 0;
}
roll('E',&d2);
}
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117068/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117068/source.c"
target datalayout = "e-m:e-p270: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.Dice = type { i32, i32, i32, i32, i32, i32 }
@.str = private unnamed_addr constant [13 x i8] c"%d%d%d%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: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @roll(i8 noundef signext %c, ptr nocapture noundef %d) local_unnamed_addr #0 {
entry:
%conv = sext i8 %c to i32
switch i32 %conv, label %sw.epilog [
i32 78, label %sw.bb
i32 83, label %sw.bb5
i32 69, label %sw.bb14
i32 87, label %sw.bb21
]
sw.bb: ; preds = %entry
%0 = load i32, ptr %d, align 4, !tbaa !5
%front = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 1
%1 = load i32, ptr %front, align 4, !tbaa !10
store i32 %1, ptr %d, align 4, !tbaa !5
%bottom = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 5
%2 = load i32, ptr %bottom, align 4, !tbaa !11
store i32 %2, ptr %front, align 4, !tbaa !10
%back = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 4
%3 = load i32, ptr %back, align 4, !tbaa !12
store i32 %3, ptr %bottom, align 4, !tbaa !11
store i32 %0, ptr %back, align 4, !tbaa !12
br label %sw.epilog
sw.bb5: ; preds = %entry
%4 = load i32, ptr %d, align 4, !tbaa !5
%back7 = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 4
%5 = load i32, ptr %back7, align 4, !tbaa !12
store i32 %5, ptr %d, align 4, !tbaa !5
%bottom9 = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 5
%6 = load i32, ptr %bottom9, align 4, !tbaa !11
store i32 %6, ptr %back7, align 4, !tbaa !12
%front11 = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 1
%7 = load i32, ptr %front11, align 4, !tbaa !10
store i32 %7, ptr %bottom9, align 4, !tbaa !11
store i32 %4, ptr %front11, align 4, !tbaa !10
br label %sw.epilog
sw.bb14: ; preds = %entry
%8 = load i32, ptr %d, align 4, !tbaa !5
%left = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 3
%9 = load i32, ptr %left, align 4, !tbaa !13
store i32 %9, ptr %d, align 4, !tbaa !5
%bottom17 = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 5
%10 = load i32, ptr %bottom17, align 4, !tbaa !11
store i32 %10, ptr %left, align 4, !tbaa !13
%right = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 2
%11 = load i32, ptr %right, align 4, !tbaa !14
store i32 %11, ptr %bottom17, align 4, !tbaa !11
store i32 %8, ptr %right, align 4, !tbaa !14
br label %sw.epilog
sw.bb21: ; preds = %entry
%12 = load i32, ptr %d, align 4, !tbaa !5
%right23 = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 2
%13 = load i32, ptr %right23, align 4, !tbaa !14
store i32 %13, ptr %d, align 4, !tbaa !5
%bottom25 = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 5
%14 = load i32, ptr %bottom25, align 4, !tbaa !11
store i32 %14, ptr %right23, align 4, !tbaa !14
%left27 = getelementptr inbounds %struct.Dice, ptr %d, i64 0, i32 3
%15 = load i32, ptr %left27, align 4, !tbaa !13
store i32 %15, ptr %bottom25, align 4, !tbaa !11
store i32 %12, ptr %left27, align 4, !tbaa !13
br label %sw.epilog
sw.epilog: ; preds = %entry, %sw.bb21, %sw.bb14, %sw.bb5, %sw.bb
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:
%d1 = alloca %struct.Dice, align 4
%d2 = alloca %struct.Dice, align 4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %d1) #5
%front = getelementptr inbounds %struct.Dice, ptr %d1, i64 0, i32 1
%right = getelementptr inbounds %struct.Dice, ptr %d1, i64 0, i32 2
%left = getelementptr inbounds %struct.Dice, ptr %d1, i64 0, i32 3
%back = getelementptr inbounds %struct.Dice, ptr %d1, i64 0, i32 4
%bottom = getelementptr inbounds %struct.Dice, ptr %d1, i64 0, i32 5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d1, ptr noundef nonnull %front, ptr noundef nonnull %right, ptr noundef nonnull %left, ptr noundef nonnull %back, ptr noundef nonnull %bottom)
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %d2) #5
%front2 = getelementptr inbounds %struct.Dice, ptr %d2, i64 0, i32 1
%right3 = getelementptr inbounds %struct.Dice, ptr %d2, i64 0, i32 2
%left4 = getelementptr inbounds %struct.Dice, ptr %d2, i64 0, i32 3
%back5 = getelementptr inbounds %struct.Dice, ptr %d2, i64 0, i32 4
%bottom6 = getelementptr inbounds %struct.Dice, ptr %d2, i64 0, i32 5
%call7 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %d2, ptr noundef nonnull %front2, ptr noundef nonnull %right3, ptr noundef nonnull %left4, ptr noundef nonnull %back5, ptr noundef nonnull %bottom6)
%0 = load i32, ptr %front, align 4, !tbaa !10
%1 = load i32, ptr %d2, align 4, !tbaa !5
%cmp = icmp eq i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%2 = load i32, ptr %back5, align 4, !tbaa !12
store i32 %2, ptr %d2, align 4, !tbaa !5
%3 = load i32, ptr %bottom6, align 4, !tbaa !11
store i32 %3, ptr %back5, align 4, !tbaa !12
%4 = load i32, ptr %front2, align 4, !tbaa !10
store i32 %4, ptr %bottom6, align 4, !tbaa !11
store i32 %0, ptr %front2, align 4, !tbaa !10
br label %if.end32
if.else: ; preds = %entry
%5 = load i32, ptr %bottom6, align 4, !tbaa !11
%cmp12 = icmp eq i32 %0, %5
br i1 %cmp12, label %if.then13, label %if.else14
if.then13: ; preds = %if.else
%6 = load i32, ptr %front2, align 4, !tbaa !10
store i32 %6, ptr %d2, align 4, !tbaa !5
store i32 %0, ptr %front2, align 4, !tbaa !10
%7 = load i32, ptr %back5, align 4, !tbaa !12
store i32 %7, ptr %bottom6, align 4, !tbaa !11
store i32 %1, ptr %back5, align 4, !tbaa !12
br label %if.end32
if.else14: ; preds = %if.else
%8 = load i32, ptr %right3, align 4, !tbaa !14
%cmp17 = icmp eq i32 %0, %8
br i1 %cmp17, label %if.then18, label %if.else19
if.then18: ; preds = %if.else14
store i32 %5, ptr %right3, align 4, !tbaa !14
%9 = load i32, ptr %left4, align 4, !tbaa !13
store i32 %1, ptr %left4, align 4, !tbaa !13
%10 = load i32, ptr %back5, align 4, !tbaa !12
store i32 %10, ptr %d2, align 4, !tbaa !5
store i32 %9, ptr %back5, align 4, !tbaa !12
%11 = load i32, ptr %front2, align 4, !tbaa !10
store i32 %11, ptr %bottom6, align 4, !tbaa !11
store i32 %0, ptr %front2, align 4, !tbaa !10
br label %if.end32
if.else19: ; preds = %if.else14
%12 = load i32, ptr %left4, align 4, !tbaa !13
%cmp22 = icmp eq i32 %0, %12
br i1 %cmp22, label %if.then23, label %if.else24
if.then23: ; preds = %if.else19
store i32 %5, ptr %left4, align 4, !tbaa !13
store i32 %1, ptr %right3, align 4, !tbaa !14
%13 = load i32, ptr %back5, align 4, !tbaa !12
store i32 %13, ptr %d2, align 4, !tbaa !5
store i32 %8, ptr %back5, align 4, !tbaa !12
%14 = load i32, ptr %front2, align 4, !tbaa !10
store i32 %14, ptr %bottom6, align 4, !tbaa !11
store i32 %0, ptr %front2, align 4, !tbaa !10
br label %if.end32
if.else24: ; preds = %if.else19
%15 = load i32, ptr %back5, align 4
%cmp27 = icmp eq i32 %0, %15
br i1 %cmp27, label %if.then28, label %if.end32
if.then28: ; preds = %if.else24
%16 = load i32, ptr %front2, align 4, !tbaa !10
store i32 %5, ptr %d2, align 4, !tbaa !5
store i32 %16, ptr %back5, align 4, !tbaa !12
store i32 %1, ptr %bottom6, align 4, !tbaa !11
store i32 %0, ptr %front2, align 4, !tbaa !10
br label %if.end32
if.end32: ; preds = %if.then13, %if.then23, %if.then28, %if.else24, %if.then18, %if.then
%17 = phi i32 [ %1, %if.then13 ], [ %8, %if.then23 ], [ %16, %if.then28 ], [ %15, %if.else24 ], [ %9, %if.then18 ], [ %3, %if.then ]
%bottom6.promoted = phi i32 [ %7, %if.then13 ], [ %14, %if.then23 ], [ %1, %if.then28 ], [ %5, %if.else24 ], [ %11, %if.then18 ], [ %4, %if.then ]
%d2.promoted = phi i32 [ %6, %if.then13 ], [ %13, %if.then23 ], [ %5, %if.then28 ], [ %1, %if.else24 ], [ %10, %if.then18 ], [ %2, %if.then ]
%18 = load i32, ptr %d1, align 4, !tbaa !5
%right3.promoted = load i32, ptr %right3, align 4, !tbaa !14
%left4.promoted = load i32, ptr %left4, align 4, !tbaa !13
%19 = load i32, ptr %bottom, align 4
%20 = load i32, ptr %right, align 4
%21 = load i32, ptr %left, align 4
%22 = load i32, ptr %back, align 4
%cmp51 = icmp eq i32 %22, %17
%cmp51.fr = freeze i1 %cmp51
br i1 %cmp51.fr, label %for.body.us.preheader, label %for.end
for.body.us.preheader: ; preds = %if.end32
%cmp36.us = icmp eq i32 %18, %d2.promoted
%cmp39.us = icmp eq i32 %19, %bottom6.promoted
%or.cond = select i1 %cmp36.us, i1 %cmp39.us, i1 false
%cmp43.us = icmp eq i32 %20, %right3.promoted
%or.cond79 = select i1 %or.cond, i1 %cmp43.us, i1 false
%cmp47.us = icmp eq i32 %21, %left4.promoted
%or.cond80 = select i1 %or.cond79, i1 %cmp47.us, i1 false
br i1 %or.cond80, label %cleanup, label %if.end54.us
if.end54.us: ; preds = %for.body.us.preheader
store i32 %left4.promoted, ptr %d2, align 4, !tbaa !5
store i32 %bottom6.promoted, ptr %left4, align 4, !tbaa !13
store i32 %right3.promoted, ptr %bottom6, align 4, !tbaa !11
store i32 %d2.promoted, ptr %right3, align 4, !tbaa !14
%cmp36.us.1 = icmp eq i32 %18, %left4.promoted
%cmp39.us.1 = icmp eq i32 %19, %right3.promoted
%or.cond.1 = select i1 %cmp36.us.1, i1 %cmp39.us.1, i1 false
%cmp43.us.1 = icmp eq i32 %20, %d2.promoted
%or.cond79.1 = select i1 %or.cond.1, i1 %cmp43.us.1, i1 false
%cmp47.us.1 = icmp eq i32 %21, %bottom6.promoted
%or.cond80.1 = select i1 %or.cond79.1, i1 %cmp47.us.1, i1 false
br i1 %or.cond80.1, label %cleanup, label %if.end54.us.1
if.end54.us.1: ; preds = %if.end54.us
store i32 %bottom6.promoted, ptr %d2, align 4, !tbaa !5
store i32 %right3.promoted, ptr %left4, align 4, !tbaa !13
store i32 %d2.promoted, ptr %bottom6, align 4, !tbaa !11
store i32 %left4.promoted, ptr %right3, align 4, !tbaa !14
%cmp36.us.2 = icmp eq i32 %18, %bottom6.promoted
%cmp39.us.2 = icmp eq i32 %19, %d2.promoted
%or.cond.2 = select i1 %cmp36.us.2, i1 %cmp39.us.2, i1 false
%cmp43.us.2 = icmp eq i32 %20, %left4.promoted
%or.cond79.2 = select i1 %or.cond.2, i1 %cmp43.us.2, i1 false
%cmp47.us.2 = icmp eq i32 %21, %right3.promoted
%or.cond80.2 = select i1 %or.cond79.2, i1 %cmp47.us.2, i1 false
br i1 %or.cond80.2, label %cleanup, label %if.end54.us.2
if.end54.us.2: ; preds = %if.end54.us.1
store i32 %right3.promoted, ptr %d2, align 4, !tbaa !5
store i32 %d2.promoted, ptr %left4, align 4, !tbaa !13
store i32 %left4.promoted, ptr %bottom6, align 4, !tbaa !11
store i32 %bottom6.promoted, ptr %right3, align 4, !tbaa !14
%cmp36.us.3 = icmp eq i32 %18, %right3.promoted
%cmp39.us.3 = icmp eq i32 %19, %left4.promoted
%or.cond.3 = select i1 %cmp36.us.3, i1 %cmp39.us.3, i1 false
%cmp43.us.3 = icmp eq i32 %20, %bottom6.promoted
%or.cond79.3 = select i1 %or.cond.3, i1 %cmp43.us.3, i1 false
%cmp47.us.3 = icmp eq i32 %21, %d2.promoted
%or.cond80.3 = select i1 %or.cond79.3, i1 %cmp47.us.3, i1 false
br i1 %or.cond80.3, label %cleanup, label %for.end
for.end: ; preds = %if.end54.us.2, %if.end32
store i32 %d2.promoted, ptr %d2, align 4, !tbaa !5
store i32 %left4.promoted, ptr %left4, align 4, !tbaa !13
store i32 %bottom6.promoted, ptr %bottom6, align 4, !tbaa !11
store i32 %right3.promoted, ptr %right3, align 4, !tbaa !14
br label %cleanup
cleanup: ; preds = %for.body.us.preheader, %if.end54.us, %if.end54.us.1, %if.end54.us.2, %for.end
%str.sink = phi ptr [ @str, %for.end ], [ @str.3, %if.end54.us.2 ], [ @str.3, %if.end54.us.1 ], [ @str.3, %if.end54.us ], [ @str.3, %for.body.us.preheader ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %d2) #5
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %d1) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree 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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!6, !7, i64 20}
!12 = !{!6, !7, i64 16}
!13 = !{!6, !7, i64 12}
!14 = !{!6, !7, i64 8}
|
#include <stdio.h>
int f(int W[][2],int A[][3], int b)
{
int r, c;
r = W[0][0] ^ W[1][0];
if (W[1][1] - (W[0][1] + 1) % 3 != 0) r = !r;
c = 3 - (W[0][1] + W[1][1]);
return b ? A[r][c] : A[!r][c];
}
int main()
{
int A[2][3];
int B[2][3];
int W[2][2];
int i, h, r, c;
for (i = 0; i < 3; i++) scanf("%d", &A[0][i]);
for (i = 2; i >= 0; i--) scanf("%d", &A[1][i]);
for (i = 0; i < 3; i++) scanf("%d", &B[0][i]);
for (i = 2; i >= 0; i--) scanf("%d", &B[1][i]);
i = 0;
h = 1;
W[0][1] = -1;
while (i < 2 && h)
{
h = 0;
for (r = 0; r < 2; r++)
{
for (c = 0; c < 3; c++)
{
if (c == W[0][1]) continue;
if (A[0][i] == B[r][c] && A[1][i] == B[!r][c])
{
W[i][0] = r;
W[i][1] = c;
h = 1;
break;
}
}
if (h) break;
}
i++;
}
if (h && A[0][2] == f(W, B, 1) && A[1][2] == f(W, B, 0)) printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117110/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117110/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @f(ptr nocapture noundef readonly %W, ptr nocapture noundef readonly %A, i32 noundef %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %W, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [2 x i32], ptr %W, i64 1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%xor = xor i32 %1, %0
%arrayidx5 = getelementptr inbounds [2 x i32], ptr %W, i64 1, i64 1
%2 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%arrayidx7 = getelementptr inbounds [2 x i32], ptr %W, i64 0, i64 1
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%add = add nsw i32 %3, 1
%rem = srem i32 %add, 3
%cmp.not = icmp eq i32 %2, %rem
%tobool.not = icmp eq i32 %xor, 0
%lnot.ext = zext i1 %tobool.not to i32
%r.0 = select i1 %cmp.not, i32 %xor, i32 %lnot.ext
%4 = add i32 %2, %3
%sub13 = sub i32 3, %4
%tobool14.not = icmp eq i32 %b, 0
%tobool18.not = icmp eq i32 %r.0, 0
%idxprom21 = zext i1 %tobool18.not to i64
%idxprom = sext i32 %r.0 to i64
%idxprom21.sink = select i1 %tobool14.not, i64 %idxprom21, i64 %idxprom
%idxprom23 = sext i32 %sub13 to i64
%arrayidx24 = getelementptr inbounds [3 x i32], ptr %A, i64 %idxprom21.sink, i64 %idxprom23
%cond = load i32, ptr %arrayidx24, align 4, !tbaa !5
ret i32 %cond
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%A = alloca [2 x [3 x i32]], align 16
%B = alloca [2 x [3 x i32]], align 16
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %B) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%arrayidx1.1 = getelementptr inbounds [3 x i32], ptr %A, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1.1)
%arrayidx1.2 = getelementptr inbounds [3 x i32], ptr %A, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx1.2)
%arrayidx7 = getelementptr inbounds [2 x [3 x i32]], ptr %A, i64 0, i64 1, i64 2
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%arrayidx7.1 = getelementptr inbounds [2 x [3 x i32]], ptr %A, i64 0, i64 1, i64 1
%call8.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.1)
%arrayidx7.2 = getelementptr inbounds [2 x [3 x i32]], ptr %A, i64 0, i64 1, i64 0
%call8.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.2)
%call17 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B)
%arrayidx16.1 = getelementptr inbounds [3 x i32], ptr %B, i64 0, i64 1
%call17.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx16.1)
%arrayidx16.2 = getelementptr inbounds [3 x i32], ptr %B, i64 0, i64 2
%call17.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx16.2)
%arrayidx26 = getelementptr inbounds [2 x [3 x i32]], ptr %B, i64 0, i64 1, i64 2
%call27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx26)
%arrayidx26.1 = getelementptr inbounds [2 x [3 x i32]], ptr %B, i64 0, i64 1, i64 1
%call27.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx26.1)
%arrayidx26.2 = getelementptr inbounds [2 x [3 x i32]], ptr %B, i64 0, i64 1, i64 0
%call27.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx26.2)
%0 = load i32, ptr %B, align 16
%1 = load i32, ptr %arrayidx26.2, align 4
%2 = load i32, ptr %arrayidx16.1, align 4
%3 = load i32, ptr %arrayidx26.1, align 16
%4 = load i32, ptr %arrayidx16.2, align 8
%5 = load i32, ptr %arrayidx26, align 4
%arrayidx53 = getelementptr inbounds [2 x [3 x i32]], ptr %A, i64 0, i64 1, i64 0
%6 = load i32, ptr %A, align 16, !tbaa !5
%cmp50 = icmp eq i32 %6, %0
%7 = load i32, ptr %arrayidx53, align 4
%cmp59 = icmp eq i32 %7, %1
%or.cond215 = select i1 %cmp50, i1 %cmp59, i1 false
br i1 %or.cond215, label %for.end76, label %if.end.1
if.end.1192: ; preds = %for.end76
%8 = load i32, ptr %arrayidx45.1, align 4, !tbaa !5
%cmp50.1191 = icmp eq i32 %8, %0
%9 = load i32, ptr %arrayidx53.1, align 16
%cmp59.1193 = icmp eq i32 %9, %1
%or.cond = select i1 %cmp50.1191, i1 %cmp59.1193, i1 false
br i1 %or.cond, label %land.lhs.true79, label %for.inc68.1195
for.inc68.1195: ; preds = %if.end.1192
%cmp42.1.1 = icmp eq i32 %W.sroa.0.4.vec.extract207, 1
br i1 %cmp42.1.1, label %if.end.2.1202, label %if.end.1.1197
if.end.1.1197: ; preds = %for.inc68.1195, %for.end76
%10 = load i32, ptr %arrayidx45.1, align 4, !tbaa !5
%cmp50.1.1196 = icmp eq i32 %10, %2
%11 = load i32, ptr %arrayidx53.1, align 16
%cmp59.1.1198 = icmp eq i32 %11, %3
%or.cond208 = select i1 %cmp50.1.1196, i1 %cmp59.1.1198, i1 false
br i1 %or.cond208, label %land.lhs.true79, label %for.inc68.1.1200
for.inc68.1.1200: ; preds = %if.end.1.1197
%cmp42.2.1 = icmp eq i32 %W.sroa.0.4.vec.extract207, 2
br i1 %cmp42.2.1, label %if.end.1164.1, label %if.end.2.1202
if.end.2.1202: ; preds = %for.inc68.1.1200, %for.inc68.1195
%cmp42.1172175.1 = phi i1 [ false, %for.inc68.1.1200 ], [ true, %for.inc68.1195 ]
%12 = load i32, ptr %arrayidx45.1, align 4, !tbaa !5
%cmp50.2.1201 = icmp eq i32 %12, %4
%13 = load i32, ptr %arrayidx53.1, align 16
%cmp59.2.1203 = icmp eq i32 %13, %5
%or.cond209 = select i1 %cmp50.2.1201, i1 %cmp59.2.1203, i1 false
br i1 %or.cond209, label %land.lhs.true79, label %for.inc68.2.1
for.inc68.2.1: ; preds = %if.end.2.1202
br i1 %cmp42.1190, label %for.inc68.1168.1, label %if.end.1164.1
if.end.1164.1: ; preds = %for.inc68.2.1, %for.inc68.1.1200
%cmp42.1172176183.1 = phi i1 [ %cmp42.1172175.1, %for.inc68.2.1 ], [ false, %for.inc68.1.1200 ]
%cmp42.2178181.1 = phi i1 [ false, %for.inc68.2.1 ], [ true, %for.inc68.1.1200 ]
%14 = load i32, ptr %arrayidx45.1, align 4, !tbaa !5
%cmp50.1163.1 = icmp eq i32 %14, %1
%15 = load i32, ptr %arrayidx53.1, align 16
%cmp59.1166.1 = icmp eq i32 %15, %0
%or.cond210 = select i1 %cmp50.1163.1, i1 %cmp59.1166.1, i1 false
br i1 %or.cond210, label %land.lhs.true79, label %for.inc68.1168.1
for.inc68.1168.1: ; preds = %if.end.1164.1, %for.inc68.2.1
%cmp42.1172176184.1 = phi i1 [ %cmp42.1172176183.1, %if.end.1164.1 ], [ %cmp42.1172175.1, %for.inc68.2.1 ]
%cmp42.2178182.1 = phi i1 [ %cmp42.2178181.1, %if.end.1164.1 ], [ false, %for.inc68.2.1 ]
%cmp42.1172176184.1.not = xor i1 %cmp42.1172176184.1, true
%16 = load i32, ptr %arrayidx45.1, align 4
%cmp50.1.1.1 = icmp eq i32 %16, %3
%or.cond211 = select i1 %cmp42.1172176184.1.not, i1 %cmp50.1.1.1, i1 false
%17 = load i32, ptr %arrayidx53.1, align 16
%cmp59.1.1.1 = icmp eq i32 %17, %2
%or.cond212 = select i1 %or.cond211, i1 %cmp59.1.1.1, i1 false
br i1 %or.cond212, label %land.lhs.true79, label %for.inc68.1.1.1
for.inc68.1.1.1: ; preds = %for.inc68.1168.1
%cmp42.2178182.1.not = xor i1 %cmp42.2178182.1, true
%18 = load i32, ptr %arrayidx45.1, align 4
%cmp50.2.1.1 = icmp eq i32 %18, %5
%or.cond213 = select i1 %cmp42.2178182.1.not, i1 %cmp50.2.1.1, i1 false
%19 = load i32, ptr %arrayidx53.1, align 16
%cmp59.2.1.1 = icmp eq i32 %19, %4
%or.cond214 = select i1 %or.cond213, i1 %cmp59.2.1.1, i1 false
br i1 %or.cond214, label %land.lhs.true79, label %if.else
if.end.1: ; preds = %entry
%20 = load i32, ptr %A, align 16, !tbaa !5
%cmp50.1 = icmp eq i32 %20, %2
%21 = load i32, ptr %arrayidx53, align 4
%cmp59.1 = icmp eq i32 %21, %3
%or.cond216 = select i1 %cmp50.1, i1 %cmp59.1, i1 false
br i1 %or.cond216, label %for.end76, label %if.end.2
if.end.2: ; preds = %if.end.1
%22 = load i32, ptr %A, align 16, !tbaa !5
%cmp50.2 = icmp eq i32 %22, %4
%23 = load i32, ptr %arrayidx53, align 4
%cmp59.2 = icmp eq i32 %23, %5
%or.cond217 = select i1 %cmp50.2, i1 %cmp59.2, i1 false
br i1 %or.cond217, label %for.end76, label %if.end.1164
if.end.1164: ; preds = %if.end.2
%24 = load i32, ptr %A, align 16, !tbaa !5
%cmp50.1163 = icmp eq i32 %24, %1
%25 = load i32, ptr %arrayidx53, align 4
%cmp59.1166 = icmp eq i32 %25, %0
%or.cond218 = select i1 %cmp50.1163, i1 %cmp59.1166, i1 false
br i1 %or.cond218, label %for.end76, label %if.end.1.1
if.end.1.1: ; preds = %if.end.1164
%26 = load i32, ptr %A, align 16, !tbaa !5
%cmp50.1.1 = icmp eq i32 %26, %3
%27 = load i32, ptr %arrayidx53, align 4
%cmp59.1.1 = icmp eq i32 %27, %2
%or.cond219 = select i1 %cmp50.1.1, i1 %cmp59.1.1, i1 false
br i1 %or.cond219, label %for.end76, label %if.end.2.1
if.end.2.1: ; preds = %if.end.1.1
%28 = load i32, ptr %A, align 16, !tbaa !5
%cmp50.2.1 = icmp eq i32 %28, %5
%29 = load i32, ptr %arrayidx53, align 4
%cmp59.2.1 = icmp eq i32 %29, %4
%or.cond220 = select i1 %cmp50.2.1, i1 %cmp59.2.1, i1 false
br i1 %or.cond220, label %for.end76, label %if.else
for.end76: ; preds = %if.end.2.1, %if.end.1.1, %if.end.1164, %if.end.2, %if.end.1, %entry
%30 = phi <2 x i32> [ zeroinitializer, %entry ], [ <i32 0, i32 1>, %if.end.1 ], [ <i32 0, i32 2>, %if.end.2 ], [ <i32 1, i32 0>, %if.end.1164 ], [ <i32 1, i32 1>, %if.end.1.1 ], [ <i32 1, i32 2>, %if.end.2.1 ]
%W.sroa.0.4.vec.extract207 = extractelement <2 x i32> %30, i64 1
%arrayidx45.1 = getelementptr inbounds [3 x i32], ptr %A, i64 0, i64 1
%arrayidx53.1 = getelementptr inbounds [2 x [3 x i32]], ptr %A, i64 0, i64 1, i64 1
%cmp42.1190 = icmp eq i32 %W.sroa.0.4.vec.extract207, 0
br i1 %cmp42.1190, label %if.end.1.1197, label %if.end.1192
land.lhs.true79: ; preds = %if.end.1192, %if.end.1.1197, %if.end.2.1202, %if.end.1164.1, %for.inc68.1168.1, %for.inc68.1.1.1
%31 = phi <2 x i32> [ zeroinitializer, %if.end.1192 ], [ <i32 0, i32 1>, %if.end.1.1197 ], [ <i32 0, i32 2>, %if.end.2.1202 ], [ <i32 1, i32 0>, %if.end.1164.1 ], [ <i32 1, i32 1>, %for.inc68.1168.1 ], [ <i32 1, i32 2>, %for.inc68.1.1.1 ]
%32 = load i32, ptr %arrayidx1.2, align 8, !tbaa !5
%W.sroa.0.0.vec.extract = extractelement <2 x i32> %30, i64 0
%W.sroa.7.8.vec.extract = extractelement <2 x i32> %31, i64 0
%xor.i = xor i32 %W.sroa.7.8.vec.extract, %W.sroa.0.0.vec.extract
%W.sroa.7.12.vec.extract = extractelement <2 x i32> %31, i64 1
%W.sroa.0.4.vec.extract = extractelement <2 x i32> %30, i64 1
%add.i = add nuw nsw i32 %W.sroa.0.4.vec.extract, 1
%rem.i = urem i32 %add.i, 3
%cmp.not.i = icmp eq i32 %W.sroa.7.12.vec.extract, %rem.i
%tobool.not.i = icmp eq i32 %xor.i, 0
%lnot.ext.i = zext i1 %tobool.not.i to i32
%r.0.i = select i1 %cmp.not.i, i32 %xor.i, i32 %lnot.ext.i
%33 = add nuw nsw i32 %W.sroa.7.12.vec.extract, %W.sroa.0.4.vec.extract
%sub13.i = sub nsw i32 3, %33
%idxprom.i = zext i32 %r.0.i to i64
%idxprom23.i = sext i32 %sub13.i to i64
%arrayidx24.i = getelementptr inbounds [3 x i32], ptr %B, i64 %idxprom.i, i64 %idxprom23.i
%cond.i = load i32, ptr %arrayidx24.i, align 4, !tbaa !5
%cmp84 = icmp eq i32 %32, %cond.i
br i1 %cmp84, label %land.lhs.true85, label %if.else
land.lhs.true85: ; preds = %land.lhs.true79
%tobool18.not.i = icmp eq i32 %r.0.i, 0
%34 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%idxprom21.i137 = zext i1 %tobool18.not.i to i64
%arrayidx24.i140 = getelementptr inbounds [3 x i32], ptr %B, i64 %idxprom21.i137, i64 %idxprom23.i
%cond.i141 = load i32, ptr %arrayidx24.i140, align 4, !tbaa !5
%cmp91 = icmp eq i32 %34, %cond.i141
br i1 %cmp91, label %if.end95, label %if.else
if.else: ; preds = %if.end.2.1, %for.inc68.1.1.1, %land.lhs.true85, %land.lhs.true79
br label %if.end95
if.end95: ; preds = %land.lhs.true85, %if.else
%str.sink = phi ptr [ @str, %if.else ], [ @str.3, %land.lhs.true85 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int i,ex1,ex2,ex3,ex4,a,b;
int dice[7],dice2[7];
int command;
for(i=1; i<=6; i++){
scanf("%d",&dice[i]);
}
for(i=1; i<=6; i++){
scanf("%d",&dice2[i]);
}
for(i=0; i<100; i++){
command = rand() % 4;
if(command == 0){
ex1 = dice[1];
ex2 = dice[2];
ex3 = dice[5];
ex4 = dice[6];
dice[1] = ex3;
dice[2] = ex1;
dice[5] = ex4;
dice[6] = ex2;
}else if(command == 1){
ex1 = dice[1];
ex2 = dice[2];
ex3 = dice[5];
ex4 = dice[6];
dice[1] = ex2;
dice[2] = ex4;
dice[5] = ex1;
dice[6] = ex3;
}else if(command == 2){
ex1 = dice[1];
ex2 = dice[3];
ex3 = dice[4];
ex4 = dice[6];
dice[1] = ex3;
dice[3] = ex1;
dice[4] = ex4;
dice[6] = ex2;
}else if(command == 3){
ex1 = dice[1];
ex2 = dice[3];
ex3 = dice[4];
ex4 = dice[6];
dice[1] = ex2;
dice[3] = ex4;
dice[4] = ex1;
dice[6] = ex3;
}
for(a = 1;a <= 6;a++)
if(dice[a] != dice2[a])
break;
if(a == 7){
printf("Yes\n");return 0;
}
}
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117154/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117154/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%dice = alloca [7 x i32], align 16
%dice2 = alloca [7 x i32], align 16
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %dice) #5
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %dice2) #5
%arrayidx = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%arrayidx.1 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 2
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 3
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 4
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 5
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [7 x i32], ptr %dice, i64 0, i64 6
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%arrayidx5 = getelementptr inbounds [7 x i32], ptr %dice2, i64 0, i64 1
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5)
%arrayidx5.1 = getelementptr inbounds [7 x i32], ptr %dice2, i64 0, i64 2
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [7 x i32], ptr %dice2, i64 0, i64 3
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.3 = getelementptr inbounds [7 x i32], ptr %dice2, i64 0, i64 4
%call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3)
%arrayidx5.4 = getelementptr inbounds [7 x i32], ptr %dice2, i64 0, i64 5
%call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4)
%arrayidx5.5 = getelementptr inbounds [7 x i32], ptr %dice2, i64 0, i64 6
%call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5)
br label %for.body12
for.body12: ; preds = %entry, %for.inc75
%i.2120 = phi i32 [ 0, %entry ], [ %inc76, %for.inc75 ]
%call13 = call i32 @rand() #5
%rem = srem i32 %call13, 4
%.pre = load i32, ptr %arrayidx, align 4, !tbaa !5
switch i32 %rem, label %if.end57 [
i32 0, label %if.then
i32 1, label %if.then24
i32 2, label %if.then35
i32 3, label %if.then46
]
if.then: ; preds = %for.body12
%0 = load i32, ptr %arrayidx.1, align 8, !tbaa !5
%1 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%2 = load i32, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %1, ptr %arrayidx, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx.1, align 8, !tbaa !5
store i32 %2, ptr %arrayidx.4, align 4, !tbaa !5
br label %if.end57.sink.split
if.then24: ; preds = %for.body12
%3 = load i32, ptr %arrayidx.1, align 8, !tbaa !5
%4 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %3, ptr %arrayidx, align 4, !tbaa !5
store i32 %5, ptr %arrayidx.1, align 8, !tbaa !5
store i32 %.pre, ptr %arrayidx.4, align 4, !tbaa !5
br label %if.end57.sink.split
if.then35: ; preds = %for.body12
%6 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx.3, align 16, !tbaa !5
%8 = load i32, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %7, ptr %arrayidx, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx.2, align 4, !tbaa !5
store i32 %8, ptr %arrayidx.3, align 16, !tbaa !5
br label %if.end57.sink.split
if.then46: ; preds = %for.body12
%9 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%10 = load i32, ptr %arrayidx.3, align 16, !tbaa !5
%11 = load i32, ptr %arrayidx.5, align 8, !tbaa !5
store i32 %9, ptr %arrayidx, align 4, !tbaa !5
store i32 %11, ptr %arrayidx.2, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx.3, align 16, !tbaa !5
br label %if.end57.sink.split
if.end57.sink.split: ; preds = %if.then, %if.then35, %if.then46, %if.then24
%.sink = phi i32 [ %4, %if.then24 ], [ %10, %if.then46 ], [ %6, %if.then35 ], [ %0, %if.then ]
%.ph = phi i32 [ %3, %if.then24 ], [ %9, %if.then46 ], [ %7, %if.then35 ], [ %1, %if.then ]
store i32 %.sink, ptr %arrayidx.5, align 8, !tbaa !5
br label %if.end57
if.end57: ; preds = %if.end57.sink.split, %for.body12
%12 = phi i32 [ %.pre, %for.body12 ], [ %.ph, %if.end57.sink.split ]
%13 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp65.not = icmp eq i32 %12, %13
br i1 %cmp65.not, label %for.inc68, label %for.inc75
for.inc68: ; preds = %if.end57
%14 = load i32, ptr %arrayidx.1, align 8, !tbaa !5
%15 = load i32, ptr %arrayidx5.1, align 8, !tbaa !5
%cmp65.not.1 = icmp eq i32 %14, %15
br i1 %cmp65.not.1, label %for.inc68.1, label %for.inc75
for.inc68.1: ; preds = %for.inc68
%16 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%17 = load i32, ptr %arrayidx5.2, align 4, !tbaa !5
%cmp65.not.2 = icmp eq i32 %16, %17
br i1 %cmp65.not.2, label %for.inc68.2, label %for.inc75
for.inc68.2: ; preds = %for.inc68.1
%18 = load i32, ptr %arrayidx.3, align 16, !tbaa !5
%19 = load i32, ptr %arrayidx5.3, align 16, !tbaa !5
%cmp65.not.3 = icmp eq i32 %18, %19
br i1 %cmp65.not.3, label %for.inc68.3, label %for.inc75
for.inc68.3: ; preds = %for.inc68.2
%20 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%21 = load i32, ptr %arrayidx5.4, align 4, !tbaa !5
%cmp65.not.4 = icmp eq i32 %20, %21
br i1 %cmp65.not.4, label %for.inc68.4, label %for.inc75
for.inc68.4: ; preds = %for.inc68.3
%22 = load i32, ptr %arrayidx.5, align 8, !tbaa !5
%23 = load i32, ptr %arrayidx5.5, align 8, !tbaa !5
%cmp65.not.5 = icmp eq i32 %22, %23
br i1 %cmp65.not.5, label %cleanup, label %for.inc75
for.inc75: ; preds = %if.end57, %for.inc68, %for.inc68.1, %for.inc68.2, %for.inc68.3, %for.inc68.4
%inc76 = add nuw nsw i32 %i.2120, 1
%exitcond.not = icmp eq i32 %inc76, 100
br i1 %exitcond.not, label %cleanup, label %for.body12, !llvm.loop !9
cleanup: ; preds = %for.inc75, %for.inc68.4
%str.sink = phi ptr [ @str.3, %for.inc68.4 ], [ @str, %for.inc75 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %dice2) #5
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %dice) #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: nounwind
declare i32 @rand() 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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
#include <stdlib.h>
int main()
{
int pattern[24][7] = {
{ 0,1,2,3,4,5,6 },{ 0,1,3,5,2,4,6 },{ 0,1,4,2,5,3,6 },{ 0,1,5,4,3,2,6 },
{ 0,2,6,3,4,1,5 },{ 0,2,3,1,6,4,5 },{ 0,2,1,4,3,6,5 },{ 0,2,4,6,1,3,5 },
{ 0,3,1,2,5,6,4 },{ 0,3,2,6,1,5,4 },{ 0,3,5,1,6,2,4 },{ 0,3,6,5,2,1,4 },
{ 0,4,1,5,2,6,3 },{ 0,4,2,1,6,5,3 },{ 0,4,5,6,1,2,3 },{ 0,4,6,2,5,1,3 },
{ 0,5,1,3,4,6,2 },{ 0,5,3,6,1,4,2 },{ 0,5,4,1,6,3,2 },{ 0,5,6,4,3,1,2 },
{ 0,6,2,4,3,5,1 },{ 0,6,3,2,5,4,1 },{ 0,6,5,3,4,2,1 },{ 0,6,4,5,2,3,1 } };
int diceA[7];
int i, j, break_flag;
int a[7], b[7], diceB[7];
break_flag = 0;
for (i = 1; i < 7; i++)
{
scanf("%d", &diceA[i]);
}
for (i = 1; i < 7; i++)
{
scanf("%d", &a[i]);
}
for (j = 0; j < 24; j++)
{
for (i = 1; i < 7; i++)
{
diceB[i] = pattern[j][i];
}
for (i = 1; i < 7; i++)
{
b[i] = diceA[diceB[i]];
}
for (i = 1; ; i++)
{
if (i > 6)
{
printf("Yes\n");
return 0;
}
if (a[i] != b[i])
{
break;
}
}
}
//printf("%d %d %d %d %d %d\n",a[1],a[2],a[3],a[4],a[5],a[6]);
//printf("%d %d %d %d %d %d\n",b[1],b[2],b[3],b[4],b[5],b[6]);
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117198/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117198/source.c"
target datalayout = "e-m:e-p270: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.pattern = private unnamed_addr constant [24 x [7 x i32]] [[7 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6], [7 x i32] [i32 0, i32 1, i32 3, i32 5, i32 2, i32 4, i32 6], [7 x i32] [i32 0, i32 1, i32 4, i32 2, i32 5, i32 3, i32 6], [7 x i32] [i32 0, i32 1, i32 5, i32 4, i32 3, i32 2, i32 6], [7 x i32] [i32 0, i32 2, i32 6, i32 3, i32 4, i32 1, i32 5], [7 x i32] [i32 0, i32 2, i32 3, i32 1, i32 6, i32 4, i32 5], [7 x i32] [i32 0, i32 2, i32 1, i32 4, i32 3, i32 6, i32 5], [7 x i32] [i32 0, i32 2, i32 4, i32 6, i32 1, i32 3, i32 5], [7 x i32] [i32 0, i32 3, i32 1, i32 2, i32 5, i32 6, i32 4], [7 x i32] [i32 0, i32 3, i32 2, i32 6, i32 1, i32 5, i32 4], [7 x i32] [i32 0, i32 3, i32 5, i32 1, i32 6, i32 2, i32 4], [7 x i32] [i32 0, i32 3, i32 6, i32 5, i32 2, i32 1, i32 4], [7 x i32] [i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3], [7 x i32] [i32 0, i32 4, i32 2, i32 1, i32 6, i32 5, i32 3], [7 x i32] [i32 0, i32 4, i32 5, i32 6, i32 1, i32 2, i32 3], [7 x i32] [i32 0, i32 4, i32 6, i32 2, i32 5, i32 1, i32 3], [7 x i32] [i32 0, i32 5, i32 1, i32 3, i32 4, i32 6, i32 2], [7 x i32] [i32 0, i32 5, i32 3, i32 6, i32 1, i32 4, i32 2], [7 x i32] [i32 0, i32 5, i32 4, i32 1, i32 6, i32 3, i32 2], [7 x i32] [i32 0, i32 5, i32 6, i32 4, i32 3, i32 1, i32 2], [7 x i32] [i32 0, i32 6, i32 2, i32 4, i32 3, i32 5, i32 1], [7 x i32] [i32 0, i32 6, i32 3, i32 2, i32 5, i32 4, i32 1], [7 x i32] [i32 0, i32 6, i32 5, i32 3, i32 4, i32 2, i32 1], [7 x i32] [i32 0, i32 6, i32 4, i32 5, i32 2, i32 3, i32 1]], align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%diceA = alloca [7 x i32], align 16
%a = alloca [7 x i32], align 16
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %diceA) #4
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %a) #4
%arrayidx = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 1
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%arrayidx.1 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 2
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 3
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 4
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 5
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 6
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%arrayidx5 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 1
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5)
%arrayidx5.1 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 2
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 3
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.3 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 4
%call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3)
%arrayidx5.4 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 5
%call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4)
%arrayidx5.5 = getelementptr inbounds [7 x i32], ptr %a, i64 0, i64 6
%call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5)
%.pre = load i32, ptr %arrayidx5, align 4, !tbaa !5
%0 = load i32, ptr %arrayidx5.1, align 8
%1 = load i32, ptr %arrayidx5.2, align 4
%2 = load i32, ptr %arrayidx5.3, align 16
%3 = load i32, ptr %arrayidx5.4, align 4
%4 = load i32, ptr %arrayidx5.5, align 8
br label %for.cond13.preheader
for.cond13.preheader: ; preds = %entry, %for.inc50
%indvar = phi i64 [ 0, %entry ], [ %indvar.next, %for.inc50 ]
%5 = mul nuw nsw i64 %indvar, 28
%6 = getelementptr i8, ptr @__const.main.pattern, i64 %5
%scevgep89 = getelementptr i8, ptr %6, i64 4
%diceB.sroa.2.4.copyload = load i32, ptr %scevgep89, align 4, !tbaa !5
%idxprom30 = sext i32 %diceB.sroa.2.4.copyload to i64
%arrayidx31 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 %idxprom30
%7 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%cmp44.not = icmp eq i32 %.pre, %7
br i1 %cmp44.not, label %for.cond37, label %for.inc50
for.cond37: ; preds = %for.cond13.preheader
%diceB.sroa.8.4.scevgep89.sroa_idx = getelementptr i8, ptr %6, i64 24
%diceB.sroa.8.4.copyload = load i32, ptr %diceB.sroa.8.4.scevgep89.sroa_idx, align 4, !tbaa !5
%idxprom30.5 = sext i32 %diceB.sroa.8.4.copyload to i64
%arrayidx31.5 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 %idxprom30.5
%8 = load i32, ptr %arrayidx31.5, align 4, !tbaa !5
%diceB.sroa.7.4.scevgep89.sroa_idx = getelementptr i8, ptr %6, i64 20
%diceB.sroa.7.4.copyload = load i32, ptr %diceB.sroa.7.4.scevgep89.sroa_idx, align 4, !tbaa !5
%idxprom30.4 = sext i32 %diceB.sroa.7.4.copyload to i64
%arrayidx31.4 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 %idxprom30.4
%9 = load i32, ptr %arrayidx31.4, align 4, !tbaa !5
%diceB.sroa.6.4.scevgep89.sroa_idx = getelementptr i8, ptr %6, i64 16
%diceB.sroa.6.4.copyload = load i32, ptr %diceB.sroa.6.4.scevgep89.sroa_idx, align 4, !tbaa !5
%idxprom30.3 = sext i32 %diceB.sroa.6.4.copyload to i64
%arrayidx31.3 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 %idxprom30.3
%10 = load i32, ptr %arrayidx31.3, align 4, !tbaa !5
%diceB.sroa.5.4.scevgep89.sroa_idx = getelementptr i8, ptr %6, i64 12
%diceB.sroa.5.4.copyload = load i32, ptr %diceB.sroa.5.4.scevgep89.sroa_idx, align 4, !tbaa !5
%idxprom30.2 = sext i32 %diceB.sroa.5.4.copyload to i64
%arrayidx31.2 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 %idxprom30.2
%11 = load i32, ptr %arrayidx31.2, align 4, !tbaa !5
%diceB.sroa.4.4.scevgep89.sroa_idx = getelementptr i8, ptr %6, i64 8
%diceB.sroa.4.4.copyload = load i32, ptr %diceB.sroa.4.4.scevgep89.sroa_idx, align 4, !tbaa !5
%idxprom30.1 = sext i32 %diceB.sroa.4.4.copyload to i64
%arrayidx31.1 = getelementptr inbounds [7 x i32], ptr %diceA, i64 0, i64 %idxprom30.1
%12 = load i32, ptr %arrayidx31.1, align 4, !tbaa !5
%cmp44.not.1 = icmp eq i32 %0, %12
%cmp44.not.2 = icmp eq i32 %1, %11
%or.cond = select i1 %cmp44.not.1, i1 %cmp44.not.2, i1 false
%cmp44.not.3 = icmp eq i32 %2, %10
%or.cond94 = select i1 %or.cond, i1 %cmp44.not.3, i1 false
%cmp44.not.4 = icmp eq i32 %3, %9
%or.cond95 = select i1 %or.cond94, i1 %cmp44.not.4, i1 false
%cmp44.not.5 = icmp eq i32 %4, %8
%or.cond96 = select i1 %or.cond95, i1 %cmp44.not.5, i1 false
br i1 %or.cond96, label %cleanup, label %for.inc50
for.inc50: ; preds = %for.cond37, %for.cond13.preheader
%indvar.next = add nuw nsw i64 %indvar, 1
%exitcond.not = icmp eq i64 %indvar.next, 24
br i1 %exitcond.not, label %cleanup, label %for.cond13.preheader, !llvm.loop !9
cleanup: ; preds = %for.inc50, %for.cond37
%str.sink = phi ptr [ @str.3, %for.cond37 ], [ @str, %for.inc50 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %diceA) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
struct diceOne{
int number[6];
};
struct diceTwo{
int number[6];
};
int search(struct diceOne *x, struct diceTwo *y, int z){
for(int i = 0; i < 6; i++){
if(y->number[z] == x->number[i]){
return i; //0とiの添字の要素が等しい数字を持つ
}
}
return 6;
}
void rollN(struct diceOne *x){
int diceNumber;
diceNumber = x->number[0];
x->number[0] = x->number[1];
x->number[1] = x->number[5];
x->number[5] = x->number[4];
x->number[4] = diceNumber;
}
void rollS(struct diceOne *x){
int diceNumber;
diceNumber = x->number[0];
x->number[0] = x->number[4];
x->number[4] = x->number[5];
x->number[5] = x->number[1];
x->number[1] = diceNumber;
}
void rollE(struct diceOne *x){
int diceNumber;
diceNumber = x->number[0];
x->number[0] = x->number[3];
x->number[3] = x->number[5];
x->number[5] = x->number[2];
x->number[2] = diceNumber;
}
void rollW(struct diceOne *x){
int diceNumber;
diceNumber = x->number[0];
x->number[0] = x->number[2];
x->number[2] = x->number[5];
x->number[5] = x->number[3];
x->number[3] = diceNumber;
}
int main(void){
int j, q, k;
int ans;
char order[120];
struct diceOne x;
struct diceTwo y;
fgets(order, 120, stdin);
sscanf(order, "%d %d %d %d %d %d",
&x.number[0], &x.number[1], &x.number[2], &x.number[3], &x.number[4], &x.number[5]);
fgets(order, 120, stdin);
sscanf(order, "%d %d %d %d %d %d",
&y.number[0], &y.number[1], &y.number[2], &y.number[3], &y.number[4], &y.number[5]);
ans = search(&x, &y, 1); //お互いの数字が一致する配列の添字を見つける関数search。
switch(ans){
case 0: rollS(&x);
break;
case 1: break;
case 2: rollW(&x);
rollS(&x);
break;
case 3: rollE(&x);
rollS(&x);
break;
case 4: rollS(&x);
rollS(&x);
break;
case 5: rollN(&x);
break;
case 6: printf("このダイスは同一ではありません\n");
}
ans = search(&x, &y, 0);
switch(ans){
case 0: break;
case 1: break;
case 2: rollW(&x);
break;
case 3: rollE(&x);
break;
case 4: printf("このダイスは同一ではありません\n");
break;
case 5: rollW(&x);
rollW(&x);
break;
case 6: printf("このダイスは同一ではありません\n");
}
ans = 0;
for(j = 0; j < 6; j++){
if(x.number[j] == y.number[j])
ans++;
}
if(ans == 6){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117240/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117240/source.c"
target datalayout = "e-m:e-p270: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.diceOne = type { [6 x i32] }
%struct.diceTwo = type { [6 x i32] }
@stdin = external local_unnamed_addr global ptr, align 8
@.str = private unnamed_addr constant [18 x i8] c"%d %d %d %d %d %d\00", align 1
@str.5 = private unnamed_addr constant [46 x i8] c"\E3\81\93\E3\81\AE\E3\83\80\E3\82\A4\E3\82\B9\E3\81\AF\E5\90\8C\E4\B8\80\E3\81\A7\E3\81\AF\E3\81\82\E3\82\8A\E3\81\BE\E3\81\9B\E3\82\93\00", align 1
@str.6 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.7 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @search(ptr nocapture noundef readonly %x, ptr nocapture noundef readonly %y, i32 noundef %z) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %z to i64
%arrayidx = getelementptr inbounds [6 x i32], ptr %y, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%1 = load i32, ptr %x, align 4, !tbaa !5
%cmp4 = icmp eq i32 %0, %1
br i1 %cmp4, label %cleanup, label %for.inc
for.inc: ; preds = %entry
%arrayidx3.1 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 1
%2 = load i32, ptr %arrayidx3.1, align 4, !tbaa !5
%cmp4.1 = icmp eq i32 %0, %2
br i1 %cmp4.1, label %cleanup, label %for.inc.1
for.inc.1: ; preds = %for.inc
%arrayidx3.2 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 2
%3 = load i32, ptr %arrayidx3.2, align 4, !tbaa !5
%cmp4.2 = icmp eq i32 %0, %3
br i1 %cmp4.2, label %cleanup, label %for.inc.2
for.inc.2: ; preds = %for.inc.1
%arrayidx3.3 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 3
%4 = load i32, ptr %arrayidx3.3, align 4, !tbaa !5
%cmp4.3 = icmp eq i32 %0, %4
br i1 %cmp4.3, label %cleanup, label %for.inc.3
for.inc.3: ; preds = %for.inc.2
%arrayidx3.4 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 4
%5 = load i32, ptr %arrayidx3.4, align 4, !tbaa !5
%cmp4.4 = icmp eq i32 %0, %5
br i1 %cmp4.4, label %cleanup, label %for.inc.4
for.inc.4: ; preds = %for.inc.3
%arrayidx3.5 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 5
%6 = load i32, ptr %arrayidx3.5, align 4, !tbaa !5
%cmp4.5 = icmp eq i32 %0, %6
%spec.select10 = select i1 %cmp4.5, i32 5, i32 6
br label %cleanup
cleanup: ; preds = %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry
%spec.select = phi i32 [ 0, %entry ], [ 1, %for.inc ], [ 2, %for.inc.1 ], [ 3, %for.inc.2 ], [ 4, %for.inc.3 ], [ %spec.select10, %for.inc.4 ]
ret i32 %spec.select
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @rollN(ptr nocapture noundef %x) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %1, ptr %x, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 5
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 4
%3 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %3, ptr %arrayidx6, align 4, !tbaa !5
store i32 %0, ptr %arrayidx10, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @rollS(ptr nocapture noundef %x) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 4
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %1, ptr %x, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 5
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 1
%3 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %3, ptr %arrayidx6, align 4, !tbaa !5
store i32 %0, ptr %arrayidx10, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @rollE(ptr nocapture noundef %x) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 3
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %1, ptr %x, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 5
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 2
%3 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %3, ptr %arrayidx6, align 4, !tbaa !5
store i32 %0, ptr %arrayidx10, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @rollW(ptr nocapture noundef %x) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %x, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 2
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
store i32 %1, ptr %x, align 4, !tbaa !5
%arrayidx6 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 5
%2 = load i32, ptr %arrayidx6, align 4, !tbaa !5
store i32 %2, ptr %arrayidx2, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 3
%3 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %3, ptr %arrayidx6, align 4, !tbaa !5
store i32 %0, ptr %arrayidx10, align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #3 {
entry:
%order = alloca [120 x i8], align 16
%x = alloca %struct.diceOne, align 16
%y = alloca %struct.diceTwo, align 16
call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %order) #7
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %x) #7
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %y) #7
%0 = load ptr, ptr @stdin, align 8, !tbaa !9
%call = call ptr @fgets(ptr noundef nonnull %order, i32 noundef 120, ptr noundef %0)
%arrayidx3 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 1
%arrayidx5 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 2
%arrayidx7 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 3
%arrayidx9 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 4
%arrayidx11 = getelementptr inbounds [6 x i32], ptr %x, i64 0, i64 5
%call12 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %order, ptr noundef nonnull @.str, ptr noundef nonnull %x, ptr noundef nonnull %arrayidx3, ptr noundef nonnull %arrayidx5, ptr noundef nonnull %arrayidx7, ptr noundef nonnull %arrayidx9, ptr noundef nonnull %arrayidx11) #7
%1 = load ptr, ptr @stdin, align 8, !tbaa !9
%call14 = call ptr @fgets(ptr noundef nonnull %order, i32 noundef 120, ptr noundef %1)
%arrayidx19 = getelementptr inbounds [6 x i32], ptr %y, i64 0, i64 1
%arrayidx21 = getelementptr inbounds [6 x i32], ptr %y, i64 0, i64 2
%arrayidx23 = getelementptr inbounds [6 x i32], ptr %y, i64 0, i64 3
%arrayidx25 = getelementptr inbounds [6 x i32], ptr %y, i64 0, i64 4
%arrayidx27 = getelementptr inbounds [6 x i32], ptr %y, i64 0, i64 5
%call28 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %order, ptr noundef nonnull @.str, ptr noundef nonnull %y, ptr noundef nonnull %arrayidx19, ptr noundef nonnull %arrayidx21, ptr noundef nonnull %arrayidx23, ptr noundef nonnull %arrayidx25, ptr noundef nonnull %arrayidx27) #7
%2 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%3 = load i32, ptr %x, align 16, !tbaa !5
%cmp4.i = icmp eq i32 %2, %3
br i1 %cmp4.i, label %sw.bb, label %for.inc.i
for.inc.i: ; preds = %entry
%4 = load i32, ptr %arrayidx3, align 4
%cmp4.1.i = icmp eq i32 %2, %4
br i1 %cmp4.1.i, label %sw.epilog, label %for.inc.1.i
for.inc.1.i: ; preds = %for.inc.i
%5 = load i32, ptr %arrayidx5, align 8, !tbaa !5
%cmp4.2.i = icmp eq i32 %2, %5
br i1 %cmp4.2.i, label %sw.bb30, label %for.inc.2.i
for.inc.2.i: ; preds = %for.inc.1.i
%6 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp4.3.i = icmp eq i32 %2, %6
br i1 %cmp4.3.i, label %sw.bb31, label %for.inc.3.i
for.inc.3.i: ; preds = %for.inc.2.i
%7 = load i32, ptr %arrayidx9, align 16, !tbaa !5
%cmp4.4.i = icmp eq i32 %2, %7
%8 = load i32, ptr %arrayidx11, align 4, !tbaa !5
br i1 %cmp4.4.i, label %sw.bb32, label %for.inc.4.i
for.inc.4.i: ; preds = %for.inc.3.i
%cmp4.5.i = icmp eq i32 %2, %8
br i1 %cmp4.5.i, label %sw.bb33, label %sw.bb34
sw.bb: ; preds = %entry
%9 = load i32, ptr %arrayidx9, align 16, !tbaa !5
store i32 %9, ptr %x, align 16, !tbaa !5
%10 = load i32, ptr %arrayidx11, align 4, !tbaa !5
store i32 %10, ptr %arrayidx9, align 16, !tbaa !5
%11 = load i32, ptr %arrayidx3, align 4, !tbaa !5
store i32 %11, ptr %arrayidx11, align 4, !tbaa !5
store i32 %2, ptr %arrayidx3, align 4, !tbaa !5
br label %sw.epilog
sw.bb30: ; preds = %for.inc.1.i
%12 = load i32, ptr %arrayidx11, align 4, !tbaa !5
store i32 %12, ptr %arrayidx5, align 8, !tbaa !5
%13 = load i32, ptr %arrayidx7, align 4, !tbaa !5
store i32 %3, ptr %arrayidx7, align 4, !tbaa !5
%14 = load i32, ptr %arrayidx9, align 16, !tbaa !5
store i32 %14, ptr %x, align 16, !tbaa !5
store i32 %13, ptr %arrayidx9, align 16, !tbaa !5
store i32 %4, ptr %arrayidx11, align 4, !tbaa !5
store i32 %2, ptr %arrayidx3, align 4, !tbaa !5
br label %sw.epilog
sw.bb31: ; preds = %for.inc.2.i
%15 = load i32, ptr %arrayidx11, align 4, !tbaa !5
store i32 %15, ptr %arrayidx7, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5, align 8, !tbaa !5
%16 = load i32, ptr %arrayidx9, align 16, !tbaa !5
store i32 %16, ptr %x, align 16, !tbaa !5
store i32 %5, ptr %arrayidx9, align 16, !tbaa !5
store i32 %4, ptr %arrayidx11, align 4, !tbaa !5
store i32 %2, ptr %arrayidx3, align 4, !tbaa !5
br label %sw.epilog
sw.bb32: ; preds = %for.inc.3.i
store i32 %8, ptr %x, align 16, !tbaa !5
store i32 %4, ptr %arrayidx9, align 16, !tbaa !5
store i32 %3, ptr %arrayidx11, align 4, !tbaa !5
store i32 %2, ptr %arrayidx3, align 4, !tbaa !5
br label %sw.epilog
sw.bb33: ; preds = %for.inc.4.i
store i32 %4, ptr %x, align 16, !tbaa !5
store i32 %2, ptr %arrayidx3, align 4, !tbaa !5
store i32 %7, ptr %arrayidx11, align 4, !tbaa !5
store i32 %3, ptr %arrayidx9, align 16, !tbaa !5
br label %sw.epilog
sw.bb34: ; preds = %for.inc.4.i
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
%.pre = load i32, ptr %x, align 16, !tbaa !5
%.pre143 = load i32, ptr %arrayidx3, align 4
br label %sw.epilog
sw.epilog: ; preds = %for.inc.i, %sw.bb34, %sw.bb33, %sw.bb32, %sw.bb31, %sw.bb30, %sw.bb
%17 = phi i32 [ %2, %for.inc.i ], [ %.pre143, %sw.bb34 ], [ %2, %sw.bb33 ], [ %2, %sw.bb32 ], [ %2, %sw.bb31 ], [ %2, %sw.bb30 ], [ %2, %sw.bb ]
%18 = phi i32 [ %3, %for.inc.i ], [ %.pre, %sw.bb34 ], [ %4, %sw.bb33 ], [ %8, %sw.bb32 ], [ %16, %sw.bb31 ], [ %14, %sw.bb30 ], [ %9, %sw.bb ]
%19 = load i32, ptr %y, align 16, !tbaa !5
%cmp4.i88 = icmp eq i32 %19, %18
%cmp4.1.i91 = icmp eq i32 %19, %17
%or.cond = select i1 %cmp4.i88, i1 true, i1 %cmp4.1.i91
br i1 %or.cond, label %sw.epilog44, label %for.inc.1.i92
for.inc.1.i92: ; preds = %sw.epilog
%20 = load i32, ptr %arrayidx5, align 8, !tbaa !5
%cmp4.2.i94 = icmp eq i32 %19, %20
br i1 %cmp4.2.i94, label %sw.bb37, label %for.inc.2.i95
for.inc.2.i95: ; preds = %for.inc.1.i92
%21 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp4.3.i97 = icmp eq i32 %19, %21
br i1 %cmp4.3.i97, label %sw.bb38, label %for.inc.3.i98
for.inc.3.i98: ; preds = %for.inc.2.i95
%22 = load i32, ptr %arrayidx9, align 16, !tbaa !5
%cmp4.4.i100 = icmp eq i32 %19, %22
br i1 %cmp4.4.i100, label %sw.bb39, label %for.inc.4.i101
for.inc.4.i101: ; preds = %for.inc.3.i98
%23 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp4.5.i103 = icmp eq i32 %19, %23
br i1 %cmp4.5.i103, label %sw.bb41, label %sw.bb42
sw.bb37: ; preds = %for.inc.1.i92
store i32 %19, ptr %x, align 16, !tbaa !5
%24 = load i32, ptr %arrayidx11, align 4, !tbaa !5
store i32 %24, ptr %arrayidx5, align 8, !tbaa !5
%25 = load i32, ptr %arrayidx7, align 4, !tbaa !5
store i32 %25, ptr %arrayidx11, align 4, !tbaa !5
store i32 %18, ptr %arrayidx7, align 4, !tbaa !5
br label %sw.epilog44
sw.bb38: ; preds = %for.inc.2.i95
store i32 %19, ptr %x, align 16, !tbaa !5
%26 = load i32, ptr %arrayidx11, align 4, !tbaa !5
store i32 %26, ptr %arrayidx7, align 4, !tbaa !5
store i32 %20, ptr %arrayidx11, align 4, !tbaa !5
store i32 %18, ptr %arrayidx5, align 8, !tbaa !5
br label %sw.epilog44
sw.bb39: ; preds = %for.inc.3.i98
%puts63 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %sw.epilog44
sw.bb41: ; preds = %for.inc.4.i101
store i32 %19, ptr %x, align 16, !tbaa !5
store i32 %21, ptr %arrayidx5, align 8, !tbaa !5
store i32 %18, ptr %arrayidx11, align 4, !tbaa !5
store i32 %20, ptr %arrayidx7, align 4, !tbaa !5
br label %sw.epilog44
sw.bb42: ; preds = %for.inc.4.i101
%puts64 = call i32 @puts(ptr nonnull dereferenceable(1) @str.5)
br label %sw.epilog44
sw.epilog44: ; preds = %sw.epilog, %sw.bb42, %sw.bb41, %sw.bb39, %sw.bb38, %sw.bb37
%27 = load <4 x i32>, ptr %x, align 16, !tbaa !5
%28 = load <4 x i32>, ptr %y, align 16, !tbaa !5
%29 = icmp eq <4 x i32> %27, %28
%30 = load <2 x i32>, ptr %arrayidx9, align 16, !tbaa !5
%31 = load <2 x i32>, ptr %arrayidx25, align 16, !tbaa !5
%32 = icmp eq <2 x i32> %30, %31
%33 = extractelement <2 x i1> %32, i64 0
%inc.4 = zext i1 %33 to i32
%34 = extractelement <2 x i1> %32, i64 1
%inc.5 = zext i1 %34 to i32
%35 = bitcast <4 x i1> %29 to i4
%36 = call i4 @llvm.ctpop.i4(i4 %35), !range !11
%37 = zext i4 %36 to i32
%op.rdx = add nuw nsw i32 %37, %inc.4
%op.rdx144 = add nuw nsw i32 %op.rdx, %inc.5
%cmp52 = icmp eq i32 %op.rdx144, 6
%str.7.str.6 = select i1 %cmp52, ptr @str.7, ptr @str.6
%puts65 = call i32 @puts(ptr nonnull dereferenceable(1) %str.7.str.6)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %y) #7
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %x) #7
call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %order) #7
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i4 @llvm.ctpop.i4(i4) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"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 = !{i4 0, i4 5}
|
// AOJ 0321: Investigation of Club Activities
// 2017.9.29 bal4u@uu
#include <stdio.h>
#define MAX 100003
/* UNION-FIND library */
int p[MAX], rank[MAX];
void make_set(int x) { p[x] = x, rank[x] = 0; }
void link(int x, int y) {
if (rank[x] > rank[y]) p[y] = x;
else { p[x] = y; if (rank[x] == rank[y]) rank[y] = rank[y] + 1; }
}
int find_set(int x) { if (x != p[x]) p[x] = find_set(p[x]); return p[x]; }
void union_set(int x, int y) { link(find_set(x), find_set(y)); }
int joined[MAX];
int main()
{
int n, m, k, i, c, a, b, ga, gb, x;
scanf("%d%d%d", &n, &m, &k);
for (i = 1; i <= n; i++) p[i] = i;
for (i = 1; i <= k; i++) {
scanf("%d%d%d", &c, &a, &b);
if (c == 1) { // cmd: 1 a b
a = find_set(a);
b = find_set(b);
ga = joined[a], gb = joined[b];
if (ga > 0 && gb > 0 && ga != gb) break;
union_set(a, b);
x = find_set(a);
if (ga == 0) ga = gb;
if (ga > 0) {
if (joined[x] == 0) joined[x] = ga;
else if (joined[x] != ga) break;
}
}
else if (c == 2) { // cmd: 2 a b
a = find_set(a);
if (!joined[a]) joined[a] = b;
else if (joined[a] != b) break;
}
}
if (i > k) puts("0");
else printf("%d\n", i);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117284/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117284/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@p = dso_local local_unnamed_addr global [100003 x i32] zeroinitializer, align 16
@rank = dso_local local_unnamed_addr global [100003 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@joined = dso_local local_unnamed_addr global [100003 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [2 x i8] c"0\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(write, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @make_set(i32 noundef %x) local_unnamed_addr #0 {
entry:
%idxprom = sext i32 %x to i64
%arrayidx = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %idxprom
store i32 %x, ptr %arrayidx, align 4, !tbaa !5
%arrayidx2 = getelementptr inbounds [100003 x i32], ptr @rank, i64 0, i64 %idxprom
store i32 0, ptr %arrayidx2, align 4, !tbaa !5
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @link(i32 noundef %x, i32 noundef %y) local_unnamed_addr #1 {
entry:
%idxprom = sext i32 %x to i64
%arrayidx = getelementptr inbounds [100003 x i32], ptr @rank, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%idxprom1 = sext i32 %y to i64
%arrayidx2 = getelementptr inbounds [100003 x i32], ptr @rank, i64 0, i64 %idxprom1
%1 = load i32, ptr %arrayidx2, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%arrayidx4 = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %idxprom1
store i32 %x, ptr %arrayidx4, align 4, !tbaa !5
br label %if.end17
if.else: ; preds = %entry
%arrayidx6 = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %idxprom
store i32 %y, ptr %arrayidx6, align 4, !tbaa !5
%cmp11 = icmp eq i32 %0, %1
br i1 %cmp11, label %if.then12, label %if.end17
if.then12: ; preds = %if.else
%add = add nsw i32 %0, 1
store i32 %add, ptr %arrayidx2, align 4, !tbaa !5
br label %if.end17
if.end17: ; preds = %if.else, %if.then12, %if.then
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @find_set(i32 noundef %x) local_unnamed_addr #2 {
entry:
%idxprom = sext i32 %x to i64
%arrayidx = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %idxprom
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp.not = icmp eq i32 %0, %x
br i1 %cmp.not, label %common.ret, label %if.then
common.ret: ; preds = %entry, %if.then
%common.ret.op = phi i32 [ %call, %if.then ], [ %x, %entry ]
ret i32 %common.ret.op
if.then: ; preds = %entry
%call = tail call i32 @find_set(i32 noundef %0)
store i32 %call, ptr %arrayidx, align 4, !tbaa !5
br label %common.ret
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @union_set(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 {
entry:
%call = tail call i32 @find_set(i32 noundef %x)
%call1 = tail call i32 @find_set(i32 noundef %y)
%idxprom.i = sext i32 %call to i64
%arrayidx.i = getelementptr inbounds [100003 x i32], ptr @rank, i64 0, i64 %idxprom.i
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%idxprom1.i = sext i32 %call1 to i64
%arrayidx2.i = getelementptr inbounds [100003 x i32], ptr @rank, i64 0, i64 %idxprom1.i
%1 = load i32, ptr %arrayidx2.i, align 4, !tbaa !5
%cmp.i = icmp sgt i32 %0, %1
br i1 %cmp.i, label %if.then.i, label %if.else.i
if.then.i: ; preds = %entry
%arrayidx4.i = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %idxprom1.i
store i32 %call, ptr %arrayidx4.i, align 4, !tbaa !5
br label %link.exit
if.else.i: ; preds = %entry
%arrayidx6.i = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %idxprom.i
store i32 %call1, ptr %arrayidx6.i, align 4, !tbaa !5
%cmp11.i = icmp eq i32 %0, %1
br i1 %cmp11.i, label %if.then12.i, label %link.exit
if.then12.i: ; preds = %if.else.i
%add.i = add nsw i32 %0, 1
store i32 %add.i, ptr %arrayidx2.i, align 4, !tbaa !5
br label %link.exit
link.exit: ; preds = %if.then.i, %if.else.i, %if.then12.i
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%k = alloca i32, align 4
%c = alloca i32, align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not85 = icmp slt i32 %0, 1
br i1 %cmp.not85, label %for.cond1.preheader, label %for.body.preheader
for.body.preheader: ; preds = %entry
%1 = add nuw i32 %0, 1
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %0, 8
br i1 %min.iters.check, label %for.body.preheader94, label %vector.ph
vector.ph: ; preds = %for.body.preheader
%n.vec = and i64 %2, -8
%ind.end = or i64 %n.vec, 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%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>
%offset.idx = or i64 %index, 1
%3 = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %offset.idx
store <4 x i32> %vec.ind, ptr %3, align 4, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
store <4 x i32> %step.add, ptr %4, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %2, %n.vec
br i1 %cmp.n, label %for.cond1.preheader, label %for.body.preheader94
for.body.preheader94: ; preds = %for.body.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 1, %for.body.preheader ], [ %ind.end, %middle.block ]
br label %for.body
for.cond1.preheader: ; preds = %for.body, %middle.block, %entry
%6 = load i32, ptr %k, align 4, !tbaa !5
%cmp2.not87 = icmp slt i32 %6, 1
br i1 %cmp2.not87, label %for.end56, label %for.body3
for.body: ; preds = %for.body.preheader94, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %indvars.iv.ph, %for.body.preheader94 ]
%arrayidx = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %indvars.iv
%7 = trunc i64 %indvars.iv to i32
store i32 %7, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.cond1.preheader, label %for.body, !llvm.loop !13
for.body3: ; preds = %for.cond1.preheader, %for.inc54
%i.188 = phi i32 [ %inc55, %for.inc54 ], [ 1, %for.cond1.preheader ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %c, ptr noundef nonnull %a, ptr noundef nonnull %b)
%8 = load i32, ptr %c, align 4, !tbaa !5
switch i32 %8, label %for.inc54 [
i32 1, label %if.then
i32 2, label %if.then38
]
if.then: ; preds = %for.body3
%9 = load i32, ptr %a, align 4, !tbaa !5
%call6 = call i32 @find_set(i32 noundef %9)
store i32 %call6, ptr %a, align 4, !tbaa !5
%10 = load i32, ptr %b, align 4, !tbaa !5
%call7 = call i32 @find_set(i32 noundef %10)
store i32 %call7, ptr %b, align 4, !tbaa !5
%11 = load i32, ptr %a, align 4, !tbaa !5
%idxprom8 = sext i32 %11 to i64
%arrayidx9 = getelementptr inbounds [100003 x i32], ptr @joined, i64 0, i64 %idxprom8
%12 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%idxprom10 = sext i32 %call7 to i64
%arrayidx11 = getelementptr inbounds [100003 x i32], ptr @joined, i64 0, i64 %idxprom10
%13 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp12 = icmp slt i32 %12, 1
%cmp13 = icmp slt i32 %13, 1
%or.cond.not84 = select i1 %cmp12, i1 true, i1 %cmp13
%cmp15.not = icmp eq i32 %12, %13
%or.cond83 = select i1 %or.cond.not84, i1 true, i1 %cmp15.not
br i1 %or.cond83, label %if.end, label %for.end56.loopexit
if.end: ; preds = %if.then
%call.i = call i32 @find_set(i32 noundef %11)
%call1.i = call i32 @find_set(i32 noundef %call7)
%idxprom.i.i = sext i32 %call.i to i64
%arrayidx.i.i = getelementptr inbounds [100003 x i32], ptr @rank, i64 0, i64 %idxprom.i.i
%14 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5
%idxprom1.i.i = sext i32 %call1.i to i64
%arrayidx2.i.i = getelementptr inbounds [100003 x i32], ptr @rank, i64 0, i64 %idxprom1.i.i
%15 = load i32, ptr %arrayidx2.i.i, align 4, !tbaa !5
%cmp.i.i = icmp sgt i32 %14, %15
br i1 %cmp.i.i, label %if.then.i.i, label %if.else.i.i
if.then.i.i: ; preds = %if.end
%arrayidx4.i.i = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %idxprom1.i.i
store i32 %call.i, ptr %arrayidx4.i.i, align 4, !tbaa !5
br label %union_set.exit
if.else.i.i: ; preds = %if.end
%arrayidx6.i.i = getelementptr inbounds [100003 x i32], ptr @p, i64 0, i64 %idxprom.i.i
store i32 %call1.i, ptr %arrayidx6.i.i, align 4, !tbaa !5
%cmp11.i.i = icmp eq i32 %14, %15
br i1 %cmp11.i.i, label %if.then12.i.i, label %union_set.exit
if.then12.i.i: ; preds = %if.else.i.i
%add.i.i = add nsw i32 %14, 1
store i32 %add.i.i, ptr %arrayidx2.i.i, align 4, !tbaa !5
br label %union_set.exit
union_set.exit: ; preds = %if.then.i.i, %if.else.i.i, %if.then12.i.i
%16 = load i32, ptr %a, align 4, !tbaa !5
%call17 = call i32 @find_set(i32 noundef %16)
%cmp18 = icmp eq i32 %12, 0
%spec.select = select i1 %cmp18, i32 %13, i32 %12
%cmp21 = icmp sgt i32 %spec.select, 0
br i1 %cmp21, label %if.then22, label %for.inc54
if.then22: ; preds = %union_set.exit
%idxprom23 = sext i32 %call17 to i64
%arrayidx24 = getelementptr inbounds [100003 x i32], ptr @joined, i64 0, i64 %idxprom23
%17 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%cmp25 = icmp eq i32 %17, 0
br i1 %cmp25, label %if.then26, label %if.else
if.then26: ; preds = %if.then22
store i32 %spec.select, ptr %arrayidx24, align 4, !tbaa !5
br label %for.inc54
if.else: ; preds = %if.then22
%cmp31.not = icmp eq i32 %17, %spec.select
br i1 %cmp31.not, label %for.inc54, label %for.end56.loopexit
if.then38: ; preds = %for.body3
%18 = load i32, ptr %a, align 4, !tbaa !5
%call39 = call i32 @find_set(i32 noundef %18)
store i32 %call39, ptr %a, align 4, !tbaa !5
%idxprom40 = sext i32 %call39 to i64
%arrayidx41 = getelementptr inbounds [100003 x i32], ptr @joined, i64 0, i64 %idxprom40
%19 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%tobool.not = icmp eq i32 %19, 0
%20 = load i32, ptr %b, align 4, !tbaa !5
br i1 %tobool.not, label %if.then42, label %if.else45
if.then42: ; preds = %if.then38
store i32 %20, ptr %arrayidx41, align 4, !tbaa !5
br label %for.inc54
if.else45: ; preds = %if.then38
%cmp48.not = icmp eq i32 %19, %20
br i1 %cmp48.not, label %for.inc54, label %for.end56.loopexit
for.inc54: ; preds = %for.body3, %if.then26, %if.else, %union_set.exit, %if.then42, %if.else45
%inc55 = add nuw nsw i32 %i.188, 1
%21 = load i32, ptr %k, align 4, !tbaa !5
%cmp2.not.not = icmp slt i32 %i.188, %21
br i1 %cmp2.not.not, label %for.body3, label %for.end56.loopexit, !llvm.loop !14
for.end56.loopexit: ; preds = %if.then, %if.else45, %if.else, %for.inc54
%i.1.lcssa.ph = phi i32 [ %inc55, %for.inc54 ], [ %i.188, %if.else ], [ %i.188, %if.else45 ], [ %i.188, %if.then ]
%.pre = load i32, ptr %k, align 4, !tbaa !5
br label %for.end56
for.end56: ; preds = %for.end56.loopexit, %for.cond1.preheader
%22 = phi i32 [ %6, %for.cond1.preheader ], [ %.pre, %for.end56.loopexit ]
%i.1.lcssa = phi i32 [ 1, %for.cond1.preheader ], [ %i.1.lcssa.ph, %for.end56.loopexit ]
%cmp57 = icmp sgt i32 %i.1.lcssa, %22
br i1 %cmp57, label %if.then58, label %if.else60
if.then58: ; preds = %for.end56
%call59 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end62
if.else60: ; preds = %for.end56
%call61 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.1.lcssa)
br label %if.end62
if.end62: ; preds = %if.else60, %if.then58
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #7
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #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) #5
; 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 #6
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #6
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #5
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(write, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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}
|
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) > (b) ? (b) : (a))
#define REP(i, n) for(int i = 0; i < n; i++)
typedef long long ll;
int
main(int argc, char *argv[])
{
ll a, b, c;
scanf("%lld %lld %lld", &a, &b, &c);
if(a == b && b == c && c % 2 == 0) printf("-1\n");
else{
ll ans = 0; ll tmp[3];
while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0){
tmp[0] = a / 2;
tmp[1] = b / 2;
tmp[2] = c / 2;
a = tmp[1] + tmp[2];
b = tmp[0] + tmp[2];
c = tmp[0] + tmp[1];
ans++;
}
printf("%lld\n", ans);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117327/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117327/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca i64, align 8
%b = alloca i64, align 8
%c = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %c) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b, ptr noundef nonnull %c)
%0 = load i64, ptr %a, align 8, !tbaa !5
%1 = load i64, ptr %b, align 8, !tbaa !5
%cmp = icmp eq i64 %0, %1
%2 = load i64, ptr %c, align 8, !tbaa !5
br i1 %cmp, label %land.lhs.true, label %if.else
land.lhs.true: ; preds = %entry
%cmp1 = icmp eq i64 %0, %2
%3 = and i64 %2, 1
%cmp3 = icmp eq i64 %3, 0
%or.cond = and i1 %cmp1, %cmp3
br i1 %or.cond, label %if.then, label %if.else
if.then: ; preds = %land.lhs.true
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end
if.else: ; preds = %entry, %land.lhs.true
%4 = and i64 %0, 1
%cmp633 = icmp eq i64 %4, 0
br i1 %cmp633, label %land.lhs.true7, label %while.end
land.lhs.true7: ; preds = %if.else, %while.body
%ans.037 = phi i64 [ %inc, %while.body ], [ 0, %if.else ]
%add3036 = phi i64 [ %add, %while.body ], [ %0, %if.else ]
%add203135 = phi i64 [ %add20, %while.body ], [ %1, %if.else ]
%add233234 = phi i64 [ %add23, %while.body ], [ %2, %if.else ]
%5 = and i64 %add203135, 1
%cmp9 = icmp eq i64 %5, 0
%6 = and i64 %add233234, 1
%cmp11 = icmp eq i64 %6, 0
%or.cond40 = select i1 %cmp9, i1 %cmp11, i1 false
br i1 %or.cond40, label %while.body, label %while.end
while.body: ; preds = %land.lhs.true7
%div = sdiv i64 %add3036, 2
%div12 = sdiv i64 %add203135, 2
%div14 = sdiv i64 %add233234, 2
%add = add nsw i64 %div14, %div12
store i64 %add, ptr %a, align 8, !tbaa !5
%add20 = add nsw i64 %div14, %div
store i64 %add20, ptr %b, align 8, !tbaa !5
%add23 = add nsw i64 %div12, %div
store i64 %add23, ptr %c, align 8, !tbaa !5
%inc = add nuw nsw i64 %ans.037, 1
%7 = and i64 %add, 1
%cmp6 = icmp eq i64 %7, 0
br i1 %cmp6, label %land.lhs.true7, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %land.lhs.true7, %if.else
%ans.0.lcssa = phi i64 [ 0, %if.else ], [ %ans.037, %land.lhs.true7 ], [ %inc, %while.body ]
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %ans.0.lcssa)
br label %if.end
if.end: ; preds = %while.end, %if.then
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %c) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %a) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int i = 0;
double a[4], b[4];
scanf("%lf %lf %lf", &a[0], &a[1], &a[2]);
if(a[0] == a[1] && a[1] == a[2] && (long long int)a[0] % 2 == 0 && (long long int)a[1] % 2 == 0 && (int long long)a[2] % 2 == 0) {
printf("-1");
}
else {
while ((long long int)a[0] % 2 == 0 && (long long int)a[1] % 2 == 0 && (int long long)a[2] % 2 == 0) {
b[0] = a[0];
b[1] = a[1];
b[2] = a[2];
a[0] = b[1] / 2 + b[2] / 2;
a[1] = b[2] / 2 + b[0] / 2;
a[2] = b[0] / 2 + b[1] / 2;
i++;
}
printf("%d", i);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117370/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117370/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [12 x i8] c"%lf %lf %lf\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [4 x double], align 16
call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %a) #3
%arrayidx1 = getelementptr inbounds [4 x double], ptr %a, i64 0, i64 1
%arrayidx2 = getelementptr inbounds [4 x double], ptr %a, i64 0, i64 2
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %arrayidx1, ptr noundef nonnull %arrayidx2)
%0 = load double, ptr %a, align 16, !tbaa !5
%1 = load double, ptr %arrayidx1, align 8, !tbaa !5
%cmp = fcmp oeq double %0, %1
%2 = load double, ptr %arrayidx2, align 16, !tbaa !5
%cmp7 = fcmp oeq double %1, %2
%or.cond = select i1 %cmp, i1 %cmp7, i1 false
br i1 %or.cond, label %land.lhs.true8, label %if.else
land.lhs.true8: ; preds = %entry
%conv = fptosi double %0 to i64
%3 = and i64 %conv, 1
%cmp10 = icmp eq i64 %3, 0
br i1 %cmp10, label %land.lhs.true12, label %if.else
land.lhs.true12: ; preds = %land.lhs.true8
%conv14 = fptosi double %1 to i64
%4 = and i64 %conv14, 1
%cmp16 = icmp eq i64 %4, 0
br i1 %cmp16, label %land.lhs.true18, label %if.else
land.lhs.true18: ; preds = %land.lhs.true12
%conv20 = fptosi double %2 to i64
%5 = and i64 %conv20, 1
%cmp22 = icmp eq i64 %5, 0
br i1 %cmp22, label %if.then, label %if.else
if.then: ; preds = %land.lhs.true18
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end
if.else: ; preds = %entry, %land.lhs.true18, %land.lhs.true12, %land.lhs.true8
%conv2673 = fptosi double %0 to i64
%6 = and i64 %conv2673, 1
%cmp2874 = icmp eq i64 %6, 0
br i1 %cmp2874, label %land.lhs.true30, label %while.end
land.lhs.true30: ; preds = %if.else, %while.body
%i.078 = phi i32 [ %inc, %while.body ], [ 0, %if.else ]
%add7077 = phi double [ %add, %while.body ], [ %0, %if.else ]
%add557176 = phi double [ %add55, %while.body ], [ %1, %if.else ]
%add617275 = phi double [ %add61, %while.body ], [ %2, %if.else ]
%conv32 = fptosi double %add557176 to i64
%7 = and i64 %conv32, 1
%cmp34 = icmp eq i64 %7, 0
br i1 %cmp34, label %land.rhs, label %while.end
land.rhs: ; preds = %land.lhs.true30
%conv37 = fptosi double %add617275 to i64
%8 = and i64 %conv37, 1
%cmp39 = icmp eq i64 %8, 0
br i1 %cmp39, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%div = fmul double %add557176, 5.000000e-01
%div49 = fmul double %add617275, 5.000000e-01
%add = fadd double %div, %div49
store double %add, ptr %a, align 16, !tbaa !5
%div54 = fmul double %add7077, 5.000000e-01
%add55 = fadd double %div54, %div49
store double %add55, ptr %arrayidx1, align 8, !tbaa !5
%add61 = fadd double %div54, %div
store double %add61, ptr %arrayidx2, align 16, !tbaa !5
%inc = add nuw nsw i32 %i.078, 1
%conv26 = fptosi double %add to i64
%9 = and i64 %conv26, 1
%cmp28 = icmp eq i64 %9, 0
br i1 %cmp28, label %land.lhs.true30, label %while.end, !llvm.loop !9
while.end: ; preds = %land.rhs, %while.body, %land.lhs.true30, %if.else
%i.0.lcssa = phi i32 [ 0, %if.else ], [ %i.078, %land.lhs.true30 ], [ %inc, %while.body ], [ %i.078, %land.rhs ]
%call63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %i.0.lcssa)
br label %if.end
if.end: ; preds = %while.end, %if.then
call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %a) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
char A[55][55];
char B[55][55];
int N,M;
scanf("%d %d",&N,&M);
int i,j,x,y;
for(i=0;i<N;i++){
scanf("%s",A[i]);
}
for(i=0;i<M;i++){
scanf("%s",B[i]);
}
i=0;
j=0;
while(1){
if(i+M-1>=N) break;
int cnt=0;
for(y=0;y<M;y++){
for(x=0;x<M;x++){
if(A[y+i][x+j]==B[y][x])cnt++;
}
}
if(cnt==M*M){
printf("Yes\n");
return 0;
}
j++;
if(j+M-1>=N){
i++;
j=0;
}
}
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117413/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117413/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@str = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [55 x [55 x i8]], align 16
%B = alloca [55 x [55 x i8]], align 16
%N = alloca i32, align 4
%M = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 3025, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 3025, ptr nonnull %B) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp85 = icmp sgt i32 %0, 0
br i1 %cmp85, label %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %M, align 4, !tbaa !5
%cmp387 = icmp sgt i32 %2, 0
br i1 %cmp387, label %for.body4, label %while.cond.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [55 x [55 x i8]], 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
%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.cond2.preheader, !llvm.loop !9
while.cond.preheader.loopexit: ; preds = %for.body4
%.pre = load i32, ptr %N, align 4, !tbaa !5
br label %while.cond.preheader
while.cond.preheader: ; preds = %while.cond.preheader.loopexit, %for.cond2.preheader
%5 = phi i32 [ %.pre, %while.cond.preheader.loopexit ], [ %1, %for.cond2.preheader ]
%6 = phi i32 [ %27, %while.cond.preheader.loopexit ], [ %2, %for.cond2.preheader ]
%cmp12.not.not96 = icmp sgt i32 %6, %5
br i1 %cmp12.not.not96, label %cleanup55, label %for.cond13.preheader.lr.ph
for.cond13.preheader.lr.ph: ; preds = %while.cond.preheader
%cmp1492 = icmp sgt i32 %6, 0
%mul = mul nsw i32 %6, %6
br i1 %cmp1492, label %for.cond13.preheader.us.preheader, label %for.cond13.preheader.lr.ph.split
for.cond13.preheader.us.preheader: ; preds = %for.cond13.preheader.lr.ph
%wide.trip.count112 = zext i32 %6 to i64
%min.iters.check = icmp ult i32 %6, 8
%n.vec = and i64 %wide.trip.count112, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count112
br label %for.cond13.preheader.us
for.cond13.preheader.us: ; preds = %for.cond13.preheader.us.preheader, %cleanup.us
%j.098.us = phi i32 [ %spec.select82.us, %cleanup.us ], [ 0, %for.cond13.preheader.us.preheader ]
%i.297.us = phi i32 [ %spec.select81.us, %cleanup.us ], [ 0, %for.cond13.preheader.us.preheader ]
%7 = sext i32 %j.098.us to i64
%8 = zext i32 %i.297.us to i64
br label %for.cond16.preheader.us.us
cleanup.us: ; preds = %for.cond13.for.end40_crit_edge.split.us.us
%inc46.us = add nsw i32 %j.098.us, 1
%sub48.us = add i32 %6, %j.098.us
%cmp49.not.us = icmp sge i32 %sub48.us, %5
%inc52.us = zext i1 %cmp49.not.us to i32
%spec.select81.us = add nuw nsw i32 %i.297.us, %inc52.us
%spec.select82.us = select i1 %cmp49.not.us, i32 0, i32 %inc46.us
%add.us = add nsw i32 %6, %spec.select81.us
%cmp12.not.not.us = icmp sgt i32 %add.us, %5
br i1 %cmp12.not.not.us, label %cleanup55, label %for.cond13.preheader.us
for.cond16.preheader.us.us: ; preds = %for.cond16.for.inc38_crit_edge.us.us, %for.cond13.preheader.us
%indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.cond16.for.inc38_crit_edge.us.us ], [ 0, %for.cond13.preheader.us ]
%cnt.094.us.us = phi i32 [ %spec.select.us.us.lcssa, %for.cond16.for.inc38_crit_edge.us.us ], [ 0, %for.cond13.preheader.us ]
%9 = add nuw nsw i64 %indvars.iv108, %8
br i1 %min.iters.check, label %for.body18.us.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond16.preheader.us.us
%10 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %cnt.094.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> [ %10, %vector.ph ], [ %20, %vector.body ]
%vec.phi118 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %21, %vector.body ]
%11 = add nsw i64 %index, %7
%12 = getelementptr inbounds [55 x [55 x i8]], ptr %A, i64 0, i64 %9, i64 %11
%wide.load = load <4 x i8>, ptr %12, align 1, !tbaa !11
%13 = getelementptr inbounds i8, ptr %12, i64 4
%wide.load119 = load <4 x i8>, ptr %13, align 1, !tbaa !11
%14 = getelementptr inbounds [55 x [55 x i8]], ptr %B, i64 0, i64 %indvars.iv108, i64 %index
%wide.load120 = load <4 x i8>, ptr %14, align 1, !tbaa !11
%15 = getelementptr inbounds i8, ptr %14, i64 4
%wide.load121 = load <4 x i8>, ptr %15, align 1, !tbaa !11
%16 = icmp eq <4 x i8> %wide.load, %wide.load120
%17 = icmp eq <4 x i8> %wide.load119, %wide.load121
%18 = zext <4 x i1> %16 to <4 x i32>
%19 = zext <4 x i1> %17 to <4 x i32>
%20 = add <4 x i32> %vec.phi, %18
%21 = add <4 x i32> %vec.phi118, %19
%index.next = add nuw i64 %index, 8
%22 = icmp eq i64 %index.next, %n.vec
br i1 %22, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %21, %20
%23 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br i1 %cmp.n, label %for.cond16.for.inc38_crit_edge.us.us, label %for.body18.us.us.preheader
for.body18.us.us.preheader: ; preds = %for.cond16.preheader.us.us, %middle.block
%indvars.iv104.ph = phi i64 [ 0, %for.cond16.preheader.us.us ], [ %n.vec, %middle.block ]
%cnt.191.us.us.ph = phi i32 [ %cnt.094.us.us, %for.cond16.preheader.us.us ], [ %23, %middle.block ]
br label %for.body18.us.us
for.body18.us.us: ; preds = %for.body18.us.us.preheader, %for.body18.us.us
%indvars.iv104 = phi i64 [ %indvars.iv.next105, %for.body18.us.us ], [ %indvars.iv104.ph, %for.body18.us.us.preheader ]
%cnt.191.us.us = phi i32 [ %spec.select.us.us, %for.body18.us.us ], [ %cnt.191.us.us.ph, %for.body18.us.us.preheader ]
%24 = add nsw i64 %indvars.iv104, %7
%arrayidx24.us.us = getelementptr inbounds [55 x [55 x i8]], ptr %A, i64 0, i64 %9, i64 %24
%25 = load i8, ptr %arrayidx24.us.us, align 1, !tbaa !11
%arrayidx28.us.us = getelementptr inbounds [55 x [55 x i8]], ptr %B, i64 0, i64 %indvars.iv108, i64 %indvars.iv104
%26 = load i8, ptr %arrayidx28.us.us, align 1, !tbaa !11
%cmp30.us.us = icmp eq i8 %25, %26
%inc33.us.us = zext i1 %cmp30.us.us to i32
%spec.select.us.us = add nsw i32 %cnt.191.us.us, %inc33.us.us
%indvars.iv.next105 = add nuw nsw i64 %indvars.iv104, 1
%exitcond.not = icmp eq i64 %indvars.iv.next105, %wide.trip.count112
br i1 %exitcond.not, label %for.cond16.for.inc38_crit_edge.us.us, label %for.body18.us.us, !llvm.loop !15
for.cond16.for.inc38_crit_edge.us.us: ; preds = %for.body18.us.us, %middle.block
%spec.select.us.us.lcssa = phi i32 [ %23, %middle.block ], [ %spec.select.us.us, %for.body18.us.us ]
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%exitcond113.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count112
br i1 %exitcond113.not, label %for.cond13.for.end40_crit_edge.split.us.us, label %for.cond16.preheader.us.us, !llvm.loop !16
for.cond13.for.end40_crit_edge.split.us.us: ; preds = %for.cond16.for.inc38_crit_edge.us.us
%cmp41.not.us = icmp eq i32 %spec.select.us.us.lcssa, %mul
br i1 %cmp41.not.us, label %cleanup55, label %cleanup.us
for.cond13.preheader.lr.ph.split: ; preds = %for.cond13.preheader.lr.ph
%cmp41.not = icmp eq i32 %6, 0
br i1 %cmp41.not, label %cleanup55, label %for.cond13.preheader
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv101 = phi i64 [ %indvars.iv.next102, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [55 x [55 x i8]], ptr %B, i64 0, i64 %indvars.iv101
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%27 = load i32, ptr %M, align 4, !tbaa !5
%28 = sext i32 %27 to i64
%cmp3 = icmp slt i64 %indvars.iv.next102, %28
br i1 %cmp3, label %for.body4, label %while.cond.preheader.loopexit, !llvm.loop !17
for.cond13.preheader: ; preds = %for.cond13.preheader.lr.ph.split, %for.cond13.preheader
%j.098 = phi i32 [ %spec.select82, %for.cond13.preheader ], [ 0, %for.cond13.preheader.lr.ph.split ]
%i.297 = phi i32 [ %spec.select81, %for.cond13.preheader ], [ 0, %for.cond13.preheader.lr.ph.split ]
%inc46 = add nsw i32 %j.098, 1
%sub48 = add i32 %6, %j.098
%cmp49.not = icmp sge i32 %sub48, %5
%inc52 = zext i1 %cmp49.not to i32
%spec.select81 = add nuw nsw i32 %i.297, %inc52
%spec.select82 = select i1 %cmp49.not, i32 0, i32 %inc46
%add = add nsw i32 %6, %spec.select81
%cmp12.not.not = icmp sgt i32 %add, %5
br i1 %cmp12.not.not, label %cleanup55, label %for.cond13.preheader
cleanup55: ; preds = %for.cond13.preheader, %cleanup.us, %for.cond13.for.end40_crit_edge.split.us.us, %while.cond.preheader, %for.cond13.preheader.lr.ph.split
%str.sink = phi ptr [ @str, %for.cond13.preheader.lr.ph.split ], [ @str.4, %while.cond.preheader ], [ @str, %for.cond13.for.end40_crit_edge.split.us.us ], [ @str.4, %cleanup.us ], [ @str.4, %for.cond13.preheader ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.end.p0(i64 3025, ptr nonnull %B) #5
call void @llvm.lifetime.end.p0(i64 3025, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!7, !7, i64 0}
!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, !10}
|
#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))
#define bool _Bool
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 check(char A[64][64], char B[64][64], int i, int j, int m) {
int x, y;
for (x = 0; x < m; x++) {
for (y = 0; y < m; y++) {
if (A[i + x][j + y] != B[x][y]) {
return 0;
}
}
}
return 1;
}
int main() {
int N, M;
int i, j;
int flag = 0;
scanf("%d%d", &N, &M);
char A[50][51], B[50][51];
for (int i = 0; i < N; i++) {
scanf("%s", &A[i][0]);
}
for (int k = 0; k < M; k++) {
scanf("%s", &B[k][0]);
}
for (i = 0; i < N - (M - 1); i++) {
for (j = 0; j < N - (M - 1); j++) {
flag = check(A, B, i, j, M);
if (flag) {
puts("Yes");
return 0;
}
}
}
puts("No");
#ifdef DEBUGF
getch();
#endif
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117457/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117457/source.c"
target datalayout = "e-m:e-p270: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
@.str.8 = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.9 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.10 = private unnamed_addr constant [3 x i8] c"No\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 norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @check(ptr nocapture noundef readonly %A, ptr nocapture noundef readonly %B, i32 noundef %i, i32 noundef %j, i32 noundef %m) local_unnamed_addr #9 {
entry:
%cmp28 = icmp sgt i32 %m, 0
br i1 %cmp28, label %for.cond1.preheader.us.preheader, label %cleanup
for.cond1.preheader.us.preheader: ; preds = %entry
%0 = sext i32 %j to i64
%1 = sext i32 %i to i64
%wide.trip.count37 = zext i32 %m to i64
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.inc14_crit_edge.us
%indvars.iv33 = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvars.iv.next34, %for.cond1.for.inc14_crit_edge.us ]
%2 = add nsw i64 %indvars.iv33, %1
br label %for.body3.us
for.cond1.us: ; preds = %for.body3.us
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count37
br i1 %exitcond.not, label %for.cond1.for.inc14_crit_edge.us, label %for.body3.us, !llvm.loop !13
for.body3.us: ; preds = %for.cond1.preheader.us, %for.cond1.us
%indvars.iv = phi i64 [ 0, %for.cond1.preheader.us ], [ %indvars.iv.next, %for.cond1.us ]
%3 = add nsw i64 %indvars.iv, %0
%arrayidx6.us = getelementptr inbounds [64 x i8], ptr %A, i64 %2, i64 %3
%4 = load i8, ptr %arrayidx6.us, align 1, !tbaa !15
%arrayidx10.us = getelementptr inbounds [64 x i8], ptr %B, i64 %indvars.iv33, i64 %indvars.iv
%5 = load i8, ptr %arrayidx10.us, align 1, !tbaa !15
%cmp12.not.us = icmp eq i8 %4, %5
br i1 %cmp12.not.us, label %for.cond1.us, label %cleanup
for.cond1.for.inc14_crit_edge.us: ; preds = %for.cond1.us
%indvars.iv.next34 = add nuw nsw i64 %indvars.iv33, 1
%exitcond38.not = icmp eq i64 %indvars.iv.next34, %wide.trip.count37
br i1 %exitcond38.not, label %cleanup, label %for.cond1.preheader.us, !llvm.loop !16
cleanup: ; preds = %for.cond1.for.inc14_crit_edge.us, %for.body3.us, %entry
%retval.0 = phi i32 [ 1, %entry ], [ 0, %for.body3.us ], [ 1, %for.cond1.for.inc14_crit_edge.us ]
ret i32 %retval.0
}
; 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 [50 x [51 x i8]], align 16
%B = alloca [50 x [51 x i8]], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #11
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #11
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.8, ptr noundef nonnull %N, ptr noundef nonnull %M)
call void @llvm.lifetime.start.p0(i64 2550, ptr nonnull %A) #11
call void @llvm.lifetime.start.p0(i64 2550, ptr nonnull %B) #11
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp51 = icmp sgt i32 %0, 0
br i1 %cmp51, label %for.body, label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.body, %entry
%1 = phi i32 [ %0, %entry ], [ %3, %for.body ]
%2 = load i32, ptr %M, align 4, !tbaa !5
%cmp553 = icmp sgt i32 %2, 0
br i1 %cmp553, label %for.body7, label %for.cond15.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [50 x [51 x i8]], ptr %A, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %N, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !17
for.cond15.preheader.loopexit: ; preds = %for.body7
%.pre = load i32, ptr %N, align 4, !tbaa !5
br label %for.cond15.preheader
for.cond15.preheader: ; preds = %for.cond15.preheader.loopexit, %for.cond4.preheader
%5 = phi i32 [ %1, %for.cond4.preheader ], [ %.pre, %for.cond15.preheader.loopexit ]
%.lcssa = phi i32 [ %2, %for.cond4.preheader ], [ %10, %for.cond15.preheader.loopexit ]
%reass.sub = sub i32 %5, %.lcssa
%sub16 = add i32 %reass.sub, 1
%cmp1757 = icmp ult i32 %reass.sub, 2147483647
br i1 %cmp1757, label %for.cond19.preheader.lr.ph, label %cleanup
for.cond19.preheader.lr.ph: ; preds = %for.cond15.preheader
%cmp28.i = icmp sgt i32 %.lcssa, 0
%wide.trip.count37.i = zext i32 %.lcssa to i64
br i1 %cmp28.i, label %for.cond19.preheader.us.preheader, label %cleanup
for.cond19.preheader.us.preheader: ; preds = %for.cond19.preheader.lr.ph
%wide.trip.count70 = zext i32 %sub16 to i64
br label %for.cond19.preheader.us
for.cond19.preheader.us: ; preds = %for.cond19.preheader.us.preheader, %for.cond19.for.inc30_crit_edge.us
%indvars.iv67 = phi i64 [ 0, %for.cond19.preheader.us.preheader ], [ %indvars.iv.next68, %for.cond19.for.inc30_crit_edge.us ]
br label %for.body23.us
for.body23.us: ; preds = %for.cond19.preheader.us, %for.inc27.us
%indvars.iv64 = phi i64 [ 0, %for.cond19.preheader.us ], [ %indvars.iv.next65, %for.inc27.us ]
br label %for.cond1.preheader.us.i.us
for.cond1.preheader.us.i.us: ; preds = %for.cond1.for.inc14_crit_edge.us.i.us, %for.body23.us
%indvars.iv33.i.us = phi i64 [ 0, %for.body23.us ], [ %indvars.iv.next34.i.us, %for.cond1.for.inc14_crit_edge.us.i.us ]
%6 = add nuw nsw i64 %indvars.iv33.i.us, %indvars.iv67
br label %for.body3.us.i.us
for.body3.us.i.us: ; preds = %for.cond1.us.i.us, %for.cond1.preheader.us.i.us
%indvars.iv.i.us = phi i64 [ 0, %for.cond1.preheader.us.i.us ], [ %indvars.iv.next.i.us, %for.cond1.us.i.us ]
%7 = add nuw nsw i64 %indvars.iv.i.us, %indvars.iv64
%arrayidx6.us.i.us = getelementptr inbounds [64 x i8], ptr %A, i64 %6, i64 %7
%8 = load i8, ptr %arrayidx6.us.i.us, align 1, !tbaa !15
%arrayidx10.us.i.us = getelementptr inbounds [64 x i8], ptr %B, i64 %indvars.iv33.i.us, i64 %indvars.iv.i.us
%9 = load i8, ptr %arrayidx10.us.i.us, align 1, !tbaa !15
%cmp12.not.us.i.us = icmp eq i8 %8, %9
br i1 %cmp12.not.us.i.us, label %for.cond1.us.i.us, label %for.inc27.us
for.inc27.us: ; preds = %for.body3.us.i.us
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%exitcond.not = icmp eq i64 %indvars.iv.next65, %wide.trip.count70
br i1 %exitcond.not, label %for.cond19.for.inc30_crit_edge.us, label %for.body23.us, !llvm.loop !18
for.cond1.us.i.us: ; preds = %for.body3.us.i.us
%indvars.iv.next.i.us = add nuw nsw i64 %indvars.iv.i.us, 1
%exitcond.not.i.us = icmp eq i64 %indvars.iv.next.i.us, %wide.trip.count37.i
br i1 %exitcond.not.i.us, label %for.cond1.for.inc14_crit_edge.us.i.us, label %for.body3.us.i.us, !llvm.loop !13
for.cond1.for.inc14_crit_edge.us.i.us: ; preds = %for.cond1.us.i.us
%indvars.iv.next34.i.us = add nuw nsw i64 %indvars.iv33.i.us, 1
%exitcond38.not.i.us = icmp eq i64 %indvars.iv.next34.i.us, %wide.trip.count37.i
br i1 %exitcond38.not.i.us, label %cleanup, label %for.cond1.preheader.us.i.us, !llvm.loop !16
for.cond19.for.inc30_crit_edge.us: ; preds = %for.inc27.us
%indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
%exitcond71.not = icmp eq i64 %indvars.iv.next68, %wide.trip.count70
br i1 %exitcond71.not, label %cleanup, label %for.cond19.preheader.us, !llvm.loop !19
for.body7: ; preds = %for.cond4.preheader, %for.body7
%indvars.iv61 = phi i64 [ %indvars.iv.next62, %for.body7 ], [ 0, %for.cond4.preheader ]
%arrayidx9 = getelementptr inbounds [50 x [51 x i8]], ptr %B, i64 0, i64 %indvars.iv61
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %arrayidx9)
%indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
%10 = load i32, ptr %M, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp5 = icmp slt i64 %indvars.iv.next62, %11
br i1 %cmp5, label %for.body7, label %for.cond15.preheader.loopexit, !llvm.loop !20
cleanup: ; preds = %for.cond19.for.inc30_crit_edge.us, %for.cond1.for.inc14_crit_edge.us.i.us, %for.cond15.preheader, %for.cond19.preheader.lr.ph
%.str.10.sink = phi ptr [ @.str.9, %for.cond19.preheader.lr.ph ], [ @.str.10, %for.cond15.preheader ], [ @.str.9, %for.cond1.for.inc14_crit_edge.us.i.us ], [ @.str.10, %for.cond19.for.inc30_crit_edge.us ]
%call33 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.10.sink)
call void @llvm.lifetime.end.p0(i64 2550, ptr nonnull %B) #11
call void @llvm.lifetime.end.p0(i64 2550, ptr nonnull %A) #11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #11
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #11
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #10
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #10
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
|
#include<stdio.h>
int main()
{
int t,n,a[100],b[100],i,j,maxa,maxb,k;
scanf("%d",&t);
for(i=0;i<t;i++)
{
scanf("%d",&n);
for(j=0;j<n;j++)
{
scanf("%d",&a[j]);
}
for(j=0;j<n;j++)
{
scanf("%d",&b[j]);
}
maxa=a[0];
maxb=b[0];
for(j=0;j<n;j++)
{
if(a[j]>maxa)
maxa=a[j];
if(b[j]>maxb)
maxb=b[j];
}
if(maxa>maxb)
for(j=0;j<n;j++)
{
if(a[j]<b[j])
{
k=a[j];
a[j]=b[j];
b[j]=k;
}
}
else
for(j=0;j<n;j++)
{
if(b[j]<a[j])
{
k=a[j];
a[j]=b[j];
b[j]=k;
}
}
maxa=a[0];
maxb=b[0];
for(j=0;j<n;j++)
{
if(a[j]>maxa)
maxa=a[j];
if(b[j]>maxb)
maxb=b[j];
}
printf("%d\n",maxa*maxb);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11750/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11750/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i32, align 4
%a = alloca [100 x i32], align 16
%b = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%cmp176 = icmp sgt i32 %0, 0
br i1 %cmp176, label %for.body, label %for.end105
for.body: ; preds = %entry, %for.end101
%i.0177 = phi i32 [ %inc104, %for.end101 ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp3156 = icmp sgt i32 %1, 0
br i1 %cmp3156, label %for.body4, label %for.end14.thread
for.cond6.preheader: ; preds = %for.body4
%cmp7158 = icmp sgt i32 %2, 0
br i1 %cmp7158, label %for.body8, label %for.end14.thread
for.body4: ; preds = %for.body, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.body ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%call5 = 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
%cmp3 = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp3, label %for.body4, label %for.cond6.preheader, !llvm.loop !9
for.body8: ; preds = %for.cond6.preheader, %for.body8
%indvars.iv181 = phi i64 [ %indvars.iv.next182, %for.body8 ], [ 0, %for.cond6.preheader ]
%arrayidx10 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv181
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx10)
%indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp7 = icmp slt i64 %indvars.iv.next182, %5
br i1 %cmp7, label %for.body8, label %for.end14, !llvm.loop !11
for.end14.thread: ; preds = %for.cond6.preheader, %for.body
%.lcssa.ph = phi i32 [ %2, %for.cond6.preheader ], [ %1, %for.body ]
%6 = load i32, ptr %a, align 16, !tbaa !5
%7 = load i32, ptr %b, align 16, !tbaa !5
br label %for.end34
for.end14: ; preds = %for.body8
%8 = load i32, ptr %a, align 16, !tbaa !5
%9 = load i32, ptr %b, align 16, !tbaa !5
%cmp18160 = icmp sgt i32 %4, 0
br i1 %cmp18160, label %for.body19.preheader, label %for.end34
for.body19.preheader: ; preds = %for.end14
%wide.trip.count = zext i32 %4 to i64
%min.iters.check223 = icmp ult i32 %4, 8
br i1 %min.iters.check223, label %for.body19.preheader250, label %vector.ph224
vector.ph224: ; preds = %for.body19.preheader
%n.vec226 = and i64 %wide.trip.count, 4294967288
%minmax.ident.splatinsert233 = insertelement <4 x i32> poison, i32 %9, i64 0
%minmax.ident.splat234 = shufflevector <4 x i32> %minmax.ident.splatinsert233, <4 x i32> poison, <4 x i32> zeroinitializer
%minmax.ident.splatinsert237 = insertelement <4 x i32> poison, i32 %8, i64 0
%minmax.ident.splat238 = shufflevector <4 x i32> %minmax.ident.splatinsert237, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body229
vector.body229: ; preds = %vector.body229, %vector.ph224
%index230 = phi i64 [ 0, %vector.ph224 ], [ %index.next243, %vector.body229 ]
%vec.phi231 = phi <4 x i32> [ %minmax.ident.splat234, %vector.ph224 ], [ %16, %vector.body229 ]
%vec.phi232 = phi <4 x i32> [ %minmax.ident.splat234, %vector.ph224 ], [ %17, %vector.body229 ]
%vec.phi235 = phi <4 x i32> [ %minmax.ident.splat238, %vector.ph224 ], [ %12, %vector.body229 ]
%vec.phi236 = phi <4 x i32> [ %minmax.ident.splat238, %vector.ph224 ], [ %13, %vector.body229 ]
%10 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %index230
%wide.load239 = load <4 x i32>, ptr %10, align 16, !tbaa !5
%11 = getelementptr inbounds i32, ptr %10, i64 4
%wide.load240 = load <4 x i32>, ptr %11, align 16, !tbaa !5
%12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load239, <4 x i32> %vec.phi235)
%13 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load240, <4 x i32> %vec.phi236)
%14 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %index230
%wide.load241 = load <4 x i32>, ptr %14, align 16, !tbaa !5
%15 = getelementptr inbounds i32, ptr %14, i64 4
%wide.load242 = load <4 x i32>, ptr %15, align 16, !tbaa !5
%16 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load241, <4 x i32> %vec.phi231)
%17 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load242, <4 x i32> %vec.phi232)
%index.next243 = add nuw i64 %index230, 8
%18 = icmp eq i64 %index.next243, %n.vec226
br i1 %18, label %middle.block221, label %vector.body229, !llvm.loop !12
middle.block221: ; preds = %vector.body229
%rdx.minmax246 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %12, <4 x i32> %13)
%19 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax246)
%rdx.minmax244 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %16, <4 x i32> %17)
%20 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax244)
%cmp.n228 = icmp eq i64 %n.vec226, %wide.trip.count
br i1 %cmp.n228, label %for.end34, label %for.body19.preheader250
for.body19.preheader250: ; preds = %for.body19.preheader, %middle.block221
%indvars.iv184.ph = phi i64 [ 0, %for.body19.preheader ], [ %n.vec226, %middle.block221 ]
%maxb.0163.ph = phi i32 [ %9, %for.body19.preheader ], [ %20, %middle.block221 ]
%maxa.0162.ph = phi i32 [ %8, %for.body19.preheader ], [ %19, %middle.block221 ]
br label %for.body19
for.body19: ; preds = %for.body19.preheader250, %for.body19
%indvars.iv184 = phi i64 [ %indvars.iv.next185, %for.body19 ], [ %indvars.iv184.ph, %for.body19.preheader250 ]
%maxb.0163 = phi i32 [ %maxb.1, %for.body19 ], [ %maxb.0163.ph, %for.body19.preheader250 ]
%maxa.0162 = phi i32 [ %spec.select, %for.body19 ], [ %maxa.0162.ph, %for.body19.preheader250 ]
%arrayidx21 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv184
%21 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %21, i32 %maxa.0162)
%arrayidx26 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv184
%22 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%maxb.1 = call i32 @llvm.smax.i32(i32 %22, i32 %maxb.0163)
%indvars.iv.next185 = add nuw nsw i64 %indvars.iv184, 1
%exitcond.not = icmp eq i64 %indvars.iv.next185, %wide.trip.count
br i1 %exitcond.not, label %for.end34, label %for.body19, !llvm.loop !15
for.end34: ; preds = %for.body19, %middle.block221, %for.end14.thread, %for.end14
%cmp18160206 = phi i1 [ false, %for.end14 ], [ false, %for.end14.thread ], [ %cmp18160, %middle.block221 ], [ %cmp18160, %for.body19 ]
%.lcssa205 = phi i32 [ %4, %for.end14 ], [ %.lcssa.ph, %for.end14.thread ], [ %4, %middle.block221 ], [ %4, %for.body19 ]
%maxa.0.lcssa = phi i32 [ %8, %for.end14 ], [ %6, %for.end14.thread ], [ %19, %middle.block221 ], [ %spec.select, %for.body19 ]
%maxb.0.lcssa = phi i32 [ %9, %for.end14 ], [ %7, %for.end14.thread ], [ %20, %middle.block221 ], [ %maxb.1, %for.body19 ]
%cmp35 = icmp sgt i32 %maxa.0.lcssa, %maxb.0.lcssa
br i1 %cmp35, label %for.cond37.preheader, label %for.cond58.preheader
for.cond58.preheader: ; preds = %for.end34
br i1 %cmp18160206, label %for.body60.preheader, label %if.end79.thread
for.body60.preheader: ; preds = %for.cond58.preheader
%wide.trip.count190 = zext i32 %.lcssa205 to i64
%xtraiter = and i64 %wide.trip.count190, 1
%23 = icmp eq i32 %.lcssa205, 1
br i1 %23, label %if.end79.loopexit249.unr-lcssa, label %for.body60.preheader.new
for.body60.preheader.new: ; preds = %for.body60.preheader
%unroll_iter = and i64 %wide.trip.count190, 4294967294
br label %for.body60
for.cond37.preheader: ; preds = %for.end34
br i1 %cmp18160206, label %for.body39.preheader, label %if.end79.thread
for.body39.preheader: ; preds = %for.cond37.preheader
%wide.trip.count195 = zext i32 %.lcssa205 to i64
%xtraiter260 = and i64 %wide.trip.count195, 1
%24 = icmp eq i32 %.lcssa205, 1
br i1 %24, label %if.end79.loopexit.unr-lcssa, label %for.body39.preheader.new
for.body39.preheader.new: ; preds = %for.body39.preheader
%unroll_iter262 = and i64 %wide.trip.count195, 4294967294
br label %for.body39
for.body39: ; preds = %for.inc55.1, %for.body39.preheader.new
%indvars.iv192 = phi i64 [ 0, %for.body39.preheader.new ], [ %indvars.iv.next193.1, %for.inc55.1 ]
%niter263 = phi i64 [ 0, %for.body39.preheader.new ], [ %niter263.next.1, %for.inc55.1 ]
%arrayidx41 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv192
%25 = load i32, ptr %arrayidx41, align 8, !tbaa !5
%arrayidx43 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv192
%26 = load i32, ptr %arrayidx43, align 8, !tbaa !5
%cmp44 = icmp slt i32 %25, %26
br i1 %cmp44, label %if.then45, label %for.inc55
if.then45: ; preds = %for.body39
store i32 %26, ptr %arrayidx41, align 8, !tbaa !5
store i32 %25, ptr %arrayidx43, align 8, !tbaa !5
br label %for.inc55
for.inc55: ; preds = %for.body39, %if.then45
%indvars.iv.next193 = or i64 %indvars.iv192, 1
%arrayidx41.1 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next193
%27 = load i32, ptr %arrayidx41.1, align 4, !tbaa !5
%arrayidx43.1 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv.next193
%28 = load i32, ptr %arrayidx43.1, align 4, !tbaa !5
%cmp44.1 = icmp slt i32 %27, %28
br i1 %cmp44.1, label %if.then45.1, label %for.inc55.1
if.then45.1: ; preds = %for.inc55
store i32 %28, ptr %arrayidx41.1, align 4, !tbaa !5
store i32 %27, ptr %arrayidx43.1, align 4, !tbaa !5
br label %for.inc55.1
for.inc55.1: ; preds = %if.then45.1, %for.inc55
%indvars.iv.next193.1 = add nuw nsw i64 %indvars.iv192, 2
%niter263.next.1 = add i64 %niter263, 2
%niter263.ncmp.1 = icmp eq i64 %niter263.next.1, %unroll_iter262
br i1 %niter263.ncmp.1, label %if.end79.loopexit.unr-lcssa, label %for.body39, !llvm.loop !16
for.body60: ; preds = %for.inc76.1, %for.body60.preheader.new
%indvars.iv187 = phi i64 [ 0, %for.body60.preheader.new ], [ %indvars.iv.next188.1, %for.inc76.1 ]
%niter = phi i64 [ 0, %for.body60.preheader.new ], [ %niter.next.1, %for.inc76.1 ]
%arrayidx62 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv187
%29 = load i32, ptr %arrayidx62, align 8, !tbaa !5
%arrayidx64 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv187
%30 = load i32, ptr %arrayidx64, align 8, !tbaa !5
%cmp65 = icmp slt i32 %29, %30
br i1 %cmp65, label %if.then66, label %for.inc76
if.then66: ; preds = %for.body60
store i32 %29, ptr %arrayidx64, align 8, !tbaa !5
store i32 %30, ptr %arrayidx62, align 8, !tbaa !5
br label %for.inc76
for.inc76: ; preds = %for.body60, %if.then66
%indvars.iv.next188 = or i64 %indvars.iv187, 1
%arrayidx62.1 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv.next188
%31 = load i32, ptr %arrayidx62.1, align 4, !tbaa !5
%arrayidx64.1 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next188
%32 = load i32, ptr %arrayidx64.1, align 4, !tbaa !5
%cmp65.1 = icmp slt i32 %31, %32
br i1 %cmp65.1, label %if.then66.1, label %for.inc76.1
if.then66.1: ; preds = %for.inc76
store i32 %31, ptr %arrayidx64.1, align 4, !tbaa !5
store i32 %32, ptr %arrayidx62.1, align 4, !tbaa !5
br label %for.inc76.1
for.inc76.1: ; preds = %if.then66.1, %for.inc76
%indvars.iv.next188.1 = add nuw nsw i64 %indvars.iv187, 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 %if.end79.loopexit249.unr-lcssa, label %for.body60, !llvm.loop !17
if.end79.thread: ; preds = %for.cond58.preheader, %for.cond37.preheader
%33 = load i32, ptr %a, align 16, !tbaa !5
%34 = load i32, ptr %b, align 16, !tbaa !5
br label %for.end101
if.end79.loopexit.unr-lcssa: ; preds = %for.inc55.1, %for.body39.preheader
%indvars.iv192.unr = phi i64 [ 0, %for.body39.preheader ], [ %indvars.iv.next193.1, %for.inc55.1 ]
%lcmp.mod261.not = icmp eq i64 %xtraiter260, 0
br i1 %lcmp.mod261.not, label %if.end79, label %for.body39.epil
for.body39.epil: ; preds = %if.end79.loopexit.unr-lcssa
%arrayidx41.epil = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv192.unr
%35 = load i32, ptr %arrayidx41.epil, align 4, !tbaa !5
%arrayidx43.epil = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv192.unr
%36 = load i32, ptr %arrayidx43.epil, align 4, !tbaa !5
%cmp44.epil = icmp slt i32 %35, %36
br i1 %cmp44.epil, label %if.then45.epil, label %if.end79
if.then45.epil: ; preds = %for.body39.epil
store i32 %36, ptr %arrayidx41.epil, align 4, !tbaa !5
store i32 %35, ptr %arrayidx43.epil, align 4, !tbaa !5
br label %if.end79
if.end79.loopexit249.unr-lcssa: ; preds = %for.inc76.1, %for.body60.preheader
%indvars.iv187.unr = phi i64 [ 0, %for.body60.preheader ], [ %indvars.iv.next188.1, %for.inc76.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %if.end79, label %for.body60.epil
for.body60.epil: ; preds = %if.end79.loopexit249.unr-lcssa
%arrayidx62.epil = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv187.unr
%37 = load i32, ptr %arrayidx62.epil, align 4, !tbaa !5
%arrayidx64.epil = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv187.unr
%38 = load i32, ptr %arrayidx64.epil, align 4, !tbaa !5
%cmp65.epil = icmp slt i32 %37, %38
br i1 %cmp65.epil, label %if.then66.epil, label %if.end79
if.then66.epil: ; preds = %for.body60.epil
store i32 %37, ptr %arrayidx64.epil, align 4, !tbaa !5
store i32 %38, ptr %arrayidx62.epil, align 4, !tbaa !5
br label %if.end79
if.end79: ; preds = %if.end79.loopexit249.unr-lcssa, %if.then66.epil, %for.body60.epil, %if.end79.loopexit.unr-lcssa, %if.then45.epil, %for.body39.epil
%39 = load i32, ptr %a, align 16, !tbaa !5
%40 = load i32, ptr %b, align 16, !tbaa !5
br i1 %cmp18160206, label %for.body84.preheader, label %for.end101
for.body84.preheader: ; preds = %if.end79
%wide.trip.count200 = zext i32 %.lcssa205 to i64
%min.iters.check = icmp ult i32 %.lcssa205, 8
br i1 %min.iters.check, label %for.body84.preheader248, label %vector.ph
vector.ph: ; preds = %for.body84.preheader
%n.vec = and i64 %wide.trip.count200, 4294967288
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %40, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%minmax.ident.splatinsert214 = insertelement <4 x i32> poison, i32 %39, i64 0
%minmax.ident.splat215 = shufflevector <4 x i32> %minmax.ident.splatinsert214, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %47, %vector.body ]
%vec.phi211 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %48, %vector.body ]
%vec.phi212 = phi <4 x i32> [ %minmax.ident.splat215, %vector.ph ], [ %43, %vector.body ]
%vec.phi213 = phi <4 x i32> [ %minmax.ident.splat215, %vector.ph ], [ %44, %vector.body ]
%41 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %41, align 16, !tbaa !5
%42 = getelementptr inbounds i32, ptr %41, i64 4
%wide.load216 = load <4 x i32>, ptr %42, align 16, !tbaa !5
%43 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi212)
%44 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load216, <4 x i32> %vec.phi213)
%45 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %index
%wide.load217 = load <4 x i32>, ptr %45, align 16, !tbaa !5
%46 = getelementptr inbounds i32, ptr %45, i64 4
%wide.load218 = load <4 x i32>, ptr %46, align 16, !tbaa !5
%47 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load217, <4 x i32> %vec.phi)
%48 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load218, <4 x i32> %vec.phi211)
%index.next = add nuw i64 %index, 8
%49 = icmp eq i64 %index.next, %n.vec
br i1 %49, label %middle.block, label %vector.body, !llvm.loop !18
middle.block: ; preds = %vector.body
%rdx.minmax219 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %43, <4 x i32> %44)
%50 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax219)
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %47, <4 x i32> %48)
%51 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count200
br i1 %cmp.n, label %for.end101, label %for.body84.preheader248
for.body84.preheader248: ; preds = %for.body84.preheader, %middle.block
%indvars.iv197.ph = phi i64 [ 0, %for.body84.preheader ], [ %n.vec, %middle.block ]
%maxb.2173.ph = phi i32 [ %40, %for.body84.preheader ], [ %51, %middle.block ]
%maxa.2172.ph = phi i32 [ %39, %for.body84.preheader ], [ %50, %middle.block ]
br label %for.body84
for.body84: ; preds = %for.body84.preheader248, %for.body84
%indvars.iv197 = phi i64 [ %indvars.iv.next198, %for.body84 ], [ %indvars.iv197.ph, %for.body84.preheader248 ]
%maxb.2173 = phi i32 [ %maxb.3, %for.body84 ], [ %maxb.2173.ph, %for.body84.preheader248 ]
%maxa.2172 = phi i32 [ %spec.select154, %for.body84 ], [ %maxa.2172.ph, %for.body84.preheader248 ]
%arrayidx86 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv197
%52 = load i32, ptr %arrayidx86, align 4, !tbaa !5
%spec.select154 = call i32 @llvm.smax.i32(i32 %52, i32 %maxa.2172)
%arrayidx93 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv197
%53 = load i32, ptr %arrayidx93, align 4, !tbaa !5
%maxb.3 = call i32 @llvm.smax.i32(i32 %53, i32 %maxb.2173)
%indvars.iv.next198 = add nuw nsw i64 %indvars.iv197, 1
%exitcond201.not = icmp eq i64 %indvars.iv.next198, %wide.trip.count200
br i1 %exitcond201.not, label %for.end101, label %for.body84, !llvm.loop !19
for.end101: ; preds = %for.body84, %middle.block, %if.end79.thread, %if.end79
%maxa.2.lcssa = phi i32 [ %39, %if.end79 ], [ %33, %if.end79.thread ], [ %50, %middle.block ], [ %spec.select154, %for.body84 ]
%maxb.2.lcssa = phi i32 [ %40, %if.end79 ], [ %34, %if.end79.thread ], [ %51, %middle.block ], [ %maxb.3, %for.body84 ]
%mul = mul nsw i32 %maxb.2.lcssa, %maxa.2.lcssa
%call102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
%inc104 = add nuw nsw i32 %i.0177, 1
%54 = load i32, ptr %t, align 4, !tbaa !5
%cmp = icmp slt i32 %inc104, %54
br i1 %cmp, label %for.body, label %for.end105, !llvm.loop !20
for.end105: ; preds = %for.end101, %entry
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree 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}
!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, !10}
!18 = distinct !{!18, !10, !13, !14}
!19 = distinct !{!19, !10, !14, !13}
!20 = distinct !{!20, !10}
|
#include<stdio.h>
int main()
{
int s,w;
scanf("%d %d",&s,&w);
if(w>=s)
{
printf("unsafe\n");
}
else
{
printf("safe\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117550/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117550/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w)
%0 = load i32, ptr %w, align 4, !tbaa !5
%1 = load i32, ptr %s, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 s, w;
do{
scanf("%d%d", &s, &w);
} while (s < 1 || s > 100 || w < 1 || w > 100);
if (s > w)
printf("safe");
else
printf("unsafe");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117594/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117594/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
br label %do.body
do.body: ; preds = %do.body, %entry
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w)
%0 = load i32, ptr %s, align 4
%1 = add i32 %0, -101
%or.cond = icmp ult i32 %1, -100
%2 = load i32, ptr %w, align 4
%cmp3 = icmp slt i32 %2, 1
%or.cond8 = select i1 %or.cond, i1 true, i1 %cmp3
%cmp4 = icmp sgt i32 %2, 100
%or.cond9 = select i1 %or.cond8, i1 true, i1 %cmp4
br i1 %or.cond9, label %do.body, label %do.end, !llvm.loop !5
do.end: ; preds = %do.body
%cmp5 = icmp ugt i32 %0, %2
%.str.1..str.2 = select i1 %cmp5, ptr @.str.1, ptr @.str.2
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int main(){
int S,W;
scanf("%d %d",&S,&W);
if(W>=S)printf("unsafe");
else printf("safe");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117637/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117637/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W)
%0 = load i32, ptr %W, align 4, !tbaa !5
%1 = load i32, ptr %S, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int s,w;
scanf("%d%d",&s,&w);
if(w>=s)
printf("unsafe\n");
else
printf("safe\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117680/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117680/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"safe\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w)
%0 = load i32, ptr %w, align 4, !tbaa !5
%1 = load i32, ptr %s, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void)
{
int S,W;
scanf("%d %d",&S,&W);
if(W>=S)
printf("unsafe");
else
printf("safe");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117723/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117723/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W)
%0 = load i32, ptr %W, align 4, !tbaa !5
%1 = load i32, ptr %S, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 s,w;
scanf("%d",&s);
scanf("%d",&w);
if(s<=w){
printf("unsafe");
}else{
printf("safe");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117774/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117774/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"unsafe\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
%0 = load i32, ptr %s, align 4, !tbaa !5
%1 = load i32, ptr %w, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int S,W;
scanf("%d %d",&S,&W);
if(S<=W)
printf("unsafe");
else
printf("safe");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117817/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117817/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W)
%0 = load i32, ptr %S, align 4, !tbaa !5
%1 = load i32, ptr %W, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(int argc, char** argv) {
int sheeps, wolves;
scanf("%d%d", &sheeps, &wolves);
if (sheeps > wolves) {
printf("safe");
} else {
printf("unsafe");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117860/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117860/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"unsafe\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:
%sheeps = alloca i32, align 4
%wolves = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sheeps) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %wolves) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sheeps, ptr noundef nonnull %wolves)
%0 = load i32, ptr %sheeps, align 4, !tbaa !5
%1 = load i32, ptr %wolves, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %wolves) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sheeps) #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 s = 0, w = 0;
scanf("%d %d", &s, &w);
if (s <= w) {
printf("unsafe\n");
}
else {
printf("safe\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117918/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117918/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
store i32 0, ptr %s, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
store i32 0, ptr %w, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w)
%0 = load i32, ptr %s, align 4, !tbaa !5
%1 = load i32, ptr %w, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(void){
int S,W;
scanf("%d %d",&S,&W);
if(S>W){
printf("safe\n");
}else{
printf("unsafe\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117961/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117961/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
@str.3 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W)
%0 = load i32, ptr %S, align 4, !tbaa !5
%1 = load i32, ptr %W, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <string.h>
int main() {
short sheep, wolf;
char output[8];
scanf("%hd %hd", &sheep, &wolf);
if (sheep > wolf) {
strcpy(output, "safe\n");
} else {
strcpy(output, "unsafe\n");
}
printf("%s", output);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118003/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118003/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%hd %hd\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"safe\0A\00", align 1
@.str.3 = 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:
%sheep = alloca i16, align 2
%wolf = alloca i16, align 2
%output = alloca [8 x i8], align 8
call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %sheep) #4
call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %wolf) #4
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %output) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sheep, ptr noundef nonnull %wolf)
%0 = load i16, ptr %sheep, align 2, !tbaa !5
%1 = load i16, ptr %wolf, align 2, !tbaa !5
%cmp = icmp sgt i16 %0, %1
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(6) %output, ptr noundef nonnull align 1 dereferenceable(6) @.str.1, i64 6, i1 false) #4
br label %if.end
if.else: ; preds = %entry
store i64 2926240163130997, ptr %output, align 8
br label %if.end
if.end: ; preds = %if.else, %if.then
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %output)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %output) #4
call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %wolf) #4
call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %sheep) #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: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, 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: readwrite) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main()
{
int n,m;
scanf("%d %d",&n,&m);
if(n>m){
printf("safe");
}
else{
printf("unsafe");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118047/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118047/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
void main()
{
int S,W;
scanf("%d",&S);
scanf("%d",&W);
if(W>=S)
{
printf("unsafe");
}
else
{
printf("safe");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118090/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118090/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"unsafe\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %W)
%0 = load i32, ptr %W, align 4, !tbaa !5
%1 = load i32, ptr %S, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<math.h>
int main()
{
int s,w;
scanf("%d %d",&s,&w);
if(w>=s){
printf("unsafe\n");
}
else
printf("safe\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118140/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118140/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w)
%0 = load i32, ptr %w, align 4, !tbaa !5
%1 = load i32, ptr %s, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 s, w;
scanf("%d %d", &s, &w);
if (w>=s) printf("unsafe\n");
else printf("safe\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118184/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118184/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w)
%0 = load i32, ptr %w, align 4, !tbaa !5
%1 = load i32, ptr %s, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
#include <math.h>
int main(){
int S = 0, W = 0;
scanf("%d %d", &S, &W);
if( S <= W ){
printf("unsafe");
}
else{
printf("safe");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118227/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118227/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%S = alloca i32, align 4
%W = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %S) #3
store i32 0, ptr %S, align 4, !tbaa !5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #3
store i32 0, ptr %W, align 4, !tbaa !5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W)
%0 = load i32, ptr %S, align 4, !tbaa !5
%1 = load i32, ptr %W, align 4, !tbaa !5
%cmp.not = icmp sgt i32 %0, %1
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %S) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int s,w;
scanf("%d %d",&s,&w);
if (w>=s) puts("unsafe");
else puts("safe");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118270/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118270/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
@.str.2 = private unnamed_addr constant [5 x i8] c"safe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w)
%0 = load i32, ptr %w, align 4, !tbaa !5
%1 = load i32, ptr %s, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%.str.2..str.1 = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call2 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main()
{
int s,w;
scanf("%d%d",&s,&w);
if(w>=s)
{
printf("unsafe\n");
}
else
{
printf("safe\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118313/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118313/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [5 x i8] c"safe\00", align 1
@str.3 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%w = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %w) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w)
%0 = load i32, ptr %w, align 4, !tbaa !5
%1 = load i32, ptr %s, align 4, !tbaa !5
%cmp.not = icmp slt i32 %0, %1
%str.str.3 = select i1 %cmp.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %w) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 <ctype.h>
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//char rbuf[]; int rbufl;
//#define getchar() rbuf[rbufl++]
#define getchar getchar_unlocked
#define putchar putchar_unlocked
int32_t nextint(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); bool s=false; if(c=='-'){s=true;c=getchar();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar(); int s=0; if(c=='-'){s=1;c=getchar();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return s?-x:x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }
void printint(int32_t x){ if(x<0){x=-x; putchar('-');}else if(x==0){putchar('0');} int d=0; char s[10]; while(x){ s[d]='0'+x%10; x/=10; d++; } for (int i=d-1; i>=0; i--) putchar(s[i]); putchar('\n'); }
void rsorta_d32(void *base, const int count, const int size, const int index){
typedef int32_t rsort_t;
rsort_t (*a)[size] = (rsort_t(*)[size])base;
rsort_t (*b)[size] = (rsort_t(*)[size])malloc(count*size*sizeof(rsort_t));
int c[0x100];
for(int k=0; k<4; k++){
memset(c, 0, sizeof(c)); for(int i=0; i<count; i++){ c[(a[i][index]>>(k<<3))&0xFF]++; } for(int i=1; i<0x100; i++) c[i]+=c[i-1]; for(int i=count-1; i>=0; i--){ int to=--c[(a[i][index]>>(k<<3))&0xFF]; for(int j=0; j<size; j++){ b[to][j]=a[i][j]; } }{rsort_t(*t)[size]=a; a=b; b=t;}
}
free(b);
}
int p[200000][2];
int main(void){
int n=nextint();
for(int i=0; i<n; i++){
p[i][0]=nextint();
p[i][1]=nextint();
}
int a1 = p[0][0]-p[0][1];
int a2 = p[0][0]-p[0][1];
int b1 = p[0][0]+p[0][1];
int b2 = p[0][0]+p[0][1];
long ans=0;
for(int i=1; i<n; i++){
{ long now=p[i][0]-p[i][1]-a1; if(now<0) now=-now; if(now>ans) ans=now; }
{ long now=p[i][0]-p[i][1]-a2; if(now<0) now=-now; if(now>ans) ans=now; }
{ long now=p[i][0]+p[i][1]-b1; if(now<0) now=-now; if(now>ans) ans=now; }
{ long now=p[i][0]+p[i][1]-b2; if(now<0) now=-now; if(now>ans) ans=now; }
{ long now=p[i][0]-p[i][1]; if(now>a1) a1=now; if(now<a2) a2=now; }
{ long now=p[i][0]+p[i][1]; if(now>b1) b1=now; if(now<b2) b2=now; }
}
printf("%ld\n", ans);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118357/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118357/source.c"
target datalayout = "e-m:e-p270: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] }
@p = dso_local local_unnamed_addr global [200000 x [2 x i32]] zeroinitializer, align 16
@.str = private unnamed_addr constant [5 x i8] c"%ld\0A\00", align 1
@stdin = external local_unnamed_addr global ptr, align 8
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nounwind uwtable
define dso_local i32 @nextint() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #9
br label %getchar_unlocked.exit
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%sext72 = shl i32 %cond.i, 24
%cmp.not73 = icmp ne i32 %sext72, 754974720
%4 = add i32 %sext72, -956301313
%5 = icmp ult i32 %4, -150994945
%or.cond74 = and i1 %cmp.not73, %5
br i1 %or.cond74, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %getchar_unlocked.exit
%.pre81 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.preheader, %getchar_unlocked.exit51
%6 = phi ptr [ %.pre81, %while.body.preheader ], [ %10, %getchar_unlocked.exit51 ]
%_IO_read_ptr.i42 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 1
%7 = load ptr, ptr %_IO_read_ptr.i42, align 8, !tbaa !9
%_IO_read_end.i43 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 2
%8 = load ptr, ptr %_IO_read_end.i43, align 8, !tbaa !14
%cmp.not.i44 = icmp ult ptr %7, %8
br i1 %cmp.not.i44, label %cond.false.i48, label %cond.true.i45, !prof !15
cond.true.i45: ; preds = %while.body
%call.i46 = tail call i32 @__uflow(ptr noundef nonnull %6) #9
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit51
cond.false.i48: ; preds = %while.body
%incdec.ptr.i49 = getelementptr inbounds i8, ptr %7, i64 1
store ptr %incdec.ptr.i49, ptr %_IO_read_ptr.i42, align 8, !tbaa !9
%9 = load i8, ptr %7, align 1, !tbaa !16
%conv3.i50 = zext i8 %9 to i32
br label %getchar_unlocked.exit51
getchar_unlocked.exit51: ; preds = %cond.true.i45, %cond.false.i48
%10 = phi ptr [ %.pre, %cond.true.i45 ], [ %6, %cond.false.i48 ]
%cond.i47 = phi i32 [ %call.i46, %cond.true.i45 ], [ %conv3.i50, %cond.false.i48 ]
%sext = shl i32 %cond.i47, 24
%cmp.not = icmp ne i32 %sext, 754974720
%11 = add i32 %sext, -956301313
%12 = icmp ult i32 %11, -150994945
%or.cond = and i1 %cmp.not, %12
br i1 %or.cond, label %while.body, label %while.end, !llvm.loop !17
while.end: ; preds = %getchar_unlocked.exit51, %getchar_unlocked.exit
%c.0.in.lcssa = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %cond.i47, %getchar_unlocked.exit51 ]
%sext.lcssa = phi i32 [ %sext72, %getchar_unlocked.exit ], [ %sext, %getchar_unlocked.exit51 ]
%cmp12 = icmp eq i32 %sext.lcssa, 754974720
br i1 %cmp12, label %if.then, label %if.end
if.then: ; preds = %while.end
%13 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i52 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1
%14 = load ptr, ptr %_IO_read_ptr.i52, align 8, !tbaa !9
%_IO_read_end.i53 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2
%15 = load ptr, ptr %_IO_read_end.i53, align 8, !tbaa !14
%cmp.not.i54 = icmp ult ptr %14, %15
br i1 %cmp.not.i54, label %cond.false.i58, label %cond.true.i55, !prof !15
cond.true.i55: ; preds = %if.then
%call.i56 = tail call i32 @__uflow(ptr noundef nonnull %13) #9
br label %if.end
cond.false.i58: ; preds = %if.then
%incdec.ptr.i59 = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i59, ptr %_IO_read_ptr.i52, align 8, !tbaa !9
%16 = load i8, ptr %14, align 1, !tbaa !16
%conv3.i60 = zext i8 %16 to i32
br label %if.end
if.end: ; preds = %cond.false.i58, %cond.true.i55, %while.end
%c.1.in = phi i32 [ %c.0.in.lcssa, %while.end ], [ %call.i56, %cond.true.i55 ], [ %conv3.i60, %cond.false.i58 ]
%sext4076 = shl i32 %c.1.in, 24
%17 = add i32 %sext4076, -788529153
%18 = icmp ult i32 %17, 184549375
br i1 %18, label %while.body25.preheader, label %while.end29
while.body25.preheader: ; preds = %if.end
%.pre83 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body25
while.body25: ; preds = %while.body25.preheader, %getchar_unlocked.exit71
%19 = phi ptr [ %23, %getchar_unlocked.exit71 ], [ %.pre83, %while.body25.preheader ]
%x.078 = phi i32 [ %sub, %getchar_unlocked.exit71 ], [ 0, %while.body25.preheader ]
%c.2.in77 = phi i32 [ %cond.i67, %getchar_unlocked.exit71 ], [ %c.1.in, %while.body25.preheader ]
%conv17 = and i32 %c.2.in77, 255
%mul = mul i32 %x.078, 10
%add = add nsw i32 %conv17, -48
%sub = add i32 %add, %mul
%_IO_read_ptr.i62 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 1
%20 = load ptr, ptr %_IO_read_ptr.i62, align 8, !tbaa !9
%_IO_read_end.i63 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 2
%21 = load ptr, ptr %_IO_read_end.i63, align 8, !tbaa !14
%cmp.not.i64 = icmp ult ptr %20, %21
br i1 %cmp.not.i64, label %cond.false.i68, label %cond.true.i65, !prof !15
cond.true.i65: ; preds = %while.body25
%call.i66 = tail call i32 @__uflow(ptr noundef nonnull %19) #9
%.pre82 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit71
cond.false.i68: ; preds = %while.body25
%incdec.ptr.i69 = getelementptr inbounds i8, ptr %20, i64 1
store ptr %incdec.ptr.i69, ptr %_IO_read_ptr.i62, align 8, !tbaa !9
%22 = load i8, ptr %20, align 1, !tbaa !16
%conv3.i70 = zext i8 %22 to i32
br label %getchar_unlocked.exit71
getchar_unlocked.exit71: ; preds = %cond.true.i65, %cond.false.i68
%23 = phi ptr [ %.pre82, %cond.true.i65 ], [ %19, %cond.false.i68 ]
%cond.i67 = phi i32 [ %call.i66, %cond.true.i65 ], [ %conv3.i70, %cond.false.i68 ]
%sext40 = shl i32 %cond.i67, 24
%24 = add i32 %sext40, -788529153
%25 = icmp ult i32 %24, 184549375
br i1 %25, label %while.body25, label %while.end29, !llvm.loop !19
while.end29: ; preds = %getchar_unlocked.exit71, %if.end
%x.0.lcssa = phi i32 [ 0, %if.end ], [ %sub, %getchar_unlocked.exit71 ]
%sub31 = sub i32 0, %x.0.lcssa
%cond = select i1 %cmp12, i32 %sub31, i32 %x.0.lcssa
ret i32 %cond
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nounwind uwtable
define dso_local i64 @nextlong() local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #9
br label %getchar_unlocked.exit
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %getchar_unlocked.exit
getchar_unlocked.exit: ; preds = %cond.true.i, %cond.false.i
%cond.i = phi i32 [ %call.i, %cond.true.i ], [ %conv3.i, %cond.false.i ]
%sext72 = shl i32 %cond.i, 24
%cmp.not73 = icmp ne i32 %sext72, 754974720
%4 = add i32 %sext72, -956301313
%5 = icmp ult i32 %4, -150994945
%or.cond74 = and i1 %cmp.not73, %5
br i1 %or.cond74, label %while.body.preheader, label %while.end
while.body.preheader: ; preds = %getchar_unlocked.exit
%.pre81 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body
while.body: ; preds = %while.body.preheader, %getchar_unlocked.exit51
%6 = phi ptr [ %.pre81, %while.body.preheader ], [ %10, %getchar_unlocked.exit51 ]
%_IO_read_ptr.i42 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 1
%7 = load ptr, ptr %_IO_read_ptr.i42, align 8, !tbaa !9
%_IO_read_end.i43 = getelementptr inbounds %struct._IO_FILE, ptr %6, i64 0, i32 2
%8 = load ptr, ptr %_IO_read_end.i43, align 8, !tbaa !14
%cmp.not.i44 = icmp ult ptr %7, %8
br i1 %cmp.not.i44, label %cond.false.i48, label %cond.true.i45, !prof !15
cond.true.i45: ; preds = %while.body
%call.i46 = tail call i32 @__uflow(ptr noundef nonnull %6) #9
%.pre = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit51
cond.false.i48: ; preds = %while.body
%incdec.ptr.i49 = getelementptr inbounds i8, ptr %7, i64 1
store ptr %incdec.ptr.i49, ptr %_IO_read_ptr.i42, align 8, !tbaa !9
%9 = load i8, ptr %7, align 1, !tbaa !16
%conv3.i50 = zext i8 %9 to i32
br label %getchar_unlocked.exit51
getchar_unlocked.exit51: ; preds = %cond.true.i45, %cond.false.i48
%10 = phi ptr [ %.pre, %cond.true.i45 ], [ %6, %cond.false.i48 ]
%cond.i47 = phi i32 [ %call.i46, %cond.true.i45 ], [ %conv3.i50, %cond.false.i48 ]
%sext = shl i32 %cond.i47, 24
%cmp.not = icmp ne i32 %sext, 754974720
%11 = add i32 %sext, -956301313
%12 = icmp ult i32 %11, -150994945
%or.cond = and i1 %cmp.not, %12
br i1 %or.cond, label %while.body, label %while.end, !llvm.loop !20
while.end: ; preds = %getchar_unlocked.exit51, %getchar_unlocked.exit
%c.0.in.lcssa = phi i32 [ %cond.i, %getchar_unlocked.exit ], [ %cond.i47, %getchar_unlocked.exit51 ]
%sext.lcssa = phi i32 [ %sext72, %getchar_unlocked.exit ], [ %sext, %getchar_unlocked.exit51 ]
%cmp12.not = icmp eq i32 %sext.lcssa, 754974720
br i1 %cmp12.not, label %if.then, label %if.end
if.then: ; preds = %while.end
%13 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i52 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 1
%14 = load ptr, ptr %_IO_read_ptr.i52, align 8, !tbaa !9
%_IO_read_end.i53 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 2
%15 = load ptr, ptr %_IO_read_end.i53, align 8, !tbaa !14
%cmp.not.i54 = icmp ult ptr %14, %15
br i1 %cmp.not.i54, label %cond.false.i58, label %cond.true.i55, !prof !15
cond.true.i55: ; preds = %if.then
%call.i56 = tail call i32 @__uflow(ptr noundef nonnull %13) #9
br label %if.end
cond.false.i58: ; preds = %if.then
%incdec.ptr.i59 = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i59, ptr %_IO_read_ptr.i52, align 8, !tbaa !9
%16 = load i8, ptr %14, align 1, !tbaa !16
%conv3.i60 = zext i8 %16 to i32
br label %if.end
if.end: ; preds = %cond.false.i58, %cond.true.i55, %while.end
%c.1.in = phi i32 [ %c.0.in.lcssa, %while.end ], [ %call.i56, %cond.true.i55 ], [ %conv3.i60, %cond.false.i58 ]
%sext3976 = shl i32 %c.1.in, 24
%17 = add i32 %sext3976, -788529153
%18 = icmp ult i32 %17, 184549375
br i1 %18, label %while.body25.preheader, label %while.end29
while.body25.preheader: ; preds = %if.end
%.pre83 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %while.body25
while.body25: ; preds = %while.body25.preheader, %getchar_unlocked.exit71
%19 = phi ptr [ %23, %getchar_unlocked.exit71 ], [ %.pre83, %while.body25.preheader ]
%x.078 = phi i64 [ %sub, %getchar_unlocked.exit71 ], [ 0, %while.body25.preheader ]
%c.2.in77 = phi i32 [ %cond.i67, %getchar_unlocked.exit71 ], [ %c.1.in, %while.body25.preheader ]
%c.2 = zext i32 %c.2.in77 to i64
%mul = mul i64 %x.078, 10
%sext40 = shl i64 %c.2, 56
%conv26 = ashr exact i64 %sext40, 56
%add = add i64 %mul, -48
%sub = add i64 %add, %conv26
%_IO_read_ptr.i62 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 1
%20 = load ptr, ptr %_IO_read_ptr.i62, align 8, !tbaa !9
%_IO_read_end.i63 = getelementptr inbounds %struct._IO_FILE, ptr %19, i64 0, i32 2
%21 = load ptr, ptr %_IO_read_end.i63, align 8, !tbaa !14
%cmp.not.i64 = icmp ult ptr %20, %21
br i1 %cmp.not.i64, label %cond.false.i68, label %cond.true.i65, !prof !15
cond.true.i65: ; preds = %while.body25
%call.i66 = tail call i32 @__uflow(ptr noundef nonnull %19) #9
%.pre82 = load ptr, ptr @stdin, align 8, !tbaa !5
br label %getchar_unlocked.exit71
cond.false.i68: ; preds = %while.body25
%incdec.ptr.i69 = getelementptr inbounds i8, ptr %20, i64 1
store ptr %incdec.ptr.i69, ptr %_IO_read_ptr.i62, align 8, !tbaa !9
%22 = load i8, ptr %20, align 1, !tbaa !16
%conv3.i70 = zext i8 %22 to i32
br label %getchar_unlocked.exit71
getchar_unlocked.exit71: ; preds = %cond.true.i65, %cond.false.i68
%23 = phi ptr [ %.pre82, %cond.true.i65 ], [ %19, %cond.false.i68 ]
%cond.i67 = phi i32 [ %call.i66, %cond.true.i65 ], [ %conv3.i70, %cond.false.i68 ]
%sext39 = shl i32 %cond.i67, 24
%24 = add i32 %sext39, -788529153
%25 = icmp ult i32 %24, 184549375
br i1 %25, label %while.body25, label %while.end29, !llvm.loop !21
while.end29: ; preds = %getchar_unlocked.exit71, %if.end
%x.0.lcssa = phi i64 [ 0, %if.end ], [ %sub, %getchar_unlocked.exit71 ]
%sub30 = sub i64 0, %x.0.lcssa
%cond = select i1 %cmp12.not, i64 %sub30, i64 %x.0.lcssa
ret i64 %cond
}
; Function Attrs: nounwind uwtable
define dso_local i32 @nextstr(ptr nocapture noundef writeonly %s) local_unnamed_addr #0 {
entry:
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 1
%1 = load ptr, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%_IO_read_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 2
%2 = load ptr, ptr %_IO_read_end.i, align 8, !tbaa !14
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %entry
%call.i = tail call i32 @__uflow(ptr noundef nonnull %0) #9
br label %while.cond.preheader
cond.false.i: ; preds = %entry
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_read_ptr.i, align 8, !tbaa !9
%3 = load i8, ptr %1, align 1, !tbaa !16
%conv3.i = zext i8 %3 to i32
br label %while.cond.preheader
while.cond.preheader: ; preds = %cond.true.i, %cond.false.i
%c.0.in.ph = phi i32 [ %conv3.i, %cond.false.i ], [ %call.i, %cond.true.i ]
br label %while.cond
while.cond: ; preds = %while.cond.backedge, %while.cond.preheader
%c.0.in = phi i32 [ %c.0.in.ph, %while.cond.preheader ], [ %c.0.in.be, %while.cond.backedge ]
%sext = shl i32 %c.0.in, 24
switch i32 %sext, label %while.cond8 [
i32 536870912, label %while.body
i32 167772160, label %while.body
]
while.body: ; preds = %while.cond, %while.cond
%4 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i26 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 1
%5 = load ptr, ptr %_IO_read_ptr.i26, align 8, !tbaa !9
%_IO_read_end.i27 = getelementptr inbounds %struct._IO_FILE, ptr %4, i64 0, i32 2
%6 = load ptr, ptr %_IO_read_end.i27, align 8, !tbaa !14
%cmp.not.i28 = icmp ult ptr %5, %6
br i1 %cmp.not.i28, label %cond.false.i32, label %cond.true.i29, !prof !15
cond.true.i29: ; preds = %while.body
%call.i30 = tail call i32 @__uflow(ptr noundef nonnull %4) #9
br label %while.cond.backedge
while.cond.backedge: ; preds = %cond.true.i29, %cond.false.i32
%c.0.in.be = phi i32 [ %call.i30, %cond.true.i29 ], [ %conv3.i34, %cond.false.i32 ]
br label %while.cond, !llvm.loop !22
cond.false.i32: ; preds = %while.body
%incdec.ptr.i33 = getelementptr inbounds i8, ptr %5, i64 1
store ptr %incdec.ptr.i33, ptr %_IO_read_ptr.i26, align 8, !tbaa !9
%7 = load i8, ptr %5, align 1, !tbaa !16
%conv3.i34 = zext i8 %7 to i32
br label %while.cond.backedge
while.cond8: ; preds = %while.cond, %while.cond8.backedge
%s.addr.0 = phi ptr [ %incdec.ptr, %while.cond8.backedge ], [ %s, %while.cond ]
%c.1.in = phi i32 [ %c.1.in.be, %while.cond8.backedge ], [ %c.0.in, %while.cond ]
%len.0 = phi i32 [ %inc, %while.cond8.backedge ], [ 0, %while.cond ]
%sext25 = shl i32 %c.1.in, 24
switch i32 %sext25, label %while.body15 [
i32 536870912, label %while.end18
i32 167772160, label %while.end18
]
while.body15: ; preds = %while.cond8
%c.1 = trunc i32 %c.1.in to i8
%incdec.ptr = getelementptr inbounds i8, ptr %s.addr.0, i64 1
store i8 %c.1, ptr %s.addr.0, align 1, !tbaa !16
%inc = add i32 %len.0, 1
%8 = load ptr, ptr @stdin, align 8, !tbaa !5
%_IO_read_ptr.i36 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 1
%9 = load ptr, ptr %_IO_read_ptr.i36, align 8, !tbaa !9
%_IO_read_end.i37 = getelementptr inbounds %struct._IO_FILE, ptr %8, i64 0, i32 2
%10 = load ptr, ptr %_IO_read_end.i37, align 8, !tbaa !14
%cmp.not.i38 = icmp ult ptr %9, %10
br i1 %cmp.not.i38, label %cond.false.i42, label %cond.true.i39, !prof !15
cond.true.i39: ; preds = %while.body15
%call.i40 = tail call i32 @__uflow(ptr noundef nonnull %8) #9
br label %while.cond8.backedge
while.cond8.backedge: ; preds = %cond.true.i39, %cond.false.i42
%c.1.in.be = phi i32 [ %call.i40, %cond.true.i39 ], [ %conv3.i44, %cond.false.i42 ]
br label %while.cond8, !llvm.loop !23
cond.false.i42: ; preds = %while.body15
%incdec.ptr.i43 = getelementptr inbounds i8, ptr %9, i64 1
store ptr %incdec.ptr.i43, ptr %_IO_read_ptr.i36, align 8, !tbaa !9
%11 = load i8, ptr %9, align 1, !tbaa !16
%conv3.i44 = zext i8 %11 to i32
br label %while.cond8.backedge
while.end18: ; preds = %while.cond8, %while.cond8
store i8 0, ptr %s.addr.0, align 1, !tbaa !16
ret i32 %len.0
}
; Function Attrs: nounwind uwtable
define dso_local void @printint(i32 noundef %x) local_unnamed_addr #0 {
entry:
%s = alloca [10 x i8], align 1
%cmp = icmp slt i32 %x, 0
br i1 %cmp, label %if.then, label %if.else
if.then: ; preds = %entry
%sub = sub nsw i32 0, %x
%0 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 5
%1 = load ptr, ptr %_IO_write_ptr.i, align 8, !tbaa !24
%_IO_write_end.i = getelementptr inbounds %struct._IO_FILE, ptr %0, i64 0, i32 6
%2 = load ptr, ptr %_IO_write_end.i, align 8, !tbaa !25
%cmp.not.i = icmp ult ptr %1, %2
br i1 %cmp.not.i, label %cond.false.i, label %cond.true.i, !prof !15
cond.true.i: ; preds = %if.then
%call.i = tail call i32 @__overflow(ptr noundef nonnull %0, i32 noundef 45) #9
br label %while.body.preheader
cond.false.i: ; preds = %if.then
%incdec.ptr.i = getelementptr inbounds i8, ptr %1, i64 1
store ptr %incdec.ptr.i, ptr %_IO_write_ptr.i, align 8, !tbaa !24
store i8 45, ptr %1, align 1, !tbaa !16
br label %while.body.preheader
if.else: ; preds = %entry
%cmp1 = icmp eq i32 %x, 0
br i1 %cmp1, label %if.then2, label %while.body.preheader
if.then2: ; preds = %if.else
%3 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i22 = getelementptr inbounds %struct._IO_FILE, ptr %3, i64 0, i32 5
%4 = load ptr, ptr %_IO_write_ptr.i22, align 8, !tbaa !24
%_IO_write_end.i23 = getelementptr inbounds %struct._IO_FILE, ptr %3, i64 0, i32 6
%5 = load ptr, ptr %_IO_write_end.i23, align 8, !tbaa !25
%cmp.not.i24 = icmp ult ptr %4, %5
br i1 %cmp.not.i24, label %cond.false.i28, label %cond.true.i25, !prof !15
cond.true.i25: ; preds = %if.then2
%call.i26 = tail call i32 @__overflow(ptr noundef nonnull %3, i32 noundef 48) #9
br label %for.cond.preheader.thread
cond.false.i28: ; preds = %if.then2
%incdec.ptr.i29 = getelementptr inbounds i8, ptr %4, i64 1
store ptr %incdec.ptr.i29, ptr %_IO_write_ptr.i22, align 8, !tbaa !24
store i8 48, ptr %4, align 1, !tbaa !16
br label %for.cond.preheader.thread
for.cond.preheader.thread: ; preds = %cond.true.i25, %cond.false.i28
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #9
br label %for.cond.cleanup
while.body.preheader: ; preds = %if.else, %cond.true.i, %cond.false.i
%x.addr.0.ph = phi i32 [ %sub, %cond.false.i ], [ %sub, %cond.true.i ], [ %x, %if.else ]
call void @llvm.lifetime.start.p0(i64 10, ptr nonnull %s) #9
br label %while.body
for.cond.preheader: ; preds = %while.body
%6 = trunc i64 %indvars.iv.next to i32
%cmp652 = icmp sgt i32 %6, 0
br i1 %cmp652, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %for.cond.preheader
%7 = and i64 %indvars.iv.next, 4294967295
br label %for.body
while.body: ; preds = %while.body.preheader, %while.body
%indvars.iv = phi i64 [ 0, %while.body.preheader ], [ %indvars.iv.next, %while.body ]
%x.addr.150 = phi i32 [ %x.addr.0.ph, %while.body.preheader ], [ %div, %while.body ]
%rem = srem i32 %x.addr.150, 10
%8 = trunc i32 %rem to i8
%conv = add nsw i8 %8, 48
%arrayidx = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %indvars.iv
store i8 %conv, ptr %arrayidx, align 1, !tbaa !16
%div = sdiv i32 %x.addr.150, 10
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%x.addr.150.off = add i32 %x.addr.150, 9
%tobool.not = icmp ult i32 %x.addr.150.off, 19
br i1 %tobool.not, label %for.cond.preheader, label %while.body, !llvm.loop !26
for.cond.cleanup: ; preds = %putchar_unlocked.exit48, %for.cond.preheader.thread, %for.cond.preheader
%9 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i31 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 5
%10 = load ptr, ptr %_IO_write_ptr.i31, align 8, !tbaa !24
%_IO_write_end.i32 = getelementptr inbounds %struct._IO_FILE, ptr %9, i64 0, i32 6
%11 = load ptr, ptr %_IO_write_end.i32, align 8, !tbaa !25
%cmp.not.i33 = icmp ult ptr %10, %11
br i1 %cmp.not.i33, label %cond.false.i37, label %cond.true.i34, !prof !15
cond.true.i34: ; preds = %for.cond.cleanup
%call.i35 = tail call i32 @__overflow(ptr noundef nonnull %9, i32 noundef 10) #9
br label %putchar_unlocked.exit39
cond.false.i37: ; preds = %for.cond.cleanup
%incdec.ptr.i38 = getelementptr inbounds i8, ptr %10, i64 1
store ptr %incdec.ptr.i38, ptr %_IO_write_ptr.i31, align 8, !tbaa !24
store i8 10, ptr %10, align 1, !tbaa !16
br label %putchar_unlocked.exit39
putchar_unlocked.exit39: ; preds = %cond.true.i34, %cond.false.i37
call void @llvm.lifetime.end.p0(i64 10, ptr nonnull %s) #9
ret void
for.body: ; preds = %for.body.preheader, %putchar_unlocked.exit48
%indvars.iv55 = phi i64 [ %7, %for.body.preheader ], [ %indvars.iv.next56, %putchar_unlocked.exit48 ]
%indvars.iv.next56 = add nsw i64 %indvars.iv55, -1
%idxprom8 = and i64 %indvars.iv.next56, 4294967295
%arrayidx9 = getelementptr inbounds [10 x i8], ptr %s, i64 0, i64 %idxprom8
%12 = load i8, ptr %arrayidx9, align 1, !tbaa !16
%13 = load ptr, ptr @stdout, align 8, !tbaa !5
%_IO_write_ptr.i40 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 5
%14 = load ptr, ptr %_IO_write_ptr.i40, align 8, !tbaa !24
%_IO_write_end.i41 = getelementptr inbounds %struct._IO_FILE, ptr %13, i64 0, i32 6
%15 = load ptr, ptr %_IO_write_end.i41, align 8, !tbaa !25
%cmp.not.i42 = icmp ult ptr %14, %15
br i1 %cmp.not.i42, label %cond.false.i46, label %cond.true.i43, !prof !15
cond.true.i43: ; preds = %for.body
%conv10 = zext i8 %12 to i32
%call.i44 = tail call i32 @__overflow(ptr noundef nonnull %13, i32 noundef %conv10) #9
br label %putchar_unlocked.exit48
cond.false.i46: ; preds = %for.body
%incdec.ptr.i47 = getelementptr inbounds i8, ptr %14, i64 1
store ptr %incdec.ptr.i47, ptr %_IO_write_ptr.i40, align 8, !tbaa !24
store i8 %12, ptr %14, align 1, !tbaa !16
br label %putchar_unlocked.exit48
putchar_unlocked.exit48: ; preds = %cond.true.i43, %cond.false.i46
%cmp6 = icmp ugt i64 %indvars.iv55, 1
br i1 %cmp6, label %for.body, label %for.cond.cleanup, !llvm.loop !27
}
; Function Attrs: nounwind uwtable
define dso_local void @rsorta_d32(ptr nocapture noundef %base, i32 noundef %count, i32 noundef %size, i32 noundef %index) local_unnamed_addr #0 {
entry:
%c = alloca [256 x i32], align 16
%0 = zext i32 %size to i64
%mul = mul nsw i32 %size, %count
%conv = sext i32 %mul to i64
%mul1 = shl nsw i64 %conv, 2
%call = tail call noalias ptr @malloc(i64 noundef %mul1) #10
call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %c) #9
%cmp492 = icmp sgt i32 %count, 0
%idxprom8 = sext i32 %index to i64
br i1 %cmp492, label %entry.split.us, label %for.body.preheader
for.body.preheader: ; preds = %entry
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
br label %for.body18
entry.split.us: ; preds = %entry
%i26.097 = add i32 %count, -1
%cmp4395 = icmp sgt i32 %size, 0
%1 = zext i32 %i26.097 to i64
br i1 %cmp4395, label %for.body7.lr.ph.us.us, label %for.body7.lr.ph.us
for.body18.us.us: ; preds = %for.body18.us.us, %for.cond14.preheader.us.us
%2 = phi i32 [ %.pre193.pre, %for.cond14.preheader.us.us ], [ %add.us.us.4, %for.body18.us.us ]
%indvars.iv176 = phi i64 [ 1, %for.cond14.preheader.us.us ], [ %indvars.iv.next177.4, %for.body18.us.us ]
%arrayidx22.us.us = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv176
%3 = load i32, ptr %arrayidx22.us.us, align 4, !tbaa !28
%add.us.us = add nsw i32 %3, %2
store i32 %add.us.us, ptr %arrayidx22.us.us, align 4, !tbaa !28
%indvars.iv.next177 = add nuw nsw i64 %indvars.iv176, 1
%arrayidx22.us.us.1297 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177
%4 = load i32, ptr %arrayidx22.us.us.1297, align 4, !tbaa !28
%add.us.us.1298 = add nsw i32 %4, %add.us.us
store i32 %add.us.us.1298, ptr %arrayidx22.us.us.1297, align 4, !tbaa !28
%indvars.iv.next177.1299 = add nuw nsw i64 %indvars.iv176, 2
%arrayidx22.us.us.2302 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.1299
%5 = load i32, ptr %arrayidx22.us.us.2302, align 4, !tbaa !28
%add.us.us.2303 = add nsw i32 %5, %add.us.us.1298
store i32 %add.us.us.2303, ptr %arrayidx22.us.us.2302, align 4, !tbaa !28
%indvars.iv.next177.2304 = add nuw nsw i64 %indvars.iv176, 3
%arrayidx22.us.us.3307 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.2304
%6 = load i32, ptr %arrayidx22.us.us.3307, align 4, !tbaa !28
%add.us.us.3308 = add nsw i32 %6, %add.us.us.2303
store i32 %add.us.us.3308, ptr %arrayidx22.us.us.3307, align 4, !tbaa !28
%indvars.iv.next177.3309 = add nuw nsw i64 %indvars.iv176, 4
%arrayidx22.us.us.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.3309
%7 = load i32, ptr %arrayidx22.us.us.4, align 4, !tbaa !28
%add.us.us.4 = add nsw i32 %7, %add.us.us.3308
store i32 %add.us.us.4, ptr %arrayidx22.us.us.4, align 4, !tbaa !28
%indvars.iv.next177.4 = add nuw nsw i64 %indvars.iv176, 5
%exitcond180.not.4 = icmp eq i64 %indvars.iv.next177.4, 256
br i1 %exitcond180.not.4, label %for.cond28.preheader.us.us, label %for.body18.us.us, !llvm.loop !29
for.body7.us.us: ; preds = %for.body7.us.us, %for.body7.lr.ph.us.us.new
%indvars.iv171 = phi i64 [ 0, %for.body7.lr.ph.us.us.new ], [ %indvars.iv.next172.1294, %for.body7.us.us ]
%niter287 = phi i64 [ 0, %for.body7.lr.ph.us.us.new ], [ %niter287.next.1, %for.body7.us.us ]
%8 = mul nuw nsw i64 %indvars.iv171, %0
%gep.us.us = getelementptr i32, ptr %invariant.gep.us.us, i64 %8
%9 = load i32, ptr %gep.us.us, align 4, !tbaa !28
%and.us.us = and i32 %9, 255
%idxprom10.us.us = zext i32 %and.us.us to i64
%arrayidx11.us.us = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us
%10 = load i32, ptr %arrayidx11.us.us, align 4, !tbaa !28
%inc.us.us = add nsw i32 %10, 1
store i32 %inc.us.us, ptr %arrayidx11.us.us, align 4, !tbaa !28
%indvars.iv.next172 = or i64 %indvars.iv171, 1
%11 = mul nuw nsw i64 %indvars.iv.next172, %0
%gep.us.us.1289 = getelementptr i32, ptr %invariant.gep.us.us, i64 %11
%12 = load i32, ptr %gep.us.us.1289, align 4, !tbaa !28
%and.us.us.1290 = and i32 %12, 255
%idxprom10.us.us.1291 = zext i32 %and.us.us.1290 to i64
%arrayidx11.us.us.1292 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.1291
%13 = load i32, ptr %arrayidx11.us.us.1292, align 4, !tbaa !28
%inc.us.us.1293 = add nsw i32 %13, 1
store i32 %inc.us.us.1293, ptr %arrayidx11.us.us.1292, align 4, !tbaa !28
%indvars.iv.next172.1294 = add nuw nsw i64 %indvars.iv171, 2
%niter287.next.1 = add i64 %niter287, 2
%niter287.ncmp.1 = icmp eq i64 %niter287.next.1, %unroll_iter286
br i1 %niter287.ncmp.1, label %for.cond14.preheader.us.us.unr-lcssa, label %for.body7.us.us, !llvm.loop !30
for.cond28.preheader.us.us: ; preds = %for.body18.us.us
%wide.trip.count187 = zext i32 %count to i64
%14 = getelementptr i8, ptr %base, i64 %19
%invariant.gep = getelementptr i32, ptr %base, i64 %idxprom8
br label %for.body32.us.us.us
for.cond14.preheader.us.us.unr-lcssa: ; preds = %for.body7.us.us, %for.body7.lr.ph.us.us
%indvars.iv171.unr = phi i64 [ 0, %for.body7.lr.ph.us.us ], [ %indvars.iv.next172.1294, %for.body7.us.us ]
%lcmp.mod285.not = icmp eq i64 %xtraiter284, 0
br i1 %lcmp.mod285.not, label %for.cond14.preheader.us.us, label %for.body7.us.us.epil
for.body7.us.us.epil: ; preds = %for.cond14.preheader.us.us.unr-lcssa
%15 = mul nuw nsw i64 %indvars.iv171.unr, %0
%gep.us.us.epil = getelementptr i32, ptr %invariant.gep.us.us, i64 %15
%16 = load i32, ptr %gep.us.us.epil, align 4, !tbaa !28
%and.us.us.epil = and i32 %16, 255
%idxprom10.us.us.epil = zext i32 %and.us.us.epil to i64
%arrayidx11.us.us.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.epil
%17 = load i32, ptr %arrayidx11.us.us.epil, align 4, !tbaa !28
%inc.us.us.epil = add nsw i32 %17, 1
store i32 %inc.us.us.epil, ptr %arrayidx11.us.us.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.us
for.cond14.preheader.us.us: ; preds = %for.cond14.preheader.us.us.unr-lcssa, %for.body7.us.us.epil
%.pre193.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.us
for.body7.lr.ph.us.us: ; preds = %entry.split.us
%18 = mul nuw nsw i64 %0, %1
%19 = shl i64 %18, 2
%20 = mul nsw i64 %0, -4
%21 = shl nuw nsw i64 %0, 2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us.us = getelementptr i32, ptr %base, i64 %idxprom8
%wide.trip.count174 = zext i32 %count to i64
%22 = add nsw i64 %wide.trip.count174, -1
%xtraiter284 = and i64 %wide.trip.count174, 1
%23 = icmp eq i64 %22, 0
br i1 %23, label %for.cond14.preheader.us.us.unr-lcssa, label %for.body7.lr.ph.us.us.new
for.body7.lr.ph.us.us.new: ; preds = %for.body7.lr.ph.us.us
%unroll_iter286 = and i64 %wide.trip.count174, 4294967294
br label %for.body7.us.us
for.body32.us.us.us: ; preds = %for.body32.us.us.us, %for.cond28.preheader.us.us
%indvars.iv184 = phi i64 [ %indvars.iv.next185, %for.body32.us.us.us ], [ %1, %for.cond28.preheader.us.us ]
%indvar = phi i64 [ %indvar.next, %for.body32.us.us.us ], [ 0, %for.cond28.preheader.us.us ]
%24 = mul i64 %20, %indvar
%scevgep = getelementptr i8, ptr %14, i64 %24
%25 = mul nuw nsw i64 %indvars.iv184, %0
%gep = getelementptr i32, ptr %invariant.gep, i64 %25
%26 = load i32, ptr %gep, align 4, !tbaa !28
%and39.us.us.us = and i32 %26, 255
%idxprom40.us.us.us = zext i32 %and39.us.us.us to i64
%arrayidx41.us.us.us = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us.us.us
%27 = load i32, ptr %arrayidx41.us.us.us, align 4, !tbaa !28
%dec.us.us.us = add nsw i32 %27, -1
store i32 %dec.us.us.us, ptr %arrayidx41.us.us.us, align 4, !tbaa !28
%idxprom51.us.us.us = sext i32 %dec.us.us.us to i64
%28 = mul nsw i64 %idxprom51.us.us.us, %0
%arrayidx52.us.us.us = getelementptr inbounds i32, ptr %call, i64 %28
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arrayidx52.us.us.us, ptr align 4 %scevgep, i64 %21, i1 false), !tbaa !28
%indvars.iv.next185 = add nsw i64 %indvars.iv184, -1
%indvar.next = add nuw nsw i64 %indvar, 1
%exitcond188.not = icmp eq i64 %indvar.next, %wide.trip.count187
br i1 %exitcond188.not, label %for.body7.lr.ph.us.us.1, label %for.body32.us.us.us, !llvm.loop !31
for.body7.lr.ph.us.us.1: ; preds = %for.body32.us.us.us
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us.us.1 = getelementptr i32, ptr %call, i64 %idxprom8
%xtraiter311 = and i64 %wide.trip.count174, 1
%29 = icmp eq i64 %22, 0
br i1 %29, label %for.cond14.preheader.us.us.1.unr-lcssa, label %for.body7.lr.ph.us.us.1.new
for.body7.lr.ph.us.us.1.new: ; preds = %for.body7.lr.ph.us.us.1
%unroll_iter313 = and i64 %wide.trip.count174, 4294967294
br label %for.body7.us.us.1
for.body7.us.us.1: ; preds = %for.body7.us.us.1, %for.body7.lr.ph.us.us.1.new
%indvars.iv171.1 = phi i64 [ 0, %for.body7.lr.ph.us.us.1.new ], [ %indvars.iv.next172.1.1, %for.body7.us.us.1 ]
%niter314 = phi i64 [ 0, %for.body7.lr.ph.us.us.1.new ], [ %niter314.next.1, %for.body7.us.us.1 ]
%30 = mul nuw nsw i64 %indvars.iv171.1, %0
%gep.us.us.1 = getelementptr i32, ptr %invariant.gep.us.us.1, i64 %30
%31 = load i32, ptr %gep.us.us.1, align 4, !tbaa !28
%shr.us.us.1 = lshr i32 %31, 8
%and.us.us.1 = and i32 %shr.us.us.1, 255
%idxprom10.us.us.1 = zext i32 %and.us.us.1 to i64
%arrayidx11.us.us.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.1
%32 = load i32, ptr %arrayidx11.us.us.1, align 4, !tbaa !28
%inc.us.us.1 = add nsw i32 %32, 1
store i32 %inc.us.us.1, ptr %arrayidx11.us.us.1, align 4, !tbaa !28
%indvars.iv.next172.1 = or i64 %indvars.iv171.1, 1
%33 = mul nuw nsw i64 %indvars.iv.next172.1, %0
%gep.us.us.1.1 = getelementptr i32, ptr %invariant.gep.us.us.1, i64 %33
%34 = load i32, ptr %gep.us.us.1.1, align 4, !tbaa !28
%shr.us.us.1.1 = lshr i32 %34, 8
%and.us.us.1.1 = and i32 %shr.us.us.1.1, 255
%idxprom10.us.us.1.1 = zext i32 %and.us.us.1.1 to i64
%arrayidx11.us.us.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.1.1
%35 = load i32, ptr %arrayidx11.us.us.1.1, align 4, !tbaa !28
%inc.us.us.1.1 = add nsw i32 %35, 1
store i32 %inc.us.us.1.1, ptr %arrayidx11.us.us.1.1, align 4, !tbaa !28
%indvars.iv.next172.1.1 = add nuw nsw i64 %indvars.iv171.1, 2
%niter314.next.1 = add i64 %niter314, 2
%niter314.ncmp.1 = icmp eq i64 %niter314.next.1, %unroll_iter313
br i1 %niter314.ncmp.1, label %for.cond14.preheader.us.us.1.unr-lcssa, label %for.body7.us.us.1, !llvm.loop !30
for.cond14.preheader.us.us.1.unr-lcssa: ; preds = %for.body7.us.us.1, %for.body7.lr.ph.us.us.1
%indvars.iv171.1.unr = phi i64 [ 0, %for.body7.lr.ph.us.us.1 ], [ %indvars.iv.next172.1.1, %for.body7.us.us.1 ]
%lcmp.mod312.not = icmp eq i64 %xtraiter311, 0
br i1 %lcmp.mod312.not, label %for.cond14.preheader.us.us.1, label %for.body7.us.us.1.epil
for.body7.us.us.1.epil: ; preds = %for.cond14.preheader.us.us.1.unr-lcssa
%36 = mul nuw nsw i64 %indvars.iv171.1.unr, %0
%gep.us.us.1.epil = getelementptr i32, ptr %invariant.gep.us.us.1, i64 %36
%37 = load i32, ptr %gep.us.us.1.epil, align 4, !tbaa !28
%shr.us.us.1.epil = lshr i32 %37, 8
%and.us.us.1.epil = and i32 %shr.us.us.1.epil, 255
%idxprom10.us.us.1.epil = zext i32 %and.us.us.1.epil to i64
%arrayidx11.us.us.1.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.1.epil
%38 = load i32, ptr %arrayidx11.us.us.1.epil, align 4, !tbaa !28
%inc.us.us.1.epil = add nsw i32 %38, 1
store i32 %inc.us.us.1.epil, ptr %arrayidx11.us.us.1.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.us.1
for.cond14.preheader.us.us.1: ; preds = %for.cond14.preheader.us.us.1.unr-lcssa, %for.body7.us.us.1.epil
%.pre194.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.us.1
for.body18.us.us.1: ; preds = %for.body18.us.us.1, %for.cond14.preheader.us.us.1
%39 = phi i32 [ %.pre194.pre, %for.cond14.preheader.us.us.1 ], [ %add.us.us.1.4, %for.body18.us.us.1 ]
%indvars.iv176.1 = phi i64 [ 1, %for.cond14.preheader.us.us.1 ], [ %indvars.iv.next177.1.4, %for.body18.us.us.1 ]
%arrayidx22.us.us.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv176.1
%40 = load i32, ptr %arrayidx22.us.us.1, align 4, !tbaa !28
%add.us.us.1 = add nsw i32 %40, %39
store i32 %add.us.us.1, ptr %arrayidx22.us.us.1, align 4, !tbaa !28
%indvars.iv.next177.1 = add nuw nsw i64 %indvars.iv176.1, 1
%arrayidx22.us.us.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.1
%41 = load i32, ptr %arrayidx22.us.us.1.1, align 4, !tbaa !28
%add.us.us.1.1 = add nsw i32 %41, %add.us.us.1
store i32 %add.us.us.1.1, ptr %arrayidx22.us.us.1.1, align 4, !tbaa !28
%indvars.iv.next177.1.1 = add nuw nsw i64 %indvars.iv176.1, 2
%arrayidx22.us.us.1.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.1.1
%42 = load i32, ptr %arrayidx22.us.us.1.2, align 4, !tbaa !28
%add.us.us.1.2 = add nsw i32 %42, %add.us.us.1.1
store i32 %add.us.us.1.2, ptr %arrayidx22.us.us.1.2, align 4, !tbaa !28
%indvars.iv.next177.1.2 = add nuw nsw i64 %indvars.iv176.1, 3
%arrayidx22.us.us.1.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.1.2
%43 = load i32, ptr %arrayidx22.us.us.1.3, align 4, !tbaa !28
%add.us.us.1.3 = add nsw i32 %43, %add.us.us.1.2
store i32 %add.us.us.1.3, ptr %arrayidx22.us.us.1.3, align 4, !tbaa !28
%indvars.iv.next177.1.3 = add nuw nsw i64 %indvars.iv176.1, 4
%arrayidx22.us.us.1.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.1.3
%44 = load i32, ptr %arrayidx22.us.us.1.4, align 4, !tbaa !28
%add.us.us.1.4 = add nsw i32 %44, %add.us.us.1.3
store i32 %add.us.us.1.4, ptr %arrayidx22.us.us.1.4, align 4, !tbaa !28
%indvars.iv.next177.1.4 = add nuw nsw i64 %indvars.iv176.1, 5
%exitcond180.1.not.4 = icmp eq i64 %indvars.iv.next177.1.4, 256
br i1 %exitcond180.1.not.4, label %for.cond28.preheader.us.us.1, label %for.body18.us.us.1, !llvm.loop !29
for.cond28.preheader.us.us.1: ; preds = %for.body18.us.us.1
%45 = getelementptr i8, ptr %call, i64 %19
%invariant.gep207 = getelementptr i32, ptr %call, i64 %idxprom8
br label %for.body32.us.us.us.1
for.body32.us.us.us.1: ; preds = %for.body32.us.us.us.1, %for.cond28.preheader.us.us.1
%indvars.iv184.1 = phi i64 [ %indvars.iv.next185.1, %for.body32.us.us.us.1 ], [ %1, %for.cond28.preheader.us.us.1 ]
%indvar.1 = phi i64 [ %indvar.next.1, %for.body32.us.us.us.1 ], [ 0, %for.cond28.preheader.us.us.1 ]
%46 = mul i64 %20, %indvar.1
%scevgep.1 = getelementptr i8, ptr %45, i64 %46
%47 = mul nuw nsw i64 %indvars.iv184.1, %0
%gep208 = getelementptr i32, ptr %invariant.gep207, i64 %47
%48 = load i32, ptr %gep208, align 4, !tbaa !28
%shr38.us.us.us.1 = lshr i32 %48, 8
%and39.us.us.us.1 = and i32 %shr38.us.us.us.1, 255
%idxprom40.us.us.us.1 = zext i32 %and39.us.us.us.1 to i64
%arrayidx41.us.us.us.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us.us.us.1
%49 = load i32, ptr %arrayidx41.us.us.us.1, align 4, !tbaa !28
%dec.us.us.us.1 = add nsw i32 %49, -1
store i32 %dec.us.us.us.1, ptr %arrayidx41.us.us.us.1, align 4, !tbaa !28
%idxprom51.us.us.us.1 = sext i32 %dec.us.us.us.1 to i64
%50 = mul nsw i64 %idxprom51.us.us.us.1, %0
%arrayidx52.us.us.us.1 = getelementptr inbounds i32, ptr %base, i64 %50
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arrayidx52.us.us.us.1, ptr align 4 %scevgep.1, i64 %21, i1 false), !tbaa !28
%indvars.iv.next185.1 = add nsw i64 %indvars.iv184.1, -1
%indvar.next.1 = add nuw nsw i64 %indvar.1, 1
%exitcond188.1.not = icmp eq i64 %indvar.next.1, %wide.trip.count187
br i1 %exitcond188.1.not, label %for.body7.lr.ph.us.us.2, label %for.body32.us.us.us.1, !llvm.loop !31
for.body7.lr.ph.us.us.2: ; preds = %for.body32.us.us.us.1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us.us.2 = getelementptr i32, ptr %base, i64 %idxprom8
%xtraiter315 = and i64 %wide.trip.count174, 1
%51 = icmp eq i64 %22, 0
br i1 %51, label %for.cond14.preheader.us.us.2.unr-lcssa, label %for.body7.lr.ph.us.us.2.new
for.body7.lr.ph.us.us.2.new: ; preds = %for.body7.lr.ph.us.us.2
%unroll_iter317 = and i64 %wide.trip.count174, 4294967294
br label %for.body7.us.us.2
for.body7.us.us.2: ; preds = %for.body7.us.us.2, %for.body7.lr.ph.us.us.2.new
%indvars.iv171.2 = phi i64 [ 0, %for.body7.lr.ph.us.us.2.new ], [ %indvars.iv.next172.2.1, %for.body7.us.us.2 ]
%niter318 = phi i64 [ 0, %for.body7.lr.ph.us.us.2.new ], [ %niter318.next.1, %for.body7.us.us.2 ]
%52 = mul nuw nsw i64 %indvars.iv171.2, %0
%gep.us.us.2 = getelementptr i32, ptr %invariant.gep.us.us.2, i64 %52
%53 = load i32, ptr %gep.us.us.2, align 4, !tbaa !28
%shr.us.us.2 = lshr i32 %53, 16
%and.us.us.2 = and i32 %shr.us.us.2, 255
%idxprom10.us.us.2 = zext i32 %and.us.us.2 to i64
%arrayidx11.us.us.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.2
%54 = load i32, ptr %arrayidx11.us.us.2, align 4, !tbaa !28
%inc.us.us.2 = add nsw i32 %54, 1
store i32 %inc.us.us.2, ptr %arrayidx11.us.us.2, align 4, !tbaa !28
%indvars.iv.next172.2 = or i64 %indvars.iv171.2, 1
%55 = mul nuw nsw i64 %indvars.iv.next172.2, %0
%gep.us.us.2.1 = getelementptr i32, ptr %invariant.gep.us.us.2, i64 %55
%56 = load i32, ptr %gep.us.us.2.1, align 4, !tbaa !28
%shr.us.us.2.1 = lshr i32 %56, 16
%and.us.us.2.1 = and i32 %shr.us.us.2.1, 255
%idxprom10.us.us.2.1 = zext i32 %and.us.us.2.1 to i64
%arrayidx11.us.us.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.2.1
%57 = load i32, ptr %arrayidx11.us.us.2.1, align 4, !tbaa !28
%inc.us.us.2.1 = add nsw i32 %57, 1
store i32 %inc.us.us.2.1, ptr %arrayidx11.us.us.2.1, align 4, !tbaa !28
%indvars.iv.next172.2.1 = add nuw nsw i64 %indvars.iv171.2, 2
%niter318.next.1 = add i64 %niter318, 2
%niter318.ncmp.1 = icmp eq i64 %niter318.next.1, %unroll_iter317
br i1 %niter318.ncmp.1, label %for.cond14.preheader.us.us.2.unr-lcssa, label %for.body7.us.us.2, !llvm.loop !30
for.cond14.preheader.us.us.2.unr-lcssa: ; preds = %for.body7.us.us.2, %for.body7.lr.ph.us.us.2
%indvars.iv171.2.unr = phi i64 [ 0, %for.body7.lr.ph.us.us.2 ], [ %indvars.iv.next172.2.1, %for.body7.us.us.2 ]
%lcmp.mod316.not = icmp eq i64 %xtraiter315, 0
br i1 %lcmp.mod316.not, label %for.cond14.preheader.us.us.2, label %for.body7.us.us.2.epil
for.body7.us.us.2.epil: ; preds = %for.cond14.preheader.us.us.2.unr-lcssa
%58 = mul nuw nsw i64 %indvars.iv171.2.unr, %0
%gep.us.us.2.epil = getelementptr i32, ptr %invariant.gep.us.us.2, i64 %58
%59 = load i32, ptr %gep.us.us.2.epil, align 4, !tbaa !28
%shr.us.us.2.epil = lshr i32 %59, 16
%and.us.us.2.epil = and i32 %shr.us.us.2.epil, 255
%idxprom10.us.us.2.epil = zext i32 %and.us.us.2.epil to i64
%arrayidx11.us.us.2.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.2.epil
%60 = load i32, ptr %arrayidx11.us.us.2.epil, align 4, !tbaa !28
%inc.us.us.2.epil = add nsw i32 %60, 1
store i32 %inc.us.us.2.epil, ptr %arrayidx11.us.us.2.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.us.2
for.cond14.preheader.us.us.2: ; preds = %for.cond14.preheader.us.us.2.unr-lcssa, %for.body7.us.us.2.epil
%.pre195.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.us.2
for.body18.us.us.2: ; preds = %for.body18.us.us.2, %for.cond14.preheader.us.us.2
%61 = phi i32 [ %.pre195.pre, %for.cond14.preheader.us.us.2 ], [ %add.us.us.2.4, %for.body18.us.us.2 ]
%indvars.iv176.2 = phi i64 [ 1, %for.cond14.preheader.us.us.2 ], [ %indvars.iv.next177.2.4, %for.body18.us.us.2 ]
%arrayidx22.us.us.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv176.2
%62 = load i32, ptr %arrayidx22.us.us.2, align 4, !tbaa !28
%add.us.us.2 = add nsw i32 %62, %61
store i32 %add.us.us.2, ptr %arrayidx22.us.us.2, align 4, !tbaa !28
%indvars.iv.next177.2 = add nuw nsw i64 %indvars.iv176.2, 1
%arrayidx22.us.us.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.2
%63 = load i32, ptr %arrayidx22.us.us.2.1, align 4, !tbaa !28
%add.us.us.2.1 = add nsw i32 %63, %add.us.us.2
store i32 %add.us.us.2.1, ptr %arrayidx22.us.us.2.1, align 4, !tbaa !28
%indvars.iv.next177.2.1 = add nuw nsw i64 %indvars.iv176.2, 2
%arrayidx22.us.us.2.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.2.1
%64 = load i32, ptr %arrayidx22.us.us.2.2, align 4, !tbaa !28
%add.us.us.2.2 = add nsw i32 %64, %add.us.us.2.1
store i32 %add.us.us.2.2, ptr %arrayidx22.us.us.2.2, align 4, !tbaa !28
%indvars.iv.next177.2.2 = add nuw nsw i64 %indvars.iv176.2, 3
%arrayidx22.us.us.2.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.2.2
%65 = load i32, ptr %arrayidx22.us.us.2.3, align 4, !tbaa !28
%add.us.us.2.3 = add nsw i32 %65, %add.us.us.2.2
store i32 %add.us.us.2.3, ptr %arrayidx22.us.us.2.3, align 4, !tbaa !28
%indvars.iv.next177.2.3 = add nuw nsw i64 %indvars.iv176.2, 4
%arrayidx22.us.us.2.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.2.3
%66 = load i32, ptr %arrayidx22.us.us.2.4, align 4, !tbaa !28
%add.us.us.2.4 = add nsw i32 %66, %add.us.us.2.3
store i32 %add.us.us.2.4, ptr %arrayidx22.us.us.2.4, align 4, !tbaa !28
%indvars.iv.next177.2.4 = add nuw nsw i64 %indvars.iv176.2, 5
%exitcond180.2.not.4 = icmp eq i64 %indvars.iv.next177.2.4, 256
br i1 %exitcond180.2.not.4, label %for.cond28.preheader.us.us.2, label %for.body18.us.us.2, !llvm.loop !29
for.cond28.preheader.us.us.2: ; preds = %for.body18.us.us.2
%67 = getelementptr i8, ptr %base, i64 %19
%invariant.gep209 = getelementptr i32, ptr %base, i64 %idxprom8
br label %for.body32.us.us.us.2
for.body32.us.us.us.2: ; preds = %for.body32.us.us.us.2, %for.cond28.preheader.us.us.2
%indvars.iv184.2 = phi i64 [ %indvars.iv.next185.2, %for.body32.us.us.us.2 ], [ %1, %for.cond28.preheader.us.us.2 ]
%indvar.2 = phi i64 [ %indvar.next.2, %for.body32.us.us.us.2 ], [ 0, %for.cond28.preheader.us.us.2 ]
%68 = mul i64 %20, %indvar.2
%scevgep.2 = getelementptr i8, ptr %67, i64 %68
%69 = mul nuw nsw i64 %indvars.iv184.2, %0
%gep210 = getelementptr i32, ptr %invariant.gep209, i64 %69
%70 = load i32, ptr %gep210, align 4, !tbaa !28
%shr38.us.us.us.2 = lshr i32 %70, 16
%and39.us.us.us.2 = and i32 %shr38.us.us.us.2, 255
%idxprom40.us.us.us.2 = zext i32 %and39.us.us.us.2 to i64
%arrayidx41.us.us.us.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us.us.us.2
%71 = load i32, ptr %arrayidx41.us.us.us.2, align 4, !tbaa !28
%dec.us.us.us.2 = add nsw i32 %71, -1
store i32 %dec.us.us.us.2, ptr %arrayidx41.us.us.us.2, align 4, !tbaa !28
%idxprom51.us.us.us.2 = sext i32 %dec.us.us.us.2 to i64
%72 = mul nsw i64 %idxprom51.us.us.us.2, %0
%arrayidx52.us.us.us.2 = getelementptr inbounds i32, ptr %call, i64 %72
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arrayidx52.us.us.us.2, ptr align 4 %scevgep.2, i64 %21, i1 false), !tbaa !28
%indvars.iv.next185.2 = add nsw i64 %indvars.iv184.2, -1
%indvar.next.2 = add nuw nsw i64 %indvar.2, 1
%exitcond188.2.not = icmp eq i64 %indvar.next.2, %wide.trip.count187
br i1 %exitcond188.2.not, label %for.body7.lr.ph.us.us.3, label %for.body32.us.us.us.2, !llvm.loop !31
for.body7.lr.ph.us.us.3: ; preds = %for.body32.us.us.us.2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us.us.3 = getelementptr i32, ptr %call, i64 %idxprom8
%xtraiter319 = and i64 %wide.trip.count174, 1
%73 = icmp eq i64 %22, 0
br i1 %73, label %for.cond14.preheader.us.us.3.unr-lcssa, label %for.body7.lr.ph.us.us.3.new
for.body7.lr.ph.us.us.3.new: ; preds = %for.body7.lr.ph.us.us.3
%unroll_iter321 = and i64 %wide.trip.count174, 4294967294
br label %for.body7.us.us.3
for.body7.us.us.3: ; preds = %for.body7.us.us.3, %for.body7.lr.ph.us.us.3.new
%indvars.iv171.3 = phi i64 [ 0, %for.body7.lr.ph.us.us.3.new ], [ %indvars.iv.next172.3.1, %for.body7.us.us.3 ]
%niter322 = phi i64 [ 0, %for.body7.lr.ph.us.us.3.new ], [ %niter322.next.1, %for.body7.us.us.3 ]
%74 = mul nuw nsw i64 %indvars.iv171.3, %0
%gep.us.us.3 = getelementptr i32, ptr %invariant.gep.us.us.3, i64 %74
%75 = load i32, ptr %gep.us.us.3, align 4, !tbaa !28
%shr.us.us.3 = lshr i32 %75, 24
%idxprom10.us.us.3 = zext i32 %shr.us.us.3 to i64
%arrayidx11.us.us.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.3
%76 = load i32, ptr %arrayidx11.us.us.3, align 4, !tbaa !28
%inc.us.us.3 = add nsw i32 %76, 1
store i32 %inc.us.us.3, ptr %arrayidx11.us.us.3, align 4, !tbaa !28
%indvars.iv.next172.3 = or i64 %indvars.iv171.3, 1
%77 = mul nuw nsw i64 %indvars.iv.next172.3, %0
%gep.us.us.3.1 = getelementptr i32, ptr %invariant.gep.us.us.3, i64 %77
%78 = load i32, ptr %gep.us.us.3.1, align 4, !tbaa !28
%shr.us.us.3.1 = lshr i32 %78, 24
%idxprom10.us.us.3.1 = zext i32 %shr.us.us.3.1 to i64
%arrayidx11.us.us.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.3.1
%79 = load i32, ptr %arrayidx11.us.us.3.1, align 4, !tbaa !28
%inc.us.us.3.1 = add nsw i32 %79, 1
store i32 %inc.us.us.3.1, ptr %arrayidx11.us.us.3.1, align 4, !tbaa !28
%indvars.iv.next172.3.1 = add nuw nsw i64 %indvars.iv171.3, 2
%niter322.next.1 = add i64 %niter322, 2
%niter322.ncmp.1 = icmp eq i64 %niter322.next.1, %unroll_iter321
br i1 %niter322.ncmp.1, label %for.cond14.preheader.us.us.3.unr-lcssa, label %for.body7.us.us.3, !llvm.loop !30
for.cond14.preheader.us.us.3.unr-lcssa: ; preds = %for.body7.us.us.3, %for.body7.lr.ph.us.us.3
%indvars.iv171.3.unr = phi i64 [ 0, %for.body7.lr.ph.us.us.3 ], [ %indvars.iv.next172.3.1, %for.body7.us.us.3 ]
%lcmp.mod320.not = icmp eq i64 %xtraiter319, 0
br i1 %lcmp.mod320.not, label %for.cond14.preheader.us.us.3, label %for.body7.us.us.3.epil
for.body7.us.us.3.epil: ; preds = %for.cond14.preheader.us.us.3.unr-lcssa
%80 = mul nuw nsw i64 %indvars.iv171.3.unr, %0
%gep.us.us.3.epil = getelementptr i32, ptr %invariant.gep.us.us.3, i64 %80
%81 = load i32, ptr %gep.us.us.3.epil, align 4, !tbaa !28
%shr.us.us.3.epil = lshr i32 %81, 24
%idxprom10.us.us.3.epil = zext i32 %shr.us.us.3.epil to i64
%arrayidx11.us.us.3.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.us.3.epil
%82 = load i32, ptr %arrayidx11.us.us.3.epil, align 4, !tbaa !28
%inc.us.us.3.epil = add nsw i32 %82, 1
store i32 %inc.us.us.3.epil, ptr %arrayidx11.us.us.3.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.us.3
for.cond14.preheader.us.us.3: ; preds = %for.cond14.preheader.us.us.3.unr-lcssa, %for.body7.us.us.3.epil
%.pre196.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.us.3
for.body18.us.us.3: ; preds = %for.body18.us.us.3, %for.cond14.preheader.us.us.3
%83 = phi i32 [ %.pre196.pre, %for.cond14.preheader.us.us.3 ], [ %add.us.us.3.4, %for.body18.us.us.3 ]
%indvars.iv176.3 = phi i64 [ 1, %for.cond14.preheader.us.us.3 ], [ %indvars.iv.next177.3.4, %for.body18.us.us.3 ]
%arrayidx22.us.us.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv176.3
%84 = load i32, ptr %arrayidx22.us.us.3, align 4, !tbaa !28
%add.us.us.3 = add nsw i32 %84, %83
store i32 %add.us.us.3, ptr %arrayidx22.us.us.3, align 4, !tbaa !28
%indvars.iv.next177.3 = add nuw nsw i64 %indvars.iv176.3, 1
%arrayidx22.us.us.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.3
%85 = load i32, ptr %arrayidx22.us.us.3.1, align 4, !tbaa !28
%add.us.us.3.1 = add nsw i32 %85, %add.us.us.3
store i32 %add.us.us.3.1, ptr %arrayidx22.us.us.3.1, align 4, !tbaa !28
%indvars.iv.next177.3.1 = add nuw nsw i64 %indvars.iv176.3, 2
%arrayidx22.us.us.3.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.3.1
%86 = load i32, ptr %arrayidx22.us.us.3.2, align 4, !tbaa !28
%add.us.us.3.2 = add nsw i32 %86, %add.us.us.3.1
store i32 %add.us.us.3.2, ptr %arrayidx22.us.us.3.2, align 4, !tbaa !28
%indvars.iv.next177.3.2 = add nuw nsw i64 %indvars.iv176.3, 3
%arrayidx22.us.us.3.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.3.2
%87 = load i32, ptr %arrayidx22.us.us.3.3, align 4, !tbaa !28
%add.us.us.3.3 = add nsw i32 %87, %add.us.us.3.2
store i32 %add.us.us.3.3, ptr %arrayidx22.us.us.3.3, align 4, !tbaa !28
%indvars.iv.next177.3.3 = add nuw nsw i64 %indvars.iv176.3, 4
%arrayidx22.us.us.3.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next177.3.3
%88 = load i32, ptr %arrayidx22.us.us.3.4, align 4, !tbaa !28
%add.us.us.3.4 = add nsw i32 %88, %add.us.us.3.3
store i32 %add.us.us.3.4, ptr %arrayidx22.us.us.3.4, align 4, !tbaa !28
%indvars.iv.next177.3.4 = add nuw nsw i64 %indvars.iv176.3, 5
%exitcond180.3.not.4 = icmp eq i64 %indvars.iv.next177.3.4, 256
br i1 %exitcond180.3.not.4, label %for.cond28.preheader.us.us.3, label %for.body18.us.us.3, !llvm.loop !29
for.cond28.preheader.us.us.3: ; preds = %for.body18.us.us.3
%89 = getelementptr i8, ptr %call, i64 %19
%invariant.gep211 = getelementptr i32, ptr %call, i64 %idxprom8
br label %for.body32.us.us.us.3
for.body32.us.us.us.3: ; preds = %for.body32.us.us.us.3, %for.cond28.preheader.us.us.3
%indvars.iv184.3 = phi i64 [ %indvars.iv.next185.3, %for.body32.us.us.us.3 ], [ %1, %for.cond28.preheader.us.us.3 ]
%indvar.3 = phi i64 [ %indvar.next.3, %for.body32.us.us.us.3 ], [ 0, %for.cond28.preheader.us.us.3 ]
%90 = mul i64 %20, %indvar.3
%scevgep.3 = getelementptr i8, ptr %89, i64 %90
%91 = mul nuw nsw i64 %indvars.iv184.3, %0
%gep212 = getelementptr i32, ptr %invariant.gep211, i64 %91
%92 = load i32, ptr %gep212, align 4, !tbaa !28
%shr38.us.us.us.3 = lshr i32 %92, 24
%idxprom40.us.us.us.3 = zext i32 %shr38.us.us.us.3 to i64
%arrayidx41.us.us.us.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us.us.us.3
%93 = load i32, ptr %arrayidx41.us.us.us.3, align 4, !tbaa !28
%dec.us.us.us.3 = add nsw i32 %93, -1
store i32 %dec.us.us.us.3, ptr %arrayidx41.us.us.us.3, align 4, !tbaa !28
%idxprom51.us.us.us.3 = sext i32 %dec.us.us.us.3 to i64
%94 = mul nsw i64 %idxprom51.us.us.us.3, %0
%arrayidx52.us.us.us.3 = getelementptr inbounds i32, ptr %base, i64 %94
tail call void @llvm.memcpy.p0.p0.i64(ptr align 4 %arrayidx52.us.us.us.3, ptr align 4 %scevgep.3, i64 %21, i1 false), !tbaa !28
%indvars.iv.next185.3 = add nsw i64 %indvars.iv184.3, -1
%indvar.next.3 = add nuw nsw i64 %indvar.3, 1
%exitcond188.3.not = icmp eq i64 %indvar.next.3, %wide.trip.count187
br i1 %exitcond188.3.not, label %for.cond.cleanup, label %for.body32.us.us.us.3, !llvm.loop !31
for.body32.us105: ; preds = %for.body32.us105.prol.loopexit, %for.body32.us105
%indvars.iv167 = phi i64 [ %indvars.iv.next168.1263, %for.body32.us105 ], [ %indvars.iv167.unr, %for.body32.us105.prol.loopexit ]
%95 = mul nuw nsw i64 %indvars.iv167, %0
%gep101.us = getelementptr i32, ptr %invariant.gep100.us, i64 %95
%96 = load i32, ptr %gep101.us, align 4, !tbaa !28
%and39.us109 = and i32 %96, 255
%idxprom40.us110 = zext i32 %and39.us109 to i64
%arrayidx41.us111 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110
%97 = load i32, ptr %arrayidx41.us111, align 4, !tbaa !28
%dec.us112 = add nsw i32 %97, -1
store i32 %dec.us112, ptr %arrayidx41.us111, align 4, !tbaa !28
%indvars.iv.next168 = add nsw i64 %indvars.iv167, -1
%98 = mul nuw nsw i64 %indvars.iv.next168, %0
%gep101.us.1258 = getelementptr i32, ptr %invariant.gep100.us, i64 %98
%99 = load i32, ptr %gep101.us.1258, align 4, !tbaa !28
%and39.us109.1259 = and i32 %99, 255
%idxprom40.us110.1260 = zext i32 %and39.us109.1259 to i64
%arrayidx41.us111.1261 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.1260
%100 = load i32, ptr %arrayidx41.us111.1261, align 4, !tbaa !28
%dec.us112.1262 = add nsw i32 %100, -1
store i32 %dec.us112.1262, ptr %arrayidx41.us111.1261, align 4, !tbaa !28
%indvars.iv.next168.1263 = add nsw i64 %indvars.iv167, -2
%cmp29.us114.1264 = icmp sgt i64 %indvars.iv167, 1
br i1 %cmp29.us114.1264, label %for.body32.us105, label %for.body7.lr.ph.us.1, !llvm.loop !31
for.body18.us: ; preds = %for.body18.us, %for.cond14.preheader.us
%101 = phi i32 [ %.pre.pre, %for.cond14.preheader.us ], [ %add.us.4, %for.body18.us ]
%indvars.iv162 = phi i64 [ 1, %for.cond14.preheader.us ], [ %indvars.iv.next163.4, %for.body18.us ]
%arrayidx22.us = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv162
%102 = load i32, ptr %arrayidx22.us, align 4, !tbaa !28
%add.us = add nsw i32 %102, %101
store i32 %add.us, ptr %arrayidx22.us, align 4, !tbaa !28
%indvars.iv.next163 = add nuw nsw i64 %indvars.iv162, 1
%arrayidx22.us.1241 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163
%103 = load i32, ptr %arrayidx22.us.1241, align 4, !tbaa !28
%add.us.1242 = add nsw i32 %103, %add.us
store i32 %add.us.1242, ptr %arrayidx22.us.1241, align 4, !tbaa !28
%indvars.iv.next163.1243 = add nuw nsw i64 %indvars.iv162, 2
%arrayidx22.us.2246 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.1243
%104 = load i32, ptr %arrayidx22.us.2246, align 4, !tbaa !28
%add.us.2247 = add nsw i32 %104, %add.us.1242
store i32 %add.us.2247, ptr %arrayidx22.us.2246, align 4, !tbaa !28
%indvars.iv.next163.2248 = add nuw nsw i64 %indvars.iv162, 3
%arrayidx22.us.3251 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.2248
%105 = load i32, ptr %arrayidx22.us.3251, align 4, !tbaa !28
%add.us.3252 = add nsw i32 %105, %add.us.2247
store i32 %add.us.3252, ptr %arrayidx22.us.3251, align 4, !tbaa !28
%indvars.iv.next163.3253 = add nuw nsw i64 %indvars.iv162, 4
%arrayidx22.us.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.3253
%106 = load i32, ptr %arrayidx22.us.4, align 4, !tbaa !28
%add.us.4 = add nsw i32 %106, %add.us.3252
store i32 %add.us.4, ptr %arrayidx22.us.4, align 4, !tbaa !28
%indvars.iv.next163.4 = add nuw nsw i64 %indvars.iv162, 5
%exitcond166.not.4 = icmp eq i64 %indvars.iv.next163.4, 256
br i1 %exitcond166.not.4, label %for.cond28.preheader.us, label %for.body18.us, !llvm.loop !29
for.body7.us: ; preds = %for.body7.us, %for.body7.lr.ph.us.new
%indvars.iv158 = phi i64 [ 0, %for.body7.lr.ph.us.new ], [ %indvars.iv.next159.1238, %for.body7.us ]
%niter = phi i64 [ 0, %for.body7.lr.ph.us.new ], [ %niter.next.1, %for.body7.us ]
%107 = mul nuw nsw i64 %indvars.iv158, %0
%gep.us = getelementptr i32, ptr %invariant.gep.us, i64 %107
%108 = load i32, ptr %gep.us, align 4, !tbaa !28
%and.us = and i32 %108, 255
%idxprom10.us = zext i32 %and.us to i64
%arrayidx11.us = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us
%109 = load i32, ptr %arrayidx11.us, align 4, !tbaa !28
%inc.us = add nsw i32 %109, 1
store i32 %inc.us, ptr %arrayidx11.us, align 4, !tbaa !28
%indvars.iv.next159 = or i64 %indvars.iv158, 1
%110 = mul nuw nsw i64 %indvars.iv.next159, %0
%gep.us.1233 = getelementptr i32, ptr %invariant.gep.us, i64 %110
%111 = load i32, ptr %gep.us.1233, align 4, !tbaa !28
%and.us.1234 = and i32 %111, 255
%idxprom10.us.1235 = zext i32 %and.us.1234 to i64
%arrayidx11.us.1236 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.1235
%112 = load i32, ptr %arrayidx11.us.1236, align 4, !tbaa !28
%inc.us.1237 = add nsw i32 %112, 1
store i32 %inc.us.1237, ptr %arrayidx11.us.1236, align 4, !tbaa !28
%indvars.iv.next159.1238 = add nuw nsw i64 %indvars.iv158, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond14.preheader.us.unr-lcssa, label %for.body7.us, !llvm.loop !30
for.cond28.preheader.us: ; preds = %for.body18.us
%invariant.gep100.us = getelementptr i32, ptr %base, i64 %idxprom8
%113 = zext i32 %count to i64
%xtraiter255 = and i64 %113, 1
%lcmp.mod256.not = icmp eq i64 %xtraiter255, 0
br i1 %lcmp.mod256.not, label %for.body32.us105.prol.loopexit, label %for.body32.us105.prol
for.body32.us105.prol: ; preds = %for.cond28.preheader.us
%114 = mul nuw nsw i64 %1, %0
%gep101.us.prol = getelementptr i32, ptr %invariant.gep100.us, i64 %114
%115 = load i32, ptr %gep101.us.prol, align 4, !tbaa !28
%and39.us109.prol = and i32 %115, 255
%idxprom40.us110.prol = zext i32 %and39.us109.prol to i64
%arrayidx41.us111.prol = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.prol
%116 = load i32, ptr %arrayidx41.us111.prol, align 4, !tbaa !28
%dec.us112.prol = add nsw i32 %116, -1
store i32 %dec.us112.prol, ptr %arrayidx41.us111.prol, align 4, !tbaa !28
%indvars.iv.next168.prol = add nsw i64 %1, -1
br label %for.body32.us105.prol.loopexit
for.body32.us105.prol.loopexit: ; preds = %for.body32.us105.prol, %for.cond28.preheader.us
%indvars.iv167.unr = phi i64 [ %1, %for.cond28.preheader.us ], [ %indvars.iv.next168.prol, %for.body32.us105.prol ]
%117 = icmp eq i32 %i26.097, 0
br i1 %117, label %for.body7.lr.ph.us.1, label %for.body32.us105
for.cond14.preheader.us.unr-lcssa: ; preds = %for.body7.us, %for.body7.lr.ph.us
%indvars.iv158.unr = phi i64 [ 0, %for.body7.lr.ph.us ], [ %indvars.iv.next159.1238, %for.body7.us ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond14.preheader.us, label %for.body7.us.epil
for.body7.us.epil: ; preds = %for.cond14.preheader.us.unr-lcssa
%118 = mul nuw nsw i64 %indvars.iv158.unr, %0
%gep.us.epil = getelementptr i32, ptr %invariant.gep.us, i64 %118
%119 = load i32, ptr %gep.us.epil, align 4, !tbaa !28
%and.us.epil = and i32 %119, 255
%idxprom10.us.epil = zext i32 %and.us.epil to i64
%arrayidx11.us.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.epil
%120 = load i32, ptr %arrayidx11.us.epil, align 4, !tbaa !28
%inc.us.epil = add nsw i32 %120, 1
store i32 %inc.us.epil, ptr %arrayidx11.us.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us
for.cond14.preheader.us: ; preds = %for.cond14.preheader.us.unr-lcssa, %for.body7.us.epil
%.pre.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us
for.body7.lr.ph.us: ; preds = %entry.split.us
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us = getelementptr i32, ptr %base, i64 %idxprom8
%wide.trip.count = zext i32 %count to i64
%121 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %wide.trip.count, 1
%122 = icmp eq i64 %121, 0
br i1 %122, label %for.cond14.preheader.us.unr-lcssa, label %for.body7.lr.ph.us.new
for.body7.lr.ph.us.new: ; preds = %for.body7.lr.ph.us
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body7.us
for.body7.lr.ph.us.1: ; preds = %for.body32.us105, %for.body32.us105.prol.loopexit
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%invariant.gep.us.1 = getelementptr i32, ptr %call, i64 %idxprom8
%xtraiter266 = and i64 %wide.trip.count, 1
%123 = icmp eq i64 %121, 0
br i1 %123, label %for.cond14.preheader.us.1.unr-lcssa, label %for.body7.lr.ph.us.1.new
for.body7.lr.ph.us.1.new: ; preds = %for.body7.lr.ph.us.1
%unroll_iter268 = and i64 %wide.trip.count, 4294967294
br label %for.body7.us.1
for.body7.us.1: ; preds = %for.body7.us.1, %for.body7.lr.ph.us.1.new
%indvars.iv158.1 = phi i64 [ 0, %for.body7.lr.ph.us.1.new ], [ %indvars.iv.next159.1.1, %for.body7.us.1 ]
%niter269 = phi i64 [ 0, %for.body7.lr.ph.us.1.new ], [ %niter269.next.1, %for.body7.us.1 ]
%124 = mul nuw nsw i64 %indvars.iv158.1, %0
%gep.us.1 = getelementptr i32, ptr %invariant.gep.us.1, i64 %124
%125 = load i32, ptr %gep.us.1, align 4, !tbaa !28
%shr.us.1 = lshr i32 %125, 8
%and.us.1 = and i32 %shr.us.1, 255
%idxprom10.us.1 = zext i32 %and.us.1 to i64
%arrayidx11.us.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.1
%126 = load i32, ptr %arrayidx11.us.1, align 4, !tbaa !28
%inc.us.1 = add nsw i32 %126, 1
store i32 %inc.us.1, ptr %arrayidx11.us.1, align 4, !tbaa !28
%indvars.iv.next159.1 = or i64 %indvars.iv158.1, 1
%127 = mul nuw nsw i64 %indvars.iv.next159.1, %0
%gep.us.1.1 = getelementptr i32, ptr %invariant.gep.us.1, i64 %127
%128 = load i32, ptr %gep.us.1.1, align 4, !tbaa !28
%shr.us.1.1 = lshr i32 %128, 8
%and.us.1.1 = and i32 %shr.us.1.1, 255
%idxprom10.us.1.1 = zext i32 %and.us.1.1 to i64
%arrayidx11.us.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.1.1
%129 = load i32, ptr %arrayidx11.us.1.1, align 4, !tbaa !28
%inc.us.1.1 = add nsw i32 %129, 1
store i32 %inc.us.1.1, ptr %arrayidx11.us.1.1, align 4, !tbaa !28
%indvars.iv.next159.1.1 = add nuw nsw i64 %indvars.iv158.1, 2
%niter269.next.1 = add i64 %niter269, 2
%niter269.ncmp.1 = icmp eq i64 %niter269.next.1, %unroll_iter268
br i1 %niter269.ncmp.1, label %for.cond14.preheader.us.1.unr-lcssa, label %for.body7.us.1, !llvm.loop !30
for.cond14.preheader.us.1.unr-lcssa: ; preds = %for.body7.us.1, %for.body7.lr.ph.us.1
%indvars.iv158.1.unr = phi i64 [ 0, %for.body7.lr.ph.us.1 ], [ %indvars.iv.next159.1.1, %for.body7.us.1 ]
%lcmp.mod267.not = icmp eq i64 %xtraiter266, 0
br i1 %lcmp.mod267.not, label %for.cond14.preheader.us.1, label %for.body7.us.1.epil
for.body7.us.1.epil: ; preds = %for.cond14.preheader.us.1.unr-lcssa
%130 = mul nuw nsw i64 %indvars.iv158.1.unr, %0
%gep.us.1.epil = getelementptr i32, ptr %invariant.gep.us.1, i64 %130
%131 = load i32, ptr %gep.us.1.epil, align 4, !tbaa !28
%shr.us.1.epil = lshr i32 %131, 8
%and.us.1.epil = and i32 %shr.us.1.epil, 255
%idxprom10.us.1.epil = zext i32 %and.us.1.epil to i64
%arrayidx11.us.1.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.1.epil
%132 = load i32, ptr %arrayidx11.us.1.epil, align 4, !tbaa !28
%inc.us.1.epil = add nsw i32 %132, 1
store i32 %inc.us.1.epil, ptr %arrayidx11.us.1.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.1
for.cond14.preheader.us.1: ; preds = %for.cond14.preheader.us.1.unr-lcssa, %for.body7.us.1.epil
%.pre190.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.1
for.body18.us.1: ; preds = %for.body18.us.1, %for.cond14.preheader.us.1
%133 = phi i32 [ %.pre190.pre, %for.cond14.preheader.us.1 ], [ %add.us.1.4, %for.body18.us.1 ]
%indvars.iv162.1 = phi i64 [ 1, %for.cond14.preheader.us.1 ], [ %indvars.iv.next163.1.4, %for.body18.us.1 ]
%arrayidx22.us.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv162.1
%134 = load i32, ptr %arrayidx22.us.1, align 4, !tbaa !28
%add.us.1 = add nsw i32 %134, %133
store i32 %add.us.1, ptr %arrayidx22.us.1, align 4, !tbaa !28
%indvars.iv.next163.1 = add nuw nsw i64 %indvars.iv162.1, 1
%arrayidx22.us.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.1
%135 = load i32, ptr %arrayidx22.us.1.1, align 4, !tbaa !28
%add.us.1.1 = add nsw i32 %135, %add.us.1
store i32 %add.us.1.1, ptr %arrayidx22.us.1.1, align 4, !tbaa !28
%indvars.iv.next163.1.1 = add nuw nsw i64 %indvars.iv162.1, 2
%arrayidx22.us.1.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.1.1
%136 = load i32, ptr %arrayidx22.us.1.2, align 4, !tbaa !28
%add.us.1.2 = add nsw i32 %136, %add.us.1.1
store i32 %add.us.1.2, ptr %arrayidx22.us.1.2, align 4, !tbaa !28
%indvars.iv.next163.1.2 = add nuw nsw i64 %indvars.iv162.1, 3
%arrayidx22.us.1.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.1.2
%137 = load i32, ptr %arrayidx22.us.1.3, align 4, !tbaa !28
%add.us.1.3 = add nsw i32 %137, %add.us.1.2
store i32 %add.us.1.3, ptr %arrayidx22.us.1.3, align 4, !tbaa !28
%indvars.iv.next163.1.3 = add nuw nsw i64 %indvars.iv162.1, 4
%arrayidx22.us.1.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.1.3
%138 = load i32, ptr %arrayidx22.us.1.4, align 4, !tbaa !28
%add.us.1.4 = add nsw i32 %138, %add.us.1.3
store i32 %add.us.1.4, ptr %arrayidx22.us.1.4, align 4, !tbaa !28
%indvars.iv.next163.1.4 = add nuw nsw i64 %indvars.iv162.1, 5
%exitcond166.1.not.4 = icmp eq i64 %indvars.iv.next163.1.4, 256
br i1 %exitcond166.1.not.4, label %for.cond28.preheader.us.1, label %for.body18.us.1, !llvm.loop !29
for.cond28.preheader.us.1: ; preds = %for.body18.us.1
%invariant.gep100.us.1 = getelementptr i32, ptr %call, i64 %idxprom8
%xtraiter270 = and i64 %113, 1
%lcmp.mod271.not = icmp eq i64 %xtraiter270, 0
br i1 %lcmp.mod271.not, label %for.body32.us105.1.prol.loopexit, label %for.body32.us105.1.prol
for.body32.us105.1.prol: ; preds = %for.cond28.preheader.us.1
%139 = mul nuw nsw i64 %1, %0
%gep101.us.1.prol = getelementptr i32, ptr %invariant.gep100.us.1, i64 %139
%140 = load i32, ptr %gep101.us.1.prol, align 4, !tbaa !28
%shr38.us108.1.prol = lshr i32 %140, 8
%and39.us109.1.prol = and i32 %shr38.us108.1.prol, 255
%idxprom40.us110.1.prol = zext i32 %and39.us109.1.prol to i64
%arrayidx41.us111.1.prol = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.1.prol
%141 = load i32, ptr %arrayidx41.us111.1.prol, align 4, !tbaa !28
%dec.us112.1.prol = add nsw i32 %141, -1
store i32 %dec.us112.1.prol, ptr %arrayidx41.us111.1.prol, align 4, !tbaa !28
%indvars.iv.next168.1.prol = add nsw i64 %1, -1
br label %for.body32.us105.1.prol.loopexit
for.body32.us105.1.prol.loopexit: ; preds = %for.body32.us105.1.prol, %for.cond28.preheader.us.1
%indvars.iv167.1.unr = phi i64 [ %1, %for.cond28.preheader.us.1 ], [ %indvars.iv.next168.1.prol, %for.body32.us105.1.prol ]
%142 = icmp eq i32 %i26.097, 0
br i1 %142, label %for.body7.lr.ph.us.2, label %for.body32.us105.1
for.body32.us105.1: ; preds = %for.body32.us105.1.prol.loopexit, %for.body32.us105.1
%indvars.iv167.1 = phi i64 [ %indvars.iv.next168.1.1, %for.body32.us105.1 ], [ %indvars.iv167.1.unr, %for.body32.us105.1.prol.loopexit ]
%143 = mul nuw nsw i64 %indvars.iv167.1, %0
%gep101.us.1 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %143
%144 = load i32, ptr %gep101.us.1, align 4, !tbaa !28
%shr38.us108.1 = lshr i32 %144, 8
%and39.us109.1 = and i32 %shr38.us108.1, 255
%idxprom40.us110.1 = zext i32 %and39.us109.1 to i64
%arrayidx41.us111.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.1
%145 = load i32, ptr %arrayidx41.us111.1, align 4, !tbaa !28
%dec.us112.1 = add nsw i32 %145, -1
store i32 %dec.us112.1, ptr %arrayidx41.us111.1, align 4, !tbaa !28
%indvars.iv.next168.1 = add nsw i64 %indvars.iv167.1, -1
%146 = mul nuw nsw i64 %indvars.iv.next168.1, %0
%gep101.us.1.1 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %146
%147 = load i32, ptr %gep101.us.1.1, align 4, !tbaa !28
%shr38.us108.1.1 = lshr i32 %147, 8
%and39.us109.1.1 = and i32 %shr38.us108.1.1, 255
%idxprom40.us110.1.1 = zext i32 %and39.us109.1.1 to i64
%arrayidx41.us111.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.1.1
%148 = load i32, ptr %arrayidx41.us111.1.1, align 4, !tbaa !28
%dec.us112.1.1 = add nsw i32 %148, -1
store i32 %dec.us112.1.1, ptr %arrayidx41.us111.1.1, align 4, !tbaa !28
%indvars.iv.next168.1.1 = add nsw i64 %indvars.iv167.1, -2
%cmp29.us114.1.1 = icmp sgt i64 %indvars.iv167.1, 1
br i1 %cmp29.us114.1.1, label %for.body32.us105.1, label %for.body7.lr.ph.us.2, !llvm.loop !31
for.body7.lr.ph.us.2: ; preds = %for.body32.us105.1, %for.body32.us105.1.prol.loopexit
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%xtraiter272 = and i64 %wide.trip.count, 1
%149 = icmp eq i64 %121, 0
br i1 %149, label %for.cond14.preheader.us.2.unr-lcssa, label %for.body7.lr.ph.us.2.new
for.body7.lr.ph.us.2.new: ; preds = %for.body7.lr.ph.us.2
%unroll_iter274 = and i64 %wide.trip.count, 4294967294
br label %for.body7.us.2
for.body7.us.2: ; preds = %for.body7.us.2, %for.body7.lr.ph.us.2.new
%indvars.iv158.2 = phi i64 [ 0, %for.body7.lr.ph.us.2.new ], [ %indvars.iv.next159.2.1, %for.body7.us.2 ]
%niter275 = phi i64 [ 0, %for.body7.lr.ph.us.2.new ], [ %niter275.next.1, %for.body7.us.2 ]
%150 = mul nuw nsw i64 %indvars.iv158.2, %0
%gep.us.2 = getelementptr i32, ptr %invariant.gep100.us, i64 %150
%151 = load i32, ptr %gep.us.2, align 4, !tbaa !28
%shr.us.2 = lshr i32 %151, 16
%and.us.2 = and i32 %shr.us.2, 255
%idxprom10.us.2 = zext i32 %and.us.2 to i64
%arrayidx11.us.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.2
%152 = load i32, ptr %arrayidx11.us.2, align 4, !tbaa !28
%inc.us.2 = add nsw i32 %152, 1
store i32 %inc.us.2, ptr %arrayidx11.us.2, align 4, !tbaa !28
%indvars.iv.next159.2 = or i64 %indvars.iv158.2, 1
%153 = mul nuw nsw i64 %indvars.iv.next159.2, %0
%gep.us.2.1 = getelementptr i32, ptr %invariant.gep100.us, i64 %153
%154 = load i32, ptr %gep.us.2.1, align 4, !tbaa !28
%shr.us.2.1 = lshr i32 %154, 16
%and.us.2.1 = and i32 %shr.us.2.1, 255
%idxprom10.us.2.1 = zext i32 %and.us.2.1 to i64
%arrayidx11.us.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.2.1
%155 = load i32, ptr %arrayidx11.us.2.1, align 4, !tbaa !28
%inc.us.2.1 = add nsw i32 %155, 1
store i32 %inc.us.2.1, ptr %arrayidx11.us.2.1, align 4, !tbaa !28
%indvars.iv.next159.2.1 = add nuw nsw i64 %indvars.iv158.2, 2
%niter275.next.1 = add i64 %niter275, 2
%niter275.ncmp.1 = icmp eq i64 %niter275.next.1, %unroll_iter274
br i1 %niter275.ncmp.1, label %for.cond14.preheader.us.2.unr-lcssa, label %for.body7.us.2, !llvm.loop !30
for.cond14.preheader.us.2.unr-lcssa: ; preds = %for.body7.us.2, %for.body7.lr.ph.us.2
%indvars.iv158.2.unr = phi i64 [ 0, %for.body7.lr.ph.us.2 ], [ %indvars.iv.next159.2.1, %for.body7.us.2 ]
%lcmp.mod273.not = icmp eq i64 %xtraiter272, 0
br i1 %lcmp.mod273.not, label %for.cond14.preheader.us.2, label %for.body7.us.2.epil
for.body7.us.2.epil: ; preds = %for.cond14.preheader.us.2.unr-lcssa
%156 = mul nuw nsw i64 %indvars.iv158.2.unr, %0
%gep.us.2.epil = getelementptr i32, ptr %invariant.gep100.us, i64 %156
%157 = load i32, ptr %gep.us.2.epil, align 4, !tbaa !28
%shr.us.2.epil = lshr i32 %157, 16
%and.us.2.epil = and i32 %shr.us.2.epil, 255
%idxprom10.us.2.epil = zext i32 %and.us.2.epil to i64
%arrayidx11.us.2.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.2.epil
%158 = load i32, ptr %arrayidx11.us.2.epil, align 4, !tbaa !28
%inc.us.2.epil = add nsw i32 %158, 1
store i32 %inc.us.2.epil, ptr %arrayidx11.us.2.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.2
for.cond14.preheader.us.2: ; preds = %for.cond14.preheader.us.2.unr-lcssa, %for.body7.us.2.epil
%.pre191.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.2
for.body18.us.2: ; preds = %for.body18.us.2, %for.cond14.preheader.us.2
%159 = phi i32 [ %.pre191.pre, %for.cond14.preheader.us.2 ], [ %add.us.2.4, %for.body18.us.2 ]
%indvars.iv162.2 = phi i64 [ 1, %for.cond14.preheader.us.2 ], [ %indvars.iv.next163.2.4, %for.body18.us.2 ]
%arrayidx22.us.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv162.2
%160 = load i32, ptr %arrayidx22.us.2, align 4, !tbaa !28
%add.us.2 = add nsw i32 %160, %159
store i32 %add.us.2, ptr %arrayidx22.us.2, align 4, !tbaa !28
%indvars.iv.next163.2 = add nuw nsw i64 %indvars.iv162.2, 1
%arrayidx22.us.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.2
%161 = load i32, ptr %arrayidx22.us.2.1, align 4, !tbaa !28
%add.us.2.1 = add nsw i32 %161, %add.us.2
store i32 %add.us.2.1, ptr %arrayidx22.us.2.1, align 4, !tbaa !28
%indvars.iv.next163.2.1 = add nuw nsw i64 %indvars.iv162.2, 2
%arrayidx22.us.2.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.2.1
%162 = load i32, ptr %arrayidx22.us.2.2, align 4, !tbaa !28
%add.us.2.2 = add nsw i32 %162, %add.us.2.1
store i32 %add.us.2.2, ptr %arrayidx22.us.2.2, align 4, !tbaa !28
%indvars.iv.next163.2.2 = add nuw nsw i64 %indvars.iv162.2, 3
%arrayidx22.us.2.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.2.2
%163 = load i32, ptr %arrayidx22.us.2.3, align 4, !tbaa !28
%add.us.2.3 = add nsw i32 %163, %add.us.2.2
store i32 %add.us.2.3, ptr %arrayidx22.us.2.3, align 4, !tbaa !28
%indvars.iv.next163.2.3 = add nuw nsw i64 %indvars.iv162.2, 4
%arrayidx22.us.2.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.2.3
%164 = load i32, ptr %arrayidx22.us.2.4, align 4, !tbaa !28
%add.us.2.4 = add nsw i32 %164, %add.us.2.3
store i32 %add.us.2.4, ptr %arrayidx22.us.2.4, align 4, !tbaa !28
%indvars.iv.next163.2.4 = add nuw nsw i64 %indvars.iv162.2, 5
%exitcond166.2.not.4 = icmp eq i64 %indvars.iv.next163.2.4, 256
br i1 %exitcond166.2.not.4, label %for.body32.us105.2.preheader, label %for.body18.us.2, !llvm.loop !29
for.body32.us105.2.preheader: ; preds = %for.body18.us.2
%xtraiter276 = and i64 %113, 1
%lcmp.mod277.not = icmp eq i64 %xtraiter276, 0
br i1 %lcmp.mod277.not, label %for.body32.us105.2.prol.loopexit, label %for.body32.us105.2.prol
for.body32.us105.2.prol: ; preds = %for.body32.us105.2.preheader
%165 = mul nuw nsw i64 %1, %0
%gep101.us.2.prol = getelementptr i32, ptr %invariant.gep100.us, i64 %165
%166 = load i32, ptr %gep101.us.2.prol, align 4, !tbaa !28
%shr38.us108.2.prol = lshr i32 %166, 16
%and39.us109.2.prol = and i32 %shr38.us108.2.prol, 255
%idxprom40.us110.2.prol = zext i32 %and39.us109.2.prol to i64
%arrayidx41.us111.2.prol = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.2.prol
%167 = load i32, ptr %arrayidx41.us111.2.prol, align 4, !tbaa !28
%dec.us112.2.prol = add nsw i32 %167, -1
store i32 %dec.us112.2.prol, ptr %arrayidx41.us111.2.prol, align 4, !tbaa !28
%indvars.iv.next168.2.prol = add nsw i64 %1, -1
br label %for.body32.us105.2.prol.loopexit
for.body32.us105.2.prol.loopexit: ; preds = %for.body32.us105.2.prol, %for.body32.us105.2.preheader
%indvars.iv167.2.unr = phi i64 [ %1, %for.body32.us105.2.preheader ], [ %indvars.iv.next168.2.prol, %for.body32.us105.2.prol ]
%168 = icmp eq i32 %i26.097, 0
br i1 %168, label %for.body7.lr.ph.us.3, label %for.body32.us105.2
for.body32.us105.2: ; preds = %for.body32.us105.2.prol.loopexit, %for.body32.us105.2
%indvars.iv167.2 = phi i64 [ %indvars.iv.next168.2.1, %for.body32.us105.2 ], [ %indvars.iv167.2.unr, %for.body32.us105.2.prol.loopexit ]
%169 = mul nuw nsw i64 %indvars.iv167.2, %0
%gep101.us.2 = getelementptr i32, ptr %invariant.gep100.us, i64 %169
%170 = load i32, ptr %gep101.us.2, align 4, !tbaa !28
%shr38.us108.2 = lshr i32 %170, 16
%and39.us109.2 = and i32 %shr38.us108.2, 255
%idxprom40.us110.2 = zext i32 %and39.us109.2 to i64
%arrayidx41.us111.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.2
%171 = load i32, ptr %arrayidx41.us111.2, align 4, !tbaa !28
%dec.us112.2 = add nsw i32 %171, -1
store i32 %dec.us112.2, ptr %arrayidx41.us111.2, align 4, !tbaa !28
%indvars.iv.next168.2 = add nsw i64 %indvars.iv167.2, -1
%172 = mul nuw nsw i64 %indvars.iv.next168.2, %0
%gep101.us.2.1 = getelementptr i32, ptr %invariant.gep100.us, i64 %172
%173 = load i32, ptr %gep101.us.2.1, align 4, !tbaa !28
%shr38.us108.2.1 = lshr i32 %173, 16
%and39.us109.2.1 = and i32 %shr38.us108.2.1, 255
%idxprom40.us110.2.1 = zext i32 %and39.us109.2.1 to i64
%arrayidx41.us111.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.2.1
%174 = load i32, ptr %arrayidx41.us111.2.1, align 4, !tbaa !28
%dec.us112.2.1 = add nsw i32 %174, -1
store i32 %dec.us112.2.1, ptr %arrayidx41.us111.2.1, align 4, !tbaa !28
%indvars.iv.next168.2.1 = add nsw i64 %indvars.iv167.2, -2
%cmp29.us114.2.1 = icmp sgt i64 %indvars.iv167.2, 1
br i1 %cmp29.us114.2.1, label %for.body32.us105.2, label %for.body7.lr.ph.us.3, !llvm.loop !31
for.body7.lr.ph.us.3: ; preds = %for.body32.us105.2, %for.body32.us105.2.prol.loopexit
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
%xtraiter278 = and i64 %wide.trip.count, 1
%175 = icmp eq i64 %121, 0
br i1 %175, label %for.cond14.preheader.us.3.unr-lcssa, label %for.body7.lr.ph.us.3.new
for.body7.lr.ph.us.3.new: ; preds = %for.body7.lr.ph.us.3
%unroll_iter280 = and i64 %wide.trip.count, 4294967294
br label %for.body7.us.3
for.body7.us.3: ; preds = %for.body7.us.3, %for.body7.lr.ph.us.3.new
%indvars.iv158.3 = phi i64 [ 0, %for.body7.lr.ph.us.3.new ], [ %indvars.iv.next159.3.1, %for.body7.us.3 ]
%niter281 = phi i64 [ 0, %for.body7.lr.ph.us.3.new ], [ %niter281.next.1, %for.body7.us.3 ]
%176 = mul nuw nsw i64 %indvars.iv158.3, %0
%gep.us.3 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %176
%177 = load i32, ptr %gep.us.3, align 4, !tbaa !28
%shr.us.3 = lshr i32 %177, 24
%idxprom10.us.3 = zext i32 %shr.us.3 to i64
%arrayidx11.us.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.3
%178 = load i32, ptr %arrayidx11.us.3, align 4, !tbaa !28
%inc.us.3 = add nsw i32 %178, 1
store i32 %inc.us.3, ptr %arrayidx11.us.3, align 4, !tbaa !28
%indvars.iv.next159.3 = or i64 %indvars.iv158.3, 1
%179 = mul nuw nsw i64 %indvars.iv.next159.3, %0
%gep.us.3.1 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %179
%180 = load i32, ptr %gep.us.3.1, align 4, !tbaa !28
%shr.us.3.1 = lshr i32 %180, 24
%idxprom10.us.3.1 = zext i32 %shr.us.3.1 to i64
%arrayidx11.us.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.3.1
%181 = load i32, ptr %arrayidx11.us.3.1, align 4, !tbaa !28
%inc.us.3.1 = add nsw i32 %181, 1
store i32 %inc.us.3.1, ptr %arrayidx11.us.3.1, align 4, !tbaa !28
%indvars.iv.next159.3.1 = add nuw nsw i64 %indvars.iv158.3, 2
%niter281.next.1 = add i64 %niter281, 2
%niter281.ncmp.1 = icmp eq i64 %niter281.next.1, %unroll_iter280
br i1 %niter281.ncmp.1, label %for.cond14.preheader.us.3.unr-lcssa, label %for.body7.us.3, !llvm.loop !30
for.cond14.preheader.us.3.unr-lcssa: ; preds = %for.body7.us.3, %for.body7.lr.ph.us.3
%indvars.iv158.3.unr = phi i64 [ 0, %for.body7.lr.ph.us.3 ], [ %indvars.iv.next159.3.1, %for.body7.us.3 ]
%lcmp.mod279.not = icmp eq i64 %xtraiter278, 0
br i1 %lcmp.mod279.not, label %for.cond14.preheader.us.3, label %for.body7.us.3.epil
for.body7.us.3.epil: ; preds = %for.cond14.preheader.us.3.unr-lcssa
%182 = mul nuw nsw i64 %indvars.iv158.3.unr, %0
%gep.us.3.epil = getelementptr i32, ptr %invariant.gep100.us.1, i64 %182
%183 = load i32, ptr %gep.us.3.epil, align 4, !tbaa !28
%shr.us.3.epil = lshr i32 %183, 24
%idxprom10.us.3.epil = zext i32 %shr.us.3.epil to i64
%arrayidx11.us.3.epil = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom10.us.3.epil
%184 = load i32, ptr %arrayidx11.us.3.epil, align 4, !tbaa !28
%inc.us.3.epil = add nsw i32 %184, 1
store i32 %inc.us.3.epil, ptr %arrayidx11.us.3.epil, align 4, !tbaa !28
br label %for.cond14.preheader.us.3
for.cond14.preheader.us.3: ; preds = %for.cond14.preheader.us.3.unr-lcssa, %for.body7.us.3.epil
%.pre192.pre = load i32, ptr %c, align 16, !tbaa !28
br label %for.body18.us.3
for.body18.us.3: ; preds = %for.body18.us.3, %for.cond14.preheader.us.3
%185 = phi i32 [ %.pre192.pre, %for.cond14.preheader.us.3 ], [ %add.us.3.4, %for.body18.us.3 ]
%indvars.iv162.3 = phi i64 [ 1, %for.cond14.preheader.us.3 ], [ %indvars.iv.next163.3.4, %for.body18.us.3 ]
%arrayidx22.us.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv162.3
%186 = load i32, ptr %arrayidx22.us.3, align 4, !tbaa !28
%add.us.3 = add nsw i32 %186, %185
store i32 %add.us.3, ptr %arrayidx22.us.3, align 4, !tbaa !28
%indvars.iv.next163.3 = add nuw nsw i64 %indvars.iv162.3, 1
%arrayidx22.us.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.3
%187 = load i32, ptr %arrayidx22.us.3.1, align 4, !tbaa !28
%add.us.3.1 = add nsw i32 %187, %add.us.3
store i32 %add.us.3.1, ptr %arrayidx22.us.3.1, align 4, !tbaa !28
%indvars.iv.next163.3.1 = add nuw nsw i64 %indvars.iv162.3, 2
%arrayidx22.us.3.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.3.1
%188 = load i32, ptr %arrayidx22.us.3.2, align 4, !tbaa !28
%add.us.3.2 = add nsw i32 %188, %add.us.3.1
store i32 %add.us.3.2, ptr %arrayidx22.us.3.2, align 4, !tbaa !28
%indvars.iv.next163.3.2 = add nuw nsw i64 %indvars.iv162.3, 3
%arrayidx22.us.3.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.3.2
%189 = load i32, ptr %arrayidx22.us.3.3, align 4, !tbaa !28
%add.us.3.3 = add nsw i32 %189, %add.us.3.2
store i32 %add.us.3.3, ptr %arrayidx22.us.3.3, align 4, !tbaa !28
%indvars.iv.next163.3.3 = add nuw nsw i64 %indvars.iv162.3, 4
%arrayidx22.us.3.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next163.3.3
%190 = load i32, ptr %arrayidx22.us.3.4, align 4, !tbaa !28
%add.us.3.4 = add nsw i32 %190, %add.us.3.3
store i32 %add.us.3.4, ptr %arrayidx22.us.3.4, align 4, !tbaa !28
%indvars.iv.next163.3.4 = add nuw nsw i64 %indvars.iv162.3, 5
%exitcond166.3.not.4 = icmp eq i64 %indvars.iv.next163.3.4, 256
br i1 %exitcond166.3.not.4, label %for.body32.us105.3.preheader, label %for.body18.us.3, !llvm.loop !29
for.body32.us105.3.preheader: ; preds = %for.body18.us.3
%xtraiter282 = and i64 %113, 1
%lcmp.mod283.not = icmp eq i64 %xtraiter282, 0
br i1 %lcmp.mod283.not, label %for.body32.us105.3.prol.loopexit, label %for.body32.us105.3.prol
for.body32.us105.3.prol: ; preds = %for.body32.us105.3.preheader
%191 = mul nuw nsw i64 %1, %0
%gep101.us.3.prol = getelementptr i32, ptr %invariant.gep100.us.1, i64 %191
%192 = load i32, ptr %gep101.us.3.prol, align 4, !tbaa !28
%shr38.us108.3.prol = lshr i32 %192, 24
%idxprom40.us110.3.prol = zext i32 %shr38.us108.3.prol to i64
%arrayidx41.us111.3.prol = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.3.prol
%193 = load i32, ptr %arrayidx41.us111.3.prol, align 4, !tbaa !28
%dec.us112.3.prol = add nsw i32 %193, -1
store i32 %dec.us112.3.prol, ptr %arrayidx41.us111.3.prol, align 4, !tbaa !28
%indvars.iv.next168.3.prol = add nsw i64 %1, -1
br label %for.body32.us105.3.prol.loopexit
for.body32.us105.3.prol.loopexit: ; preds = %for.body32.us105.3.prol, %for.body32.us105.3.preheader
%indvars.iv167.3.unr = phi i64 [ %1, %for.body32.us105.3.preheader ], [ %indvars.iv.next168.3.prol, %for.body32.us105.3.prol ]
%194 = icmp eq i32 %i26.097, 0
br i1 %194, label %for.cond.cleanup, label %for.body32.us105.3
for.body32.us105.3: ; preds = %for.body32.us105.3.prol.loopexit, %for.body32.us105.3
%indvars.iv167.3 = phi i64 [ %indvars.iv.next168.3.1, %for.body32.us105.3 ], [ %indvars.iv167.3.unr, %for.body32.us105.3.prol.loopexit ]
%195 = mul nuw nsw i64 %indvars.iv167.3, %0
%gep101.us.3 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %195
%196 = load i32, ptr %gep101.us.3, align 4, !tbaa !28
%shr38.us108.3 = lshr i32 %196, 24
%idxprom40.us110.3 = zext i32 %shr38.us108.3 to i64
%arrayidx41.us111.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.3
%197 = load i32, ptr %arrayidx41.us111.3, align 4, !tbaa !28
%dec.us112.3 = add nsw i32 %197, -1
store i32 %dec.us112.3, ptr %arrayidx41.us111.3, align 4, !tbaa !28
%indvars.iv.next168.3 = add nsw i64 %indvars.iv167.3, -1
%198 = mul nuw nsw i64 %indvars.iv.next168.3, %0
%gep101.us.3.1 = getelementptr i32, ptr %invariant.gep100.us.1, i64 %198
%199 = load i32, ptr %gep101.us.3.1, align 4, !tbaa !28
%shr38.us108.3.1 = lshr i32 %199, 24
%idxprom40.us110.3.1 = zext i32 %shr38.us108.3.1 to i64
%arrayidx41.us111.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %idxprom40.us110.3.1
%200 = load i32, ptr %arrayidx41.us111.3.1, align 4, !tbaa !28
%dec.us112.3.1 = add nsw i32 %200, -1
store i32 %dec.us112.3.1, ptr %arrayidx41.us111.3.1, align 4, !tbaa !28
%indvars.iv.next168.3.1 = add nsw i64 %indvars.iv167.3, -2
%cmp29.us114.3.1 = icmp sgt i64 %indvars.iv167.3, 1
br i1 %cmp29.us114.3.1, label %for.body32.us105.3, label %for.cond.cleanup, !llvm.loop !31
for.cond.cleanup: ; preds = %for.body18.3, %for.body32.us105.3.prol.loopexit, %for.body32.us105.3, %for.body32.us.us.us.3
tail call void @free(ptr noundef %call) #9
call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %c) #9
ret void
for.cond28.preheader: ; preds = %for.body18
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
br label %for.body18.1
for.body18.1: ; preds = %for.body18.1, %for.cond28.preheader
%201 = phi i32 [ 0, %for.cond28.preheader ], [ %add.1.4, %for.body18.1 ]
%indvars.iv.1 = phi i64 [ 1, %for.cond28.preheader ], [ %indvars.iv.next.1.4, %for.body18.1 ]
%arrayidx22.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.1
%202 = load i32, ptr %arrayidx22.1, align 4, !tbaa !28
%add.1 = add nsw i32 %202, %201
store i32 %add.1, ptr %arrayidx22.1, align 4, !tbaa !28
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
%arrayidx22.1.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.1
%203 = load i32, ptr %arrayidx22.1.1, align 4, !tbaa !28
%add.1.1 = add nsw i32 %203, %add.1
store i32 %add.1.1, ptr %arrayidx22.1.1, align 4, !tbaa !28
%indvars.iv.next.1.1 = add nuw nsw i64 %indvars.iv.1, 2
%arrayidx22.1.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.1.1
%204 = load i32, ptr %arrayidx22.1.2, align 4, !tbaa !28
%add.1.2 = add nsw i32 %204, %add.1.1
store i32 %add.1.2, ptr %arrayidx22.1.2, align 4, !tbaa !28
%indvars.iv.next.1.2 = add nuw nsw i64 %indvars.iv.1, 3
%arrayidx22.1.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.1.2
%205 = load i32, ptr %arrayidx22.1.3, align 4, !tbaa !28
%add.1.3 = add nsw i32 %205, %add.1.2
store i32 %add.1.3, ptr %arrayidx22.1.3, align 4, !tbaa !28
%indvars.iv.next.1.3 = add nuw nsw i64 %indvars.iv.1, 4
%arrayidx22.1.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.1.3
%206 = load i32, ptr %arrayidx22.1.4, align 4, !tbaa !28
%add.1.4 = add nsw i32 %206, %add.1.3
store i32 %add.1.4, ptr %arrayidx22.1.4, align 4, !tbaa !28
%indvars.iv.next.1.4 = add nuw nsw i64 %indvars.iv.1, 5
%exitcond.1.not.4 = icmp eq i64 %indvars.iv.next.1.4, 256
br i1 %exitcond.1.not.4, label %for.cond28.preheader.1, label %for.body18.1, !llvm.loop !29
for.cond28.preheader.1: ; preds = %for.body18.1
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
br label %for.body18.2
for.body18.2: ; preds = %for.body18.2, %for.cond28.preheader.1
%207 = phi i32 [ 0, %for.cond28.preheader.1 ], [ %add.2.4, %for.body18.2 ]
%indvars.iv.2 = phi i64 [ 1, %for.cond28.preheader.1 ], [ %indvars.iv.next.2.4, %for.body18.2 ]
%arrayidx22.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.2
%208 = load i32, ptr %arrayidx22.2, align 4, !tbaa !28
%add.2 = add nsw i32 %208, %207
store i32 %add.2, ptr %arrayidx22.2, align 4, !tbaa !28
%indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
%arrayidx22.2.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.2
%209 = load i32, ptr %arrayidx22.2.1, align 4, !tbaa !28
%add.2.1 = add nsw i32 %209, %add.2
store i32 %add.2.1, ptr %arrayidx22.2.1, align 4, !tbaa !28
%indvars.iv.next.2.1 = add nuw nsw i64 %indvars.iv.2, 2
%arrayidx22.2.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.2.1
%210 = load i32, ptr %arrayidx22.2.2, align 4, !tbaa !28
%add.2.2 = add nsw i32 %210, %add.2.1
store i32 %add.2.2, ptr %arrayidx22.2.2, align 4, !tbaa !28
%indvars.iv.next.2.2 = add nuw nsw i64 %indvars.iv.2, 3
%arrayidx22.2.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.2.2
%211 = load i32, ptr %arrayidx22.2.3, align 4, !tbaa !28
%add.2.3 = add nsw i32 %211, %add.2.2
store i32 %add.2.3, ptr %arrayidx22.2.3, align 4, !tbaa !28
%indvars.iv.next.2.3 = add nuw nsw i64 %indvars.iv.2, 4
%arrayidx22.2.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.2.3
%212 = load i32, ptr %arrayidx22.2.4, align 4, !tbaa !28
%add.2.4 = add nsw i32 %212, %add.2.3
store i32 %add.2.4, ptr %arrayidx22.2.4, align 4, !tbaa !28
%indvars.iv.next.2.4 = add nuw nsw i64 %indvars.iv.2, 5
%exitcond.2.not.4 = icmp eq i64 %indvars.iv.next.2.4, 256
br i1 %exitcond.2.not.4, label %for.cond28.preheader.2, label %for.body18.2, !llvm.loop !29
for.cond28.preheader.2: ; preds = %for.body18.2
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(1024) %c, i8 0, i64 1024, i1 false)
br label %for.body18.3
for.body18.3: ; preds = %for.body18.3, %for.cond28.preheader.2
%213 = phi i32 [ 0, %for.cond28.preheader.2 ], [ %add.3.4, %for.body18.3 ]
%indvars.iv.3 = phi i64 [ 1, %for.cond28.preheader.2 ], [ %indvars.iv.next.3.4, %for.body18.3 ]
%arrayidx22.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.3
%214 = load i32, ptr %arrayidx22.3, align 4, !tbaa !28
%add.3 = add nsw i32 %214, %213
store i32 %add.3, ptr %arrayidx22.3, align 4, !tbaa !28
%indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
%arrayidx22.3.1 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.3
%215 = load i32, ptr %arrayidx22.3.1, align 4, !tbaa !28
%add.3.1 = add nsw i32 %215, %add.3
store i32 %add.3.1, ptr %arrayidx22.3.1, align 4, !tbaa !28
%indvars.iv.next.3.1 = add nuw nsw i64 %indvars.iv.3, 2
%arrayidx22.3.2 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.3.1
%216 = load i32, ptr %arrayidx22.3.2, align 4, !tbaa !28
%add.3.2 = add nsw i32 %216, %add.3.1
store i32 %add.3.2, ptr %arrayidx22.3.2, align 4, !tbaa !28
%indvars.iv.next.3.2 = add nuw nsw i64 %indvars.iv.3, 3
%arrayidx22.3.3 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.3.2
%217 = load i32, ptr %arrayidx22.3.3, align 4, !tbaa !28
%add.3.3 = add nsw i32 %217, %add.3.2
store i32 %add.3.3, ptr %arrayidx22.3.3, align 4, !tbaa !28
%indvars.iv.next.3.3 = add nuw nsw i64 %indvars.iv.3, 4
%arrayidx22.3.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.3.3
%218 = load i32, ptr %arrayidx22.3.4, align 4, !tbaa !28
%add.3.4 = add nsw i32 %218, %add.3.3
store i32 %add.3.4, ptr %arrayidx22.3.4, align 4, !tbaa !28
%indvars.iv.next.3.4 = add nuw nsw i64 %indvars.iv.3, 5
%exitcond.3.not.4 = icmp eq i64 %indvars.iv.next.3.4, 256
br i1 %exitcond.3.not.4, label %for.cond.cleanup, label %for.body18.3, !llvm.loop !29
for.body18: ; preds = %for.body18, %for.body.preheader
%219 = phi i32 [ 0, %for.body.preheader ], [ %add.4, %for.body18 ]
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next.4, %for.body18 ]
%arrayidx22 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv
%220 = load i32, ptr %arrayidx22, align 4, !tbaa !28
%add = add nsw i32 %220, %219
store i32 %add, ptr %arrayidx22, align 4, !tbaa !28
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx22.1218 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next
%221 = load i32, ptr %arrayidx22.1218, align 4, !tbaa !28
%add.1219 = add nsw i32 %221, %add
store i32 %add.1219, ptr %arrayidx22.1218, align 4, !tbaa !28
%indvars.iv.next.1220 = add nuw nsw i64 %indvars.iv, 2
%arrayidx22.2223 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.1220
%222 = load i32, ptr %arrayidx22.2223, align 4, !tbaa !28
%add.2224 = add nsw i32 %222, %add.1219
store i32 %add.2224, ptr %arrayidx22.2223, align 4, !tbaa !28
%indvars.iv.next.2225 = add nuw nsw i64 %indvars.iv, 3
%arrayidx22.3228 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.2225
%223 = load i32, ptr %arrayidx22.3228, align 4, !tbaa !28
%add.3229 = add nsw i32 %223, %add.2224
store i32 %add.3229, ptr %arrayidx22.3228, align 4, !tbaa !28
%indvars.iv.next.3230 = add nuw nsw i64 %indvars.iv, 4
%arrayidx22.4 = getelementptr inbounds [256 x i32], ptr %c, i64 0, i64 %indvars.iv.next.3230
%224 = load i32, ptr %arrayidx22.4, align 4, !tbaa !28
%add.4 = add nsw i32 %224, %add.3229
store i32 %add.4, ptr %arrayidx22.4, align 4, !tbaa !28
%indvars.iv.next.4 = add nuw nsw i64 %indvars.iv, 5
%exitcond.not.4 = icmp eq i64 %indvars.iv.next.4, 256
br i1 %exitcond.not.4, label %for.cond28.preheader, label %for.body18, !llvm.loop !29
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 @nextint()
%cmp177 = icmp sgt i32 %call, 0
br i1 %cmp177, label %for.body.preheader, label %for.cond.cleanup12
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %call to i64
br label %for.body
for.cond.cleanup: ; preds = %for.body
%cmp11179 = icmp sgt i32 %call, 1
br i1 %cmp11179, label %for.body13.preheader, label %for.cond.cleanup12
for.body13.preheader: ; preds = %for.cond.cleanup
%0 = load i32, ptr getelementptr inbounds ([200000 x [2 x i32]], ptr @p, i64 0, i64 0, i64 1), align 4, !tbaa !28
%1 = load i32, ptr @p, align 16, !tbaa !28
%add = add nsw i32 %0, %1
%sub = sub nsw i32 %1, %0
%wide.trip.count190 = zext i32 %call to i64
br label %for.body13
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%call1 = tail call i32 @nextint()
%arrayidx = getelementptr inbounds [200000 x [2 x i32]], ptr @p, i64 0, i64 %indvars.iv
store i32 %call1, ptr %arrayidx, align 8, !tbaa !28
%call3 = tail call i32 @nextint()
%arrayidx6 = getelementptr inbounds [200000 x [2 x i32]], ptr @p, i64 0, i64 %indvars.iv, i64 1
store i32 %call3, ptr %arrayidx6, align 4, !tbaa !28
%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 !32
for.cond.cleanup12: ; preds = %for.body13, %entry, %for.cond.cleanup
%ans.0.lcssa = phi i64 [ 0, %for.cond.cleanup ], [ 0, %entry ], [ %ans.4, %for.body13 ]
%call131 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %ans.0.lcssa)
ret i32 0
for.body13: ; preds = %for.body13.preheader, %for.body13
%indvars.iv187 = phi i64 [ 1, %for.body13.preheader ], [ %indvars.iv.next188, %for.body13 ]
%a1.0185 = phi i32 [ %sub, %for.body13.preheader ], [ %a1.1, %for.body13 ]
%ans.0183 = phi i64 [ 0, %for.body13.preheader ], [ %ans.4, %for.body13 ]
%b2.0182 = phi i32 [ %add, %for.body13.preheader ], [ %b2.1, %for.body13 ]
%b1.0181 = phi i32 [ %add, %for.body13.preheader ], [ %b1.1, %for.body13 ]
%a2.0180 = phi i32 [ %sub, %for.body13.preheader ], [ %a2.1, %for.body13 ]
%arrayidx15 = getelementptr inbounds [200000 x [2 x i32]], ptr @p, i64 0, i64 %indvars.iv187
%2 = load i32, ptr %arrayidx15, align 8, !tbaa !28
%arrayidx19 = getelementptr inbounds [200000 x [2 x i32]], ptr @p, i64 0, i64 %indvars.iv187, i64 1
%3 = load i32, ptr %arrayidx19, align 4, !tbaa !28
%4 = add i32 %a1.0185, %3
%sub21 = sub i32 %2, %4
%5 = tail call i32 @llvm.abs.i32(i32 %sub21, i1 false)
%spec.select = zext i32 %5 to i64
%ans.1 = tail call i64 @llvm.smax.i64(i64 %ans.0183, i64 %spec.select)
%6 = add i32 %a2.0180, %3
%sub37 = sub i32 %2, %6
%7 = tail call i32 @llvm.abs.i32(i32 %sub37, i1 false)
%now29.0 = zext i32 %7 to i64
%ans.2 = tail call i64 @llvm.umax.i64(i64 %ans.1, i64 %now29.0)
%add55 = add nsw i32 %3, %2
%sub56 = sub nsw i32 %add55, %b1.0181
%8 = tail call i32 @llvm.abs.i32(i32 %sub56, i1 false)
%now48.0 = zext i32 %8 to i64
%ans.3 = tail call i64 @llvm.umax.i64(i64 %ans.2, i64 %now48.0)
%sub75 = sub nsw i32 %add55, %b2.0182
%9 = tail call i32 @llvm.abs.i32(i32 %sub75, i1 false)
%now67.0 = zext i32 %9 to i64
%ans.4 = tail call i64 @llvm.umax.i64(i64 %ans.3, i64 %now67.0)
%sub93 = sub nsw i32 %2, %3
%a1.1 = tail call i32 @llvm.smax.i32(i32 %sub93, i32 %a1.0185)
%a2.1 = tail call i32 @llvm.smin.i32(i32 %sub93, i32 %a2.0180)
%b1.1 = tail call i32 @llvm.smax.i32(i32 %add55, i32 %b1.0181)
%b2.1 = tail call i32 @llvm.smin.i32(i32 %add55, i32 %b2.0182)
%indvars.iv.next188 = add nuw nsw i64 %indvars.iv187, 1
%exitcond191.not = icmp eq i64 %indvars.iv.next188, %wide.trip.count190
br i1 %exitcond191.not, label %for.cond.cleanup12, label %for.body13, !llvm.loop !33
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
declare i32 @__uflow(ptr noundef) local_unnamed_addr #6
declare i32 @__overflow(ptr noundef, i32 noundef) local_unnamed_addr #6
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #8
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #8
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 8}
!10 = !{!"_IO_FILE", !11, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !11, i64 116, !12, i64 120, !13, i64 128, !7, i64 130, !7, i64 131, !6, i64 136, !12, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !12, i64 184, !11, i64 192, !7, i64 196}
!11 = !{!"int", !7, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!"branch_weights", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !18}
!24 = !{!10, !6, i64 40}
!25 = !{!10, !6, i64 48}
!26 = distinct !{!26, !18}
!27 = distinct !{!27, !18}
!28 = !{!11, !11, i64 0}
!29 = distinct !{!29, !18}
!30 = distinct !{!30, !18}
!31 = distinct !{!31, !18}
!32 = distinct !{!32, !18}
!33 = distinct !{!33, !18}
|
#include<stdio.h>
int main(){
int n,m;
int sum=0;
int count=0;
scanf("%d%d",&n,&m);
int a[n];
for(int i=0;i<n;i++){
scanf("%d ",&a[i]);
sum+=a[i];
}
for(int i=0;i<n;i++){
if(a[i]*4*m>=sum)
count++;
}
if(count>=m){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118407/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118407/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 \00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%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
%cmp30 = icmp sgt i32 %3, 0
br i1 %cmp30, label %for.body, label %for.cond5.preheader.thread
for.cond5.preheader.thread: ; preds = %entry
%.pre46 = load i32, ptr %m, align 4, !tbaa !5
br label %for.cond.cleanup7
for.cond5.preheader: ; preds = %for.body
%cmp634 = icmp sgt i32 %19, 0
%.pre = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp634, label %for.body8.lr.ph, label %for.cond.cleanup7
for.body8.lr.ph: ; preds = %for.cond5.preheader
%wide.trip.count = zext i32 %19 to i64
%min.iters.check = icmp ult i32 %19, 8
br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph
vector.ph: ; preds = %for.body8.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert50 = insertelement <4 x i32> poison, i32 %add, i64 0
%broadcast.splat51 = shufflevector <4 x i32> %broadcast.splatinsert50, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%vec.phi48 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%4 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load49 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = shl nsw <4 x i32> %wide.load, <i32 2, i32 2, i32 2, i32 2>
%7 = shl nsw <4 x i32> %wide.load49, <i32 2, i32 2, i32 2, i32 2>
%8 = mul nsw <4 x i32> %6, %broadcast.splat
%9 = mul nsw <4 x i32> %7, %broadcast.splat
%10 = icmp sge <4 x i32> %8, %broadcast.splat51
%11 = icmp sge <4 x i32> %9, %broadcast.splat51
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = zext <4 x i1> %11 to <4 x i32>
%14 = add <4 x i32> %vec.phi, %12
%15 = add <4 x i32> %vec.phi48, %13
%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 !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %15, %14
%17 = 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.cleanup7, label %for.body8.preheader
for.body8.preheader: ; preds = %for.body8.lr.ph, %middle.block
%indvars.iv40.ph = phi i64 [ 0, %for.body8.lr.ph ], [ %n.vec, %middle.block ]
%count.035.ph = phi i32 [ 0, %for.body8.lr.ph ], [ %17, %middle.block ]
br label %for.body8
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.031 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%18 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %18, %sum.031
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%19 = load i32, ptr %n, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp = icmp slt i64 %indvars.iv.next, %20
br i1 %cmp, label %for.body, label %for.cond5.preheader, !llvm.loop !13
for.cond.cleanup7: ; preds = %for.body8, %middle.block, %for.cond5.preheader.thread, %for.cond5.preheader
%.pre47 = phi i32 [ %.pre, %for.cond5.preheader ], [ %.pre46, %for.cond5.preheader.thread ], [ %.pre, %middle.block ], [ %.pre, %for.body8 ]
%count.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %for.cond5.preheader.thread ], [ %17, %middle.block ], [ %spec.select, %for.body8 ]
%cmp17.not = icmp slt i32 %count.0.lcssa, %.pre47
%str.str.4 = select i1 %cmp17.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.stackrestore.p0(ptr %2)
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.body8: ; preds = %for.body8.preheader, %for.body8
%indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body8 ], [ %indvars.iv40.ph, %for.body8.preheader ]
%count.035 = phi i32 [ %spec.select, %for.body8 ], [ %count.035.ph, %for.body8.preheader ]
%arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv40
%21 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%mul = shl nsw i32 %21, 2
%mul11 = mul nsw i32 %mul, %.pre
%cmp12.not = icmp sge i32 %mul11, %add
%inc13 = zext i1 %cmp12.not to i32
%spec.select = add nuw nsw i32 %count.035, %inc13
%indvars.iv.next41 = add nuw nsw i64 %indvars.iv40, 1
%exitcond.not = icmp eq i64 %indvars.iv.next41, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup7, label %for.body8, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main(void)
{
int n,m;
scanf("%d", &n);
scanf("%d", &m);
int a[n],i,j = 0;
double sum = 0;
for(i = 0;i < n;i++)
{
scanf("%d", &a[i]);
sum = sum + a[i];
}
m = m*4;
for(i = 0;i < n;i++)
{
if(a[i] >= sum / m)
j++;
}
if(j >= m / 4)
printf("Yes\n");
else
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118450/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118450/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.3 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = 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 = 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)
%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
%cmp35 = icmp sgt i32 %3, 0
br i1 %cmp35, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%4 = load i32, ptr %m, align 4, !tbaa !5
%mul50 = shl nsw i32 %4, 2
store i32 %mul50, ptr %m, align 4, !tbaa !5
br label %for.end18
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.037 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%5 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sitofp i32 %5 to double
%add = fadd double %sum.037, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp = icmp slt i64 %indvars.iv.next, %7
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%8 = load i32, ptr %m, align 4, !tbaa !5
%mul = shl nsw i32 %8, 2
store i32 %mul, ptr %m, align 4, !tbaa !5
%cmp639 = icmp sgt i32 %6, 0
br i1 %cmp639, label %for.body8.lr.ph, label %for.end18
for.body8.lr.ph: ; preds = %for.end
%conv12 = sitofp i32 %mul to double
%div = fdiv double %add, %conv12
%wide.trip.count = zext i32 %6 to i64
%min.iters.check = icmp ult i32 %6, 8
br i1 %min.iters.check, label %for.body8.preheader, label %vector.ph
vector.ph: ; preds = %for.body8.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x double> poison, double %div, i64 0
%broadcast.splat = shufflevector <4 x double> %broadcast.splatinsert, <4 x double> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%vec.phi52 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %18, %vector.body ]
%9 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
%wide.load53 = load <4 x i32>, ptr %10, align 16, !tbaa !5
%11 = sitofp <4 x i32> %wide.load to <4 x double>
%12 = sitofp <4 x i32> %wide.load53 to <4 x double>
%13 = fcmp ole <4 x double> %broadcast.splat, %11
%14 = fcmp ole <4 x double> %broadcast.splat, %12
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = zext <4 x i1> %14 to <4 x i32>
%17 = add <4 x i32> %vec.phi, %15
%18 = add <4 x i32> %vec.phi52, %16
%index.next = add nuw i64 %index, 8
%19 = icmp eq i64 %index.next, %n.vec
br i1 %19, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %18, %17
%20 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end18, label %for.body8.preheader
for.body8.preheader: ; preds = %for.body8.lr.ph, %middle.block
%indvars.iv45.ph = phi i64 [ 0, %for.body8.lr.ph ], [ %n.vec, %middle.block ]
%j.041.ph = phi i32 [ 0, %for.body8.lr.ph ], [ %20, %middle.block ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader, %for.body8
%indvars.iv45 = phi i64 [ %indvars.iv.next46, %for.body8 ], [ %indvars.iv45.ph, %for.body8.preheader ]
%j.041 = phi i32 [ %j.1, %for.body8 ], [ %j.041.ph, %for.body8.preheader ]
%arrayidx10 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv45
%21 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%conv11 = sitofp i32 %21 to double
%cmp13 = fcmp ole double %div, %conv11
%inc15 = zext i1 %cmp13 to i32
%j.1 = add nuw nsw i32 %j.041, %inc15
%indvars.iv.next46 = add nuw nsw i64 %indvars.iv45, 1
%exitcond.not = icmp eq i64 %indvars.iv.next46, %wide.trip.count
br i1 %exitcond.not, label %for.end18, label %for.body8, !llvm.loop !14
for.end18: ; preds = %for.body8, %middle.block, %for.end.thread, %for.end
%22 = phi i32 [ %8, %for.end ], [ %4, %for.end.thread ], [ %8, %middle.block ], [ %8, %for.body8 ]
%j.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %for.end.thread ], [ %20, %middle.block ], [ %j.1, %for.body8 ]
%cmp20.not = icmp slt i32 %j.0.lcssa, %22
%str.str.3 = select i1 %cmp20.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.stackrestore.p0(ptr %2)
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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree 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, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include <stdio.h>
int main(void){
int N, M, i;
int flag=0;
double sum = 0;
scanf("%d %d", &N, &M);
int a[N];
for(i=0;i<N;i++){
scanf("%d",&a[i]);
sum += a[i];
}
for(i=0;i<N;i++)
if(a[i]*4*M >= sum)
flag++;
if(flag >= M)
printf("Yes\n");
else
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118494/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118494/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%M = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %N, align 4, !tbaa !5
%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
%cmp33 = icmp sgt i32 %3, 0
br i1 %cmp33, label %for.body, label %for.cond4.preheader.thread
for.cond4.preheader.thread: ; preds = %entry
%.pre49 = load i32, ptr %M, align 4, !tbaa !5
br label %for.end17
for.cond4.preheader: ; preds = %for.body
%cmp537 = icmp sgt i32 %21, 0
%.pre = load i32, ptr %M, align 4, !tbaa !5
br i1 %cmp537, label %for.body7.lr.ph, label %for.end17
for.body7.lr.ph: ; preds = %for.cond4.preheader
%wide.trip.count = zext i32 %21 to i64
%min.iters.check = icmp ult i32 %21, 8
br i1 %min.iters.check, label %for.body7.preheader, label %vector.ph
vector.ph: ; preds = %for.body7.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert53 = insertelement <4 x double> poison, double %add, i64 0
%broadcast.splat54 = shufflevector <4 x double> %broadcast.splatinsert53, <4 x double> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%vec.phi51 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%4 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load52 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = shl nsw <4 x i32> %wide.load, <i32 2, i32 2, i32 2, i32 2>
%7 = shl nsw <4 x i32> %wide.load52, <i32 2, i32 2, i32 2, i32 2>
%8 = mul nsw <4 x i32> %6, %broadcast.splat
%9 = mul nsw <4 x i32> %7, %broadcast.splat
%10 = sitofp <4 x i32> %8 to <4 x double>
%11 = sitofp <4 x i32> %9 to <4 x double>
%12 = fcmp ole <4 x double> %broadcast.splat54, %10
%13 = fcmp ole <4 x double> %broadcast.splat54, %11
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi, %14
%17 = add <4 x i32> %vec.phi51, %15
%index.next = add nuw i64 %index, 8
%18 = icmp eq i64 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %17, %16
%19 = 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.end17, label %for.body7.preheader
for.body7.preheader: ; preds = %for.body7.lr.ph, %middle.block
%indvars.iv43.ph = phi i64 [ 0, %for.body7.lr.ph ], [ %n.vec, %middle.block ]
%flag.038.ph = phi i32 [ 0, %for.body7.lr.ph ], [ %19, %middle.block ]
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.034 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%20 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sitofp i32 %20 to double
%add = fadd double %sum.034, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%21 = load i32, ptr %N, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp = icmp slt i64 %indvars.iv.next, %22
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13
for.body7: ; preds = %for.body7.preheader, %for.body7
%indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body7 ], [ %indvars.iv43.ph, %for.body7.preheader ]
%flag.038 = phi i32 [ %flag.1, %for.body7 ], [ %flag.038.ph, %for.body7.preheader ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv43
%23 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%mul = shl nsw i32 %23, 2
%mul10 = mul nsw i32 %mul, %.pre
%conv11 = sitofp i32 %mul10 to double
%cmp12 = fcmp ole double %add, %conv11
%inc14 = zext i1 %cmp12 to i32
%flag.1 = add nuw nsw i32 %flag.038, %inc14
%indvars.iv.next44 = add nuw nsw i64 %indvars.iv43, 1
%exitcond.not = icmp eq i64 %indvars.iv.next44, %wide.trip.count
br i1 %exitcond.not, label %for.end17, label %for.body7, !llvm.loop !14
for.end17: ; preds = %for.body7, %middle.block, %for.cond4.preheader.thread, %for.cond4.preheader
%.pre50 = phi i32 [ %.pre, %for.cond4.preheader ], [ %.pre49, %for.cond4.preheader.thread ], [ %.pre, %middle.block ], [ %.pre, %for.body7 ]
%flag.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %for.cond4.preheader.thread ], [ %19, %middle.block ], [ %flag.1, %for.body7 ]
%cmp18.not = icmp slt i32 %flag.0.lcssa, %.pre50
%str.str.4 = select i1 %cmp18.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.stackrestore.p0(ptr %2)
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: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree 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, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main(void){
int n,m,i,k,c=0,sum=0;
int v[200];
(void)scanf("%d %d",&n,&m);
for(i=1;i<=n;i++){
(void)scanf("%d",&k);
v[i]=k;
sum+=k;
}
for(i=1;i<=n;i++){
if(4*v[i]*m>=sum)c++;
}
if(c>=m){
printf("Yes\n");
}else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118537/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118537/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%k = alloca i32, align 4
%v = alloca [200 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 %k) #5
call void @llvm.lifetime.start.p0(i64 800, ptr nonnull %v) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not26 = icmp slt i32 %0, 1
br i1 %cmp.not26, label %for.cond2.preheader.thread, label %for.body
for.cond2.preheader.thread: ; preds = %entry
%.pre42 = load i32, ptr %m, align 4, !tbaa !5
br label %for.end12
for.cond2.preheader: ; preds = %for.body
%cmp3.not30 = icmp slt i32 %18, 1
%.pre = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp3.not30, label %for.end12, label %for.body4.lr.ph
for.body4.lr.ph: ; preds = %for.cond2.preheader
%1 = add nuw i32 %18, 1
%wide.trip.count = zext i32 %1 to i64
%2 = add nsw i64 %wide.trip.count, -1
%min.iters.check = icmp ult i32 %18, 8
br i1 %min.iters.check, label %for.body4.preheader, label %vector.ph
vector.ph: ; preds = %for.body4.lr.ph
%n.vec = and i64 %2, -8
%ind.end = or i64 %n.vec, 1
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert46 = insertelement <4 x i32> poison, i32 %add, i64 0
%broadcast.splat47 = shufflevector <4 x i32> %broadcast.splatinsert46, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%vec.phi44 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %14, %vector.body ]
%offset.idx = or i64 %index, 1
%3 = getelementptr inbounds [200 x i32], ptr %v, i64 0, i64 %offset.idx
%wide.load = load <4 x i32>, ptr %3, align 4, !tbaa !5
%4 = getelementptr inbounds i32, ptr %3, i64 4
%wide.load45 = load <4 x i32>, ptr %4, align 4, !tbaa !5
%5 = shl nsw <4 x i32> %wide.load, <i32 2, i32 2, i32 2, i32 2>
%6 = shl nsw <4 x i32> %wide.load45, <i32 2, i32 2, i32 2, i32 2>
%7 = mul nsw <4 x i32> %5, %broadcast.splat
%8 = mul nsw <4 x i32> %6, %broadcast.splat
%9 = icmp sge <4 x i32> %7, %broadcast.splat47
%10 = icmp sge <4 x i32> %8, %broadcast.splat47
%11 = zext <4 x i1> %9 to <4 x i32>
%12 = zext <4 x i1> %10 to <4 x i32>
%13 = add <4 x i32> %vec.phi, %11
%14 = add <4 x i32> %vec.phi44, %12
%index.next = add nuw i64 %index, 8
%15 = icmp eq i64 %index.next, %n.vec
br i1 %15, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %14, %13
%16 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %2, %n.vec
br i1 %cmp.n, label %for.end12, label %for.body4.preheader
for.body4.preheader: ; preds = %for.body4.lr.ph, %middle.block
%indvars.iv36.ph = phi i64 [ 1, %for.body4.lr.ph ], [ %ind.end, %middle.block ]
%c.032.ph = phi i32 [ 0, %for.body4.lr.ph ], [ %16, %middle.block ]
br label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%sum.028 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %k)
%17 = load i32, ptr %k, align 4, !tbaa !5
%arrayidx = getelementptr inbounds [200 x i32], ptr %v, i64 0, i64 %indvars.iv
store i32 %17, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %17, %sum.028
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %19
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !13
for.body4: ; preds = %for.body4.preheader, %for.body4
%indvars.iv36 = phi i64 [ %indvars.iv.next37, %for.body4 ], [ %indvars.iv36.ph, %for.body4.preheader ]
%c.032 = phi i32 [ %spec.select, %for.body4 ], [ %c.032.ph, %for.body4.preheader ]
%arrayidx6 = getelementptr inbounds [200 x i32], ptr %v, i64 0, i64 %indvars.iv36
%20 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%mul = shl nsw i32 %20, 2
%mul7 = mul nsw i32 %mul, %.pre
%cmp8.not = icmp sge i32 %mul7, %add
%inc9 = zext i1 %cmp8.not to i32
%spec.select = add nuw nsw i32 %c.032, %inc9
%indvars.iv.next37 = add nuw nsw i64 %indvars.iv36, 1
%exitcond.not = icmp eq i64 %indvars.iv.next37, %wide.trip.count
br i1 %exitcond.not, label %for.end12, label %for.body4, !llvm.loop !14
for.end12: ; preds = %for.body4, %middle.block, %for.cond2.preheader.thread, %for.cond2.preheader
%.pre43 = phi i32 [ %.pre, %for.cond2.preheader ], [ %.pre42, %for.cond2.preheader.thread ], [ %.pre, %middle.block ], [ %.pre, %for.body4 ]
%c.0.lcssa = phi i32 [ 0, %for.cond2.preheader ], [ 0, %for.cond2.preheader.thread ], [ %16, %middle.block ], [ %spec.select, %for.body4 ]
%cmp13.not = icmp slt i32 %c.0.lcssa, %.pre43
%str.str.4 = select i1 %cmp13.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.lifetime.end.p0(i64 800, ptr nonnull %v) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main(void){
int m,n;
scanf("%d %d",&n,&m);
int a[n];
int i;
int sum = 0;
for(i = 0;i < n;i++){
scanf("%d",&a[i]);
sum+=a[i];
}
int cnt=0;
for(i=0;i < n;i++){
if(sum <= (4*m*a[i])){
cnt++;
}
}
if(cnt >= m){
printf("Yes");
}
else{
printf("No");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118580/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118580/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [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:
%m = alloca i32, align 4
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%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
%cmp28 = icmp sgt i32 %3, 0
br i1 %cmp28, label %for.body, label %for.cond4.preheader.thread
for.cond4.preheader.thread: ; preds = %entry
%.pre44 = load i32, ptr %m, align 4, !tbaa !5
br label %for.end14
for.cond4.preheader: ; preds = %for.body
%cmp532 = icmp sgt i32 %17, 0
%.pre = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp532, label %for.body6.lr.ph, label %for.end14
for.body6.lr.ph: ; preds = %for.cond4.preheader
%mul = shl nsw i32 %.pre, 2
%wide.trip.count = zext i32 %17 to i64
%min.iters.check = icmp ult i32 %17, 8
br i1 %min.iters.check, label %for.body6.preheader, label %vector.ph
vector.ph: ; preds = %for.body6.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %mul, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert48 = insertelement <4 x i32> poison, i32 %add, i64 0
%broadcast.splat49 = shufflevector <4 x i32> %broadcast.splatinsert48, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %13, %vector.body ]
%4 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %4, align 16, !tbaa !5
%5 = getelementptr inbounds i32, ptr %4, i64 4
%wide.load47 = load <4 x i32>, ptr %5, align 16, !tbaa !5
%6 = mul nsw <4 x i32> %broadcast.splat, %wide.load
%7 = mul nsw <4 x i32> %broadcast.splat, %wide.load47
%8 = icmp sle <4 x i32> %broadcast.splat49, %6
%9 = icmp sle <4 x i32> %broadcast.splat49, %7
%10 = zext <4 x i1> %8 to <4 x i32>
%11 = zext <4 x i1> %9 to <4 x i32>
%12 = add <4 x i32> %vec.phi, %10
%13 = add <4 x i32> %vec.phi46, %11
%index.next = add nuw i64 %index, 8
%14 = icmp eq i64 %index.next, %n.vec
br i1 %14, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %13, %12
%15 = 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.end14, label %for.body6.preheader
for.body6.preheader: ; preds = %for.body6.lr.ph, %middle.block
%indvars.iv38.ph = phi i64 [ 0, %for.body6.lr.ph ], [ %n.vec, %middle.block ]
%cnt.034.ph = phi i32 [ 0, %for.body6.lr.ph ], [ %15, %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 i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%16 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %16, %sum.030
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%17 = load i32, ptr %n, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp = icmp slt i64 %indvars.iv.next, %18
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13
for.body6: ; preds = %for.body6.preheader, %for.body6
%indvars.iv38 = phi i64 [ %indvars.iv.next39, %for.body6 ], [ %indvars.iv38.ph, %for.body6.preheader ]
%cnt.034 = phi i32 [ %spec.select, %for.body6 ], [ %cnt.034.ph, %for.body6.preheader ]
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv38
%19 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%mul9 = mul nsw i32 %mul, %19
%cmp10.not = icmp sle i32 %add, %mul9
%inc11 = zext i1 %cmp10.not to i32
%spec.select = add nuw nsw i32 %cnt.034, %inc11
%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.end14, label %for.body6, !llvm.loop !14
for.end14: ; preds = %for.body6, %middle.block, %for.cond4.preheader.thread, %for.cond4.preheader
%.pre45 = phi i32 [ %.pre, %for.cond4.preheader ], [ %.pre44, %for.cond4.preheader.thread ], [ %.pre, %middle.block ], [ %.pre, %for.body6 ]
%cnt.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %for.cond4.preheader.thread ], [ %15, %middle.block ], [ %spec.select, %for.body6 ]
%cmp15.not = icmp slt i32 %cnt.0.lcssa, %.pre45
%.str.3..str.2 = select i1 %cmp15.not, ptr @.str.3, ptr @.str.2
%call18 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main(){
int n,m;
scanf("%d %d",&n,&m);
int sum=0,count=0;
int a[1000];
int i;
for(i=0;i<n;i++){
scanf("%d",&a[i]);
sum+=a[i];
}
for(i=0;i<n;i++){
if(a[i]*4*m>=sum) count++;
}
if(count>=m) puts("Yes");
else puts("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118623/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118623/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %a) #4
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp28 = icmp sgt i32 %0, 0
br i1 %cmp28, label %for.body, label %for.cond4.preheader.thread
for.cond4.preheader.thread: ; preds = %entry
%.pre44 = load i32, ptr %m, align 4, !tbaa !5
br label %for.end14
for.cond4.preheader: ; preds = %for.body
%cmp532 = icmp sgt i32 %16, 0
%.pre = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp532, label %for.body6.lr.ph, label %for.end14
for.body6.lr.ph: ; preds = %for.cond4.preheader
%wide.trip.count = zext i32 %16 to i64
%min.iters.check = icmp ult i32 %16, 8
br i1 %min.iters.check, label %for.body6.preheader, label %vector.ph
vector.ph: ; preds = %for.body6.lr.ph
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.pre, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%broadcast.splatinsert48 = insertelement <4 x i32> poison, i32 %add, i64 0
%broadcast.splat49 = shufflevector <4 x i32> %broadcast.splatinsert48, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %11, %vector.body ]
%vec.phi46 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%1 = getelementptr inbounds [1000 x i32], ptr %a, 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 = shl nsw <4 x i32> %wide.load, <i32 2, i32 2, i32 2, i32 2>
%4 = shl nsw <4 x i32> %wide.load47, <i32 2, i32 2, i32 2, i32 2>
%5 = mul nsw <4 x i32> %3, %broadcast.splat
%6 = mul nsw <4 x i32> %4, %broadcast.splat
%7 = icmp sge <4 x i32> %5, %broadcast.splat49
%8 = icmp sge <4 x i32> %6, %broadcast.splat49
%9 = zext <4 x i1> %7 to <4 x i32>
%10 = zext <4 x i1> %8 to <4 x i32>
%11 = add <4 x i32> %vec.phi, %9
%12 = add <4 x i32> %vec.phi46, %10
%index.next = add nuw i64 %index, 8
%13 = icmp eq i64 %index.next, %n.vec
br i1 %13, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %12, %11
%14 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end14, label %for.body6.preheader
for.body6.preheader: ; preds = %for.body6.lr.ph, %middle.block
%indvars.iv38.ph = phi i64 [ 0, %for.body6.lr.ph ], [ %n.vec, %middle.block ]
%count.033.ph = phi i32 [ 0, %for.body6.lr.ph ], [ %14, %middle.block ]
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.029 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%15 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %15, %sum.029
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp = icmp slt i64 %indvars.iv.next, %17
br i1 %cmp, label %for.body, label %for.cond4.preheader, !llvm.loop !13
for.body6: ; preds = %for.body6.preheader, %for.body6
%indvars.iv38 = phi i64 [ %indvars.iv.next39, %for.body6 ], [ %indvars.iv38.ph, %for.body6.preheader ]
%count.033 = phi i32 [ %spec.select, %for.body6 ], [ %count.033.ph, %for.body6.preheader ]
%arrayidx8 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv38
%18 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%mul = shl nsw i32 %18, 2
%mul9 = mul nsw i32 %mul, %.pre
%cmp10.not = icmp sge i32 %mul9, %add
%inc11 = zext i1 %cmp10.not to i32
%spec.select = add nuw nsw i32 %count.033, %inc11
%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.end14, label %for.body6, !llvm.loop !14
for.end14: ; preds = %for.body6, %middle.block, %for.cond4.preheader.thread, %for.cond4.preheader
%.pre45 = phi i32 [ %.pre, %for.cond4.preheader ], [ %.pre44, %for.cond4.preheader.thread ], [ %.pre, %middle.block ], [ %.pre, %for.body6 ]
%count.0.lcssa = phi i32 [ 0, %for.cond4.preheader ], [ 0, %for.cond4.preheader.thread ], [ %14, %middle.block ], [ %spec.select, %for.body6 ]
%cmp15.not = icmp slt i32 %count.0.lcssa, %.pre45
%.str.3..str.2 = select i1 %cmp15.not, ptr @.str.3, ptr @.str.2
%call18 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %a) #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 @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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
int main(void){
int n,m;
scanf("%d %d",&n,&m);
int a[n];
int sum=0;
int c=0;
for(int i=0; i<n; i++){
scanf("%d",&a[i]);
sum+=a[i];
}
double line=sum/(4.0*m);
for(int i=0; i<n; i++){
if(a[i]>=line){
c++;
}
}
if(c>=m){
printf("Yes\n");
}
else{
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118674/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118674/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@str = private unnamed_addr constant [3 x i8] c"No\00", align 1
@str.4 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = 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 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%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
%cmp34 = icmp sgt i32 %3, 0
br i1 %cmp34, label %for.body, label %for.cond.cleanup.thread
for.cond.cleanup.thread: ; preds = %entry
%4 = load i32, ptr %m, align 4, !tbaa !5
br label %for.cond.cleanup9
for.cond.cleanup: ; preds = %for.body
%5 = sitofp i32 %add to double
%6 = load i32, ptr %m, align 4, !tbaa !5
%conv4 = sitofp i32 %6 to double
%mul = fmul double %conv4, 4.000000e+00
%div = fdiv double %5, %mul
%cmp738 = icmp sgt i32 %20, 0
br i1 %cmp738, label %for.body10.preheader, label %for.cond.cleanup9
for.body10.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %20 to i64
%min.iters.check = icmp ult i32 %20, 8
br i1 %min.iters.check, label %for.body10.preheader55, label %vector.ph
vector.ph: ; preds = %for.body10.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x double> poison, double %div, i64 0
%broadcast.splat = shufflevector <4 x double> %broadcast.splatinsert, <4 x double> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%vec.phi53 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%7 = getelementptr inbounds i32, ptr %vla, i64 %index
%wide.load = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load54 = load <4 x i32>, ptr %8, align 16, !tbaa !5
%9 = sitofp <4 x i32> %wide.load to <4 x double>
%10 = sitofp <4 x i32> %wide.load54 to <4 x double>
%11 = fcmp ole <4 x double> %broadcast.splat, %9
%12 = fcmp ole <4 x double> %broadcast.splat, %10
%13 = zext <4 x i1> %11 to <4 x i32>
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = add <4 x i32> %vec.phi, %13
%16 = add <4 x i32> %vec.phi53, %14
%index.next = add nuw i64 %index, 8
%17 = icmp eq i64 %index.next, %n.vec
br i1 %17, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %16, %15
%18 = 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.cleanup9, label %for.body10.preheader55
for.body10.preheader55: ; preds = %for.body10.preheader, %middle.block
%indvars.iv44.ph = phi i64 [ 0, %for.body10.preheader ], [ %n.vec, %middle.block ]
%c.039.ph = phi i32 [ 0, %for.body10.preheader ], [ %18, %middle.block ]
br label %for.body10
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.035 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%19 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %19, %sum.035
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%20 = load i32, ptr %n, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp = icmp slt i64 %indvars.iv.next, %21
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond.cleanup9: ; preds = %for.body10, %middle.block, %for.cond.cleanup.thread, %for.cond.cleanup
%22 = phi i32 [ %6, %for.cond.cleanup ], [ %4, %for.cond.cleanup.thread ], [ %6, %middle.block ], [ %6, %for.body10 ]
%c.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ 0, %for.cond.cleanup.thread ], [ %18, %middle.block ], [ %c.1, %for.body10 ]
%cmp20.not = icmp slt i32 %c.0.lcssa, %22
%str.str.4 = select i1 %cmp20.not, ptr @str, ptr @str.4
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
call void @llvm.stackrestore.p0(ptr %2)
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.body10: ; preds = %for.body10.preheader55, %for.body10
%indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body10 ], [ %indvars.iv44.ph, %for.body10.preheader55 ]
%c.039 = phi i32 [ %c.1, %for.body10 ], [ %c.039.ph, %for.body10.preheader55 ]
%arrayidx12 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv44
%23 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%conv13 = sitofp i32 %23 to double
%cmp14 = fcmp ole double %div, %conv13
%inc16 = zext i1 %cmp14 to i32
%c.1 = add nuw nsw i32 %c.039, %inc16
%indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
%exitcond.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count
br i1 %exitcond.not, label %for.cond.cleanup9, label %for.body10, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree 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, !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>
#include <string.h>
int main(){
int m,n,a[2000]={},i,count=0,sum=0;
char token[3000000]={};
fgets(token, sizeof(token), stdin);
n=atoi(strtok(token, " "));m=atoi(strtok(NULL, " "));
fgets(token, sizeof(token), stdin);
a[0]=atoi(strtok(token, " "));sum+=a[0];
for (i=1; i<n; i++) {
a[i]=atoi(strtok(NULL, " "));
sum+=a[i];
}
if (sum%(4*m)==0) {
for (i=0; i<n; i++) {
if(sum/(4*m)<=a[i]) count++;
}
}else{
for (i=0; i<n; i++) {
if(sum/(4*m)<a[i]) count++;
}
}
if (count>=m) printf("Yes");
else printf("No");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118717/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118717/source.c"
target datalayout = "e-m:e-p270: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 [2 x i8] c" \00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca [2000 x i32], align 16
%token = alloca [3000000 x i8], align 16
call void @llvm.lifetime.start.p0(i64 8000, ptr nonnull %a) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(8000) %a, i8 0, i64 8000, i1 false)
call void @llvm.lifetime.start.p0(i64 3000000, ptr nonnull %token) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(3000000) %token, i8 0, i64 3000000, i1 false)
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call ptr @fgets(ptr noundef nonnull %token, i32 noundef 3000000, ptr noundef %0)
%call2 = call ptr @strtok(ptr noundef nonnull %token, ptr noundef nonnull @.str) #6
%call.i = call i64 @strtol(ptr nocapture noundef nonnull %call2, ptr noundef null, i32 noundef 10) #6
%conv.i = trunc i64 %call.i to i32
%call4 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #6
%call.i73 = call i64 @strtol(ptr nocapture noundef nonnull %call4, ptr noundef null, i32 noundef 10) #6
%conv.i74 = trunc i64 %call.i73 to i32
%1 = load ptr, ptr @stdin, align 8, !tbaa !5
%call7 = call ptr @fgets(ptr noundef nonnull %token, i32 noundef 3000000, ptr noundef %1)
%call9 = call ptr @strtok(ptr noundef nonnull %token, ptr noundef nonnull @.str) #6
%call.i75 = call i64 @strtol(ptr nocapture noundef nonnull %call9, ptr noundef null, i32 noundef 10) #6
%conv.i76 = trunc i64 %call.i75 to i32
store i32 %conv.i76, ptr %a, align 16, !tbaa !9
%cmp80 = icmp sgt i32 %conv.i, 1
br i1 %cmp80, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%wide.trip.count = and i64 %call.i, 4294967295
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ 1, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%sum.082 = phi i32 [ %conv.i76, %for.body.preheader ], [ %add17, %for.body ]
%call12 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str) #6
%call.i77 = call i64 @strtol(ptr nocapture noundef nonnull %call12, ptr noundef null, i32 noundef 10) #6
%conv.i78 = trunc i64 %call.i77 to i32
%arrayidx14 = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %indvars.iv
store i32 %conv.i78, ptr %arrayidx14, align 4, !tbaa !9
%add17 = add nsw i32 %sum.082, %conv.i78
%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
%sum.0.lcssa = phi i32 [ %conv.i76, %entry ], [ %add17, %for.body ]
%mul = shl nsw i32 %conv.i74, 2
%rem = srem i32 %sum.0.lcssa, %mul
%div = sdiv i32 %sum.0.lcssa, %mul
%cmp18 = icmp eq i32 %rem, 0
%cmp2087 = icmp sgt i32 %conv.i, 0
br i1 %cmp18, label %for.cond19.preheader, label %for.cond31.preheader
for.cond31.preheader: ; preds = %for.end
br i1 %cmp2087, label %for.body33.lr.ph, label %if.end45
for.body33.lr.ph: ; preds = %for.cond31.preheader
%div35 = sdiv i32 %sum.0.lcssa, %mul
%wide.trip.count96 = and i64 %call.i, 4294967295
%min.iters.check = icmp ult i64 %wide.trip.count96, 8
br i1 %min.iters.check, label %for.body33.preheader, label %vector.ph
vector.ph: ; preds = %for.body33.lr.ph
%n.mod.vf = and i64 %call.i, 7
%n.vec = sub nsw i64 %wide.trip.count96, %n.mod.vf
%broadcast.splatinsert = insertelement <4 x i32> poison, i32 %div35, i64 0
%broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %8, %vector.body ]
%vec.phi105 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %9, %vector.body ]
%2 = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !9
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load106 = load <4 x i32>, ptr %3, align 16, !tbaa !9
%4 = icmp slt <4 x i32> %broadcast.splat, %wide.load
%5 = icmp slt <4 x i32> %broadcast.splat, %wide.load106
%6 = zext <4 x i1> %4 to <4 x i32>
%7 = zext <4 x i1> %5 to <4 x i32>
%8 = add <4 x i32> %vec.phi, %6
%9 = add <4 x i32> %vec.phi105, %7
%index.next = add nuw i64 %index, 8
%10 = icmp eq i64 %index.next, %n.vec
br i1 %10, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %9, %8
%11 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.mod.vf, 0
br i1 %cmp.n, label %if.end45, label %for.body33.preheader
for.body33.preheader: ; preds = %for.body33.lr.ph, %middle.block
%indvars.iv93.ph = phi i64 [ 0, %for.body33.lr.ph ], [ %n.vec, %middle.block ]
%count.285.ph = phi i32 [ 0, %for.body33.lr.ph ], [ %11, %middle.block ]
br label %for.body33
for.cond19.preheader: ; preds = %for.end
br i1 %cmp2087, label %for.body21.lr.ph, label %if.end45
for.body21.lr.ph: ; preds = %for.cond19.preheader
%wide.trip.count101 = and i64 %call.i, 4294967295
%min.iters.check109 = icmp ult i64 %wide.trip.count101, 8
br i1 %min.iters.check109, label %for.body21.preheader, label %vector.ph110
vector.ph110: ; preds = %for.body21.lr.ph
%n.mod.vf111 = and i64 %call.i, 7
%n.vec112 = sub nsw i64 %wide.trip.count101, %n.mod.vf111
%broadcast.splatinsert121 = insertelement <4 x i32> poison, i32 %div, i64 0
%broadcast.splat122 = shufflevector <4 x i32> %broadcast.splatinsert121, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body115
vector.body115: ; preds = %vector.body115, %vector.ph110
%index116 = phi i64 [ 0, %vector.ph110 ], [ %index.next123, %vector.body115 ]
%vec.phi117 = phi <4 x i32> [ zeroinitializer, %vector.ph110 ], [ %18, %vector.body115 ]
%vec.phi118 = phi <4 x i32> [ zeroinitializer, %vector.ph110 ], [ %19, %vector.body115 ]
%12 = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %index116
%wide.load119 = load <4 x i32>, ptr %12, align 16, !tbaa !9
%13 = getelementptr inbounds i32, ptr %12, i64 4
%wide.load120 = load <4 x i32>, ptr %13, align 16, !tbaa !9
%14 = icmp sle <4 x i32> %broadcast.splat122, %wide.load119
%15 = icmp sle <4 x i32> %broadcast.splat122, %wide.load120
%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.phi117, %16
%19 = add <4 x i32> %vec.phi118, %17
%index.next123 = add nuw i64 %index116, 8
%20 = icmp eq i64 %index.next123, %n.vec112
br i1 %20, label %middle.block107, label %vector.body115, !llvm.loop !16
middle.block107: ; preds = %vector.body115
%bin.rdx124 = add <4 x i32> %19, %18
%21 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx124)
%cmp.n114 = icmp eq i64 %n.mod.vf111, 0
br i1 %cmp.n114, label %if.end45, label %for.body21.preheader
for.body21.preheader: ; preds = %for.body21.lr.ph, %middle.block107
%indvars.iv98.ph = phi i64 [ 0, %for.body21.lr.ph ], [ %n.vec112, %middle.block107 ]
%count.089.ph = phi i32 [ 0, %for.body21.lr.ph ], [ %21, %middle.block107 ]
br label %for.body21
for.body21: ; preds = %for.body21.preheader, %for.body21
%indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.body21 ], [ %indvars.iv98.ph, %for.body21.preheader ]
%count.089 = phi i32 [ %spec.select, %for.body21 ], [ %count.089.ph, %for.body21.preheader ]
%arrayidx24 = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %indvars.iv98
%22 = load i32, ptr %arrayidx24, align 4, !tbaa !9
%cmp25.not = icmp sle i32 %div, %22
%inc27 = zext i1 %cmp25.not to i32
%spec.select = add nuw nsw i32 %count.089, %inc27
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%exitcond102.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count101
br i1 %exitcond102.not, label %if.end45, label %for.body21, !llvm.loop !17
for.body33: ; preds = %for.body33.preheader, %for.body33
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body33 ], [ %indvars.iv93.ph, %for.body33.preheader ]
%count.285 = phi i32 [ %spec.select72, %for.body33 ], [ %count.285.ph, %for.body33.preheader ]
%arrayidx37 = getelementptr inbounds [2000 x i32], ptr %a, i64 0, i64 %indvars.iv93
%23 = load i32, ptr %arrayidx37, align 4, !tbaa !9
%cmp38 = icmp slt i32 %div35, %23
%inc40 = zext i1 %cmp38 to i32
%spec.select72 = add nuw nsw i32 %count.285, %inc40
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
br i1 %exitcond97.not, label %if.end45, label %for.body33, !llvm.loop !18
if.end45: ; preds = %for.body33, %for.body21, %middle.block, %middle.block107, %for.cond31.preheader, %for.cond19.preheader
%count.4 = phi i32 [ 0, %for.cond19.preheader ], [ 0, %for.cond31.preheader ], [ %21, %middle.block107 ], [ %11, %middle.block ], [ %spec.select, %for.body21 ], [ %spec.select72, %for.body33 ]
%cmp46.not = icmp slt i32 %count.4, %conv.i74
%.str.2..str.1 = select i1 %cmp46.not, ptr @.str.2, ptr @.str.1
%call50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.1)
call void @llvm.lifetime.end.p0(i64 3000000, ptr nonnull %token) #6
call void @llvm.lifetime.end.p0(i64 8000, ptr nonnull %a) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) 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
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 "no-trapping-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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !14, !15}
!17 = distinct !{!17, !12, !15, !14}
!18 = distinct !{!18, !12, !15, !14}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX 100
int cmpfunc( const void * n1, const void * n2)
{
if (*(int *)n1 < *(int *)n2) return 1;
else if (*(int *)n1 > *(int *)n2) return -1;
else return 0;
}
int main()
{
int n, m;
int a[MAX];
scanf("%d%d",&n,&m);
for (int i=0; i<n; i++) scanf("%d",&a[i]);
qsort(a, n, sizeof(a[0]), cmpfunc);
//for ( int i=0; i<n; i++) printf("%d ",a[i]);
//printf("\n");
int total = 0;
for (int i=0; i<n; i++){
total += a[i];
}
//printf("total = %d, total/4M = %lf", total, (double)(total)/(double)(4*m));
if (a[m-1] < (double)(total)/(double)(4*m)){
printf("No\n");
return 0;
} else {
printf("Yes\n");
return 0;
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118760/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118760/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@str.4 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @cmpfunc(ptr nocapture noundef readonly %n1, ptr nocapture noundef readonly %n2) #0 {
entry:
%0 = load i32, ptr %n1, align 4, !tbaa !5
%1 = load i32, ptr %n2, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp sgt i32 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [100 x i32], align 16
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 400, ptr nonnull %a) #7
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %0, 0
br i1 %cmp31, 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 ], [ %9, %for.body ]
call void @qsort(ptr noundef nonnull %a, i64 noundef %conv.pre-phi, i64 noundef 4, ptr noundef nonnull @cmpfunc) #7
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp433 = icmp sgt i32 %1, 0
br i1 %cmp433, label %for.body7.preheader, label %for.cond.cleanup6
for.body7.preheader: ; preds = %for.cond.cleanup
%wide.trip.count = zext i32 %1 to i64
%min.iters.check = icmp ult i32 %1, 8
br i1 %min.iters.check, label %for.body7.preheader44, label %vector.ph
vector.ph: ; preds = %for.body7.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 ], [ %4, %vector.body ]
%vec.phi42 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %5, %vector.body ]
%2 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = getelementptr inbounds i32, ptr %2, i64 4
%wide.load43 = load <4 x i32>, ptr %3, align 16, !tbaa !5
%4 = add <4 x i32> %wide.load, %vec.phi
%5 = add <4 x i32> %wide.load43, %vec.phi42
%index.next = add nuw i64 %index, 8
%6 = icmp eq i64 %index.next, %n.vec
br i1 %6, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %5, %4
%7 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond.cleanup6.loopexit, label %for.body7.preheader44
for.body7.preheader44: ; preds = %for.body7.preheader, %middle.block
%indvars.iv39.ph = phi i64 [ 0, %for.body7.preheader ], [ %n.vec, %middle.block ]
%total.034.ph = phi i32 [ 0, %for.body7.preheader ], [ %7, %middle.block ]
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !13
for.cond.cleanup6.loopexit: ; preds = %for.body7, %middle.block
%add.lcssa = phi i32 [ %7, %middle.block ], [ %add, %for.body7 ]
%10 = sitofp i32 %add.lcssa to double
br label %for.cond.cleanup6
for.cond.cleanup6: ; preds = %for.cond.cleanup6.loopexit, %for.cond.cleanup
%total.0.lcssa = phi double [ 0.000000e+00, %for.cond.cleanup ], [ %10, %for.cond.cleanup6.loopexit ]
%11 = load i32, ptr %m, align 4, !tbaa !5
%sub = add nsw i32 %11, -1
%idxprom13 = sext i32 %sub to i64
%arrayidx14 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom13
%12 = load i32, ptr %arrayidx14, align 4, !tbaa !5
%conv15 = sitofp i32 %12 to double
%mul = shl nsw i32 %11, 2
%conv17 = sitofp i32 %mul to double
%div = fdiv double %total.0.lcssa, %conv17
%cmp18 = fcmp ogt double %div, %conv15
%str.4.str = select i1 %cmp18, ptr @str.4, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.4.str)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #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
for.body7: ; preds = %for.body7.preheader44, %for.body7
%indvars.iv39 = phi i64 [ %indvars.iv.next40, %for.body7 ], [ %indvars.iv39.ph, %for.body7.preheader44 ]
%total.034 = phi i32 [ %add, %for.body7 ], [ %total.034.ph, %for.body7.preheader44 ]
%arrayidx9 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv39
%13 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%add = add nsw i32 %13, %total.034
%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.cond.cleanup6.loopexit, label %for.body7, !llvm.loop !14
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include<stdio.h>
int main()
{ int n,m,i,a[100],s=0,c=0;
double k;
scanf("%d%d",&n,&m);
for(i=0;i<n;i++)
{ scanf("%d",&a[i]);
s=s+a[i];
}
k=s/4.;
k=k/m;
for(i=0;i<n;i++)
if(a[i]>=k)
c++;
if(c>=m) printf("Yes");
else printf("No");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118810/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118810/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = 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 4, ptr nonnull %m) #4
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, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%1 = load i32, ptr %m, align 4, !tbaa !5
br label %for.end18
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%s.036 = phi i32 [ %add, %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.1, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %2, %s.036
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%5 = sitofp i32 %add to double
%6 = fmul double %5, 2.500000e-01
%7 = load i32, ptr %m, align 4, !tbaa !5
%conv4 = sitofp i32 %7 to double
%div5 = fdiv double %6, %conv4
%cmp738 = icmp sgt i32 %3, 0
br i1 %cmp738, label %for.body9.preheader, label %for.end18
for.body9.preheader: ; preds = %for.end
%wide.trip.count = zext i32 %3 to i64
%min.iters.check = icmp ult i32 %3, 8
br i1 %min.iters.check, label %for.body9.preheader54, label %vector.ph
vector.ph: ; preds = %for.body9.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x double> poison, double %div5, i64 0
%broadcast.splat = shufflevector <4 x double> %broadcast.splatinsert, <4 x double> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%vec.phi52 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %17, %vector.body ]
%8 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %8, align 16, !tbaa !5
%9 = getelementptr inbounds i32, ptr %8, i64 4
%wide.load53 = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = sitofp <4 x i32> %wide.load to <4 x double>
%11 = sitofp <4 x i32> %wide.load53 to <4 x double>
%12 = fcmp ole <4 x double> %broadcast.splat, %10
%13 = fcmp ole <4 x double> %broadcast.splat, %11
%14 = zext <4 x i1> %12 to <4 x i32>
%15 = zext <4 x i1> %13 to <4 x i32>
%16 = add <4 x i32> %vec.phi, %14
%17 = add <4 x i32> %vec.phi52, %15
%index.next = add nuw i64 %index, 8
%18 = icmp eq i64 %index.next, %n.vec
br i1 %18, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %17, %16
%19 = 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.end18, label %for.body9.preheader54
for.body9.preheader54: ; preds = %for.body9.preheader, %middle.block
%indvars.iv44.ph = phi i64 [ 0, %for.body9.preheader ], [ %n.vec, %middle.block ]
%c.040.ph = phi i32 [ 0, %for.body9.preheader ], [ %19, %middle.block ]
br label %for.body9
for.body9: ; preds = %for.body9.preheader54, %for.body9
%indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body9 ], [ %indvars.iv44.ph, %for.body9.preheader54 ]
%c.040 = phi i32 [ %c.1, %for.body9 ], [ %c.040.ph, %for.body9.preheader54 ]
%arrayidx11 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv44
%20 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%conv12 = sitofp i32 %20 to double
%cmp13 = fcmp ole double %div5, %conv12
%inc15 = zext i1 %cmp13 to i32
%c.1 = add nuw nsw i32 %c.040, %inc15
%indvars.iv.next45 = add nuw nsw i64 %indvars.iv44, 1
%exitcond.not = icmp eq i64 %indvars.iv.next45, %wide.trip.count
br i1 %exitcond.not, label %for.end18, label %for.body9, !llvm.loop !14
for.end18: ; preds = %for.body9, %middle.block, %for.end.thread, %for.end
%21 = phi i32 [ %7, %for.end ], [ %1, %for.end.thread ], [ %7, %middle.block ], [ %7, %for.body9 ]
%c.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %for.end.thread ], [ %19, %middle.block ], [ %c.1, %for.body9 ]
%cmp19.not = icmp slt i32 %c.0.lcssa, %21
%.str.3..str.2 = select i1 %cmp19.not, ptr @.str.3, ptr @.str.2
%call23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %a) #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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
|
#include <stdio.h>
#define min(a, b) a<b?a:b
#define INF 2110001000
int v, e;
int d[101][101];
int main(void)
{
int i, j, k, s, t, c;
scanf("%d %d", &v, &e);
v;
for (i = 0; i < v; i++) {
for (j = 0; j < v; j++) {
d[i][j] = INF;
}
d[i][i] = 0;
}
for (i = 0; i < e; i++) {
scanf("%d %d %d", &s, &t, &c);
d[s][t] = c;
}
for (k = 0; k < v; k++) {
for (i = 0; i < v; i++) {
for (j = 0; j < v; j++) {
if (d[i][k] != INF && d[k][j] != INF) {
d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}
}
}
}
for (i = 0; i < v; i++) {
if (d[i][i] < 0) {
puts("NEGATIVE CYCLE");
return 0;
}
}
for (i = 0; i < v; i++) {
if (d[i][0] != INF) {
printf("%d", d[i][0]);
} else {
printf("INF");
}
for (j = 1; j < v; j++) {
if (d[i][j] == INF) {
printf(" INF");
} else {
printf(" %d", d[i][j]);
}
}
puts("");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118861/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118861/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@v = dso_local global i32 0, align 4
@e = dso_local global i32 0, align 4
@d = dso_local local_unnamed_addr global [101 x [101 x i32]] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [9 x i8] c"%d %d %d\00", align 1
@.str.2 = private unnamed_addr constant [15 x i8] c"NEGATIVE CYCLE\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"INF\00", align 1
@.str.5 = private unnamed_addr constant [5 x i8] c" INF\00", align 1
@.str.6 = private unnamed_addr constant [4 x i8] c" %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%s = alloca i32, align 4
%t = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #5
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @v, ptr noundef nonnull @e)
%0 = load i32, ptr @v, align 4, !tbaa !5
%cmp190 = icmp sgt i32 %0, 0
br i1 %cmp190, label %for.cond1.preheader.us.preheader, label %for.cond13.preheader
for.cond1.preheader.us.preheader: ; preds = %entry
%wide.trip.count217 = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
%n.vec = and i64 %wide.trip.count217, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count217
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.preheader.us.preheader, %for.cond1.for.end_crit_edge.us
%indvars.iv214 = phi i64 [ 0, %for.cond1.preheader.us.preheader ], [ %indvars.iv.next215, %for.cond1.for.end_crit_edge.us ]
br i1 %min.iters.check, label %for.body3.us.preheader, label %vector.body
vector.body: ; preds = %for.cond1.preheader.us, %vector.body
%index = phi i64 [ %index.next, %vector.body ], [ 0, %for.cond1.preheader.us ]
%1 = getelementptr inbounds [101 x [101 x i32]], ptr @d, i64 0, i64 %indvars.iv214, i64 %index
store <4 x i32> <i32 2110001000, i32 2110001000, i32 2110001000, i32 2110001000>, ptr %1, align 4, !tbaa !5
%2 = getelementptr inbounds i32, ptr %1, i64 4
store <4 x i32> <i32 2110001000, i32 2110001000, i32 2110001000, i32 2110001000>, ptr %2, align 4, !tbaa !5
%index.next = add nuw i64 %index, 8
%3 = icmp eq i64 %index.next, %n.vec
br i1 %3, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
br i1 %cmp.n, label %for.cond1.for.end_crit_edge.us, label %for.body3.us.preheader
for.body3.us.preheader: ; preds = %for.cond1.preheader.us, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.cond1.preheader.us ], [ %n.vec, %middle.block ]
br label %for.body3.us
for.body3.us: ; preds = %for.body3.us.preheader, %for.body3.us
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body3.us ], [ %indvars.iv.ph, %for.body3.us.preheader ]
%arrayidx5.us = getelementptr inbounds [101 x [101 x i32]], ptr @d, i64 0, i64 %indvars.iv214, i64 %indvars.iv
store i32 2110001000, ptr %arrayidx5.us, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count217
br i1 %exitcond.not, label %for.cond1.for.end_crit_edge.us, label %for.body3.us, !llvm.loop !13
for.cond1.for.end_crit_edge.us: ; preds = %for.body3.us, %middle.block
%arrayidx9.us = getelementptr inbounds [101 x [101 x i32]], ptr @d, i64 0, i64 %indvars.iv214, i64 %indvars.iv214
store i32 0, ptr %arrayidx9.us, align 4, !tbaa !5
%indvars.iv.next215 = add nuw nsw i64 %indvars.iv214, 1
%exitcond218.not = icmp eq i64 %indvars.iv.next215, %wide.trip.count217
br i1 %exitcond218.not, label %for.cond13.preheader, label %for.cond1.preheader.us, !llvm.loop !14
for.cond13.preheader: ; preds = %for.cond1.for.end_crit_edge.us, %entry
%4 = load i32, ptr @e, align 4, !tbaa !5
%cmp14192 = icmp sgt i32 %4, 0
br i1 %cmp14192, label %for.body15, label %for.cond24.preheader
for.cond24.preheader.loopexit: ; preds = %for.body15
%.pre = load i32, ptr @v, align 4, !tbaa !5
br label %for.cond24.preheader
for.cond24.preheader: ; preds = %for.cond24.preheader.loopexit, %for.cond13.preheader
%5 = phi i32 [ %.pre, %for.cond24.preheader.loopexit ], [ %0, %for.cond13.preheader ]
%cmp25204 = icmp sgt i32 %5, 0
br i1 %cmp25204, label %for.cond27.preheader.us.preheader, label %cleanup
for.cond27.preheader.us.preheader: ; preds = %for.cond24.preheader
%wide.trip.count232 = zext i32 %5 to i64
br label %for.cond27.preheader.us
for.cond27.preheader.us: ; preds = %for.cond27.preheader.us.preheader, %for.cond27.for.inc79_crit_edge.split.us.us
%indvars.iv229 = phi i64 [ 0, %for.cond27.preheader.us.preheader ], [ %indvars.iv.next230, %for.cond27.for.inc79_crit_edge.split.us.us ]
br label %for.cond30.preheader.us.us
for.cond30.preheader.us.us: ; preds = %for.cond30.for.inc76_crit_edge.us.us, %for.cond27.preheader.us
%indvars.iv224 = phi i64 [ %indvars.iv.next225, %for.cond30.for.inc76_crit_edge.us.us ], [ 0, %for.cond27.preheader.us ]
%arrayidx36.us.us = getelementptr inbounds [101 x [101 x i32]], ptr @d, i64 0, i64 %indvars.iv224, i64 %indvars.iv229
%6 = load i32, ptr %arrayidx36.us.us, align 4, !tbaa !5
%7 = icmp eq i32 %6, 2110001000
br i1 %7, label %for.cond30.for.inc76_crit_edge.us.us, label %for.body32.us198.us
for.body32.us198.usthread-pre-split: ; preds = %for.inc73.us.us
%.pr = load i32, ptr %arrayidx36.us.us, align 4, !tbaa !5
br label %for.body32.us198.us
for.body32.us198.us: ; preds = %for.cond30.preheader.us.us, %for.body32.us198.usthread-pre-split
%8 = phi i32 [ %.pr, %for.body32.us198.usthread-pre-split ], [ %6, %for.cond30.preheader.us.us ]
%indvars.iv219 = phi i64 [ %indvars.iv.next220, %for.body32.us198.usthread-pre-split ], [ 0, %for.cond30.preheader.us.us ]
%cmp37.not.us.us = icmp eq i32 %8, 2110001000
br i1 %cmp37.not.us.us, label %for.inc73.us.us, label %land.lhs.true.us.us
land.lhs.true.us.us: ; preds = %for.body32.us198.us
%arrayidx41.us.us = getelementptr inbounds [101 x [101 x i32]], ptr @d, i64 0, i64 %indvars.iv229, i64 %indvars.iv219
%9 = load i32, ptr %arrayidx41.us.us, align 4, !tbaa !5
%cmp42.not.us.us = icmp eq i32 %9, 2110001000
br i1 %cmp42.not.us.us, label %for.inc73.us.us, label %if.then.us.us
if.then.us.us: ; preds = %land.lhs.true.us.us
%arrayidx46.us.us = getelementptr inbounds [101 x [101 x i32]], ptr @d, i64 0, i64 %indvars.iv224, i64 %indvars.iv219
%10 = load i32, ptr %arrayidx46.us.us, align 4, !tbaa !5
%add.us.us = add nsw i32 %9, %8
%.add.us.us = call i32 @llvm.smin.i32(i32 %10, i32 %add.us.us)
store i32 %.add.us.us, ptr %arrayidx46.us.us, align 4, !tbaa !5
br label %for.inc73.us.us
for.inc73.us.us: ; preds = %if.then.us.us, %land.lhs.true.us.us, %for.body32.us198.us
%indvars.iv.next220 = add nuw nsw i64 %indvars.iv219, 1
%exitcond223.not = icmp eq i64 %indvars.iv.next220, %wide.trip.count232
br i1 %exitcond223.not, label %for.cond30.for.inc76_crit_edge.us.us, label %for.body32.us198.usthread-pre-split, !llvm.loop !15
for.cond30.for.inc76_crit_edge.us.us: ; preds = %for.inc73.us.us, %for.cond30.preheader.us.us
%indvars.iv.next225 = add nuw nsw i64 %indvars.iv224, 1
%exitcond228.not = icmp eq i64 %indvars.iv.next225, %wide.trip.count232
br i1 %exitcond228.not, label %for.cond27.for.inc79_crit_edge.split.us.us, label %for.cond30.preheader.us.us, !llvm.loop !17
for.cond27.for.inc79_crit_edge.split.us.us: ; preds = %for.cond30.for.inc76_crit_edge.us.us
%indvars.iv.next230 = add nuw nsw i64 %indvars.iv229, 1
%exitcond233.not = icmp eq i64 %indvars.iv.next230, %wide.trip.count232
br i1 %exitcond233.not, label %for.cond82.preheader, label %for.cond27.preheader.us, !llvm.loop !18
for.body15: ; preds = %for.cond13.preheader, %for.body15
%i.1193 = phi i32 [ %inc22, %for.body15 ], [ 0, %for.cond13.preheader ]
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %t, ptr noundef nonnull %c)
%11 = load i32, ptr %c, align 4, !tbaa !5
%12 = load i32, ptr %s, align 4, !tbaa !5
%idxprom17 = sext i32 %12 to i64
%13 = load i32, ptr %t, align 4, !tbaa !5
%idxprom19 = sext i32 %13 to i64
%arrayidx20 = getelementptr inbounds [101 x [101 x i32]], ptr @d, i64 0, i64 %idxprom17, i64 %idxprom19
store i32 %11, ptr %arrayidx20, align 4, !tbaa !5
%inc22 = add nuw nsw i32 %i.1193, 1
%14 = load i32, ptr @e, align 4, !tbaa !5
%cmp14 = icmp slt i32 %inc22, %14
br i1 %cmp14, label %for.body15, label %for.cond24.preheader.loopexit, !llvm.loop !19
for.cond82.preheader: ; preds = %for.cond27.for.inc79_crit_edge.split.us.us
br i1 %cmp25204, label %for.body84.preheader, label %cleanup
for.body84.preheader: ; preds = %for.cond82.preheader
%wide.trip.count237 = zext i32 %5 to i64
br label %for.body84
for.cond82: ; preds = %for.body84
%indvars.iv.next235 = add nuw nsw i64 %indvars.iv234, 1
%exitcond238.not = icmp eq i64 %indvars.iv.next235, %wide.trip.count237
br i1 %exitcond238.not, label %for.cond96.preheader, label %for.body84, !llvm.loop !20
for.cond96.preheader: ; preds = %for.cond82
br i1 %cmp25204, label %for.body98, label %cleanup
for.body84: ; preds = %for.body84.preheader, %for.cond82
%indvars.iv234 = phi i64 [ 0, %for.body84.preheader ], [ %indvars.iv.next235, %for.cond82 ]
%arrayidx88 = getelementptr inbounds [101 x [101 x i32]], ptr @d, i64 0, i64 %indvars.iv234, i64 %indvars.iv234
%15 = load i32, ptr %arrayidx88, align 4, !tbaa !5
%cmp89 = icmp slt i32 %15, 0
br i1 %cmp89, label %if.then90, label %for.cond82
if.then90: ; preds = %for.body84
%call91 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup
for.body98: ; preds = %for.cond96.preheader, %for.end129
%indvars.iv242 = phi i64 [ %indvars.iv.next243, %for.end129 ], [ 0, %for.cond96.preheader ]
%arrayidx100 = getelementptr inbounds [101 x [101 x i32]], ptr @d, i64 0, i64 %indvars.iv242
%16 = load i32, ptr %arrayidx100, align 4, !tbaa !5
%cmp102.not = icmp eq i32 %16, 2110001000
br i1 %cmp102.not, label %if.else, label %if.then103
if.then103: ; preds = %for.body98
%call107 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %16)
br label %if.end109
if.else: ; preds = %for.body98
%call108 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4)
br label %if.end109
if.end109: ; preds = %if.else, %if.then103
%17 = load i32, ptr @v, align 4, !tbaa !5
%cmp111208 = icmp sgt i32 %17, 1
br i1 %cmp111208, label %for.body112, label %for.end129
for.body112: ; preds = %if.end109, %for.inc127
%indvars.iv239 = phi i64 [ %indvars.iv.next240, %for.inc127 ], [ 1, %if.end109 ]
%arrayidx116 = getelementptr inbounds [101 x [101 x i32]], ptr @d, i64 0, i64 %indvars.iv242, i64 %indvars.iv239
%18 = load i32, ptr %arrayidx116, align 4, !tbaa !5
%cmp117 = icmp eq i32 %18, 2110001000
br i1 %cmp117, label %if.then118, label %if.else120
if.then118: ; preds = %for.body112
%call119 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
br label %for.inc127
if.else120: ; preds = %for.body112
%call125 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %18)
br label %for.inc127
for.inc127: ; preds = %if.then118, %if.else120
%indvars.iv.next240 = add nuw nsw i64 %indvars.iv239, 1
%19 = load i32, ptr @v, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp111 = icmp slt i64 %indvars.iv.next240, %20
br i1 %cmp111, label %for.body112, label %for.end129, !llvm.loop !21
for.end129: ; preds = %for.inc127, %if.end109
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next243 = add nuw nsw i64 %indvars.iv242, 1
%21 = load i32, ptr @v, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp97 = icmp slt i64 %indvars.iv.next243, %22
br i1 %cmp97, label %for.body98, label %cleanup, !llvm.loop !22
cleanup: ; preds = %for.end129, %for.cond24.preheader, %for.cond82.preheader, %for.cond96.preheader, %if.then90
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10, !12, !11}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
|