Source_Code stringlengths 69 484k | IR_Original stringlengths 2.05k 17.9M |
|---|---|
#include <stdio.h>
int main() {
int n, i, j, k, v;
int a[100];
scanf("%d", &n);
for(i = 0; i < n; i++)
scanf("%d", &a[i]);
for(i = 0; i < n; i++){
printf("%d", a[i]);
if(i != n - 1)
printf(" ");
}
printf("\n");
for(i = 1; i < n; i++){
v = a[i];
j = i - 1;
while(j >= 0 && v < a[j]){
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");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115491/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115491/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.end48
for.body16: ; preds = %for.end12, %for.end44
%10 = phi i32 [ %19, %for.end44 ], [ %9, %for.end12 ]
%indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.end44 ], [ 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
%idxprom21 = and i64 %indvars.iv.next89, 4294967295
%arrayidx22 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %idxprom21
%12 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp slt i32 %11, %12
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.iv88
store i32 %12, ptr %arrayidx27, 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
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv88, %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
%cmp3278 = icmp sgt i32 %10, 0
br i1 %cmp3278, label %for.body33, label %for.end44
for.body33: ; preds = %while.end, %for.inc42
%indvars.iv91 = phi i64 [ %indvars.iv.next92, %for.inc42 ], [ 0, %while.end ]
%arrayidx35 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv91
%14 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14)
%15 = load i32, ptr %n, align 4, !tbaa !5
%sub37 = add nsw i32 %15, -1
%16 = zext i32 %sub37 to i64
%cmp38.not = icmp eq i64 %indvars.iv91, %16
br i1 %cmp38.not, label %for.inc42, label %if.then39
if.then39: ; preds = %for.body33
%putchar69 = call i32 @putchar(i32 32)
%.pre97 = load i32, ptr %n, align 4, !tbaa !5
br label %for.inc42
for.inc42: ; preds = %for.body33, %if.then39
%17 = phi i32 [ %15, %for.body33 ], [ %.pre97, %if.then39 ]
%indvars.iv.next92 = add nuw nsw i64 %indvars.iv91, 1
%18 = sext i32 %17 to i64
%cmp32 = icmp slt i64 %indvars.iv.next92, %18
br i1 %cmp32, label %for.body33, label %for.end44, !llvm.loop !13
for.end44: ; preds = %for.inc42, %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.end48, !llvm.loop !14
for.end48: ; preds = %for.end44, %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 insertionSort(int A[], int n){
int i,j,k;
int 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-1;k++) printf("%d ",A[k]);
printf("%d",A[k]);
printf("\n");
}
}
int main(void)
{
int N;
scanf("%d",&N);
int Num[N];
int i;
for(i=0;i<N;i++) scanf("%d",&Num[i]);
for(i=0;i<N-1;i++) printf("%d ",Num[i]);
printf("%d",Num[i]);
printf("\n");
insertionSort(Num,N);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115541/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115541/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 @insertionSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp49 = icmp sgt i32 %n, 1
br i1 %cmp49, label %for.body.us.preheader, label %for.end24
for.body.us.preheader: ; preds = %entry
%sub13 = add nsw i32 %n, -1
%wide.trip.count61 = zext i32 %n to i64
%wide.trip.count = zext i32 %sub13 to i64
%arrayidx19.us = getelementptr inbounds i32, ptr %A, i64 %wide.trip.count
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %for.cond12.for.end_crit_edge.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %for.cond12.for.end_crit_edge.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.iv52 = phi i64 [ %indvars.iv.next53, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next53 = add nsw i64 %indvars.iv52, -1
%idxprom2.us = and i64 %indvars.iv.next53, 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.iv52, %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.body15.us
for.body15.us: ; preds = %while.end.us, %for.body15.us
%indvars.iv55 = phi i64 [ 0, %while.end.us ], [ %indvars.iv.next56, %for.body15.us ]
%arrayidx17.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv55
%2 = load i32, ptr %arrayidx17.us, align 4, !tbaa !5
%call.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
%exitcond.not = icmp eq i64 %indvars.iv.next56, %wide.trip.count
br i1 %exitcond.not, label %for.cond12.for.end_crit_edge.us, label %for.body15.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv52
store i32 %1, ptr %arrayidx8.us, align 4, !tbaa !5
%3 = icmp sgt i64 %indvars.iv52, 1
br i1 %3, label %land.rhs.us, label %while.end.us, !llvm.loop !11
for.cond12.for.end_crit_edge.us: ; preds = %for.body15.us
%4 = load i32, ptr %arrayidx19.us, align 4, !tbaa !5
%call20.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%putchar.us = tail call i32 @putchar(i32 10)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond62.not = icmp eq i64 %indvars.iv.next, %wide.trip.count61
br i1 %exitcond62.not, label %for.end24, label %for.body.us, !llvm.loop !12
for.end24: ; preds = %for.cond12.for.end_crit_edge.us, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, 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
%cmp21 = icmp sgt i32 %3, 0
br i1 %cmp21, 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.1, 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 !13
for.body4: ; preds = %for.cond2.preheader, %for.body4
%indvars.iv27 = phi i64 [ %indvars.iv.next28, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv27
%7 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7)
%indvars.iv.next28 = add nuw nsw i64 %indvars.iv27, 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.next28, %9
br i1 %cmp3, label %for.body4, label %for.end10.loopexit, !llvm.loop !14
for.end10.loopexit: ; preds = %for.body4
%10 = and i64 %indvars.iv.next28, 4294967295
br label %for.end10
for.end10: ; preds = %entry, %for.end10.loopexit, %for.cond2.preheader
%i.1.lcssa = phi i64 [ 0, %for.cond2.preheader ], [ %10, %for.end10.loopexit ], [ 0, %entry ]
%arrayidx12 = getelementptr inbounds i32, ptr %vla, i64 %i.1.lcssa
%11 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %11)
%putchar = call i32 @putchar(i32 10)
%12 = load i32, ptr %N, align 4, !tbaa !5
%cmp49.i = icmp sgt i32 %12, 1
br i1 %cmp49.i, label %for.body.us.preheader.i, label %insertionSort.exit
for.body.us.preheader.i: ; preds = %for.end10
%sub13.i = add nsw i32 %12, -1
%wide.trip.count61.i = zext i32 %12 to i64
%wide.trip.count.i = zext i32 %sub13.i to i64
%arrayidx19.us.i = getelementptr inbounds i32, ptr %vla, i64 %wide.trip.count.i
br label %for.body.us.i
for.body.us.i: ; preds = %for.cond12.for.end_crit_edge.us.i, %for.body.us.preheader.i
%indvars.iv.i = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i, %for.cond12.for.end_crit_edge.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i
%13 = 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.iv52.i = phi i64 [ %indvars.iv.next53.i, %while.body.us.i ], [ %indvars.iv.i, %for.body.us.i ]
%indvars.iv.next53.i = add nsw i64 %indvars.iv52.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next53.i, 4294967295
%arrayidx3.us.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom2.us.i
%14 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %14, %13
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.iv52.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 %vla, i64 %idxprom10.us.i
store i32 %13, ptr %arrayidx11.us.i, align 4, !tbaa !5
br label %for.body15.us.i
for.body15.us.i: ; preds = %for.body15.us.i, %while.end.us.i
%indvars.iv55.i = phi i64 [ 0, %while.end.us.i ], [ %indvars.iv.next56.i, %for.body15.us.i ]
%arrayidx17.us.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv55.i
%15 = load i32, ptr %arrayidx17.us.i, align 4, !tbaa !5
%call.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%indvars.iv.next56.i = add nuw nsw i64 %indvars.iv55.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next56.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.cond12.for.end_crit_edge.us.i, label %for.body15.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv52.i
store i32 %14, ptr %arrayidx8.us.i, align 4, !tbaa !5
%16 = icmp sgt i64 %indvars.iv52.i, 1
br i1 %16, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !11
for.cond12.for.end_crit_edge.us.i: ; preds = %for.body15.us.i
%17 = load i32, ptr %arrayidx19.us.i, align 4, !tbaa !5
%call20.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17)
%putchar.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond62.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count61.i
br i1 %exitcond62.not.i, label %insertionSort.exit, label %for.body.us.i, !llvm.loop !12
insertionSort.exit: ; preds = %for.cond12.for.end_crit_edge.us.i, %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: 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: 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(void){
int N, i, j, k, v;
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\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(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_115585/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115585/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp67 = icmp sgt i32 %3, 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 %5, 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
%4 = phi i32 [ %5, %for.cond2.preheader ], [ %3, %entry ]
%sub69 = add nsw i32 %4, -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 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.iv84 = phi i64 [ %indvars.iv.next85, %for.body4 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv84
%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.next85 = add nuw nsw i64 %indvars.iv84, 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.next85, %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.2, i32 noundef %10)
%11 = load i32, ptr %N, align 4, !tbaa !5
%cmp1679 = icmp sgt i32 %11, 1
br i1 %cmp1679, label %for.body17, label %for.end48
for.body17: ; preds = %for.end10, %for.end41
%12 = phi i32 [ %20, %for.end41 ], [ %11, %for.end10 ]
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.end41 ], [ 1, %for.end10 ]
%arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87
%13 = 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 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.iv89
store i32 %14, ptr %arrayidx28, align 4, !tbaa !5
store i32 %13, ptr %arrayidx23, align 4, !tbaa !5
%15 = icmp sgt i64 %indvars.iv89, 1
br i1 %15, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%cmp3476 = icmp sgt i32 %12, 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 %12, -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 i32, ptr %vla, i64 %indvars.iv92
%16 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %16)
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%17 = load i32, ptr %N, align 4, !tbaa !5
%sub33 = add nsw i32 %17, -1
%18 = sext i32 %sub33 to i64
%cmp34 = icmp slt i64 %indvars.iv.next93, %18
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 ], [ %18, %for.body35 ]
%arrayidx44 = getelementptr inbounds i32, ptr %vla, i64 %idxprom43.pre-phi
%19 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %19)
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%20 = load i32, ptr %N, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp16 = icmp slt i64 %indvars.iv.next88, %21
br i1 %cmp16, label %for.body17, label %for.end48, !llvm.loop !14
for.end48: ; preds = %for.end41, %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>
#define SIZE_MIN ((int) 1)
#define SIZE_MAX ((int) 100)
#define ELEMENT_MIN ((int) 0)
#define ELEMENT_MAX ((int) 1000)
typedef enum
{
kSuccess = 0,
kError = -1
}Result;
Result checkNumRange( int num, int min, int max );
void showArray( int *arr, int size );
void execInsertuinSort( int *array, int size );
int main( void )
{
int i, size, array[SIZE_MAX];
scanf( "%d", &size );
if( checkNumRange( size, SIZE_MIN, SIZE_MAX ) == kError )
{
return kError;
}
for( i = 0; i < size; i++ )
{
scanf( "%d", &array[i] );
if( checkNumRange( array[i], ELEMENT_MIN, ELEMENT_MAX ) == kError )
{
return kError;
}
}
showArray( array, size );
execInsertuinSort( &array[0], size );
return kSuccess;
}
Result checkNumRange( int num, int min, int max )
{
return ((num >= min) || (num <= max)) ? kSuccess : kError;
}
void showArray( int *array, int size )
{
int i;
for( i = 0; i < size - 1; i++ )
{
printf( "%d ", array[i] );
}
printf( "%d\n", array[size - 1] );
}
void execInsertuinSort( int *array, int size )
{
int i, j, work;
for( i = 1; i < size; i++ )
{
work = array[i];
j = i - 1;
while( (j >= 0) && (array[j] > work) )
{
array[j + 1] = array[j];
j--;
}
array[j + 1] = work;
showArray(array, size);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115635/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115635/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%size = alloca i32, align 4
%array = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %size) #4
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %array) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %size)
%0 = load i32, ptr %size, align 4, !tbaa !5
%cmp222 = icmp sgt i32 %0, 0
br i1 %cmp222, label %for.inc, label %for.end.thread
for.end.thread: ; preds = %entry
%sub.i27 = add i32 %0, -1
br label %showArray.exit
for.inc: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %size, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp2, label %for.inc, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc
%sub.i = add i32 %1, -1
%cmp9.i = icmp sgt i32 %1, 1
br i1 %cmp9.i, label %for.body.preheader.i, label %showArray.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 %array, 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.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 %showArray.exit, label %for.body.i, !llvm.loop !11
showArray.exit: ; preds = %for.body.i, %for.end.thread, %for.end
%sub.i29 = phi i32 [ %sub.i27, %for.end.thread ], [ %sub.i, %for.end ], [ %sub.i, %for.body.i ]
%idxprom2.i = sext i32 %sub.i29 to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %array, 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.2, i32 noundef %4)
%5 = load i32, ptr %size, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %5, 1
br i1 %cmp30.i, label %for.body.lr.ph.i, label %cleanup
for.body.lr.ph.i: ; preds = %showArray.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 %array, i64 %wide.trip.count.i.i
%wide.trip.count.i18 = zext i32 %5 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %showArray.exit.loopexit.us.i, %for.body.lr.ph.i
%indvars.iv.i19 = phi i64 [ %indvars.iv.next.i20, %showArray.exit.loopexit.us.i ], [ 1, %for.body.lr.ph.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %array, i64 %indvars.iv.i19
%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.i19, %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 %array, 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 %array, 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 %array, 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.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 %showArray.exit.loopexit.us.i, label %for.body.i.us.i, !llvm.loop !11
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %array, 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 !12
showArray.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.2, i32 noundef %10)
%indvars.iv.next.i20 = add nuw nsw i64 %indvars.iv.i19, 1
%exitcond.not.i21 = icmp eq i64 %indvars.iv.next.i20, %wide.trip.count.i18
br i1 %exitcond.not.i21, label %cleanup, label %for.body.us.i, !llvm.loop !13
cleanup: ; preds = %showArray.exit.loopexit.us.i, %showArray.exit
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %array) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %size) #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 norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @checkNumRange(i32 noundef %num, i32 noundef %min, i32 noundef %max) local_unnamed_addr #3 {
entry:
%cmp = icmp slt i32 %num, %min
%cmp1 = icmp sgt i32 %num, %max
%.not = and i1 %cmp, %cmp1
%cond = sext i1 %.not to i32
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @showArray(ptr nocapture noundef readonly %array, i32 noundef %size) local_unnamed_addr #0 {
entry:
%sub = add i32 %size, -1
%cmp9 = icmp sgt i32 %size, 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 %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.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
%idxprom2 = sext i32 %sub to i64
%arrayidx3 = getelementptr inbounds i32, ptr %array, i64 %idxprom2
%1 = load i32, ptr %arrayidx3, 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 @execInsertuinSort(ptr nocapture noundef %array, i32 noundef %size) local_unnamed_addr #0 {
entry:
%cmp30 = icmp sgt i32 %size, 1
br i1 %cmp30, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%sub.i = add nsw i32 %size, -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 %array, i64 %idxprom2.i
%wide.trip.count = zext i32 %size to i64
br label %for.body.us
for.body.us: ; preds = %showArray.exit.loopexit.us, %for.body.lr.ph
%indvars.iv = phi i64 [ %indvars.iv.next, %showArray.exit.loopexit.us ], [ 1, %for.body.lr.ph ]
%arrayidx.us = getelementptr inbounds i32, ptr %array, 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 %array, 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 %array, 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 %array, 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.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 %showArray.exit.loopexit.us, label %for.body.i.us, !llvm.loop !11
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %array, 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 !12
showArray.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.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 = %showArray.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 = { 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 #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 insertionSort(int A[],int N){
int i,v,j,r;
for(r=0;r<N;r++){
if(r==N-1){
printf("%d\n",A[r]);
}
else{
printf("%d ",A[r]);
}
}
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(r=0;r<N;r++){
if(r==N-1){
printf("%d\n",A[r]);
}
else{
printf("%d ",A[r]);
}
}
}
}
int main(void){
int i,n;
scanf("%d",&n);
int a[n];
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
insertionSort(a,n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115679/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115679/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp72 = icmp sgt i32 %N, 0
br i1 %cmp72, label %for.body.lr.ph, label %for.end41
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.cond5.preheader: ; preds = %for.body
%cmp679 = icmp sgt i32 %N, 1
br i1 %cmp679, label %for.body7.us.preheader, label %for.end41
for.body7.us.preheader: ; preds = %for.cond5.preheader
%sub25 = add nsw i32 %N, -1
%1 = zext i32 %sub25 to i64
%wide.trip.count96 = zext i32 %N to i64
br label %for.body7.us
for.body7.us: ; preds = %for.body7.us.preheader, %for.cond22.for.inc39_crit_edge.us
%indvars.iv83 = phi i64 [ 1, %for.body7.us.preheader ], [ %indvars.iv.next84, %for.cond22.for.inc39_crit_edge.us ]
%arrayidx9.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv83
%2 = load i32, ptr %arrayidx9.us, align 4, !tbaa !5
br label %land.rhs.us
land.rhs.us: ; preds = %while.body.us, %for.body7.us
%indvars.iv85 = phi i64 [ %indvars.iv.next86, %while.body.us ], [ %indvars.iv83, %for.body7.us ]
%indvars.iv.next86 = add nsw i64 %indvars.iv85, -1
%idxprom12.us = and i64 %indvars.iv.next86, 4294967295
%arrayidx13.us = getelementptr inbounds i32, ptr %A, i64 %idxprom12.us
%3 = load i32, ptr %arrayidx13.us, align 4, !tbaa !5
%cmp14.us = icmp sgt i32 %3, %2
br i1 %cmp14.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.iv85, %land.rhs.us ]
%sext = shl i64 %j.0.in.lcssa.us, 32
%idxprom20.us = ashr exact i64 %sext, 32
%arrayidx21.us = getelementptr inbounds i32, ptr %A, i64 %idxprom20.us
store i32 %2, ptr %arrayidx21.us, align 4, !tbaa !5
br label %for.body24.us
for.body24.us: ; preds = %while.end.us, %for.body24.us
%indvars.iv88 = phi i64 [ 0, %while.end.us ], [ %indvars.iv.next89, %for.body24.us ]
%cmp26.us = icmp eq i64 %indvars.iv88, %1
%arrayidx29.us.sink = getelementptr inbounds i32, ptr %A, i64 %indvars.iv88
%.str.sink = select i1 %cmp26.us, ptr @.str, ptr @.str.1
%4 = load i32, ptr %arrayidx29.us.sink, align 4, !tbaa !5
%call30.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.sink, i32 noundef %4)
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%exitcond93.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count96
br i1 %exitcond93.not, label %for.cond22.for.inc39_crit_edge.us, label %for.body24.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx18.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv85
store i32 %3, ptr %arrayidx18.us, align 4, !tbaa !5
%5 = icmp sgt i64 %indvars.iv85, 1
br i1 %5, label %land.rhs.us, label %while.end.us, !llvm.loop !11
for.cond22.for.inc39_crit_edge.us: ; preds = %for.body24.us
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%exitcond97.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count96
br i1 %exitcond97.not, label %for.end41, label %for.body7.us, !llvm.loop !12
for.body: ; preds = %for.body.lr.ph, %for.body
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
%cmp1 = icmp eq i64 %indvars.iv, %0
%arrayidx.sink = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%.str.sink99 = select i1 %cmp1, ptr @.str, ptr @.str.1
%6 = load i32, ptr %arrayidx.sink, align 4, !tbaa !5
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.sink99, i32 noundef %6)
%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.cond5.preheader, label %for.body, !llvm.loop !13
for.end41: ; preds = %for.cond22.for.inc39_crit_edge.us, %entry, %for.cond5.preheader
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) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, 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
%cmp4 = icmp sgt i32 %3, 0
br i1 %cmp4, label %for.body, label %insertionSort.exit
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.2, 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 !14
for.end: ; preds = %for.body
%cmp72.i = icmp sgt i32 %4, 0
br i1 %cmp72.i, label %for.body.lr.ph.i, label %insertionSort.exit
for.body.lr.ph.i: ; preds = %for.end
%sub.i = add nsw i32 %4, -1
%6 = zext i32 %sub.i to i64
%wide.trip.count.i = zext i32 %4 to i64
br label %for.body.i
for.cond5.preheader.i: ; preds = %for.body.i
%cmp679.i = icmp sgt i32 %4, 1
br i1 %cmp679.i, label %for.body7.us.i, label %insertionSort.exit
for.body7.us.i: ; preds = %for.cond5.preheader.i, %for.cond22.for.inc39_crit_edge.us.i
%indvars.iv83.i = phi i64 [ %indvars.iv.next84.i, %for.cond22.for.inc39_crit_edge.us.i ], [ 1, %for.cond5.preheader.i ]
%arrayidx9.us.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv83.i
%7 = load i32, ptr %arrayidx9.us.i, align 4, !tbaa !5
br label %land.rhs.us.i
land.rhs.us.i: ; preds = %while.body.us.i, %for.body7.us.i
%indvars.iv85.i = phi i64 [ %indvars.iv.next86.i, %while.body.us.i ], [ %indvars.iv83.i, %for.body7.us.i ]
%indvars.iv.next86.i = add nsw i64 %indvars.iv85.i, -1
%idxprom12.us.i = and i64 %indvars.iv.next86.i, 4294967295
%arrayidx13.us.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom12.us.i
%8 = load i32, ptr %arrayidx13.us.i, align 4, !tbaa !5
%cmp14.us.i = icmp sgt i32 %8, %7
br i1 %cmp14.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.iv85.i, %land.rhs.us.i ]
%sext.i = shl i64 %j.0.in.lcssa.us.i, 32
%idxprom20.us.i = ashr exact i64 %sext.i, 32
%arrayidx21.us.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom20.us.i
store i32 %7, ptr %arrayidx21.us.i, align 4, !tbaa !5
br label %for.body24.us.i
for.body24.us.i: ; preds = %for.body24.us.i, %while.end.us.i
%indvars.iv88.i = phi i64 [ 0, %while.end.us.i ], [ %indvars.iv.next89.i, %for.body24.us.i ]
%cmp26.us.i = icmp eq i64 %indvars.iv88.i, %6
%arrayidx29.us.sink.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv88.i
%.str.sink.i = select i1 %cmp26.us.i, ptr @.str, ptr @.str.1
%9 = load i32, ptr %arrayidx29.us.sink.i, align 4, !tbaa !5
%call30.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.sink.i, i32 noundef %9)
%indvars.iv.next89.i = add nuw nsw i64 %indvars.iv88.i, 1
%exitcond93.not.i = icmp eq i64 %indvars.iv.next89.i, %wide.trip.count.i
br i1 %exitcond93.not.i, label %for.cond22.for.inc39_crit_edge.us.i, label %for.body24.us.i, !llvm.loop !9
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx18.us.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv85.i
store i32 %8, ptr %arrayidx18.us.i, align 4, !tbaa !5
%10 = icmp sgt i64 %indvars.iv85.i, 1
br i1 %10, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !11
for.cond22.for.inc39_crit_edge.us.i: ; preds = %for.body24.us.i
%indvars.iv.next84.i = add nuw nsw i64 %indvars.iv83.i, 1
%exitcond97.not.i = icmp eq i64 %indvars.iv.next84.i, %wide.trip.count.i
br i1 %exitcond97.not.i, label %insertionSort.exit, label %for.body7.us.i, !llvm.loop !12
for.body.i: ; preds = %for.body.i, %for.body.lr.ph.i
%indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.body.i ]
%cmp1.i = icmp eq i64 %indvars.iv.i, %6
%arrayidx.sink.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i
%.str.sink99.i = select i1 %cmp1.i, ptr @.str, ptr @.str.1
%11 = load i32, ptr %arrayidx.sink.i, align 4, !tbaa !5
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.sink99.i, i32 noundef %11)
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.cond5.preheader.i, label %for.body.i, !llvm.loop !13
insertionSort.exit: ; preds = %for.cond22.for.inc39_crit_edge.us.i, %entry, %for.end, %for.cond5.preheader.i
call void @llvm.stackrestore.p0(ptr %2)
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: 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
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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>
#define MAX 101
void print(int n,int *A){
int i;
for(i=0;i<n-1;i++)
printf("%d ",A[i]);
printf("%d\n",A[i]);
}
void insertion_sort(int n,int *A){
int i,j,v;
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;
print(n,A);
}
}
int main(){
int n,i;
int a[MAX];
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
insertion_sort(n,a);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115721/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115721/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(i32 noundef %n, ptr nocapture noundef readonly %A) 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 @insertion_sort(i32 noundef %n, ptr nocapture noundef %A) local_unnamed_addr #0 {
entry:
%cmp32 = icmp sgt i32 %n, 0
br i1 %cmp32, label %for.body.lr.ph, label %for.end
for.body.lr.ph: ; preds = %entry
%cmp8.i.not = icmp eq i32 %n, 1
%sub.i = add nsw i32 %n, -1
%wide.trip.count.i = zext i32 %sub.i to i64
br i1 %cmp8.i.not, label %for.end.loopexit, label %for.body.lr.ph.split.us
for.body.lr.ph.split.us: ; preds = %for.body.lr.ph
%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 = %print.exit.loopexit.us, %for.body.lr.ph.split.us
%indvars.iv = phi i64 [ %indvars.iv.next, %print.exit.loopexit.us ], [ 0, %for.body.lr.ph.split.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%0 = load i32, ptr %arrayidx.us, align 4, !tbaa !5
%cmp128.us.not = icmp eq i64 %indvars.iv, 0
br i1 %cmp128.us.not, label %while.end.us, label %land.rhs.us
land.rhs.us: ; preds = %for.body.us, %while.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 = %land.rhs.us, %while.body.us, %for.body.us
%j.0.in.lcssa.us = phi i64 [ 0, %for.body.us ], [ 0, %while.body.us ], [ %indvars.iv35, %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 %print.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.iv35
store i32 %1, ptr %arrayidx8.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 !11
print.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.loopexit: ; preds = %for.body.lr.ph
%5 = load i32, ptr %A, align 4, !tbaa !5
%call3.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
br label %for.end
for.end: ; preds = %print.exit.loopexit.us, %for.end.loopexit, %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) #3
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #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 %insertion_sort.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.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
%cmp32.i = icmp sgt i32 %1, 0
br i1 %cmp32.i, label %for.body.lr.ph.i, label %insertion_sort.exit
for.body.lr.ph.i: ; preds = %for.end
%cmp8.i.not.i = icmp eq i32 %1, 1
%sub.i.i = add nsw i32 %1, -1
%wide.trip.count.i.i = zext i32 %sub.i.i to i64
br i1 %cmp8.i.not.i, label %for.end.loopexit.i, label %for.body.lr.ph.split.us.i
for.body.lr.ph.split.us.i: ; preds = %for.body.lr.ph.i
%arrayidx2.i.us.i = getelementptr inbounds i32, ptr %a, 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 = %print.exit.loopexit.us.i, %for.body.lr.ph.split.us.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %print.exit.loopexit.us.i ], [ 0, %for.body.lr.ph.split.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.us.i, align 4, !tbaa !5
%cmp128.us.not.i = icmp eq i64 %indvars.iv.i, 0
br i1 %cmp128.us.not.i, label %while.end.us.i, label %land.rhs.us.i
land.rhs.us.i: ; preds = %for.body.us.i, %while.body.us.i
%indvars.iv35.i = phi i64 [ %indvars.iv.next36.i, %while.body.us.i ], [ %indvars.iv.i, %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
%4 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %4, %3
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, %for.body.us.i
%j.0.in.lcssa.us.i = phi i64 [ 0, %for.body.us.i ], [ %indvars.iv35.i, %land.rhs.us.i ], [ 0, %while.body.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 %3, 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
%5 = 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 %5)
%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.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.iv35.i
store i32 %4, ptr %arrayidx8.us.i, align 4, !tbaa !5
%6 = icmp sgt i64 %indvars.iv35.i, 1
br i1 %6, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !11
print.exit.loopexit.us.i: ; preds = %for.body.i.us.i
%7 = 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 %7)
%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 %insertion_sort.exit, label %for.body.us.i, !llvm.loop !12
for.end.loopexit.i: ; preds = %for.body.lr.ph.i
%8 = load i32, ptr %a, align 16, !tbaa !5
%call3.i.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8)
br label %insertion_sort.exit
insertion_sort.exit: ; preds = %print.exit.loopexit.us.i, %entry, %for.end, %for.end.loopexit.i
call void @llvm.lifetime.end.p0(i64 404, 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>
int main(){
int N ,v,i,j;
int A[1000];
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d",&A[i]);
}
for(j=0;j<N;j++){
printf("%d", A[j]);
if (j != N-1) printf(" ");
}
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(j=0;j<N;j++){
printf("%d",A[j]);
if(j != N-1) printf(" ");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115765/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115765/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%cmp72 = icmp sgt i32 %0, 0
br i1 %cmp72, 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 [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.inc10
%indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.inc10 ], [ 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, 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.iv84, %6
br i1 %cmp8.not, label %for.inc10, label %if.then
if.then: ; preds = %for.body4
%putchar71 = 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.next85 = add nuw nsw i64 %indvars.iv84, 1
%8 = sext i32 %7 to i64
%cmp3 = icmp slt i64 %indvars.iv.next85, %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
%cmp1581 = icmp sgt i32 %9, 1
br i1 %cmp1581, label %for.body16, label %for.end48
for.body16: ; preds = %for.end12, %for.end44
%10 = phi i32 [ %19, %for.end44 ], [ %9, %for.end12 ]
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.end44 ], [ 1, %for.end12 ]
%arrayidx18 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv87
%11 = load i32, ptr %arrayidx18, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body16, %while.body
%indvars.iv89 = phi i64 [ %indvars.iv87, %for.body16 ], [ %indvars.iv.next90, %while.body ]
%indvars.iv.next90 = add nsw i64 %indvars.iv89, -1
%idxprom21 = and i64 %indvars.iv.next90, 4294967295
%arrayidx22 = getelementptr inbounds [1000 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 [1000 x i32], ptr %A, i64 0, i64 %indvars.iv89
store i32 %12, ptr %arrayidx27, align 4, !tbaa !5
%13 = icmp sgt i64 %indvars.iv89, 1
br i1 %13, 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
%idxprom29 = ashr exact i64 %sext, 32
%arrayidx30 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom29
store i32 %11, ptr %arrayidx30, align 4, !tbaa !5
%cmp3279 = icmp sgt i32 %10, 0
br i1 %cmp3279, label %for.body33, label %for.end44
for.body33: ; preds = %while.end, %for.inc42
%indvars.iv92 = phi i64 [ %indvars.iv.next93, %for.inc42 ], [ 0, %while.end ]
%arrayidx35 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv92
%14 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%call36 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %14)
%15 = load i32, ptr %N, align 4, !tbaa !5
%sub37 = add nsw i32 %15, -1
%16 = zext i32 %sub37 to i64
%cmp38.not = icmp eq i64 %indvars.iv92, %16
br i1 %cmp38.not, label %for.inc42, label %if.then39
if.then39: ; preds = %for.body33
%putchar70 = call i32 @putchar(i32 32)
%.pre98 = load i32, ptr %N, align 4, !tbaa !5
br label %for.inc42
for.inc42: ; preds = %for.body33, %if.then39
%17 = phi i32 [ %15, %for.body33 ], [ %.pre98, %if.then39 ]
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%18 = sext i32 %17 to i64
%cmp32 = icmp slt i64 %indvars.iv.next93, %18
br i1 %cmp32, label %for.body33, label %for.end44, !llvm.loop !13
for.end44: ; preds = %for.inc42, %while.end
%putchar69 = call i32 @putchar(i32 10)
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%19 = load i32, ptr %N, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp15 = icmp slt i64 %indvars.iv.next88, %20
br i1 %cmp15, label %for.body16, label %for.end48, !llvm.loop !14
for.end48: ; preds = %for.end44, %for.end12
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 i, j, size, a[100], key;
scanf("%d", &size);
for(i = 0; i < size; i++){
scanf("%d",&a[i]);
}
for(j = 0; j < size-1; j++){
printf("%d ",a[j]);
}
printf("%d\n", a[size-1]);
for(i = 1; i < size; i++){
key = a[i];
j = i-1;
while(j >= 0 && a[j] > key){
a[j+1] = a[j];
j--;
a[j+1] = key;
}
for(j = 0; j < size-1; j++){
printf("%d ", a[j]);
}
printf("%d\n", a[size-1]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115808/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115808/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%size = alloca i32, align 4
%a = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %size) #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 %size)
%0 = load i32, ptr %size, align 4, !tbaa !5
%cmp68 = icmp sgt i32 %0, 0
br i1 %cmp68, label %for.body, label %for.cond2.preheader.for.end10_crit_edge
for.cond2.preheader: ; preds = %for.body
%cmp371 = icmp sgt i32 %2, 1
br i1 %cmp371, 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 ]
%sub70 = add nsw i32 %1, -1
%.pre = sext i32 %sub70 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 [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 %size, 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.iv85 = phi i64 [ %indvars.iv.next86, %for.body4 ], [ 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.1, i32 noundef %4)
%indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
%5 = load i32, ptr %size, align 4, !tbaa !5
%sub = add nsw i32 %5, -1
%6 = sext i32 %sub to i64
%cmp3 = icmp slt i64 %indvars.iv.next86, %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 [100 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 %size, align 4, !tbaa !5
%cmp1680 = icmp sgt i32 %8, 1
br i1 %cmp1680, label %for.body17, label %for.end48
for.body17: ; preds = %for.end10, %for.end41
%9 = phi i32 [ %17, %for.end41 ], [ %8, %for.end10 ]
%indvars.iv88 = phi i64 [ %indvars.iv.next89, %for.end41 ], [ 1, %for.end10 ]
%arrayidx19 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv88
%10 = load i32, ptr %arrayidx19, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body17, %while.body
%indvars.iv90 = phi i64 [ %indvars.iv88, %for.body17 ], [ %indvars.iv.next91, %while.body ]
%indvars.iv.next91 = add nsw i64 %indvars.iv90, -1
%idxprom22 = and i64 %indvars.iv.next91, 4294967295
%arrayidx23 = getelementptr inbounds [100 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 [100 x i32], ptr %a, i64 0, i64 %indvars.iv90
store i32 %11, ptr %arrayidx28, align 4, !tbaa !5
store i32 %10, ptr %arrayidx23, align 4, !tbaa !5
%12 = icmp sgt i64 %indvars.iv90, 1
br i1 %12, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%cmp3477 = icmp sgt i32 %9, 1
br i1 %cmp3477, label %for.body35, label %while.end.for.end41_crit_edge
while.end.for.end41_crit_edge: ; preds = %while.end
%sub3376 = add nsw i32 %9, -1
%.pre99 = sext i32 %sub3376 to i64
br label %for.end41
for.body35: ; preds = %while.end, %for.body35
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body35 ], [ 0, %while.end ]
%arrayidx37 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv93
%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.next94 = add nuw nsw i64 %indvars.iv93, 1
%14 = load i32, ptr %size, align 4, !tbaa !5
%sub33 = add nsw i32 %14, -1
%15 = sext i32 %sub33 to i64
%cmp34 = icmp slt i64 %indvars.iv.next94, %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 [ %.pre99, %while.end.for.end41_crit_edge ], [ %15, %for.body35 ]
%arrayidx44 = getelementptr inbounds [100 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.next89 = add nuw nsw i64 %indvars.iv88, 1
%17 = load i32, ptr %size, align 4, !tbaa !5
%18 = sext i32 %17 to i64
%cmp16 = icmp slt i64 %indvars.iv.next89, %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 400, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %size) #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);
void insertsort(int A[],int N);
int main(void){
int N,i,j;
scanf("%d",&N);
int A[N];
for(i=0;i<N;i++){scanf("%d",&A[i]);}
trace(A,N);
insertsort(A,N);
return 0;
}
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 insertsort(int A[],int N){
int j,i,v;
int k;
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);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115851/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115851/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %3, 0
br i1 %cmp7, 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 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
%cmp8.i = icmp sgt i32 %4, 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 %4 to i64
%.pre.i = load i32, ptr %vla, align 16, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %4, 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 %vla, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6)
%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 !11
trace.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%7 = load i32, ptr %N, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %7, 1
br i1 %cmp30.i, label %for.body.us.preheader.i, label %insertsort.exit
for.body.us.preheader.i: ; preds = %trace.exit
%wide.trip.count.i.i = zext i32 %7 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.i4 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i5, %trace.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i4
%8 = 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 %vla, i64 %idxprom2.us.i
%9 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %9, %8
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 %vla, i64 %idxprom10.us.i
store i32 %8, ptr %arrayidx11.us.i, align 4, !tbaa !5
%.pre.i.us.i = load i32, ptr %vla, align 16, !tbaa !5
%call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, 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 %vla, i64 %indvars.iv.i.us.i
%10 = 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, i32 noundef %10)
%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 !11
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv34.i
store i32 %9, ptr %arrayidx8.us.i, align 4, !tbaa !5
%11 = icmp sgt i64 %indvars.iv34.i, 1
br i1 %11, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !13
trace.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 %insertsort.exit, label %for.body.us.i, !llvm.loop !14
insertsort.exit: ; preds = %trace.exit.loopexit.us.i, %trace.exit
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @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, 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, 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 !11
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertsort(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, 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, 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 !11
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 !13
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 !14
for.end: ; preds = %trace.exit.loopexit.us, %entry
ret void
}
; 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 @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 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}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int main(){
int i,j,k,n,v;
int A[10000];
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
if(i>0)printf(" ");
printf("%d",A[i]);
}
printf("\n");
for(i=1;i<=n-1;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_115895/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115895/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [10000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 40000, ptr nonnull %A) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp62 = icmp sgt i32 %0, 0
br i1 %cmp62, 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 %A)
%.pre = load i32, ptr %A, align 16, !tbaa !5
%call6.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, 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 [10000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%putchar61 = 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, 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
%cmp9.not.not69 = icmp sgt i32 %5, 1
br i1 %cmp9.not.not69, label %for.body10, label %for.end41
for.body10: ; preds = %for.end, %for.end37
%6 = phi i32 [ %14, %for.end37 ], [ %5, %for.end ]
%indvars.iv73 = phi i64 [ %indvars.iv.next74, %for.end37 ], [ 1, %for.end ]
%arrayidx12 = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %indvars.iv73
%7 = load i32, ptr %arrayidx12, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body10, %while.body
%indvars.iv75 = phi i64 [ %indvars.iv73, %for.body10 ], [ %indvars.iv.next76, %while.body ]
%indvars.iv.next76 = add nsw i64 %indvars.iv75, -1
%idxprom15 = and i64 %indvars.iv.next76, 4294967295
%arrayidx16 = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %idxprom15
%8 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %8, %7
br i1 %cmp17, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx21 = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %indvars.iv75
store i32 %8, ptr %arrayidx21, align 4, !tbaa !5
%9 = icmp sgt i64 %indvars.iv75, 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.iv75, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom23 = ashr exact i64 %sext, 32
%arrayidx24 = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %idxprom23
store i32 %7, ptr %arrayidx24, align 4, !tbaa !5
%cmp2667 = icmp sgt i32 %6, 0
br i1 %cmp2667, label %if.end31.peel, label %for.end37
if.end31.peel: ; preds = %while.end
%.pre85 = load i32, ptr %A, align 16, !tbaa !5
%call34.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre85)
%10 = load i32, ptr %n, align 4, !tbaa !5
%cmp26.peel = icmp sgt i32 %10, 1
br i1 %cmp26.peel, label %if.end31, label %for.end37
if.end31: ; preds = %if.end31.peel, %if.end31
%indvars.iv78 = phi i64 [ %indvars.iv.next79, %if.end31 ], [ 1, %if.end31.peel ]
%putchar60 = call i32 @putchar(i32 32)
%arrayidx33 = getelementptr inbounds [10000 x i32], ptr %A, i64 0, i64 %indvars.iv78
%11 = load i32, ptr %arrayidx33, align 4, !tbaa !5
%call34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11)
%indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
%12 = load i32, ptr %n, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp26 = icmp slt i64 %indvars.iv.next79, %13
br i1 %cmp26, label %if.end31, label %for.end37, !llvm.loop !13
for.end37: ; preds = %if.end31, %if.end31.peel, %while.end
%putchar59 = call i32 @putchar(i32 10)
%indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
%14 = load i32, ptr %n, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp9.not.not = icmp slt i64 %indvars.iv.next74, %15
br i1 %cmp9.not.not, label %for.body10, label %for.end41, !llvm.loop !14
for.end41: ; preds = %for.end37, %for.end
call void @llvm.lifetime.end.p0(i64 40000, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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, !11}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main(){
int i;
int length;
int c;
scanf("%d",&length);
int A[length];
for(i = 0 ; i < length ; i++){
scanf("%d" , &A[i]);
}
for(c = 0 ; c < length ; c++){
printf("%d",A[c]);
if(length - 1 != c)printf(" ");
}
printf("\n");
/*insertion sort start*/
int v;
int j;
for(i = 1 ; i < length ; i++){
int v = A[i];
int j = i - 1;
while (j >= 0){
if(A[j] < v)break;
A[j+1] = A[j];
j--;
}
A[j+1] = v;
for(c = 0 ; c < length ; c++){
printf("%d",A[c]);
if(length - 1 != c)printf(" ");
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115938/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115938/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%length = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %length) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %length)
%0 = load i32, ptr %length, 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 %length, align 4, !tbaa !5
%cmp75 = icmp sgt i32 %3, 0
br i1 %cmp75, label %for.body, label %for.end12
for.cond2.preheader: ; preds = %for.body
%4 = icmp sgt i32 %5, 0
br i1 %4, 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 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 %length, 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.inc10
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.inc10 ], [ 0, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87
%7 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7)
%8 = load i32, ptr %length, align 4, !tbaa !5
%sub = add nsw i32 %8, -1
%9 = zext i32 %sub to i64
%cmp8.not = icmp eq i64 %indvars.iv87, %9
br i1 %cmp8.not, label %for.inc10, label %if.then
if.then: ; preds = %for.body4
%putchar74 = call i32 @putchar(i32 32)
%.pre = load i32, ptr %length, align 4, !tbaa !5
br label %for.inc10
for.inc10: ; preds = %for.body4, %if.then
%10 = phi i32 [ %8, %for.body4 ], [ %.pre, %if.then ]
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%11 = sext i32 %10 to i64
%cmp3 = icmp slt i64 %indvars.iv.next88, %11
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)
%12 = load i32, ptr %length, align 4, !tbaa !5
%cmp1584 = icmp sgt i32 %12, 1
br i1 %cmp1584, label %for.body16, label %for.end52
for.body16: ; preds = %for.end12, %for.end48
%13 = phi i32 [ %22, %for.end48 ], [ %12, %for.end12 ]
%indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.end48 ], [ 1, %for.end12 ]
%arrayidx19 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv90
%14 = load i32, ptr %arrayidx19, align 4, !tbaa !5
br label %while.body
while.body: ; preds = %for.body16, %if.end27
%indvars.iv92 = phi i64 [ %indvars.iv90, %for.body16 ], [ %indvars.iv.next93, %if.end27 ]
%indvars.iv.next93 = add nsw i64 %indvars.iv92, -1
%idxprom23 = and i64 %indvars.iv.next93, 4294967295
%arrayidx24 = getelementptr inbounds i32, ptr %vla, i64 %idxprom23
%15 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%cmp25 = icmp slt i32 %15, %14
br i1 %cmp25, label %while.end, label %if.end27
if.end27: ; preds = %while.body
%arrayidx31 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv92
store i32 %15, ptr %arrayidx31, align 4, !tbaa !5
%16 = icmp sgt i64 %indvars.iv92, 1
br i1 %16, label %while.body, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %if.end27
%j20.0.in.lcssa = phi i64 [ %indvars.iv92, %while.body ], [ 0, %if.end27 ]
%sext = shl i64 %j20.0.in.lcssa, 32
%idxprom33 = ashr exact i64 %sext, 32
%arrayidx34 = getelementptr inbounds i32, ptr %vla, i64 %idxprom33
store i32 %14, ptr %arrayidx34, align 4, !tbaa !5
%cmp3682 = icmp sgt i32 %13, 0
br i1 %cmp3682, label %for.body37, label %for.end48
for.body37: ; preds = %while.end, %for.inc46
%indvars.iv95 = phi i64 [ %indvars.iv.next96, %for.inc46 ], [ 0, %while.end ]
%arrayidx39 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv95
%17 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%call40 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17)
%18 = load i32, ptr %length, align 4, !tbaa !5
%sub41 = add nsw i32 %18, -1
%19 = zext i32 %sub41 to i64
%cmp42.not = icmp eq i64 %indvars.iv95, %19
br i1 %cmp42.not, label %for.inc46, label %if.then43
if.then43: ; preds = %for.body37
%putchar73 = call i32 @putchar(i32 32)
%.pre101 = load i32, ptr %length, align 4, !tbaa !5
br label %for.inc46
for.inc46: ; preds = %for.body37, %if.then43
%20 = phi i32 [ %18, %for.body37 ], [ %.pre101, %if.then43 ]
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%21 = sext i32 %20 to i64
%cmp36 = icmp slt i64 %indvars.iv.next96, %21
br i1 %cmp36, label %for.body37, label %for.end48, !llvm.loop !13
for.end48: ; preds = %for.inc46, %while.end
%putchar72 = call i32 @putchar(i32 10)
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%22 = load i32, ptr %length, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp15 = icmp slt i64 %indvars.iv.next91, %23
br i1 %cmp15, label %for.body16, label %for.end52, !llvm.loop !14
for.end52: ; preds = %for.end48, %for.end12
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %length) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main(){
int A[1000];
int i,j,N,v;
scanf("%d",&N);
for(i=0;i<N;i++)
scanf("%d",&A[i]);
for(i=1;i<N;i++){
for(j=0;j<N-1;j++)
printf("%d ",A[j]);
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(j=0;j<N-1;j++)
printf("%d ",A[j]);
printf("%d\n",A[N-1]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_115981/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_115981/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%cmp67 = icmp sgt i32 %0, 0
br i1 %cmp67, label %for.body, label %for.cond35.preheader.for.end44_crit_edge
for.cond2.preheader: ; preds = %for.body
%cmp375 = icmp sgt i32 %1, 1
br i1 %cmp375, 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 ]
%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.cond5.preheader: ; preds = %for.cond2.preheader, %while.end
%3 = phi i32 [ %12, %while.end ], [ %1, %for.cond2.preheader ]
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %while.end ], [ 1, %for.cond2.preheader ]
%cmp670 = icmp sgt i32 %3, 1
br i1 %cmp670, label %for.body7, label %for.cond5.preheader.for.end13_crit_edge
for.cond5.preheader.for.end13_crit_edge: ; preds = %for.cond5.preheader
%sub69 = add nsw i32 %3, -1
%.pre = sext i32 %sub69 to i64
br label %for.end13
for.cond35.preheader: ; preds = %while.end
%cmp3778 = icmp sgt i32 %12, 1
br i1 %cmp3778, 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
%4 = phi i32 [ %12, %for.cond35.preheader ], [ %1, %for.cond2.preheader ], [ %0, %entry ]
%sub3677 = add nsw i32 %4, -1
%.pre98 = sext i32 %sub3677 to i64
br label %for.end44
for.body7: ; preds = %for.cond5.preheader, %for.body7
%indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.body7 ], [ 0, %for.cond5.preheader ]
%arrayidx9 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv84
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
%indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%sub = add nsw i32 %6, -1
%7 = sext i32 %sub to i64
%cmp6 = icmp slt i64 %indvars.iv.next85, %7
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 ], [ %7, %for.body7 ]
%arrayidx16 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom15.pre-phi
%8 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%call17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %8)
%arrayidx19 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv87
%9 = load i32, ptr %arrayidx19, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.end13, %while.body
%indvars.iv89 = phi i64 [ %indvars.iv87, %for.end13 ], [ %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
%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 [1000 x i32], ptr %A, i64 0, i64 %indvars.iv89
store i32 %10, ptr %arrayidx28, align 4, !tbaa !5
%11 = icmp sgt i64 %indvars.iv89, 1
br i1 %11, 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 %9, ptr %arrayidx31, align 4, !tbaa !5
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%12 = load i32, ptr %N, align 4, !tbaa !5
%13 = sext i32 %12 to i64
%cmp3 = icmp slt i64 %indvars.iv.next88, %13
br i1 %cmp3, label %for.cond5.preheader, label %for.cond35.preheader, !llvm.loop !13
for.body38: ; preds = %for.cond35.preheader, %for.body38
%indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.body38 ], [ 0, %for.cond35.preheader ]
%arrayidx40 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv94
%14 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %14)
%indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
%15 = load i32, ptr %N, align 4, !tbaa !5
%sub36 = add nsw i32 %15, -1
%16 = sext i32 %sub36 to i64
%cmp37 = icmp slt i64 %indvars.iv.next95, %16
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 [ %.pre98, %for.cond35.preheader.for.end44_crit_edge ], [ %16, %for.body38 ]
%arrayidx47 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom46.pre-phi
%17 = load i32, ptr %arrayidx47, align 4, !tbaa !5
%call48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %17)
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}
!14 = distinct !{!14, !10}
|
#include<stdio.h>
int a[105];
int main()
{
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
for(int i=0;i<n;i++){
int key=a[i];
int j=i-1;
while(j>=0&&a[j]>key){
a[j+1]=a[j];
j--;
}
a[j+1]=key;
for(int i=0;i<n;i++)
if(i==0) printf("%d",a[i]);
else printf(" %d",a[i]);
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116023/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116023/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [105 x i32] zeroinitializer, align 16
@.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) #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.cond.cleanup5
for.cond3.preheader: ; preds = %for.body
%cmp463 = icmp sgt i32 %1, 0
br i1 %cmp463, 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 [105 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.cond3.preheader, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.cond.cleanup23, %entry, %for.cond3.preheader
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
for.body6: ; preds = %for.cond3.preheader, %for.cond.cleanup23
%3 = phi i32 [ %8, %for.cond.cleanup23 ], [ %1, %for.cond3.preheader ]
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.cond.cleanup23 ], [ 0, %for.cond3.preheader ]
%arrayidx8 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %indvars.iv66
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%cmp957.not = icmp eq i64 %indvars.iv66, 0
br i1 %cmp957.not, label %while.end, label %land.rhs
land.rhs: ; preds = %for.body6, %while.body
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %while.body ], [ %indvars.iv66, %for.body6 ]
%indvars.iv.next69 = add nsw i64 %indvars.iv68, -1
%idxprom10 = and i64 %indvars.iv.next69, 4294967295
%arrayidx11 = getelementptr inbounds [105 x i32], ptr @a, 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 [105 x i32], ptr @a, i64 0, i64 %indvars.iv68
store i32 %5, ptr %arrayidx16, 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.body6
%j.0.in.lcssa = phi i64 [ 0, %for.body6 ], [ 0, %while.body ], [ %indvars.iv68, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom18 = ashr exact i64 %sext, 32
%arrayidx19 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %idxprom18
store i32 %4, ptr %arrayidx19, align 4, !tbaa !5
%cmp2261 = icmp sgt i32 %3, 0
br i1 %cmp2261, label %for.inc32.peel, label %for.cond.cleanup23
for.inc32.peel: ; preds = %while.end
%7 = load i32, ptr @a, align 16, !tbaa !5
%call28.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %7)
%.pre = load i32, ptr %n, align 4, !tbaa !5
%cmp22.peel = icmp sgt i32 %.pre, 1
br i1 %cmp22.peel, label %for.inc32, label %for.cond.cleanup23
for.cond.cleanup23: ; preds = %for.inc32, %for.inc32.peel, %while.end
%putchar = call i32 @putchar(i32 10)
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp4 = icmp slt i64 %indvars.iv.next67, %9
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !12
for.inc32: ; preds = %for.inc32.peel, %for.inc32
%indvars.iv71 = phi i64 [ %indvars.iv.next72, %for.inc32 ], [ 1, %for.inc32.peel ]
%arrayidx30 = getelementptr inbounds [105 x i32], ptr @a, i64 0, i64 %indvars.iv71
%10 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10)
%.pre78 = load i32, ptr %n, align 4, !tbaa !5
%indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
%11 = sext i32 %.pre78 to i64
%cmp22 = icmp slt i64 %indvars.iv.next72, %11
br i1 %cmp22, label %for.inc32, label %for.cond.cleanup23, !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>
void trace(int A[], int n){
int i;
for ( i = 1; i <= n; i++ ){
if ( i > 1 ) printf(" ");
printf("%d", A[i]);
}
printf("\n");
}
void move(int *num,int *j,int *stop){
int i,temp;
for(i=*stop-1;i>=*j;i--){
temp=*(num+i);
*(num+i+1)=temp;
}
}
void change(int *num,int *n){
int i,j,temp;
for(i=2;i<=*n;i++){
for(j=1;j<i;j++){
if(*(num+i)<=*(num+j)){
temp=*(num+i);
move(num,&j,&i);
*(num+j)=temp;
break;
}
}
trace(num,*n);
}
}
int main(){
int n, i, j;
int A[1001];
scanf("%d", &n);
for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);
trace(A, n);
change(A,&n);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116067/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116067/source.c"
target datalayout = "e-m:e-p270:32: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 norecurse nosync nounwind memory(argmem: readwrite) uwtable
define dso_local void @move(ptr nocapture noundef %num, ptr nocapture noundef readonly %j, ptr nocapture noundef readonly %stop) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr %stop, align 4, !tbaa !5
%1 = load i32, ptr %j, align 4, !tbaa !5
%cmp.not.not8 = icmp sgt i32 %0, %1
br i1 %cmp.not.not8, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%2 = sext i32 %0 to i64
br label %for.body
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%add.ptr = getelementptr inbounds i32, ptr %num, i64 %indvars.iv.next
%3 = load i32, ptr %add.ptr, align 4, !tbaa !5
%add.ptr3 = getelementptr inbounds i32, ptr %num, i64 %indvars.iv
store i32 %3, ptr %add.ptr3, align 4, !tbaa !5
%4 = load i32, ptr %j, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp.not.not = icmp sgt i64 %indvars.iv.next, %5
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body, %entry
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @change(ptr nocapture noundef %num, ptr nocapture noundef readonly %n) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not31 = icmp slt i32 %0, 2
br i1 %cmp.not31, label %for.end13, label %for.cond1.preheader.lr.ph
for.cond1.preheader.lr.ph: ; preds = %entry
%arrayidx.peel.phi.trans.insert.i = getelementptr inbounds i32, ptr %num, i64 1
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.cond1.preheader.lr.ph, %trace.exit
%1 = phi i32 [ %0, %for.cond1.preheader.lr.ph ], [ %9, %trace.exit ]
%indvars.iv37 = phi i64 [ 2, %for.cond1.preheader.lr.ph ], [ %indvars.iv.next38, %trace.exit ]
%add.ptr = getelementptr inbounds i32, ptr %num, i64 %indvars.iv37
%2 = load i32, ptr %add.ptr, align 4, !tbaa !5
br label %for.body3
for.body3: ; preds = %for.cond1.preheader, %for.inc
%indvars.iv = phi i64 [ 1, %for.cond1.preheader ], [ %indvars.iv.next, %for.inc ]
%add.ptr5 = getelementptr inbounds i32, ptr %num, i64 %indvars.iv
%3 = load i32, ptr %add.ptr5, align 4, !tbaa !5
%cmp6.not = icmp sgt i32 %2, %3
br i1 %cmp6.not, label %for.inc, label %for.body.i.preheader
for.body.i.preheader: ; preds = %for.body3
%4 = and i64 %indvars.iv, 4294967295
br label %for.body.i
for.body.i: ; preds = %for.body.i.preheader, %for.body.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body.i ], [ %indvars.iv37, %for.body.i.preheader ]
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%add.ptr.i = getelementptr inbounds i32, ptr %num, i64 %indvars.iv.next.i
%5 = load i32, ptr %add.ptr.i, align 4, !tbaa !5
%add.ptr3.i = getelementptr inbounds i32, ptr %num, i64 %indvars.iv.i
store i32 %5, ptr %add.ptr3.i, align 4, !tbaa !5
%cmp.not.not.i = icmp sgt i64 %indvars.iv.next.i, %4
br i1 %cmp.not.not.i, label %for.body.i, label %move.exit, !llvm.loop !12
move.exit: ; preds = %for.body.i
%add.ptr10 = getelementptr inbounds i32, ptr %num, i64 %4
store i32 %2, ptr %add.ptr10, align 4, !tbaa !5
%.pre = load i32, ptr %n, align 4, !tbaa !5
br label %for.end
for.inc: ; preds = %for.body3
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %indvars.iv37
br i1 %exitcond.not, label %for.end, label %for.body3, !llvm.loop !13
for.end: ; preds = %for.inc, %move.exit
%6 = phi i32 [ %.pre, %move.exit ], [ %1, %for.inc ]
%cmp.not8.i = icmp slt i32 %6, 1
br i1 %cmp.not8.i, label %trace.exit, label %if.end.peel.i
if.end.peel.i: ; preds = %for.end
%7 = add nuw i32 %6, 1
%wide.trip.count.i = zext i32 %7 to i64
%.pre.i = load i32, ptr %arrayidx.peel.phi.trans.insert.i, align 4, !tbaa !5
%call2.peel.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %7, 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.i23 = phi i64 [ %indvars.iv.next.i24, %if.end.i ], [ 2, %if.end.peel.i ]
%putchar7.i = tail call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %num, i64 %indvars.iv.i23
%8 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8)
%indvars.iv.next.i24 = add nuw nsw i64 %indvars.iv.i23, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i24, %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, %for.end, %if.end.peel.i
%putchar.i = tail call i32 @putchar(i32 10)
%indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp.not.not = icmp slt i64 %indvars.iv37, %10
br i1 %cmp.not.not, label %for.cond1.preheader, label %for.end13, !llvm.loop !14
for.end13: ; preds = %trace.exit, %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 [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %A) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not5 = icmp slt i32 %0, 1
br i1 %cmp.not5, 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 [1001 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.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !15
for.end: ; preds = %for.body
%cmp.not8.i = icmp slt i32 %1, 1
br i1 %cmp.not8.i, label %trace.exit, label %if.end.peel.i
if.end.peel.i: ; preds = %for.end
%3 = add nuw nsw i32 %1, 1
%wide.trip.count.i = zext i32 %3 to i64
%arrayidx.peel.phi.trans.insert.i = getelementptr inbounds i32, ptr %A, 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 %3, 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 %A, i64 %indvars.iv.i
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%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)
call void @change(ptr noundef nonnull %A, ptr noundef nonnull %n)
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: 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 #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main()
{
long long int i,j,n,t,h;
scanf("%lld",&n);
int a[n];
t=0;
for(i=0;i<n;i++)
{
scanf("%lld",&a[i]);
}
t=0;
h=a[0];
t=a[0]+1;
for(i=1;i<n;i++)
{
if(h<=a[i])
{
t=t+(a[i]-h)+2;
h=a[i];
}
else
{
t=t+(h-a[i])+2;
h=a[i];
}
// printf("%d\n",t);
}
printf("%lld\n",t);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11611/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11611/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i64, ptr %n, align 8, !tbaa !5
%1 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %0, align 16
%2 = load i64, ptr %n, align 8, !tbaa !5
%cmp43 = icmp sgt i64 %2, 0
br i1 %cmp43, label %for.body, label %for.end28
for.body: ; preds = %entry, %for.body
%i.044 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %i.044
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%inc = add nuw nsw i64 %i.044, 1
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%.pre = load i32, ptr %vla, align 16, !tbaa !11
%add = add nsw i32 %.pre, 1
%conv4 = sext i32 %add to i64
%cmp645 = icmp sgt i64 %3, 1
br i1 %cmp645, label %for.body8.preheader, label %for.end28
for.body8.preheader: ; preds = %for.end
%conv = sext i32 %.pre to i64
%4 = add i64 %3, -1
%min.iters.check = icmp ult i64 %3, 5
br i1 %min.iters.check, label %for.body8.preheader57, label %vector.ph
vector.ph: ; preds = %for.body8.preheader
%n.vec = and i64 %4, -4
%ind.end = or i64 %n.vec, 1
%5 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %conv4, i64 0
%vector.recur.init = insertelement <2 x i64> poison, i64 %conv, i64 1
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <2 x i64> [ %5, %vector.ph ], [ %18, %vector.body ]
%vec.phi55 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%vector.recur = phi <2 x i64> [ %vector.recur.init, %vector.ph ], [ %9, %vector.body ]
%offset.idx = or i64 %index, 1
%6 = getelementptr inbounds i32, ptr %vla, i64 %offset.idx
%wide.load = load <2 x i32>, ptr %6, align 4, !tbaa !11
%7 = getelementptr inbounds i32, ptr %6, i64 2
%wide.load56 = load <2 x i32>, ptr %7, align 4, !tbaa !11
%8 = sext <2 x i32> %wide.load to <2 x i64>
%9 = sext <2 x i32> %wide.load56 to <2 x i64>
%10 = shufflevector <2 x i64> %vector.recur, <2 x i64> %8, <2 x i32> <i32 1, i32 2>
%11 = shufflevector <2 x i64> %8, <2 x i64> %9, <2 x i32> <i32 1, i32 2>
%12 = sub nsw <2 x i64> %10, %8
%13 = sub nsw <2 x i64> %11, %9
%14 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %12, i1 true)
%15 = call <2 x i64> @llvm.abs.v2i64(<2 x i64> %13, i1 true)
%16 = add <2 x i64> %vec.phi, <i64 2, i64 2>
%17 = add <2 x i64> %vec.phi55, <i64 2, i64 2>
%18 = add <2 x i64> %16, %14
%19 = add <2 x i64> %17, %15
%index.next = add nuw i64 %index, 4
%20 = icmp eq i64 %index.next, %n.vec
br i1 %20, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%bin.rdx = add <2 x i64> %19, %18
%21 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
%cmp.n = icmp eq i64 %4, %n.vec
%vector.recur.extract = extractelement <2 x i64> %9, i64 1
br i1 %cmp.n, label %for.end28, label %for.body8.preheader57
for.body8.preheader57: ; preds = %for.body8.preheader, %middle.block
%i.148.ph = phi i64 [ %ind.end, %middle.block ], [ 1, %for.body8.preheader ]
%t.047.ph = phi i64 [ %21, %middle.block ], [ %conv4, %for.body8.preheader ]
%scalar.recur.ph = phi i64 [ %vector.recur.extract, %middle.block ], [ %conv, %for.body8.preheader ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader57, %for.body8
%i.148 = phi i64 [ %inc27, %for.body8 ], [ %i.148.ph, %for.body8.preheader57 ]
%t.047 = phi i64 [ %t.1, %for.body8 ], [ %t.047.ph, %for.body8.preheader57 ]
%scalar.recur = phi i64 [ %conv10, %for.body8 ], [ %scalar.recur.ph, %for.body8.preheader57 ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %i.148
%22 = load i32, ptr %arrayidx9, align 4, !tbaa !11
%conv10 = sext i32 %22 to i64
%sub21 = sub nsw i64 %scalar.recur, %conv10
%sub.pn = call i64 @llvm.abs.i64(i64 %sub21, i1 true)
%t.1.in = add i64 %t.047, 2
%t.1 = add i64 %t.1.in, %sub.pn
%inc27 = add nuw nsw i64 %i.148, 1
%exitcond.not = icmp eq i64 %inc27, %3
br i1 %exitcond.not, label %for.end28, label %for.body8, !llvm.loop !16
for.end28: ; preds = %for.body8, %middle.block, %entry, %for.end
%t.0.lcssa = phi i64 [ %conv4, %for.end ], [ 0, %entry ], [ %21, %middle.block ], [ %t.1, %for.body8 ]
%call29 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %t.0.lcssa)
call void @llvm.stackrestore.p0(ptr %1)
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: 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 i64 @llvm.abs.i64(i64, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x i64> @llvm.abs.v2i64(<2 x i64>, i1 immarg) #4
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
|
#include<stdio.h>
int main(){
int o,n,k,i,j;
int key;
int A[110];
scanf("%d",&n);
for(i=1;i<=n;i++)scanf("%d",&A[i]);
/*for(o=1;o<=n;o++)
{
if(o == n){printf("%d\n",A[o]);}
else printf("%d ",A[o]);
}
*/
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(k=1;k<=n;k++){
if(k == n)printf("%d\n",A[k]);
else printf("%d ",A[k]);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116175/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116175/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%A = alloca [110 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 440, 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
%cmp.not52 = icmp slt i32 %0, 1
br i1 %cmp.not52, label %for.end34, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp3.not61 = icmp slt i32 %1, 1
br i1 %cmp3.not61, label %for.end34, label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [110 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.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.inc32
%3 = phi i32 [ %12, %for.inc32 ], [ %1, %for.cond2.preheader ]
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.inc32 ], [ 1, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [110 x i32], ptr %A, i64 0, i64 %indvars.iv64
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp755 = icmp ugt i64 %indvars.iv64, 1
br i1 %cmp755, label %land.rhs, label %while.end
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 [110 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 [110 x i32], ptr %A, i64 0, i64 %indvars.iv66
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
%6 = icmp sgt i64 %indvars.iv66, 2
br i1 %6, label %land.rhs, label %while.end, !llvm.loop !11
while.end: ; preds = %land.rhs, %while.body, %for.body4
%i.1.in.lcssa = phi i64 [ %indvars.iv64, %for.body4 ], [ 1, %while.body ], [ %indvars.iv66, %land.rhs ]
%sext = shl i64 %i.1.in.lcssa, 32
%idxprom17 = ashr exact i64 %sext, 32
%arrayidx18 = getelementptr inbounds [110 x i32], ptr %A, i64 0, i64 %idxprom17
store i32 %4, ptr %arrayidx18, align 4, !tbaa !5
%cmp20.not59 = icmp slt i32 %3, 1
br i1 %cmp20.not59, label %while.end.for.inc32_crit_edge, label %for.body21
while.end.for.inc32_crit_edge: ; preds = %while.end
%.pre = sext i32 %3 to i64
br label %for.inc32
for.body21: ; preds = %while.end, %for.body21
%indvars.iv69 = phi i64 [ %indvars.iv.next70, %for.body21 ], [ 1, %while.end ]
%7 = phi i32 [ %10, %for.body21 ], [ %3, %while.end ]
%8 = zext i32 %7 to i64
%cmp22 = icmp eq i64 %indvars.iv69, %8
%arrayidx24 = getelementptr inbounds [110 x i32], ptr %A, i64 0, i64 %indvars.iv69
%9 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%.str.1..str.2 = select i1 %cmp22, ptr @.str.1, ptr @.str.2
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i32 noundef %9)
%indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
%10 = load i32, ptr %n, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp20.not.not = icmp slt i64 %indvars.iv69, %11
br i1 %cmp20.not.not, label %for.body21, label %for.inc32, !llvm.loop !12
for.inc32: ; preds = %for.body21, %while.end.for.inc32_crit_edge
%.pre-phi = phi i64 [ %.pre, %while.end.for.inc32_crit_edge ], [ %11, %for.body21 ]
%12 = phi i32 [ %3, %while.end.for.inc32_crit_edge ], [ %10, %for.body21 ]
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%cmp3.not.not = icmp slt i64 %indvars.iv64, %.pre-phi
br i1 %cmp3.not.not, label %for.body4, label %for.end34, !llvm.loop !13
for.end34: ; preds = %for.inc32, %entry, %for.cond2.preheader
call void @llvm.lifetime.end.p0(i64 440, 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>
int main(void)
{
int N;
int A[1001];
int i,j,k;
int v;
scanf("%d", &N);
for (i = 0; i < N; i++){
scanf("%d", &A[i]);
}
printf("%d", A[0]);
for (i = 1; i < N; i++){
printf(" %d", A[i]);
}
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;
}
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_116218/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116218/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%A = alloca [1001 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4004, ptr nonnull %A) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp64 = icmp sgt i32 %0, 0
call void @llvm.assume(i1 %cmp64)
br label %for.body
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1001 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.loopexit, !llvm.loop !9
for.end.loopexit: ; preds = %for.body
%.pre = load i32, ptr %A, align 16, !tbaa !5
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre)
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp566 = icmp sgt i32 %3, 1
br i1 %cmp566, label %for.body6, label %for.end12
for.body6: ; preds = %for.end.loopexit, %for.body6
%indvars.iv76 = phi i64 [ %indvars.iv.next77, %for.body6 ], [ 1, %for.end.loopexit ]
%arrayidx8 = getelementptr inbounds [1001 x i32], ptr %A, i64 0, i64 %indvars.iv76
%4 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %4)
%indvars.iv.next77 = add nuw nsw i64 %indvars.iv76, 1
%5 = load i32, ptr %N, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp5 = icmp slt i64 %indvars.iv.next77, %6
br i1 %cmp5, label %for.body6, label %for.end12, !llvm.loop !11
for.end12: ; preds = %for.body6, %for.end.loopexit
%putchar = call i32 @putchar(i32 10)
%7 = load i32, ptr %N, align 4, !tbaa !5
%cmp1573 = icmp sgt i32 %7, 1
br i1 %cmp1573, label %for.body16, label %for.end44
for.body16: ; preds = %for.end12, %for.end40
%indvars.iv79 = phi i64 [ %indvars.iv.next80, %for.end40 ], [ 1, %for.end12 ]
%arrayidx18 = getelementptr inbounds [1001 x i32], ptr %A, i64 0, i64 %indvars.iv79
%8 = load i32, ptr %arrayidx18, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body16, %while.body
%indvars.iv81 = phi i64 [ %indvars.iv79, %for.body16 ], [ %indvars.iv.next82, %while.body ]
%indvars.iv.next82 = add nsw i64 %indvars.iv81, -1
%idxprom20 = and i64 %indvars.iv.next82, 4294967295
%arrayidx21 = getelementptr inbounds [1001 x i32], ptr %A, i64 0, i64 %idxprom20
%9 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %9, %8
br i1 %cmp22, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx26 = getelementptr inbounds [1001 x i32], ptr %A, i64 0, i64 %indvars.iv81
store i32 %9, ptr %arrayidx26, align 4, !tbaa !5
store i32 %8, ptr %arrayidx21, align 4, !tbaa !5
%10 = icmp sgt i64 %indvars.iv81, 1
br i1 %10, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %while.body, %land.rhs
%11 = load i32, ptr %A, align 16, !tbaa !5
%call31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11)
%12 = load i32, ptr %N, align 4, !tbaa !5
%cmp3371 = icmp sgt i32 %12, 1
br i1 %cmp3371, label %for.body34, label %for.end40
for.body34: ; preds = %while.end, %for.body34
%indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.body34 ], [ 1, %while.end ]
%arrayidx36 = getelementptr inbounds [1001 x i32], ptr %A, i64 0, i64 %indvars.iv84
%13 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%call37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %13)
%indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
%14 = load i32, ptr %N, align 4, !tbaa !5
%15 = sext i32 %14 to i64
%cmp33 = icmp slt i64 %indvars.iv.next85, %15
br i1 %cmp33, label %for.body34, label %for.end40, !llvm.loop !13
for.end40: ; preds = %for.body34, %while.end
%putchar63 = call i32 @putchar(i32 10)
%indvars.iv.next80 = add nuw nsw i64 %indvars.iv79, 1
%16 = load i32, ptr %N, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp15 = icmp slt i64 %indvars.iv.next80, %17
br i1 %cmp15, label %for.body16, label %for.end44, !llvm.loop !14
for.end44: ; preds = %for.end40, %for.end12
call void @llvm.lifetime.end.p0(i64 4004, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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 willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #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 willreturn memory(inaccessiblemem: write) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
void printconsole(int A[],int n){
for (int k = 0; k < n; k++) {
printf("%d",A[k]);
if(k != n-1)putchar(' ');
}
putchar('\n');
}
void shellsort(int A[],int n){
}
void insertionSort(int A[],int n){
int v,j;
for (int i = 1; i < n; i++) {
printconsole(A,n);
v = A[i];
j = i - 1;
while(j >= 0 && A[j] > v){
A[j+1] = A[j];
j--;
}
A[j+1] = v;
}
printconsole(A,n);
}
int main(int argc, const char * argv[]) {
int n;
int A[100];
scanf("%d",&n);
for (int i = 0; i < n; i++) {
scanf("%d",&A[i]);
}
insertionSort(A, n);
/*
printf("%d\n",n);
for (int i = 0; i < n; i++) {
printf("%d\n",A[i]);
}
*/
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116261/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116261/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree nounwind uwtable
define dso_local void @printconsole(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
%1 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i = tail call i32 @putc(i32 noundef 10, ptr noundef %1)
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
%2 = load i32, ptr %arrayidx, align 4, !tbaa !9
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%cmp1.not = icmp eq i64 %indvars.iv, %0
br i1 %cmp1.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%3 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i8 = tail call i32 @putc(i32 noundef 32, ptr noundef %3)
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 !11
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local void @shellsort(ptr nocapture noundef readnone %A, i32 noundef %n) local_unnamed_addr #3 {
entry:
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp48 = icmp sgt i32 %n, 1
br i1 %cmp48, label %for.body.us.preheader, label %for.cond.cleanup
for.body.us.preheader: ; preds = %entry
%sub.i32 = add nsw i32 %n, -1
%0 = zext i32 %sub.i32 to i64
%wide.trip.count.i33 = zext i32 %n to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %while.end.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %while.end.us ]
br label %for.body.i34.us
for.body.i34.us: ; preds = %for.inc.i41.us, %for.body.us
%indvars.iv.i35.us = phi i64 [ 0, %for.body.us ], [ %indvars.iv.next.i42.us, %for.inc.i41.us ]
%arrayidx.i36.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i35.us
%1 = load i32, ptr %arrayidx.i36.us, align 4, !tbaa !9
%call.i37.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %1)
%cmp1.not.i38.us = icmp eq i64 %indvars.iv.i35.us, %0
br i1 %cmp1.not.i38.us, label %for.inc.i41.us, label %if.then.i39.us
if.then.i39.us: ; preds = %for.body.i34.us
%2 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i8.i40.us = tail call i32 @putc(i32 noundef 32, ptr noundef %2)
br label %for.inc.i41.us
for.inc.i41.us: ; preds = %if.then.i39.us, %for.body.i34.us
%indvars.iv.next.i42.us = add nuw nsw i64 %indvars.iv.i35.us, 1
%exitcond.not.i43.us = icmp eq i64 %indvars.iv.next.i42.us, %wide.trip.count.i33
br i1 %exitcond.not.i43.us, label %printconsole.exit44.loopexit.us, label %for.body.i34.us, !llvm.loop !11
land.rhs.us: ; preds = %while.body.us, %printconsole.exit44.loopexit.us
%indvars.iv51 = phi i64 [ %indvars.iv.next52, %while.body.us ], [ %indvars.iv, %printconsole.exit44.loopexit.us ]
%indvars.iv.next52 = add nsw i64 %indvars.iv51, -1
%idxprom2.us = and i64 %indvars.iv.next52, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us
%3 = load i32, ptr %arrayidx3.us, align 4, !tbaa !9
%cmp4.us = icmp sgt i32 %3, %6
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.iv51, %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 %6, ptr %arrayidx11.us, align 4, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count.i33
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body.us, !llvm.loop !13
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv51
store i32 %3, ptr %arrayidx8.us, align 4, !tbaa !9
%4 = icmp sgt i64 %indvars.iv51, 1
br i1 %4, label %land.rhs.us, label %while.end.us, !llvm.loop !14
printconsole.exit44.loopexit.us: ; preds = %for.inc.i41.us
%5 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i.i30.us = tail call i32 @putc(i32 noundef 10, ptr noundef %5)
%arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%6 = load i32, ptr %arrayidx.us, align 4, !tbaa !9
br label %land.rhs.us
for.cond.cleanup: ; preds = %while.end.us, %entry
%cmp9.i = icmp sgt i32 %n, 0
br i1 %cmp9.i, label %for.body.lr.ph.i, label %printconsole.exit
for.body.lr.ph.i: ; preds = %for.cond.cleanup
%sub.i = add nsw i32 %n, -1
%7 = zext i32 %sub.i to i64
%wide.trip.count.i = zext i32 %n 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
%8 = load i32, ptr %arrayidx.i, align 4, !tbaa !9
%call.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8)
%cmp1.not.i = icmp eq i64 %indvars.iv.i, %7
br i1 %cmp1.not.i, label %for.inc.i, label %if.then.i
if.then.i: ; preds = %for.body.i
%9 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i8.i = tail call i32 @putc(i32 noundef 32, ptr noundef %9)
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 %printconsole.exit, label %for.body.i, !llvm.loop !11
printconsole.exit: ; preds = %for.inc.i, %for.cond.cleanup
%10 = load ptr, ptr @stdout, align 8, !tbaa !5
%call.i.i = tail call i32 @putc(i32 noundef 10, ptr noundef %10)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%A = alloca [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 !9
%cmp4 = icmp sgt i32 %0, 0
br i1 %cmp4, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @insertionSort(ptr noundef nonnull %A, i32 noundef %.lcssa)
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
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 !9
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !15
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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 = !{!"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 insertionSort(int *,int);
void print(int *,int);
int main()
{
int N,i;
scanf("%d",&N);
int number[N];
for(i=0;i<N;i++){
scanf("%d",&number[i]);
}
insertionSort(number,N);
return 0;
}
void insertionSort(int *number,int n)
{
int i,j,v;
print(number,n);
for(i=1;i<n;i++){
v = number[i];
j = i-1;
while(j>=0 && number[j]>v){
number[j+1] = number[j];
j--;
}
number[j+1] = v;
print(number,n);
}
}
void print(int *number,int n)
{
int i;
for(i=0;i<n;i++){
printf("%d",number[i]);
if(i < n-1) printf(" ");
else printf("\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116304/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116304/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %3, 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 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, %entry
%.lcssa = phi i32 [ %3, %entry ], [ %4, %for.body ]
call void @insertionSort(ptr noundef nonnull %vla, i32 noundef %.lcssa)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertionSort(ptr nocapture noundef %number, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp9.i = icmp sgt i32 %n, 0
br i1 %cmp9.i, label %for.body.lr.ph.i, label %for.end
for.body.lr.ph.i: ; preds = %entry
%sub.i = add nsw i32 %n, -1
%0 = zext i32 %sub.i to i64
%wide.trip.count.i = zext i32 %n to i64
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.lr.ph.i
%indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.body.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %number, 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)
%cmp1.i = icmp ult i64 %indvars.iv.i, %0
%..i = select i1 %cmp1.i, i32 32, i32 10
%putchar8.i = tail call i32 @putchar(i32 %..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 !11
print.exit: ; preds = %for.body.i
%cmp46 = icmp sgt i32 %n, 1
br i1 %cmp46, label %for.body.us.preheader, label %for.end
for.body.us.preheader: ; preds = %print.exit
%sub.i31 = add nsw i32 %n, -1
%2 = zext i32 %sub.i31 to i64
%wide.trip.count.i32 = zext i32 %n to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %print.exit42.loopexit.us
%indvars.iv54 = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next55, %print.exit42.loopexit.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %number, i64 %indvars.iv54
%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.iv56 = phi i64 [ %indvars.iv.next57, %while.body.us ], [ %indvars.iv54, %for.body.us ]
%indvars.iv.next57 = add nsw i64 %indvars.iv56, -1
%idxprom2.us = and i64 %indvars.iv.next57, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %number, i64 %idxprom2.us
%4 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %4, %3
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.iv56, %land.rhs.us ]
%sext65 = shl i64 %j.0.in.lcssa.us, 32
%idxprom10.us = ashr exact i64 %sext65, 32
%arrayidx11.us = getelementptr inbounds i32, ptr %number, i64 %idxprom10.us
store i32 %3, ptr %arrayidx11.us, align 4, !tbaa !5
br label %for.body.i33.us
for.body.i33.us: ; preds = %for.body.i33.us, %while.end.us
%indvars.iv.i34.us = phi i64 [ 0, %while.end.us ], [ %indvars.iv.next.i40.us, %for.body.i33.us ]
%arrayidx.i35.us = getelementptr inbounds i32, ptr %number, i64 %indvars.iv.i34.us
%5 = load i32, ptr %arrayidx.i35.us, align 4, !tbaa !5
%call.i36.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%cmp1.i37.us = icmp ult i64 %indvars.iv.i34.us, %2
%..i38.us = select i1 %cmp1.i37.us, i32 32, i32 10
%putchar8.i39.us = tail call i32 @putchar(i32 %..i38.us)
%indvars.iv.next.i40.us = add nuw nsw i64 %indvars.iv.i34.us, 1
%exitcond.not.i41.us = icmp eq i64 %indvars.iv.next.i40.us, %wide.trip.count.i32
br i1 %exitcond.not.i41.us, label %print.exit42.loopexit.us, label %for.body.i33.us, !llvm.loop !11
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %number, i64 %indvars.iv56
store i32 %4, ptr %arrayidx8.us, align 4, !tbaa !5
%6 = icmp sgt i64 %indvars.iv56, 1
br i1 %6, label %land.rhs.us, label %while.end.us, !llvm.loop !12
print.exit42.loopexit.us: ; preds = %for.body.i33.us
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond64.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count.i32
br i1 %exitcond64.not, label %for.end, label %for.body.us, !llvm.loop !13
for.end: ; preds = %print.exit42.loopexit.us, %entry, %print.exit
ret void
}
; 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 uwtable
define dso_local void @print(ptr nocapture noundef readonly %number, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp9 = icmp sgt i32 %n, 0
br i1 %cmp9, label %for.body.lr.ph, label %for.end
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.body: ; preds = %for.body.lr.ph, %for.body
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %number, 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 = icmp ult i64 %indvars.iv, %0
%. = select i1 %cmp1, i32 32, i32 10
%putchar8 = tail call i32 @putchar(i32 %.)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !11
for.end: ; preds = %for.body, %entry
ret void
}
; 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 nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main()
{
int i,j,k,A[1000],N,v;
scanf("%d", &N);
for(k=0;k<N;k++)
{
scanf("%d", &A[k]);
}
for(k=0;k<N;k++)
{
if(k>0)printf(" ");
printf("%d",A[k]);
}
printf("\n");
for(i=1;i<=N-1;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_116348/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116348/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [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.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 [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
%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 [1000 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
%cmp15.not.not79 = icmp sgt i32 %8, 1
br i1 %cmp15.not.not79, label %for.body16, label %for.end47
for.body16: ; preds = %for.end12, %for.end43
%9 = phi i32 [ %17, %for.end43 ], [ %8, %for.end12 ]
%indvars.iv86 = phi i64 [ %indvars.iv.next87, %for.end43 ], [ 1, %for.end12 ]
%arrayidx18 = getelementptr inbounds [1000 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
%idxprom21 = and i64 %indvars.iv.next89, 4294967295
%arrayidx22 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom21
%11 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %11, %10
br i1 %cmp23, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx27 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv88
store i32 %11, ptr %arrayidx27, 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
%j.0.in.lcssa = phi i64 [ 0, %while.body ], [ %indvars.iv88, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom29 = ashr exact i64 %sext, 32
%arrayidx30 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom29
store i32 %10, ptr %arrayidx30, align 4, !tbaa !5
%cmp3277 = icmp sgt i32 %9, 0
br i1 %cmp3277, label %if.end37.peel, label %for.end43
if.end37.peel: ; preds = %while.end
%.pre98 = load i32, ptr %A, align 16, !tbaa !5
%call40.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre98)
%13 = load i32, ptr %N, align 4, !tbaa !5
%cmp32.peel = icmp sgt i32 %13, 1
br i1 %cmp32.peel, label %if.end37, label %for.end43
if.end37: ; preds = %if.end37.peel, %if.end37
%indvars.iv91 = phi i64 [ %indvars.iv.next92, %if.end37 ], [ 1, %if.end37.peel ]
%putchar68 = call i32 @putchar(i32 32)
%arrayidx39 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv91
%14 = load i32, ptr %arrayidx39, align 4, !tbaa !5
%call40 = 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
%cmp32 = icmp slt i64 %indvars.iv.next92, %16
br i1 %cmp32, label %if.end37, label %for.end43, !llvm.loop !14
for.end43: ; preds = %if.end37, %if.end37.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.not.not = icmp slt i64 %indvars.iv.next87, %18
br i1 %cmp15.not.not, label %for.body16, label %for.end47, !llvm.loop !15
for.end47: ; preds = %for.end43, %for.end12
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}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int main()
{
int N, i, j, v, k, array[100];
scanf("%d", &N);
for( i=0; i<N; i++ ) scanf("%d", &array[i]);
for( i=1; i<N; i++ )
{
v = array[i];
j = i - 1;
for( k=0; k<N; k++ )
{
printf("%d", array[k]);
if( k == N-1 )break;
printf(" ");
}
printf("\n");
while( j>=0 && array[j]>v )
{
array[j+1] = array[j];
j--;
array[j+1] = v;
}
}
for( i=0; i<N; i++ )
{
printf("%d", array[i]);
if( i == N-1 )break;
printf(" ");
}
printf("\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116391/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116391/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%array = 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 %array) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp72 = icmp sgt i32 %0, 0
br i1 %cmp72, label %for.body, label %for.end47
for.cond2.preheader: ; preds = %for.body
%cmp379 = icmp sgt i32 %1, 1
br i1 %cmp379, label %for.body4, label %for.cond34.preheader
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, 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.cond34.preheader: ; preds = %for.inc31, %for.cond2.preheader
%3 = phi i32 [ %1, %for.cond2.preheader ], [ %13, %for.inc31 ]
%cmp3581 = icmp sgt i32 %3, 0
br i1 %cmp3581, label %for.body36, label %for.end47
for.body4: ; preds = %for.cond2.preheader, %for.inc31
%4 = phi i32 [ %13, %for.inc31 ], [ %1, %for.cond2.preheader ]
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.inc31 ], [ 1, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv87
%5 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp874 = icmp sgt i32 %4, 0
br i1 %cmp874, label %for.body9, label %for.end18
for.body9: ; preds = %for.body4, %if.end
%indvars.iv84 = phi i64 [ %indvars.iv.next85, %if.end ], [ 0, %for.body4 ]
%arrayidx11 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv84
%6 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%call12 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6)
%7 = load i32, ptr %N, align 4, !tbaa !5
%sub13 = add nsw i32 %7, -1
%8 = zext i32 %sub13 to i64
%cmp14 = icmp eq i64 %indvars.iv84, %8
br i1 %cmp14, label %for.end18, label %if.end
if.end: ; preds = %for.body9
%putchar70 = call i32 @putchar(i32 32)
%indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
%9 = load i32, ptr %N, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp8 = icmp slt i64 %indvars.iv.next85, %10
br i1 %cmp8, label %for.body9, label %for.end18, !llvm.loop !11
for.end18: ; preds = %if.end, %for.body9, %for.body4
%putchar71 = call i32 @putchar(i32 10)
br label %land.rhs
land.rhs: ; preds = %for.end18, %while.body
%indvars.iv89 = phi i64 [ %indvars.iv87, %for.end18 ], [ %indvars.iv.next90, %while.body ]
%indvars.iv.next90 = add nsw i64 %indvars.iv89, -1
%idxprom21 = and i64 %indvars.iv.next90, 4294967295
%arrayidx22 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %idxprom21
%11 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%cmp23 = icmp sgt i32 %11, %5
br i1 %cmp23, label %while.body, label %for.inc31
while.body: ; preds = %land.rhs
%arrayidx27 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv89
store i32 %11, ptr %arrayidx27, align 4, !tbaa !5
store i32 %5, ptr %arrayidx22, align 4, !tbaa !5
%12 = icmp sgt i64 %indvars.iv89, 1
br i1 %12, label %land.rhs, label %for.inc31, !llvm.loop !12
for.inc31: ; preds = %land.rhs, %while.body
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%13 = load i32, ptr %N, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp3 = icmp slt i64 %indvars.iv.next88, %14
br i1 %cmp3, label %for.body4, label %for.cond34.preheader, !llvm.loop !13
for.body36: ; preds = %for.cond34.preheader, %if.end43
%indvars.iv94 = phi i64 [ %indvars.iv.next95, %if.end43 ], [ 0, %for.cond34.preheader ]
%arrayidx38 = getelementptr inbounds [100 x i32], ptr %array, i64 0, i64 %indvars.iv94
%15 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%16 = load i32, ptr %N, align 4, !tbaa !5
%sub40 = add nsw i32 %16, -1
%17 = zext i32 %sub40 to i64
%cmp41 = icmp eq i64 %indvars.iv94, %17
br i1 %cmp41, label %for.end47, label %if.end43
if.end43: ; preds = %for.body36
%putchar = call i32 @putchar(i32 32)
%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
%cmp35 = icmp slt i64 %indvars.iv.next95, %19
br i1 %cmp35, label %for.body36, label %for.end47, !llvm.loop !14
for.end47: ; preds = %if.end43, %for.body36, %entry, %for.cond34.preheader
%putchar69 = call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %array) #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);
void insertionSort(int A[],int N);
int main(){
int N,i,j;
int A[1000];
scanf("%d",&N);
if(0<=N && 100>=N){
for ( i=0; i < N; i++ )scanf("%d",&A[i]);
trace(A,N);
insertionSort(A,N);
}
else{ return 0;}
return 0;
}
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);
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116434/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116434/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%or.cond = icmp ult i32 %0, 101
br i1 %or.cond, label %for.cond.preheader, label %cleanup
for.cond.preheader: ; preds = %entry
%cmp213.not = icmp eq i32 %0, 0
br i1 %cmp213.not, label %trace.exit, label %for.body
for.body: ; preds = %for.cond.preheader, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.cond.preheader ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%.pr = load i32, ptr %N, align 4, !tbaa !5
%1 = sext i32 %.pr to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %1
br i1 %cmp2, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%cmp8.i = icmp sgt i32 %.pr, 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 %.pr 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, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %.pr, 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
%2 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %2)
%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 !11
trace.exit: ; preds = %if.end.i, %for.cond.preheader, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%3 = load i32, ptr %N, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %3, 1
br i1 %cmp30.i, label %for.body.us.preheader.i, label %cleanup
for.body.us.preheader.i: ; preds = %trace.exit
%wide.trip.count.i.i = zext i32 %3 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.i10 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i11, %trace.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i10
%4 = 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.i10, %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
%5 = load i32, ptr %arrayidx3.us.i, align 4, !tbaa !5
%cmp4.us.i = icmp sgt i32 %5, %4
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 %4, 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, 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
%6 = 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, i32 noundef %6)
%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 !11
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx8.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv34.i
store i32 %5, ptr %arrayidx8.us.i, align 4, !tbaa !5
%7 = icmp sgt i64 %indvars.iv34.i, 1
br i1 %7, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !13
trace.exit.loopexit.us.i: ; preds = %if.end.i.us.i
%putchar.i.us.i = call i32 @putchar(i32 10)
%indvars.iv.next.i11 = add nuw nsw i64 %indvars.iv.i10, 1
%exitcond.not.i12 = icmp eq i64 %indvars.iv.next.i11, %wide.trip.count.i.i
br i1 %exitcond.not.i12, label %cleanup, label %for.body.us.i, !llvm.loop !14
cleanup: ; preds = %trace.exit.loopexit.us.i, %trace.exit, %entry
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %A) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: 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, 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, 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 !11
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; 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, 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, 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 !11
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 !13
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 !14
for.end: ; preds = %trace.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
; 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}
|
#include <stdio.h>
int main(){
int N,i,j,A[1000],l,v;
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d",&A[i]);
}
for(i=0;i<N;i++){
printf("%d",A[i]);
if(i!=N-1){printf(" ");}
}
printf("\n");
for(i=1;i<=N-1;i++){
v = A[i];
j = i-1;
while(j>=0 && A[j]>v){
A[j+1]=A[j];
j--;
}
A[j+1]=v;
for(l=0;l<N;l++){
printf("%d",A[l]);
if(l!=N-1){printf(" ");}
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116478/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116478/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%cmp72 = icmp sgt i32 %0, 0
br i1 %cmp72, 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 [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.inc10
%indvars.iv84 = phi i64 [ %indvars.iv.next85, %for.inc10 ], [ 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, 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.iv84, %6
br i1 %cmp8.not, label %for.inc10, label %if.then
if.then: ; preds = %for.body4
%putchar71 = 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.next85 = add nuw nsw i64 %indvars.iv84, 1
%8 = sext i32 %7 to i64
%cmp3 = icmp slt i64 %indvars.iv.next85, %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
%cmp16.not.not81 = icmp sgt i32 %9, 1
br i1 %cmp16.not.not81, label %for.body17, label %for.end49
for.body17: ; preds = %for.end12, %for.end45
%10 = phi i32 [ %19, %for.end45 ], [ %9, %for.end12 ]
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.end45 ], [ 1, %for.end12 ]
%arrayidx19 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv87
%11 = 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
%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 [1000 x i32], ptr %A, i64 0, i64 %indvars.iv89
store i32 %12, ptr %arrayidx28, align 4, !tbaa !5
%13 = icmp sgt i64 %indvars.iv89, 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.iv89, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom30 = ashr exact i64 %sext, 32
%arrayidx31 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %idxprom30
store i32 %11, ptr %arrayidx31, align 4, !tbaa !5
%cmp3379 = icmp sgt i32 %10, 0
br i1 %cmp3379, label %for.body34, label %for.end45
for.body34: ; preds = %while.end, %for.inc43
%indvars.iv92 = phi i64 [ %indvars.iv.next93, %for.inc43 ], [ 0, %while.end ]
%arrayidx36 = getelementptr inbounds [1000 x i32], ptr %A, i64 0, i64 %indvars.iv92
%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.iv92, %16
br i1 %cmp39.not, label %for.inc43, label %if.then40
if.then40: ; preds = %for.body34
%putchar70 = call i32 @putchar(i32 32)
%.pre98 = 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 ], [ %.pre98, %if.then40 ]
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%18 = sext i32 %17 to i64
%cmp33 = icmp slt i64 %indvars.iv.next93, %18
br i1 %cmp33, label %for.body34, label %for.end45, !llvm.loop !13
for.end45: ; preds = %for.inc43, %while.end
%putchar69 = call i32 @putchar(i32 10)
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%19 = load i32, ptr %N, align 4, !tbaa !5
%20 = sext i32 %19 to i64
%cmp16.not.not = icmp slt i64 %indvars.iv.next88, %20
br i1 %cmp16.not.not, label %for.body17, label %for.end49, !llvm.loop !14
for.end49: ; preds = %for.end45, %for.end12
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>
void trace(int A[],int N)
{
for(int i=0;i<N;i++){
if(i>0)printf(" ");
printf("%d",A[i]);
}
printf("\n");
}
void insertionSort(int A[],int N)
{
int i,j;
int v;
trace(A,N);
for(int i=1;i<N;i++){
v=A[i];
j=i-1;
while(j>=0&&v<A[j]){
A[j+1]=A[j];
j--;
}
A[j+1]=v;
trace(A,N);
}
}
int main(void)
{
int N;
int A[1000];
scanf("%d",&N);
for(int i=0;i<N;i++){
scanf("%d",&A[i]);
}
insertionSort(A,N);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116520/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116520/source.c"
target datalayout = "e-m:e-p270:32: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.cond.cleanup
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.cond.cleanup, label %if.end
for.cond.cleanup: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
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.cond.cleanup, label %if.end, !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 void @insertionSort(ptr nocapture noundef %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp8.i = icmp sgt i32 %N, 0
br i1 %cmp8.i, label %if.end.peel.i, label %trace.exit.thread
if.end.peel.i: ; preds = %entry
%wide.trip.count.i = zext i32 %N to i64
%.pre.i = load i32, ptr %A, align 4, !tbaa !5
%call2.peel.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %N, 1
br i1 %exitcond.peel.not.i, label %trace.exit.thread, 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 = tail call i32 @putchar(i32 32)
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%0 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %0)
%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.thread: ; preds = %entry, %if.end.peel.i
%putchar.i81 = tail call i32 @putchar(i32 10)
br label %for.cond.cleanup
trace.exit: ; preds = %if.end.i
%putchar.i = tail call i32 @putchar(i32 10)
%cmp48 = icmp sgt i32 %N, 1
br i1 %cmp48, label %for.body.us.preheader, label %for.cond.cleanup
for.body.us.preheader: ; preds = %trace.exit
%wide.trip.count.i33 = zext i32 %N to i64
br label %for.body.us
for.body.us: ; preds = %for.body.us.preheader, %trace.exit44.loopexit.us
%indvars.iv57 = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next58, %trace.exit44.loopexit.us ]
%arrayidx.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv57
%1 = 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.iv59 = phi i64 [ %indvars.iv.next60, %while.body.us ], [ %indvars.iv57, %for.body.us ]
%indvars.iv.next60 = add nsw i64 %indvars.iv59, -1
%idxprom3.us = and i64 %indvars.iv.next60, 4294967295
%arrayidx4.us = getelementptr inbounds i32, ptr %A, i64 %idxprom3.us
%2 = load i32, ptr %arrayidx4.us, align 4, !tbaa !5
%cmp5.us = icmp slt i32 %1, %2
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.iv59, %land.rhs.us ]
%sext79 = shl i64 %j.0.in.lcssa.us, 32
%idxprom11.us = ashr exact i64 %sext79, 32
%arrayidx12.us = getelementptr inbounds i32, ptr %A, i64 %idxprom11.us
store i32 %1, ptr %arrayidx12.us, align 4, !tbaa !5
%.pre.i34.us = load i32, ptr %A, align 4, !tbaa !5
%call2.peel.i35.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.pre.i34.us)
br label %if.end.i37.us
if.end.i37.us: ; preds = %while.end.us, %if.end.i37.us
%indvars.iv.i38.us = phi i64 [ %indvars.iv.next.i42.us, %if.end.i37.us ], [ 1, %while.end.us ]
%putchar7.i39.us = tail call i32 @putchar(i32 32)
%arrayidx.i40.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i38.us
%3 = load i32, ptr %arrayidx.i40.us, align 4, !tbaa !5
%call2.i41.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%indvars.iv.next.i42.us = add nuw nsw i64 %indvars.iv.i38.us, 1
%exitcond.not.i43.us = icmp eq i64 %indvars.iv.next.i42.us, %wide.trip.count.i33
br i1 %exitcond.not.i43.us, label %trace.exit44.loopexit.us, label %if.end.i37.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx9.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv59
store i32 %2, ptr %arrayidx9.us, align 4, !tbaa !5
%4 = icmp sgt i64 %indvars.iv59, 1
br i1 %4, label %land.rhs.us, label %while.end.us, !llvm.loop !12
trace.exit44.loopexit.us: ; preds = %if.end.i37.us
%putchar.i31.us = tail call i32 @putchar(i32 10)
%indvars.iv.next58 = add nuw nsw i64 %indvars.iv57, 1
%exitcond67.not = icmp eq i64 %indvars.iv.next58, %wide.trip.count.i33
br i1 %exitcond67.not, label %for.cond.cleanup, label %for.body.us, !llvm.loop !13
for.cond.cleanup: ; preds = %trace.exit44.loopexit.us, %trace.exit.thread, %trace.exit
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
%cmp4 = icmp sgt i32 %0, 0
br i1 %cmp4, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @insertionSort(ptr noundef nonnull %A, i32 noundef %.lcssa)
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
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.cond.cleanup, !llvm.loop !14
}
; 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>
void insertionsort( int a[] , int n );
void output( int a[] , int n );
int main( void )
{
int n;
scanf( "%d" , &n );
int a[n];
int i;
for( i = 0; i < n; i++ ){
scanf( "%d" , &a[i] );
}
output( a , n );
insertionsort( a , n );
return 0;
}
void insertionsort( int a[] , int n ){
int i , j;
int v;
for( i = 1; i <= n - 1; i++ ){
v = a[i];
j = i - 1;
while( j >= 0 && a[j] > v ){
a[j+1] = a[j];
j--;
}
a[j+1] = v;
output( a , n );
}
}
void output( int a[] , int n ){
int i;
for( i = 0; i < n; i++ ){
if( i > 0 ){
printf( " " );
}
printf( "%d" , a[i] );
}
printf( "\n" );
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116571/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116571/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp7 = icmp sgt i32 %3, 0
br i1 %cmp7, label %for.body, label %output.exit
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
%cmp8.i = icmp sgt i32 %4, 0
br i1 %cmp8.i, label %if.end.peel.i, label %output.exit
if.end.peel.i: ; preds = %for.end
%wide.trip.count.i = zext i32 %4 to i64
%.pre.i = load i32, ptr %vla, align 16, !tbaa !5
%call2.peel.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %.pre.i)
%exitcond.peel.not.i = icmp eq i32 %4, 1
br i1 %exitcond.peel.not.i, label %output.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 %vla, i64 %indvars.iv.i
%6 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call2.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6)
%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 %output.exit, label %if.end.i, !llvm.loop !11
output.exit: ; preds = %if.end.i, %entry, %for.end, %if.end.peel.i
%putchar.i = call i32 @putchar(i32 10)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not.not31.i = icmp sgt i32 %7, 1
br i1 %cmp.not.not31.i, label %for.body.us.preheader.i, label %insertionsort.exit
for.body.us.preheader.i: ; preds = %output.exit
%wide.trip.count.i.i = zext i32 %7 to i64
br label %for.body.us.i
for.body.us.i: ; preds = %output.exit.loopexit.us.i, %for.body.us.preheader.i
%indvars.iv.i4 = phi i64 [ 1, %for.body.us.preheader.i ], [ %indvars.iv.next.i5, %output.exit.loopexit.us.i ]
%arrayidx.us.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv.i4
%8 = 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.i4, %for.body.us.i ]
%indvars.iv.next36.i = add nsw i64 %indvars.iv35.i, -1
%idxprom3.us.i = and i64 %indvars.iv.next36.i, 4294967295
%arrayidx4.us.i = getelementptr inbounds i32, ptr %vla, i64 %idxprom3.us.i
%9 = load i32, ptr %arrayidx4.us.i, align 4, !tbaa !5
%cmp5.us.i = icmp sgt i32 %9, %8
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.iv35.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 %vla, i64 %idxprom11.us.i
store i32 %8, ptr %arrayidx12.us.i, align 4, !tbaa !5
%.pre.i.us.i = load i32, ptr %vla, align 16, !tbaa !5
%call2.peel.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, 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 %vla, i64 %indvars.iv.i.us.i
%10 = 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, i32 noundef %10)
%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 %output.exit.loopexit.us.i, label %if.end.i.us.i, !llvm.loop !11
while.body.us.i: ; preds = %land.rhs.us.i
%arrayidx9.us.i = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv35.i
store i32 %9, ptr %arrayidx9.us.i, align 4, !tbaa !5
%11 = icmp sgt i64 %indvars.iv35.i, 1
br i1 %11, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !13
output.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 %insertionsort.exit, label %for.body.us.i, !llvm.loop !14
insertionsort.exit: ; preds = %output.exit.loopexit.us.i, %output.exit
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind uwtable
define dso_local void @output(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, 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, 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 !11
for.end: ; preds = %if.end, %if.end.peel, %entry
%putchar = tail call i32 @putchar(i32 10)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @insertionsort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp.not.not31 = icmp sgt i32 %n, 1
br i1 %cmp.not.not31, 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, %output.exit.loopexit.us
%indvars.iv = phi i64 [ 1, %for.body.us.preheader ], [ %indvars.iv.next, %output.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
%idxprom3.us = and i64 %indvars.iv.next36, 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 %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.iv35, %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 %a, i64 %idxprom11.us
store i32 %0, ptr %arrayidx12.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, 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, 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 %output.exit.loopexit.us, label %if.end.i.us, !llvm.loop !11
while.body.us: ; preds = %land.rhs.us
%arrayidx9.us = getelementptr inbounds i32, ptr %a, i64 %indvars.iv35
store i32 %1, ptr %arrayidx9.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 !13
output.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 !14
for.end: ; preds = %output.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: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; 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 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}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!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_116614/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116614/source.c"
target datalayout = "e-m:e-p270:32: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>
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_A&lang=jp
void print_list(int a[], int n) {
int i = 0;
for (i = 0; i < n; i++) {
printf("%d", a[i]);
if (i == n - 1)
printf("\n");
else
printf(" ");
}
}
int main(int argc, char **argv) {
int a[1024] = {0};
int n = 0;
int i = 0;
int j = 0;
int v = 0;
scanf("%d", &n);
// printf("n=%d\n", n);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
// printf("%d\n", a[i]);
}
for (i = 1; i < n; i++) {
print_list(a, n);
v = a[i];
j = i - 1;
while (j >= 0 && a[j] > v) {
a[j + 1] = a[j];
j--;
}
a[j + 1] = v;
}
print_list(a, n);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116658/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116658/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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_list(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.end
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.body: ; preds = %for.body.lr.ph, %for.body
%indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
%arrayidx = getelementptr inbounds i32, ptr %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 = icmp eq i64 %indvars.iv, %0
%. = select i1 %cmp1, i32 10, i32 32
%putchar8 = tail call i32 @putchar(i32 %.)
%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
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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%a = alloca [1024 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %a) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4096) %a, i8 0, i64 4096, i1 false)
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
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %print_list.exit48
for.cond2.preheader: ; preds = %for.body
%cmp355 = icmp sgt i32 %1, 1
br i1 %cmp355, label %for.body4, label %for.end20
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1024 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 !11
for.body4: ; preds = %for.cond2.preheader, %while.end
%indvars.iv60 = phi i64 [ %indvars.iv.next61, %while.end ], [ 1, %for.cond2.preheader ]
%3 = phi i32 [ %.pr, %while.end ], [ %1, %for.cond2.preheader ]
%cmp9.i = icmp sgt i32 %3, 0
br i1 %cmp9.i, label %for.body.lr.ph.i, label %print_list.exit
for.body.lr.ph.i: ; preds = %for.body4
%sub.i = add nsw i32 %3, -1
%4 = zext i32 %sub.i to i64
%wide.trip.count.i = zext i32 %3 to i64
br label %for.body.i
for.body.i: ; preds = %for.body.i, %for.body.lr.ph.i
%indvars.iv.i = phi i64 [ 0, %for.body.lr.ph.i ], [ %indvars.iv.next.i, %for.body.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%cmp1.i = icmp eq i64 %indvars.iv.i, %4
%..i = select i1 %cmp1.i, i32 10, i32 32
%putchar8.i = call i32 @putchar(i32 %..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_list.exit, label %for.body.i, !llvm.loop !9
print_list.exit: ; preds = %for.body.i, %for.body4
%arrayidx6 = getelementptr inbounds [1024 x i32], ptr %a, i64 0, i64 %indvars.iv60
%6 = load i32, ptr %arrayidx6, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %print_list.exit, %while.body
%indvars.iv62 = phi i64 [ %indvars.iv60, %print_list.exit ], [ %indvars.iv.next63, %while.body ]
%indvars.iv.next63 = add nsw i64 %indvars.iv62, -1
%idxprom8 = and i64 %indvars.iv.next63, 4294967295
%arrayidx9 = getelementptr inbounds [1024 x i32], ptr %a, i64 0, i64 %idxprom8
%7 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%cmp10 = icmp sgt i32 %7, %6
br i1 %cmp10, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%arrayidx14 = getelementptr inbounds [1024 x i32], ptr %a, i64 0, i64 %indvars.iv62
store i32 %7, ptr %arrayidx14, align 4, !tbaa !5
%8 = icmp sgt i64 %indvars.iv62, 1
br i1 %8, 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.iv62, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom16 = ashr exact i64 %sext, 32
%arrayidx17 = getelementptr inbounds [1024 x i32], ptr %a, i64 0, i64 %idxprom16
store i32 %6, ptr %arrayidx17, align 4, !tbaa !5
%indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
%.pr = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %.pr to i64
%cmp3 = icmp slt i64 %indvars.iv.next61, %9
br i1 %cmp3, label %for.body4, label %for.end20, !llvm.loop !13
for.end20: ; preds = %while.end, %for.cond2.preheader
%.lcssa = phi i32 [ %1, %for.cond2.preheader ], [ %.pr, %while.end ]
%cmp9.i35 = icmp sgt i32 %.lcssa, 0
br i1 %cmp9.i35, label %for.body.lr.ph.i36, label %print_list.exit48
for.body.lr.ph.i36: ; preds = %for.end20
%sub.i37 = add nsw i32 %.lcssa, -1
%10 = zext i32 %sub.i37 to i64
%wide.trip.count.i38 = zext i32 %.lcssa to i64
br label %for.body.i39
for.body.i39: ; preds = %for.body.i39, %for.body.lr.ph.i36
%indvars.iv.i40 = phi i64 [ 0, %for.body.lr.ph.i36 ], [ %indvars.iv.next.i46, %for.body.i39 ]
%arrayidx.i41 = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i40
%11 = load i32, ptr %arrayidx.i41, align 4, !tbaa !5
%call.i42 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %11)
%cmp1.i43 = icmp eq i64 %indvars.iv.i40, %10
%..i44 = select i1 %cmp1.i43, i32 10, i32 32
%putchar8.i45 = call i32 @putchar(i32 %..i44)
%indvars.iv.next.i46 = add nuw nsw i64 %indvars.iv.i40, 1
%exitcond.not.i47 = icmp eq i64 %indvars.iv.next.i46, %wide.trip.count.i38
br i1 %exitcond.not.i47, label %print_list.exit48, label %for.body.i39, !llvm.loop !9
print_list.exit48: ; preds = %for.body.i39, %entry, %for.end20
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %a) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; 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 #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main() {
int i, j, k, n, a[1000], v;
scanf("%d", &n);
for(i = 0; i < n; i++){
scanf("%d", &a[i]);
}
for(i = 1; i < n; i++){
for(k = 0; k < n; k++){
printf("%d",a[k]);
if(k != n - 1) printf(" ");
else printf("\n");
}
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++){
printf("%d",a[k]);
if(k != n - 1) printf(" ");
else printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116700/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116700/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%cmp72 = icmp sgt i32 %0, 0
br i1 %cmp72, label %for.body, label %for.end49
for.cond2.preheader: ; preds = %for.body
%cmp379 = icmp sgt i32 %1, 1
br i1 %cmp379, label %for.cond5.preheader, label %for.cond34.preheader
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.cond5.preheader: ; preds = %for.cond2.preheader, %while.end
%3 = phi i32 [ %10, %while.end ], [ %1, %for.cond2.preheader ]
%indvars.iv96 = phi i64 [ %indvars.iv.next97, %while.end ], [ 1, %for.cond2.preheader ]
%cmp674 = icmp sgt i32 %3, 0
br i1 %cmp674, label %for.body7, label %for.end16
for.cond34.preheader: ; preds = %while.end, %for.cond2.preheader
%4 = phi i32 [ %1, %for.cond2.preheader ], [ %10, %while.end ]
%cmp3581 = icmp sgt i32 %4, 0
br i1 %cmp3581, label %for.body36, label %for.end49
for.body7: ; preds = %for.cond5.preheader, %for.body7
%indvars.iv92 = phi i64 [ %indvars.iv.next93, %for.body7 ], [ 0, %for.cond5.preheader ]
%arrayidx9 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv92
%5 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%call10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%6 = load i32, ptr %n, align 4, !tbaa !5
%sub = add nsw i32 %6, -1
%7 = zext i32 %sub to i64
%cmp11.not = icmp eq i64 %indvars.iv92, %7
%. = select i1 %cmp11.not, i32 10, i32 32
%putchar71 = call i32 @putchar(i32 %.)
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp6 = icmp slt i64 %indvars.iv.next93, %9
br i1 %cmp6, label %for.body7, label %for.end16, !llvm.loop !11
for.end16: ; preds = %for.body7, %for.cond5.preheader
%10 = phi i32 [ %3, %for.cond5.preheader ], [ %8, %for.body7 ]
%arrayidx18 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv96
%11 = load i32, ptr %arrayidx18, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.end16, %while.body
%indvars.iv98 = phi i64 [ %indvars.iv96, %for.end16 ], [ %indvars.iv.next99, %while.body ]
%indvars.iv.next99 = add nsw i64 %indvars.iv98, -1
%idxprom21 = and i64 %indvars.iv.next99, 4294967295
%arrayidx22 = getelementptr inbounds [1000 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 [1000 x i32], ptr %a, i64 0, i64 %indvars.iv98
store i32 %12, ptr %arrayidx27, align 4, !tbaa !5
%13 = icmp sgt i64 %indvars.iv98, 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.iv98, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom29 = ashr exact i64 %sext, 32
%arrayidx30 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %idxprom29
store i32 %11, ptr %arrayidx30, align 4, !tbaa !5
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
%14 = sext i32 %10 to i64
%cmp3 = icmp slt i64 %indvars.iv.next97, %14
br i1 %cmp3, label %for.cond5.preheader, label %for.cond34.preheader, !llvm.loop !13
for.body36: ; preds = %for.cond34.preheader, %for.body36
%indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.body36 ], [ 0, %for.cond34.preheader ]
%arrayidx38 = getelementptr inbounds [1000 x i32], ptr %a, i64 0, i64 %indvars.iv105
%15 = load i32, ptr %arrayidx38, align 4, !tbaa !5
%call39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %15)
%16 = load i32, ptr %n, align 4, !tbaa !5
%sub40 = add nsw i32 %16, -1
%17 = zext i32 %sub40 to i64
%cmp41.not = icmp eq i64 %indvars.iv105, %17
%.114 = select i1 %cmp41.not, i32 10, i32 32
%putchar69 = call i32 @putchar(i32 %.114)
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp35 = icmp slt i64 %indvars.iv.next106, %19
br i1 %cmp35, label %for.body36, label %for.end49, !llvm.loop !15
for.end49: ; preds = %for.body36, %entry, %for.cond34.preheader
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}
!14 = !{!"llvm.loop.unswitch.partial.disable"}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int main(){
int arr,A[100],i,j=0,k,v;
scanf("%d",&arr);
for(i=1;i<=arr;i++){
scanf("%d",&A[i]);
}
for(i=1;i<=arr;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=1;k<=arr;k++){
if(k == arr)
printf("%d\n",A[k]);
else
printf("%d ",A[k]);
}
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116744/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116744/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%arr = alloca i32, align 4
%A = alloca [100 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %arr) #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 %arr)
%0 = load i32, ptr %arr, align 4, !tbaa !5
%cmp.not51 = icmp slt i32 %0, 1
br i1 %cmp.not51, label %for.end33, label %for.body
for.cond2.preheader: ; preds = %for.body
%cmp3.not60 = icmp slt i32 %1, 1
br i1 %cmp3.not60, label %for.end33, label %for.body4
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %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 %arr, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %2
br i1 %cmp.not.not, label %for.body, label %for.cond2.preheader, !llvm.loop !9
for.body4: ; preds = %for.cond2.preheader, %for.inc31
%3 = phi i32 [ %12, %for.inc31 ], [ %1, %for.cond2.preheader ]
%indvars.iv63 = phi i64 [ %indvars.iv.next64, %for.inc31 ], [ 1, %for.cond2.preheader ]
%arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv63
%4 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp754 = icmp ugt i64 %indvars.iv63, 1
br i1 %cmp754, label %land.rhs, label %while.end
land.rhs: ; preds = %for.body4, %while.body
%indvars.iv65 = phi i64 [ %indvars.iv.next66, %while.body ], [ %indvars.iv63, %for.body4 ]
%indvars.iv.next66 = add nsw i64 %indvars.iv65, -1
%idxprom8 = and i64 %indvars.iv.next66, 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.iv65
store i32 %5, ptr %arrayidx14, align 4, !tbaa !5
%6 = icmp sgt i64 %indvars.iv65, 2
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 [ %indvars.iv63, %for.body4 ], [ 1, %while.body ], [ %indvars.iv65, %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
%cmp19.not58 = icmp slt i32 %3, 1
br i1 %cmp19.not58, label %while.end.for.inc31_crit_edge, label %for.body20
while.end.for.inc31_crit_edge: ; preds = %while.end
%.pre = sext i32 %3 to i64
br label %for.inc31
for.body20: ; preds = %while.end, %for.body20
%indvars.iv68 = phi i64 [ %indvars.iv.next69, %for.body20 ], [ 1, %while.end ]
%7 = phi i32 [ %10, %for.body20 ], [ %3, %while.end ]
%8 = zext i32 %7 to i64
%cmp21 = icmp eq i64 %indvars.iv68, %8
%arrayidx23 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv68
%9 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%.str.1..str.2 = select i1 %cmp21, ptr @.str.1, ptr @.str.2
%call24 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2, i32 noundef %9)
%indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
%10 = load i32, ptr %arr, align 4, !tbaa !5
%11 = sext i32 %10 to i64
%cmp19.not.not = icmp slt i64 %indvars.iv68, %11
br i1 %cmp19.not.not, label %for.body20, label %for.inc31, !llvm.loop !12
for.inc31: ; preds = %for.body20, %while.end.for.inc31_crit_edge
%.pre-phi = phi i64 [ %.pre, %while.end.for.inc31_crit_edge ], [ %11, %for.body20 ]
%12 = phi i32 [ %3, %while.end.for.inc31_crit_edge ], [ %10, %for.body20 ]
%indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
%cmp3.not.not = icmp slt i64 %indvars.iv63, %.pre-phi
br i1 %cmp3.not.not, label %for.body4, label %for.end33, !llvm.loop !13
for.end33: ; preds = %for.inc31, %entry, %for.cond2.preheader
call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %A) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %arr) #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>
void trace(int *, int);
void insertion(int *, int);
void trace(int A[], int N){
int i;
for(i=0;i<N;i++){
if(i>=0){
if(i==N-1)
printf("%d\n",A[i]);
else printf("%d ",A[i]);
}
}
}
void insertion(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);
insertion(A, N);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116788/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116788/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local void @trace(ptr nocapture noundef readonly %A, i32 noundef %N) local_unnamed_addr #0 {
entry:
%cmp15 = icmp sgt i32 %N, 0
br i1 %cmp15, label %if.then.lr.ph, label %for.end
if.then.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 %if.then
if.then: ; preds = %if.then.lr.ph, %if.then
%indvars.iv = phi i64 [ 0, %if.then.lr.ph ], [ %indvars.iv.next, %if.then ]
%cmp2 = icmp eq i64 %indvars.iv, %0
%arrayidx5.sink = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%.str.1.sink = select i1 %cmp2, ptr @.str, ptr @.str.1
%1 = load i32, ptr %arrayidx5.sink, align 4, !tbaa !5
%call6 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink, i32 noundef %1)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %if.then, !llvm.loop !9
for.end: ; preds = %if.then, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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.us.preheader, label %for.end
for.body.us.preheader: ; preds = %entry
%sub.i = add nsw i32 %N, -1
%0 = zext i32 %sub.i to i64
%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
%1 = 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.iv33 = phi i64 [ %indvars.iv.next34, %while.body.us ], [ %indvars.iv, %for.body.us ]
%indvars.iv.next34 = add nsw i64 %indvars.iv33, -1
%idxprom2.us = and i64 %indvars.iv.next34, 4294967295
%arrayidx3.us = getelementptr inbounds i32, ptr %A, i64 %idxprom2.us
%2 = load i32, ptr %arrayidx3.us, align 4, !tbaa !5
%cmp4.us = icmp sgt i32 %2, %1
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.iv33, %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 %1, ptr %arrayidx11.us, align 4, !tbaa !5
br label %if.then.i.us
if.then.i.us: ; preds = %if.then.i.us, %while.end.us
%indvars.iv.i.us = phi i64 [ 0, %while.end.us ], [ %indvars.iv.next.i.us, %if.then.i.us ]
%cmp2.i.us = icmp eq i64 %indvars.iv.i.us, %0
%arrayidx5.sink.i.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us
%.str.1.sink.i.us = select i1 %cmp2.i.us, ptr @.str, ptr @.str.1
%3 = load i32, ptr %arrayidx5.sink.i.us, align 4, !tbaa !5
%call6.i.us = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink.i.us, 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 %trace.exit.loopexit.us, label %if.then.i.us, !llvm.loop !9
while.body.us: ; preds = %land.rhs.us
%arrayidx8.us = getelementptr inbounds i32, ptr %A, i64 %indvars.iv33
store i32 %2, ptr %arrayidx8.us, align 4, !tbaa !5
%4 = icmp sgt i64 %indvars.iv33, 1
br i1 %4, label %land.rhs.us, label %while.end.us, !llvm.loop !11
trace.exit.loopexit.us: ; preds = %if.then.i.us
%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 !12
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) #3
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #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
%cmp9 = icmp sgt i32 %0, 0
br i1 %cmp9, label %for.body, label %insertion.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
%cmp15.i = icmp sgt i32 %1, 0
br i1 %cmp15.i, label %if.then.lr.ph.i, label %insertion.exit
if.then.lr.ph.i: ; preds = %for.end
%sub.i = add nsw i32 %1, -1
%3 = zext i32 %sub.i to i64
%wide.trip.count.i = zext i32 %1 to i64
br label %if.then.i
if.then.i: ; preds = %if.then.i, %if.then.lr.ph.i
%indvars.iv.i = phi i64 [ 0, %if.then.lr.ph.i ], [ %indvars.iv.next.i, %if.then.i ]
%cmp2.i = icmp eq i64 %indvars.iv.i, %3
%arrayidx5.sink.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%.str.1.sink.i = select i1 %cmp2.i, ptr @.str, ptr @.str.1
%4 = load i32, ptr %arrayidx5.sink.i, align 4, !tbaa !5
%call6.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink.i, i32 noundef %4)
%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.then.i, !llvm.loop !9
trace.exit: ; preds = %if.then.i
%.pr = load i32, ptr %N, align 4, !tbaa !5
%cmp30.i = icmp sgt i32 %.pr, 1
br i1 %cmp30.i, label %for.body.us.preheader.i, label %insertion.exit
for.body.us.preheader.i: ; preds = %trace.exit
%sub.i.i = add nsw i32 %.pr, -1
%5 = zext i32 %sub.i.i to i64
%wide.trip.count.i.i = zext i32 %.pr 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
%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.iv33.i = phi i64 [ %indvars.iv.next34.i, %while.body.us.i ], [ %indvars.iv.i5, %for.body.us.i ]
%indvars.iv.next34.i = add nsw i64 %indvars.iv33.i, -1
%idxprom2.us.i = and i64 %indvars.iv.next34.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.iv33.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 %if.then.i.us.i
if.then.i.us.i: ; preds = %if.then.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, %if.then.i.us.i ]
%cmp2.i.us.i = icmp eq i64 %indvars.iv.i.us.i, %5
%arrayidx5.sink.i.us.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i.us.i
%.str.1.sink.i.us.i = select i1 %cmp2.i.us.i, ptr @.str, ptr @.str.1
%8 = load i32, ptr %arrayidx5.sink.i.us.i, align 4, !tbaa !5
%call6.i.us.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1.sink.i.us.i, 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 %trace.exit.loopexit.us.i, label %if.then.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.iv33.i
store i32 %7, ptr %arrayidx8.us.i, align 4, !tbaa !5
%9 = icmp sgt i64 %indvars.iv33.i, 1
br i1 %9, label %land.rhs.us.i, label %while.end.us.i, !llvm.loop !11
trace.exit.loopexit.us.i: ; preds = %if.then.i.us.i
%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 %insertion.exit, label %for.body.us.i, !llvm.loop !12
insertion.exit: ; preds = %trace.exit.loopexit.us.i, %entry, %for.end, %trace.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>
int main(){
int n,x,a;
int i,j,k;
scanf("%d", &n);
int hairetu[n];
for(i = 0; i < n; i++){
scanf("%d", &x);
hairetu[i] = x;
}
for(k = 0; k < n; k++){
if( k > 0)
printf(" ");
printf("%d",hairetu[k]);
}
printf("\n");
for(i = 1; i < n; i++){
a = hairetu[i];
j = i - 1;
while(1){
if( !(j >= 0 && hairetu[j] > a) ) break;
hairetu[j+1] = hairetu[j];
j--;
}
hairetu[j+1] = a;
for(k = 0; k < n; k++){
if( k > 0)
printf(" ");
printf("%d", hairetu[k]);
}
printf("\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_116830/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116830/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%x = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %x) #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
%cmp71 = icmp sgt i32 %3, 0
br i1 %cmp71, label %for.body, label %for.end12
for.cond2.preheader: ; preds = %for.body
%4 = icmp sgt i32 %8, 0
br i1 %4, label %if.end.peel, label %for.end12
if.end.peel: ; preds = %for.cond2.preheader
%5 = load i32, ptr %vla, align 16, !tbaa !5
%call9.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%6 = load i32, ptr %n, align 4, !tbaa !5
%cmp3.peel = icmp sgt i32 %6, 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 ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %x)
%7 = load i32, ptr %x, align 4, !tbaa !5
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
store i32 %7, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%8 = load i32, ptr %n, align 4, !tbaa !5
%9 = sext i32 %8 to i64
%cmp = icmp slt i64 %indvars.iv.next, %9
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !9
if.end: ; preds = %if.end.peel, %if.end
%indvars.iv83 = phi i64 [ %indvars.iv.next84, %if.end ], [ 1, %if.end.peel ]
%putchar70 = call i32 @putchar(i32 32)
%arrayidx8 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv83
%10 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%call9 = 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
%cmp3 = icmp slt i64 %indvars.iv.next84, %12
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)
%13 = load i32, ptr %n, align 4, !tbaa !5
%cmp1580 = icmp sgt i32 %13, 1
br i1 %cmp1580, label %for.body16, label %for.end48
for.body16: ; preds = %for.end12, %for.end44
%14 = phi i32 [ %23, %for.end44 ], [ %13, %for.end12 ]
%indvars.iv87 = phi i64 [ %indvars.iv.next88, %for.end44 ], [ 1, %for.end12 ]
%arrayidx18 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv87
%15 = load i32, ptr %arrayidx18, align 4, !tbaa !5
br label %land.lhs.true
land.lhs.true: ; preds = %for.body16, %if.end24
%indvars.iv89 = phi i64 [ %indvars.iv87, %for.body16 ], [ %indvars.iv.next90, %if.end24 ]
%indvars.iv.next90 = add nsw i64 %indvars.iv89, -1
%idxprom20 = and i64 %indvars.iv.next90, 4294967295
%arrayidx21 = getelementptr inbounds i32, ptr %vla, i64 %idxprom20
%16 = load i32, ptr %arrayidx21, align 4, !tbaa !5
%cmp22 = icmp sgt i32 %16, %15
br i1 %cmp22, label %if.end24, label %while.end
if.end24: ; preds = %land.lhs.true
%arrayidx28 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv89
store i32 %16, ptr %arrayidx28, align 4, !tbaa !5
%17 = icmp sgt i64 %indvars.iv89, 1
br i1 %17, label %land.lhs.true, label %while.end
while.end: ; preds = %if.end24, %land.lhs.true
%j.0.in.lcssa = phi i64 [ 0, %if.end24 ], [ %indvars.iv89, %land.lhs.true ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom30 = ashr exact i64 %sext, 32
%arrayidx31 = getelementptr inbounds i32, ptr %vla, i64 %idxprom30
store i32 %15, ptr %arrayidx31, align 4, !tbaa !5
%cmp3378 = icmp sgt i32 %14, 0
br i1 %cmp3378, label %if.end38.peel, label %for.end44
if.end38.peel: ; preds = %while.end
%18 = load i32, ptr %vla, align 16, !tbaa !5
%call41.peel = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %18)
%19 = load i32, ptr %n, align 4, !tbaa !5
%cmp33.peel = icmp sgt i32 %19, 1
br i1 %cmp33.peel, label %if.end38, label %for.end44
if.end38: ; preds = %if.end38.peel, %if.end38
%indvars.iv92 = phi i64 [ %indvars.iv.next93, %if.end38 ], [ 1, %if.end38.peel ]
%putchar69 = call i32 @putchar(i32 32)
%arrayidx40 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv92
%20 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %20)
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%21 = load i32, ptr %n, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp33 = icmp slt i64 %indvars.iv.next93, %22
br i1 %cmp33, label %if.end38, label %for.end44, !llvm.loop !13
for.end44: ; preds = %if.end38, %if.end38.peel, %while.end
%putchar68 = call i32 @putchar(i32 10)
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%23 = load i32, ptr %n, align 4, !tbaa !5
%24 = sext i32 %23 to i64
%cmp15 = icmp slt i64 %indvars.iv.next88, %24
br i1 %cmp15, label %for.body16, label %for.end48, !llvm.loop !14
for.end48: ; preds = %for.end44, %for.end12
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %x) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
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}
!12 = !{!"llvm.loop.peeled.count", i32 1}
!13 = distinct !{!13, !10, !12}
!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_116874/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116874/source.c"
target datalayout = "e-m:e-p270:32: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(void)
{
int A[2000];
int N, i, j, v, k;
scanf("%d", &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++)
{
j = i - 1;
v = A[i];
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_116917/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116917/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2000 x i32], align 16
%N = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 8000, 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
%cmp78 = icmp sgt i32 %0, 0
br i1 %cmp78, label %for.body, label %for.end14
for.cond2.preheader: ; preds = %for.body
%cmp380 = icmp sgt i32 %1, 0
br i1 %cmp380, 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 [2000 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.body4
%indvars.iv90 = phi i64 [ %indvars.iv.next91, %for.body4 ], [ 0, %for.cond2.preheader ]
%3 = phi i32 [ %6, %for.body4 ], [ %1, %for.cond2.preheader ]
%sub = add nsw i32 %3, -1
%4 = sext i32 %sub to i64
%cmp5 = icmp slt i64 %indvars.iv90, %4
%arrayidx7 = getelementptr inbounds [2000 x i32], ptr %A, i64 0, i64 %indvars.iv90
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%.str.1..str = select i1 %cmp5, ptr @.str.1, ptr @.str
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str, i32 noundef %5)
%indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
%6 = load i32, ptr %N, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp3 = icmp slt i64 %indvars.iv.next91, %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
%cmp1787 = icmp sgt i32 %8, 1
br i1 %cmp1787, label %for.body18, label %for.end53
for.body18: ; preds = %for.end14, %for.end49
%9 = phi i32 [ %18, %for.end49 ], [ %8, %for.end14 ]
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.end49 ], [ 1, %for.end14 ]
%arrayidx21 = getelementptr inbounds [2000 x i32], ptr %A, i64 0, i64 %indvars.iv93
%10 = load i32, ptr %arrayidx21, align 4, !tbaa !5
br label %land.rhs
land.rhs: ; preds = %for.body18, %while.body
%indvars.iv95 = phi i64 [ %indvars.iv93, %for.body18 ], [ %indvars.iv.next96, %while.body ]
%indvars.iv.next96 = add nsw i64 %indvars.iv95, -1
%idxprom23 = and i64 %indvars.iv.next96, 4294967295
%arrayidx24 = getelementptr inbounds [2000 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 [2000 x i32], ptr %A, i64 0, i64 %indvars.iv95
store i32 %11, ptr %arrayidx29, align 4, !tbaa !5
%12 = icmp sgt i64 %indvars.iv95, 1
br i1 %12, 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.iv95, %land.rhs ]
%sext = shl i64 %j.0.in.lcssa, 32
%idxprom31 = ashr exact i64 %sext, 32
%arrayidx32 = getelementptr inbounds [2000 x i32], ptr %A, i64 0, i64 %idxprom31
store i32 %10, ptr %arrayidx32, align 4, !tbaa !5
%cmp3485 = icmp sgt i32 %9, 0
br i1 %cmp3485, label %for.body35, label %for.end49
for.body35: ; preds = %while.end, %for.body35
%indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.body35 ], [ 0, %while.end ]
%13 = phi i32 [ %16, %for.body35 ], [ %9, %while.end ]
%sub36 = add nsw i32 %13, -1
%14 = sext i32 %sub36 to i64
%cmp37 = icmp slt i64 %indvars.iv98, %14
%arrayidx40 = getelementptr inbounds [2000 x i32], ptr %A, i64 0, i64 %indvars.iv98
%15 = load i32, ptr %arrayidx40, align 4, !tbaa !5
%.str.1..str106 = select i1 %cmp37, ptr @.str.1, ptr @.str
%call41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str106, i32 noundef %15)
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%16 = load i32, ptr %N, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp34 = icmp slt i64 %indvars.iv.next99, %17
br i1 %cmp34, label %for.body35, label %for.end49, !llvm.loop !13
for.end49: ; preds = %for.body35, %while.end
%putchar77 = call i32 @putchar(i32 10)
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%18 = load i32, ptr %N, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp17 = icmp slt i64 %indvars.iv.next94, %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 4, ptr nonnull %N) #4
call void @llvm.lifetime.end.p0(i64 8000, 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>
void trace(int A[], int N) {
int i;
for ( i = 0; i < N; i++) {
if (i > 0) printf(" "); // 2つ目の要素の前には空白
printf("%d",A[i]);
}
printf("\n");
}
/* 挿入ソート */
void insertionSort(int A[], int N) {
int j,v;
for (int i = 1; i < N; i++) {
v = A[i]; // pivot
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,j;
int A[100];
scanf("%d\n", &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_116960/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_116960/source.c"
target datalayout = "e-m:e-p270:32: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
@.str.3 = private unnamed_addr constant [4 x i8] c"%d\0A\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.cond.cleanup
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.cond.cleanup, label %for.body.us, !llvm.loop !13
for.cond.cleanup: ; 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.3, 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>
void dicemove(char com,int *A);
void serch0 (int *A,int *B);
void serch1(int *A,int *B);
int check(int *A,int *B);
int main(void)
{
int A[6],B[6];
int i,j,k,n=1;
for(i=0;i<6;i++){scanf("%d",&A[i]);}
for(i=0;i<6;i++){scanf("%d",&B[i]);}
serch0(A,B);
for(j=0;j<7;j++)
{
for(i=0;i<4;i++)
{if(A[0]!=B[0]){break;}
dicemove('M',A);
n= check(A,B);
if(!n){printf("Yes\n"); break;}
}
if(!n){break;}
if(n && j<4){dicemove('N',A);}
else if(n && j>3){dicemove('E',A);}
}
if(j == 7){printf("No\n");}
return 0;
}
void dicemove(char com,int *A){
int temp;
switch(com){
case 'E':
temp=A[0]; A[0]=A[3]; A[3]=A[5];A[5]=A[2]; A[2]=temp;
break;
case 'N':
temp=A[0]; A[0]=A[1]; A[1]=A[5]; A[5]=A[4]; A[4]=temp;
break;
case 'S':
temp=A[0]; A[0]=A[4]; A[4]=A[5]; A[5]=A[1]; A[1]=temp;
break;
case 'W':
temp=A[0]; A[0]=A[2]; A[2]=A[5]; A[5]=A[3]; A[3]=temp;
break;
case 'M':
temp=A[1]; A[1]=A[3]; A[3]=A[4]; A[4]=A[2]; A[2]=temp;
break;
}
}
void serch0(int *A,int *B){
int i;
for(i=0;i<4;i++)
{if(A[0] == B[0]){break;}
dicemove('E',A);
}
if(A[0]!=B[0]){
for(i=0;i<4;i++)
{
dicemove('N',A);
if(A[0] == B[0]){break;}
}
}
}
void serch1(int *A,int *B){
int i;
for(i=0;i<4;i++)
{if(A[1] == B[1]){break;}
dicemove('M',A);
}
}
int check(int *A,int *B){
int i;
for(i=0;i<6;i++)
{
if(A[i] != B[i]){break;}
}
if(i == 6){return 0;}
else {return 1;}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117002/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117002/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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:
%A = alloca [6 x i32], align 16
%B = alloca [6 x i32], align 16
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %A) #6
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %B) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %A)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %A, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %A, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [6 x i32], ptr %A, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [6 x i32], ptr %A, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [6 x i32], ptr %A, i64 0, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %B)
%arrayidx5.1 = getelementptr inbounds [6 x i32], ptr %B, i64 0, i64 1
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [6 x i32], ptr %B, i64 0, i64 2
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.3 = getelementptr inbounds [6 x i32], ptr %B, i64 0, i64 3
%call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3)
%arrayidx5.4 = getelementptr inbounds [6 x i32], ptr %B, i64 0, i64 4
%call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4)
%arrayidx5.5 = getelementptr inbounds [6 x i32], ptr %B, i64 0, i64 5
%call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5)
%0 = load i32, ptr %A, align 16, !tbaa !5
%1 = load i32, ptr %B, align 16, !tbaa !5
%cmp2.i = icmp eq i32 %0, %1
%arrayidx1.i.i.promoted105.pre = load i32, ptr %arrayidx.3, align 4, !tbaa !5
br i1 %cmp2.i, label %entry.serch0.exit_crit_edge, label %if.end.i
entry.serch0.exit_crit_edge: ; preds = %entry
%arrayidx3.i.i.promoted.pre = load i32, ptr %arrayidx.5, align 4
%arrayidx5.i.i.promoted109.pre = load i32, ptr %arrayidx.2, align 8, !tbaa !5
br label %serch0.exit
if.end.i: ; preds = %entry
store i32 %arrayidx1.i.i.promoted105.pre, ptr %A, align 16, !tbaa !5
%2 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
store i32 %3, ptr %arrayidx.5, align 4, !tbaa !5
%cmp2.1.i = icmp eq i32 %arrayidx1.i.i.promoted105.pre, %1
br i1 %cmp2.1.i, label %serch0.exit, label %if.end.1.i
if.end.1.i: ; preds = %if.end.i
store i32 %2, ptr %A, align 16, !tbaa !5
store i32 %0, ptr %arrayidx.5, align 4, !tbaa !5
%cmp2.2.i = icmp eq i32 %2, %1
br i1 %cmp2.2.i, label %serch0.exit, label %if.end.2.i
if.end.2.i: ; preds = %if.end.1.i
store i32 %3, ptr %A, align 16, !tbaa !5
store i32 %arrayidx1.i.i.promoted105.pre, ptr %arrayidx.5, align 4, !tbaa !5
%cmp2.3.i = icmp eq i32 %3, %1
br i1 %cmp2.3.i, label %serch0.exit, label %for.cond7.preheader.i
for.cond7.preheader.i: ; preds = %if.end.2.i
store i32 %3, ptr %arrayidx.2, align 8, !tbaa !5
%4 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %4, ptr %A, align 16, !tbaa !5
store i32 %2, ptr %arrayidx.1, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
store i32 %5, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %0, ptr %arrayidx.4, align 16, !tbaa !5
%cmp12.i = icmp eq i32 %4, %1
br i1 %cmp12.i, label %serch0.exit, label %for.cond7.1.i
for.cond7.1.i: ; preds = %for.cond7.preheader.i
store i32 %5, ptr %A, align 16, !tbaa !5
store i32 %0, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %4, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %2, ptr %arrayidx.4, align 16, !tbaa !5
%cmp12.2.i = icmp eq i32 %5, %1
br i1 %cmp12.2.i, label %serch0.exit, label %for.cond7.2.i
for.cond7.2.i: ; preds = %for.cond7.1.i
store i32 %0, ptr %A, align 16, !tbaa !5
store i32 %4, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %2, ptr %arrayidx.5, align 4, !tbaa !5
store i32 %5, ptr %arrayidx.4, align 16, !tbaa !5
br label %serch0.exit
serch0.exit: ; preds = %entry.serch0.exit_crit_edge, %if.end.i, %if.end.1.i, %if.end.2.i, %for.cond7.preheader.i, %for.cond7.1.i, %for.cond7.2.i
%arrayidx5.i.i.promoted109 = phi i32 [ %arrayidx5.i.i.promoted109.pre, %entry.serch0.exit_crit_edge ], [ %0, %if.end.i ], [ %arrayidx1.i.i.promoted105.pre, %if.end.1.i ], [ %2, %if.end.2.i ], [ %3, %for.cond7.preheader.i ], [ %3, %for.cond7.1.i ], [ %3, %for.cond7.2.i ]
%arrayidx3.i.i.promoted = phi i32 [ %arrayidx3.i.i.promoted.pre, %entry.serch0.exit_crit_edge ], [ %3, %if.end.i ], [ %0, %if.end.1.i ], [ %arrayidx1.i.i.promoted105.pre, %if.end.2.i ], [ %5, %for.cond7.preheader.i ], [ %4, %for.cond7.1.i ], [ %2, %for.cond7.2.i ]
%arrayidx1.i.i.promoted105 = phi i32 [ %arrayidx1.i.i.promoted105.pre, %entry.serch0.exit_crit_edge ], [ %2, %if.end.i ], [ %3, %if.end.1.i ], [ %0, %if.end.2.i ], [ %arrayidx1.i.i.promoted105.pre, %for.cond7.preheader.i ], [ %arrayidx1.i.i.promoted105.pre, %for.cond7.1.i ], [ %arrayidx1.i.i.promoted105.pre, %for.cond7.2.i ]
%A.promoted = phi i32 [ %0, %entry.serch0.exit_crit_edge ], [ %1, %if.end.i ], [ %1, %if.end.1.i ], [ %1, %if.end.2.i ], [ %1, %for.cond7.preheader.i ], [ %1, %for.cond7.1.i ], [ %0, %for.cond7.2.i ]
%6 = load i32, ptr %arrayidx5.1, align 4
%7 = load i32, ptr %arrayidx5.2, align 8
%8 = load i32, ptr %arrayidx5.3, align 4
%9 = load i32, ptr %arrayidx5.4, align 16
%10 = load i32, ptr %arrayidx5.5, align 4
%arrayidx36.i.promoted117 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%arrayidx39.i.promoted121 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%cmp19.not.peel = icmp eq i32 %A.promoted, %1
br i1 %cmp19.not.peel, label %for.cond14.preheader.split.peel, label %for.cond14.preheader.peel.next
for.cond14.preheader.split.peel: ; preds = %serch0.exit
%cmp3.not.5.i.not.peel = icmp eq i32 %arrayidx3.i.i.promoted, %10
%cmp3.not.5.i.not.fr.peel = freeze i1 %cmp3.not.5.i.not.peel
br i1 %cmp3.not.5.i.not.fr.peel, label %for.body16.us.preheader.peel, label %for.cond14.preheader.peel.next
for.body16.us.preheader.peel: ; preds = %for.cond14.preheader.split.peel
%cmp3.not.1.i.us.peel = icmp eq i32 %arrayidx1.i.i.promoted105, %6
%cmp3.not.2.i.us.peel = icmp eq i32 %arrayidx36.i.promoted117, %7
%or.cond.us.peel = select i1 %cmp3.not.1.i.us.peel, i1 %cmp3.not.2.i.us.peel, i1 false
%cmp3.not.3.i.us.peel = icmp eq i32 %arrayidx39.i.promoted121, %8
%or.cond70.us.peel = select i1 %or.cond.us.peel, i1 %cmp3.not.3.i.us.peel, i1 false
%cmp3.not.4.i.us.peel = icmp eq i32 %arrayidx5.i.i.promoted109, %9
%or.cond71.us.peel = select i1 %or.cond70.us.peel, i1 %cmp3.not.4.i.us.peel, i1 false
br i1 %or.cond71.us.peel, label %if.end50.critedge, label %for.inc27.us.peel
for.inc27.us.peel: ; preds = %for.body16.us.preheader.peel
%cmp3.not.1.i.us.1.peel = icmp eq i32 %arrayidx39.i.promoted121, %6
%cmp3.not.2.i.us.1.peel = icmp eq i32 %arrayidx1.i.i.promoted105, %7
%or.cond.us.1.peel = select i1 %cmp3.not.1.i.us.1.peel, i1 %cmp3.not.2.i.us.1.peel, i1 false
%cmp3.not.3.i.us.1.peel = icmp eq i32 %arrayidx5.i.i.promoted109, %8
%or.cond70.us.1.peel = select i1 %or.cond.us.1.peel, i1 %cmp3.not.3.i.us.1.peel, i1 false
%cmp3.not.4.i.us.1.peel = icmp eq i32 %arrayidx36.i.promoted117, %9
%or.cond71.us.1.peel = select i1 %or.cond70.us.1.peel, i1 %cmp3.not.4.i.us.1.peel, i1 false
br i1 %or.cond71.us.1.peel, label %if.end50.critedge, label %for.inc27.us.1.peel
for.inc27.us.1.peel: ; preds = %for.inc27.us.peel
%cmp3.not.1.i.us.2.peel = icmp eq i32 %arrayidx5.i.i.promoted109, %6
%cmp3.not.2.i.us.2.peel = icmp eq i32 %arrayidx39.i.promoted121, %7
%or.cond.us.2.peel = select i1 %cmp3.not.1.i.us.2.peel, i1 %cmp3.not.2.i.us.2.peel, i1 false
%cmp3.not.3.i.us.2.peel = icmp eq i32 %arrayidx36.i.promoted117, %8
%or.cond70.us.2.peel = select i1 %or.cond.us.2.peel, i1 %cmp3.not.3.i.us.2.peel, i1 false
%cmp3.not.4.i.us.2.peel = icmp eq i32 %arrayidx1.i.i.promoted105, %9
%or.cond71.us.2.peel = select i1 %or.cond70.us.2.peel, i1 %cmp3.not.4.i.us.2.peel, i1 false
br i1 %or.cond71.us.2.peel, label %if.end50.critedge, label %for.inc27.us.2.peel
for.inc27.us.2.peel: ; preds = %for.inc27.us.1.peel
%cmp3.not.1.i.us.3.peel = icmp eq i32 %arrayidx36.i.promoted117, %6
%cmp3.not.2.i.us.3.peel = icmp eq i32 %arrayidx5.i.i.promoted109, %7
%or.cond.us.3.peel = select i1 %cmp3.not.1.i.us.3.peel, i1 %cmp3.not.2.i.us.3.peel, i1 false
%cmp3.not.3.i.us.3.peel = icmp eq i32 %arrayidx1.i.i.promoted105, %8
%or.cond70.us.3.peel = select i1 %or.cond.us.3.peel, i1 %cmp3.not.3.i.us.3.peel, i1 false
%cmp3.not.4.i.us.3.peel = icmp eq i32 %arrayidx39.i.promoted121, %9
%or.cond71.us.3.peel = select i1 %or.cond70.us.3.peel, i1 %cmp3.not.4.i.us.3.peel, i1 false
br i1 %or.cond71.us.3.peel, label %if.end50.critedge, label %for.cond14.preheader.peel.next
for.cond14.preheader.peel.next: ; preds = %for.cond14.preheader.split.peel, %for.inc27.us.2.peel, %serch0.exit
store i32 %arrayidx36.i.promoted117, ptr %A, align 16
store i32 %arrayidx39.i.promoted121, ptr %arrayidx.5, align 4
%cmp19.not.peel142 = icmp eq i32 %arrayidx36.i.promoted117, %1
br i1 %cmp19.not.peel142, label %for.cond14.preheader.split.peel143, label %for.cond14.preheader.peel.next140
for.cond14.preheader.split.peel143: ; preds = %for.cond14.preheader.peel.next
%cmp3.not.5.i.not.peel144 = icmp eq i32 %arrayidx39.i.promoted121, %10
%cmp3.not.5.i.not.fr.peel145 = freeze i1 %cmp3.not.5.i.not.peel144
br i1 %cmp3.not.5.i.not.fr.peel145, label %for.body16.us.preheader.peel148, label %if.end32.critedge.peel182
for.body16.us.preheader.peel148: ; preds = %for.cond14.preheader.split.peel143
%cmp3.not.1.i.us.peel150 = icmp eq i32 %arrayidx1.i.i.promoted105, %6
%cmp3.not.2.i.us.peel151 = icmp eq i32 %arrayidx3.i.i.promoted, %7
%or.cond.us.peel152 = select i1 %cmp3.not.1.i.us.peel150, i1 %cmp3.not.2.i.us.peel151, i1 false
%cmp3.not.3.i.us.peel153 = icmp eq i32 %A.promoted, %8
%or.cond70.us.peel154 = select i1 %or.cond.us.peel152, i1 %cmp3.not.3.i.us.peel153, i1 false
%cmp3.not.4.i.us.peel155 = icmp eq i32 %arrayidx5.i.i.promoted109, %9
%or.cond71.us.peel156 = select i1 %or.cond70.us.peel154, i1 %cmp3.not.4.i.us.peel155, i1 false
br i1 %or.cond71.us.peel156, label %if.end50.critedge, label %for.inc27.us.peel157
for.inc27.us.peel157: ; preds = %for.body16.us.preheader.peel148
%cmp3.not.1.i.us.1.peel158 = icmp eq i32 %A.promoted, %6
%cmp3.not.2.i.us.1.peel159 = icmp eq i32 %arrayidx1.i.i.promoted105, %7
%or.cond.us.1.peel160 = select i1 %cmp3.not.1.i.us.1.peel158, i1 %cmp3.not.2.i.us.1.peel159, i1 false
%cmp3.not.3.i.us.1.peel161 = icmp eq i32 %arrayidx5.i.i.promoted109, %8
%or.cond70.us.1.peel162 = select i1 %or.cond.us.1.peel160, i1 %cmp3.not.3.i.us.1.peel161, i1 false
%cmp3.not.4.i.us.1.peel163 = icmp eq i32 %arrayidx3.i.i.promoted, %9
%or.cond71.us.1.peel164 = select i1 %or.cond70.us.1.peel162, i1 %cmp3.not.4.i.us.1.peel163, i1 false
br i1 %or.cond71.us.1.peel164, label %if.end50.critedge, label %for.inc27.us.1.peel165
for.inc27.us.1.peel165: ; preds = %for.inc27.us.peel157
%cmp3.not.1.i.us.2.peel166 = icmp eq i32 %arrayidx5.i.i.promoted109, %6
%cmp3.not.2.i.us.2.peel167 = icmp eq i32 %A.promoted, %7
%or.cond.us.2.peel168 = select i1 %cmp3.not.1.i.us.2.peel166, i1 %cmp3.not.2.i.us.2.peel167, i1 false
%cmp3.not.3.i.us.2.peel169 = icmp eq i32 %arrayidx3.i.i.promoted, %8
%or.cond70.us.2.peel170 = select i1 %or.cond.us.2.peel168, i1 %cmp3.not.3.i.us.2.peel169, i1 false
%cmp3.not.4.i.us.2.peel171 = icmp eq i32 %arrayidx1.i.i.promoted105, %9
%or.cond71.us.2.peel172 = select i1 %or.cond70.us.2.peel170, i1 %cmp3.not.4.i.us.2.peel171, i1 false
br i1 %or.cond71.us.2.peel172, label %if.end50.critedge, label %for.inc27.us.2.peel173
for.inc27.us.2.peel173: ; preds = %for.inc27.us.1.peel165
%cmp3.not.1.i.us.3.peel174 = icmp eq i32 %arrayidx3.i.i.promoted, %6
%cmp3.not.2.i.us.3.peel175 = icmp eq i32 %arrayidx5.i.i.promoted109, %7
%or.cond.us.3.peel176 = select i1 %cmp3.not.1.i.us.3.peel174, i1 %cmp3.not.2.i.us.3.peel175, i1 false
%cmp3.not.3.i.us.3.peel177 = icmp eq i32 %arrayidx1.i.i.promoted105, %8
%or.cond70.us.3.peel178 = select i1 %or.cond.us.3.peel176, i1 %cmp3.not.3.i.us.3.peel177, i1 false
%cmp3.not.4.i.us.3.peel179 = icmp eq i32 %A.promoted, %9
%or.cond71.us.3.peel180 = select i1 %or.cond70.us.3.peel178, i1 %cmp3.not.4.i.us.3.peel179, i1 false
br i1 %or.cond71.us.3.peel180, label %if.end50.critedge, label %if.end32.critedge.peel182
if.end32.critedge.peel182: ; preds = %for.inc27.us.2.peel173, %for.cond14.preheader.split.peel143
store i32 %arrayidx3.i.i.promoted, ptr %arrayidx.1, align 4, !tbaa !5
br label %for.cond14.preheader.peel.next140
for.cond14.preheader.peel.next140: ; preds = %for.cond14.preheader.peel.next, %if.end32.critedge.peel182
store i32 %arrayidx3.i.i.promoted, ptr %A, align 16
store i32 %A.promoted, ptr %arrayidx.5, align 4
%cmp19.not.peel200 = icmp eq i32 %arrayidx3.i.i.promoted, %1
br i1 %cmp19.not.peel200, label %for.cond14.preheader.split.peel201, label %for.cond14.preheader.peel.next198
for.cond14.preheader.split.peel201: ; preds = %for.cond14.preheader.peel.next140
%cmp3.not.5.i.not.peel202 = icmp eq i32 %A.promoted, %10
%cmp3.not.5.i.not.fr.peel203 = freeze i1 %cmp3.not.5.i.not.peel202
br i1 %cmp3.not.5.i.not.fr.peel203, label %for.body16.us.preheader.peel206, label %if.end32.critedge.peel240
for.body16.us.preheader.peel206: ; preds = %for.cond14.preheader.split.peel201
%cmp3.not.1.i.us.peel208 = icmp eq i32 %arrayidx1.i.i.promoted105, %6
%cmp3.not.2.i.us.peel209 = icmp eq i32 %arrayidx39.i.promoted121, %7
%or.cond.us.peel210 = select i1 %cmp3.not.1.i.us.peel208, i1 %cmp3.not.2.i.us.peel209, i1 false
%cmp3.not.3.i.us.peel211 = icmp eq i32 %arrayidx36.i.promoted117, %8
%or.cond70.us.peel212 = select i1 %or.cond.us.peel210, i1 %cmp3.not.3.i.us.peel211, i1 false
%cmp3.not.4.i.us.peel213 = icmp eq i32 %arrayidx5.i.i.promoted109, %9
%or.cond71.us.peel214 = select i1 %or.cond70.us.peel212, i1 %cmp3.not.4.i.us.peel213, i1 false
br i1 %or.cond71.us.peel214, label %if.end50.critedge, label %for.inc27.us.peel215
for.inc27.us.peel215: ; preds = %for.body16.us.preheader.peel206
%cmp3.not.1.i.us.1.peel216 = icmp eq i32 %arrayidx36.i.promoted117, %6
%cmp3.not.2.i.us.1.peel217 = icmp eq i32 %arrayidx1.i.i.promoted105, %7
%or.cond.us.1.peel218 = select i1 %cmp3.not.1.i.us.1.peel216, i1 %cmp3.not.2.i.us.1.peel217, i1 false
%cmp3.not.3.i.us.1.peel219 = icmp eq i32 %arrayidx5.i.i.promoted109, %8
%or.cond70.us.1.peel220 = select i1 %or.cond.us.1.peel218, i1 %cmp3.not.3.i.us.1.peel219, i1 false
%cmp3.not.4.i.us.1.peel221 = icmp eq i32 %arrayidx39.i.promoted121, %9
%or.cond71.us.1.peel222 = select i1 %or.cond70.us.1.peel220, i1 %cmp3.not.4.i.us.1.peel221, i1 false
br i1 %or.cond71.us.1.peel222, label %if.end50.critedge, label %for.inc27.us.1.peel223
for.inc27.us.1.peel223: ; preds = %for.inc27.us.peel215
%cmp3.not.1.i.us.2.peel224 = icmp eq i32 %arrayidx5.i.i.promoted109, %6
%cmp3.not.2.i.us.2.peel225 = icmp eq i32 %arrayidx36.i.promoted117, %7
%or.cond.us.2.peel226 = select i1 %cmp3.not.1.i.us.2.peel224, i1 %cmp3.not.2.i.us.2.peel225, i1 false
%cmp3.not.3.i.us.2.peel227 = icmp eq i32 %arrayidx39.i.promoted121, %8
%or.cond70.us.2.peel228 = select i1 %or.cond.us.2.peel226, i1 %cmp3.not.3.i.us.2.peel227, i1 false
%cmp3.not.4.i.us.2.peel229 = icmp eq i32 %arrayidx1.i.i.promoted105, %9
%or.cond71.us.2.peel230 = select i1 %or.cond70.us.2.peel228, i1 %cmp3.not.4.i.us.2.peel229, i1 false
br i1 %or.cond71.us.2.peel230, label %if.end50.critedge, label %for.inc27.us.2.peel231
for.inc27.us.2.peel231: ; preds = %for.inc27.us.1.peel223
%cmp3.not.1.i.us.3.peel232 = icmp eq i32 %arrayidx39.i.promoted121, %6
%cmp3.not.2.i.us.3.peel233 = icmp eq i32 %arrayidx5.i.i.promoted109, %7
%or.cond.us.3.peel234 = select i1 %cmp3.not.1.i.us.3.peel232, i1 %cmp3.not.2.i.us.3.peel233, i1 false
%cmp3.not.3.i.us.3.peel235 = icmp eq i32 %arrayidx1.i.i.promoted105, %8
%or.cond70.us.3.peel236 = select i1 %or.cond.us.3.peel234, i1 %cmp3.not.3.i.us.3.peel235, i1 false
%cmp3.not.4.i.us.3.peel237 = icmp eq i32 %arrayidx36.i.promoted117, %9
%or.cond71.us.3.peel238 = select i1 %or.cond70.us.3.peel236, i1 %cmp3.not.4.i.us.3.peel237, i1 false
br i1 %or.cond71.us.3.peel238, label %if.end50.critedge, label %if.end32.critedge.peel240
if.end32.critedge.peel240: ; preds = %for.inc27.us.2.peel231, %for.cond14.preheader.split.peel201
store i32 %arrayidx1.i.i.promoted105, ptr %arrayidx.3, align 4, !tbaa !5
store i32 %arrayidx5.i.i.promoted109, ptr %arrayidx.2, align 8, !tbaa !5
br label %for.cond14.preheader.peel.next198
for.cond14.preheader.peel.next198: ; preds = %for.cond14.preheader.peel.next140, %if.end32.critedge.peel240
store i32 %arrayidx39.i.promoted121, ptr %A, align 16
store i32 %arrayidx36.i.promoted117, ptr %arrayidx.5, align 4
%cmp19.not.peel258 = icmp eq i32 %arrayidx39.i.promoted121, %1
br i1 %cmp19.not.peel258, label %for.cond14.preheader.split.peel259, label %for.cond14.preheader.peel.next256
for.cond14.preheader.split.peel259: ; preds = %for.cond14.preheader.peel.next198
%cmp3.not.5.i.not.peel260 = icmp eq i32 %arrayidx36.i.promoted117, %10
%cmp3.not.5.i.not.fr.peel261 = freeze i1 %cmp3.not.5.i.not.peel260
br i1 %cmp3.not.5.i.not.fr.peel261, label %for.body16.us.preheader.peel264, label %for.cond14.preheader.peel.next256
for.body16.us.preheader.peel264: ; preds = %for.cond14.preheader.split.peel259
%cmp3.not.1.i.us.peel266 = icmp eq i32 %arrayidx1.i.i.promoted105, %6
%cmp3.not.2.i.us.peel267 = icmp eq i32 %A.promoted, %7
%or.cond.us.peel268 = select i1 %cmp3.not.1.i.us.peel266, i1 %cmp3.not.2.i.us.peel267, i1 false
%cmp3.not.3.i.us.peel269 = icmp eq i32 %arrayidx3.i.i.promoted, %8
%or.cond70.us.peel270 = select i1 %or.cond.us.peel268, i1 %cmp3.not.3.i.us.peel269, i1 false
%cmp3.not.4.i.us.peel271 = icmp eq i32 %arrayidx5.i.i.promoted109, %9
%or.cond71.us.peel272 = select i1 %or.cond70.us.peel270, i1 %cmp3.not.4.i.us.peel271, i1 false
br i1 %or.cond71.us.peel272, label %if.end50.critedge, label %for.inc27.us.peel273
for.inc27.us.peel273: ; preds = %for.body16.us.preheader.peel264
%cmp3.not.1.i.us.1.peel274 = icmp eq i32 %arrayidx3.i.i.promoted, %6
%cmp3.not.2.i.us.1.peel275 = icmp eq i32 %arrayidx1.i.i.promoted105, %7
%or.cond.us.1.peel276 = select i1 %cmp3.not.1.i.us.1.peel274, i1 %cmp3.not.2.i.us.1.peel275, i1 false
%cmp3.not.3.i.us.1.peel277 = icmp eq i32 %arrayidx5.i.i.promoted109, %8
%or.cond70.us.1.peel278 = select i1 %or.cond.us.1.peel276, i1 %cmp3.not.3.i.us.1.peel277, i1 false
%cmp3.not.4.i.us.1.peel279 = icmp eq i32 %A.promoted, %9
%or.cond71.us.1.peel280 = select i1 %or.cond70.us.1.peel278, i1 %cmp3.not.4.i.us.1.peel279, i1 false
br i1 %or.cond71.us.1.peel280, label %if.end50.critedge, label %for.inc27.us.1.peel281
for.inc27.us.1.peel281: ; preds = %for.inc27.us.peel273
%cmp3.not.1.i.us.2.peel282 = icmp eq i32 %arrayidx5.i.i.promoted109, %6
%cmp3.not.2.i.us.2.peel283 = icmp eq i32 %arrayidx3.i.i.promoted, %7
%or.cond.us.2.peel284 = select i1 %cmp3.not.1.i.us.2.peel282, i1 %cmp3.not.2.i.us.2.peel283, i1 false
%cmp3.not.3.i.us.2.peel285 = icmp eq i32 %A.promoted, %8
%or.cond70.us.2.peel286 = select i1 %or.cond.us.2.peel284, i1 %cmp3.not.3.i.us.2.peel285, i1 false
%cmp3.not.4.i.us.2.peel287 = icmp eq i32 %arrayidx1.i.i.promoted105, %9
%or.cond71.us.2.peel288 = select i1 %or.cond70.us.2.peel286, i1 %cmp3.not.4.i.us.2.peel287, i1 false
br i1 %or.cond71.us.2.peel288, label %if.end50.critedge, label %for.inc27.us.2.peel289
for.inc27.us.2.peel289: ; preds = %for.inc27.us.1.peel281
%cmp3.not.1.i.us.3.peel290 = icmp eq i32 %A.promoted, %6
%cmp3.not.2.i.us.3.peel291 = icmp eq i32 %arrayidx5.i.i.promoted109, %7
%or.cond.us.3.peel292 = select i1 %cmp3.not.1.i.us.3.peel290, i1 %cmp3.not.2.i.us.3.peel291, i1 false
%cmp3.not.3.i.us.3.peel293 = icmp eq i32 %arrayidx1.i.i.promoted105, %8
%or.cond70.us.3.peel294 = select i1 %or.cond.us.3.peel292, i1 %cmp3.not.3.i.us.3.peel293, i1 false
%cmp3.not.4.i.us.3.peel295 = icmp eq i32 %arrayidx3.i.i.promoted, %9
%or.cond71.us.3.peel296 = select i1 %or.cond70.us.3.peel294, i1 %cmp3.not.4.i.us.3.peel295, i1 false
br i1 %or.cond71.us.3.peel296, label %if.end50.critedge, label %for.cond14.preheader.peel.next256
for.cond14.preheader.peel.next256: ; preds = %for.cond14.preheader.split.peel259, %for.inc27.us.2.peel289, %for.cond14.preheader.peel.next198
store i32 %arrayidx36.i.promoted117, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %arrayidx39.i.promoted121, ptr %arrayidx.4, align 16, !tbaa !5
store i32 %A.promoted, ptr %A, align 16
store i32 %arrayidx3.i.i.promoted, ptr %arrayidx.5, align 4
%cmp3.not.2.i.us = icmp eq i32 %arrayidx36.i.promoted117, %7
%cmp3.not.3.i.us = icmp eq i32 %arrayidx39.i.promoted121, %8
%cmp3.not.1.i.us.1 = icmp eq i32 %arrayidx39.i.promoted121, %6
%cmp3.not.4.i.us.1 = icmp eq i32 %arrayidx36.i.promoted117, %9
%cmp3.not.2.i.us.2 = icmp eq i32 %arrayidx39.i.promoted121, %7
%cmp3.not.3.i.us.2 = icmp eq i32 %arrayidx36.i.promoted117, %8
%cmp3.not.1.i.us.3 = icmp eq i32 %arrayidx36.i.promoted117, %6
%cmp3.not.4.i.us.3 = icmp eq i32 %arrayidx39.i.promoted121, %9
%cmp19.not = icmp eq i32 %A.promoted, %1
br i1 %cmp19.not, label %for.cond14.preheader.split, label %for.inc44
for.cond14.preheader.split: ; preds = %for.cond14.preheader.peel.next256
%cmp3.not.5.i.not = icmp eq i32 %arrayidx3.i.i.promoted, %10
%cmp3.not.5.i.not.fr = freeze i1 %cmp3.not.5.i.not
br i1 %cmp3.not.5.i.not.fr, label %for.body16.us.preheader, label %if.end32.critedge
for.body16.us.preheader: ; preds = %for.cond14.preheader.split
%cmp3.not.1.i.us = icmp eq i32 %arrayidx1.i.i.promoted105, %6
%or.cond.us = select i1 %cmp3.not.1.i.us, i1 %cmp3.not.2.i.us, i1 false
%or.cond70.us = select i1 %or.cond.us, i1 %cmp3.not.3.i.us, i1 false
%cmp3.not.4.i.us = icmp eq i32 %arrayidx5.i.i.promoted109, %9
%or.cond71.us = select i1 %or.cond70.us, i1 %cmp3.not.4.i.us, i1 false
br i1 %or.cond71.us, label %if.then24.loopexit, label %for.inc27.us
for.inc27.us: ; preds = %for.body16.us.preheader
%cmp3.not.2.i.us.1 = icmp eq i32 %arrayidx1.i.i.promoted105, %7
%or.cond.us.1 = select i1 %cmp3.not.1.i.us.1, i1 %cmp3.not.2.i.us.1, i1 false
%cmp3.not.3.i.us.1 = icmp eq i32 %arrayidx5.i.i.promoted109, %8
%or.cond70.us.1 = select i1 %or.cond.us.1, i1 %cmp3.not.3.i.us.1, i1 false
%or.cond71.us.1 = select i1 %or.cond70.us.1, i1 %cmp3.not.4.i.us.1, i1 false
br i1 %or.cond71.us.1, label %if.then24.loopexit, label %for.inc27.us.1
for.inc27.us.1: ; preds = %for.inc27.us
%cmp3.not.1.i.us.2 = icmp eq i32 %arrayidx5.i.i.promoted109, %6
%or.cond.us.2 = select i1 %cmp3.not.1.i.us.2, i1 %cmp3.not.2.i.us.2, i1 false
%or.cond70.us.2 = select i1 %or.cond.us.2, i1 %cmp3.not.3.i.us.2, i1 false
%cmp3.not.4.i.us.2 = icmp eq i32 %arrayidx1.i.i.promoted105, %9
%or.cond71.us.2 = select i1 %or.cond70.us.2, i1 %cmp3.not.4.i.us.2, i1 false
br i1 %or.cond71.us.2, label %if.then24.loopexit, label %for.inc27.us.2
for.inc27.us.2: ; preds = %for.inc27.us.1
%cmp3.not.2.i.us.3 = icmp eq i32 %arrayidx5.i.i.promoted109, %7
%or.cond.us.3 = select i1 %cmp3.not.1.i.us.3, i1 %cmp3.not.2.i.us.3, i1 false
%cmp3.not.3.i.us.3 = icmp eq i32 %arrayidx1.i.i.promoted105, %8
%or.cond70.us.3 = select i1 %or.cond.us.3, i1 %cmp3.not.3.i.us.3, i1 false
%or.cond71.us.3 = select i1 %or.cond70.us.3, i1 %cmp3.not.4.i.us.3, i1 false
br i1 %or.cond71.us.3, label %if.then24.loopexit, label %if.end32.critedge
if.then24.loopexit: ; preds = %for.inc27.us.2.2, %for.inc27.us.1.2, %for.inc27.us.2335, %for.body16.us.preheader.2, %for.inc27.us.2.1, %for.inc27.us.1.1, %for.inc27.us.1329, %for.body16.us.preheader.1, %for.body16.us.preheader, %for.inc27.us, %for.inc27.us.1, %for.inc27.us.2
store i32 %6, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %8, ptr %arrayidx.3, align 4, !tbaa !5
store i32 %9, ptr %arrayidx.4, align 16, !tbaa !5
store i32 %7, ptr %arrayidx.2, align 8, !tbaa !5
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end50
if.end32.critedge: ; preds = %for.inc27.us.2, %for.cond14.preheader.split
store i32 %arrayidx36.i.promoted117, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %arrayidx39.i.promoted121, ptr %arrayidx.4, align 16, !tbaa !5
br label %for.inc44
for.inc44: ; preds = %for.cond14.preheader.peel.next256, %if.end32.critedge
store i32 %arrayidx3.i.i.promoted, ptr %arrayidx.3, align 4, !tbaa !5
store i32 %A.promoted, ptr %arrayidx.2, align 8, !tbaa !5
store i32 %arrayidx1.i.i.promoted105, ptr %A, align 16
store i32 %arrayidx5.i.i.promoted109, ptr %arrayidx.5, align 4
%cmp19.not.1 = icmp eq i32 %arrayidx1.i.i.promoted105, %1
br i1 %cmp19.not.1, label %for.cond14.preheader.split.1, label %for.inc44.1
for.cond14.preheader.split.1: ; preds = %for.inc44
%cmp3.not.5.i.not.1 = icmp eq i32 %arrayidx5.i.i.promoted109, %10
%cmp3.not.5.i.not.fr.1 = freeze i1 %cmp3.not.5.i.not.1
br i1 %cmp3.not.5.i.not.fr.1, label %for.body16.us.preheader.1, label %if.end32.critedge.1
for.body16.us.preheader.1: ; preds = %for.cond14.preheader.split.1
%cmp3.not.1.i.us.1324 = icmp eq i32 %arrayidx3.i.i.promoted, %6
%or.cond.us.1325 = select i1 %cmp3.not.1.i.us.1324, i1 %cmp3.not.2.i.us, i1 false
%or.cond70.us.1326 = select i1 %or.cond.us.1325, i1 %cmp3.not.3.i.us, i1 false
%cmp3.not.4.i.us.1327 = icmp eq i32 %A.promoted, %9
%or.cond71.us.1328 = select i1 %or.cond70.us.1326, i1 %cmp3.not.4.i.us.1327, i1 false
br i1 %or.cond71.us.1328, label %if.then24.loopexit, label %for.inc27.us.1329
for.inc27.us.1329: ; preds = %for.body16.us.preheader.1
%cmp3.not.2.i.us.1.1 = icmp eq i32 %arrayidx3.i.i.promoted, %7
%or.cond.us.1.1 = select i1 %cmp3.not.1.i.us.1, i1 %cmp3.not.2.i.us.1.1, i1 false
%cmp3.not.3.i.us.1.1 = icmp eq i32 %A.promoted, %8
%or.cond70.us.1.1 = select i1 %or.cond.us.1.1, i1 %cmp3.not.3.i.us.1.1, i1 false
%or.cond71.us.1.1 = select i1 %or.cond70.us.1.1, i1 %cmp3.not.4.i.us.1, i1 false
br i1 %or.cond71.us.1.1, label %if.then24.loopexit, label %for.inc27.us.1.1
for.inc27.us.1.1: ; preds = %for.inc27.us.1329
%cmp3.not.1.i.us.2.1 = icmp eq i32 %A.promoted, %6
%or.cond.us.2.1 = select i1 %cmp3.not.1.i.us.2.1, i1 %cmp3.not.2.i.us.2, i1 false
%or.cond70.us.2.1 = select i1 %or.cond.us.2.1, i1 %cmp3.not.3.i.us.2, i1 false
%cmp3.not.4.i.us.2.1 = icmp eq i32 %arrayidx3.i.i.promoted, %9
%or.cond71.us.2.1 = select i1 %or.cond70.us.2.1, i1 %cmp3.not.4.i.us.2.1, i1 false
br i1 %or.cond71.us.2.1, label %if.then24.loopexit, label %for.inc27.us.2.1
for.inc27.us.2.1: ; preds = %for.inc27.us.1.1
%cmp3.not.2.i.us.3.1 = icmp eq i32 %A.promoted, %7
%or.cond.us.3.1 = select i1 %cmp3.not.1.i.us.3, i1 %cmp3.not.2.i.us.3.1, i1 false
%cmp3.not.3.i.us.3.1 = icmp eq i32 %arrayidx3.i.i.promoted, %8
%or.cond70.us.3.1 = select i1 %or.cond.us.3.1, i1 %cmp3.not.3.i.us.3.1, i1 false
%or.cond71.us.3.1 = select i1 %or.cond70.us.3.1, i1 %cmp3.not.4.i.us.3, i1 false
br i1 %or.cond71.us.3.1, label %if.then24.loopexit, label %if.end32.critedge.1
if.end32.critedge.1: ; preds = %for.inc27.us.2.1, %for.cond14.preheader.split.1
store i32 %arrayidx36.i.promoted117, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %arrayidx39.i.promoted121, ptr %arrayidx.4, align 16, !tbaa !5
br label %for.inc44.1
for.inc44.1: ; preds = %if.end32.critedge.1, %for.inc44
store i32 %arrayidx5.i.i.promoted109, ptr %arrayidx.3, align 4, !tbaa !5
store i32 %arrayidx1.i.i.promoted105, ptr %arrayidx.2, align 8, !tbaa !5
store i32 %arrayidx3.i.i.promoted, ptr %A, align 16
store i32 %A.promoted, ptr %arrayidx.5, align 4
%cmp19.not.2 = icmp eq i32 %arrayidx3.i.i.promoted, %1
br i1 %cmp19.not.2, label %for.cond14.preheader.split.2, label %for.inc44.2
for.cond14.preheader.split.2: ; preds = %for.inc44.1
%cmp3.not.5.i.not.2 = icmp eq i32 %A.promoted, %10
%cmp3.not.5.i.not.fr.2 = freeze i1 %cmp3.not.5.i.not.2
br i1 %cmp3.not.5.i.not.fr.2, label %for.body16.us.preheader.2, label %if.end32.critedge.2
for.body16.us.preheader.2: ; preds = %for.cond14.preheader.split.2
%cmp3.not.1.i.us.2330 = icmp eq i32 %arrayidx5.i.i.promoted109, %6
%or.cond.us.2331 = select i1 %cmp3.not.1.i.us.2330, i1 %cmp3.not.2.i.us, i1 false
%or.cond70.us.2332 = select i1 %or.cond.us.2331, i1 %cmp3.not.3.i.us, i1 false
%cmp3.not.4.i.us.2333 = icmp eq i32 %arrayidx1.i.i.promoted105, %9
%or.cond71.us.2334 = select i1 %or.cond70.us.2332, i1 %cmp3.not.4.i.us.2333, i1 false
br i1 %or.cond71.us.2334, label %if.then24.loopexit, label %for.inc27.us.2335
for.inc27.us.2335: ; preds = %for.body16.us.preheader.2
%cmp3.not.2.i.us.1.2 = icmp eq i32 %arrayidx5.i.i.promoted109, %7
%or.cond.us.1.2 = select i1 %cmp3.not.1.i.us.1, i1 %cmp3.not.2.i.us.1.2, i1 false
%cmp3.not.3.i.us.1.2 = icmp eq i32 %arrayidx1.i.i.promoted105, %8
%or.cond70.us.1.2 = select i1 %or.cond.us.1.2, i1 %cmp3.not.3.i.us.1.2, i1 false
%or.cond71.us.1.2 = select i1 %or.cond70.us.1.2, i1 %cmp3.not.4.i.us.1, i1 false
br i1 %or.cond71.us.1.2, label %if.then24.loopexit, label %for.inc27.us.1.2
for.inc27.us.1.2: ; preds = %for.inc27.us.2335
%cmp3.not.1.i.us.2.2 = icmp eq i32 %arrayidx1.i.i.promoted105, %6
%or.cond.us.2.2 = select i1 %cmp3.not.1.i.us.2.2, i1 %cmp3.not.2.i.us.2, i1 false
%or.cond70.us.2.2 = select i1 %or.cond.us.2.2, i1 %cmp3.not.3.i.us.2, i1 false
%cmp3.not.4.i.us.2.2 = icmp eq i32 %arrayidx5.i.i.promoted109, %9
%or.cond71.us.2.2 = select i1 %or.cond70.us.2.2, i1 %cmp3.not.4.i.us.2.2, i1 false
br i1 %or.cond71.us.2.2, label %if.then24.loopexit, label %for.inc27.us.2.2
for.inc27.us.2.2: ; preds = %for.inc27.us.1.2
%cmp3.not.2.i.us.3.2 = icmp eq i32 %arrayidx1.i.i.promoted105, %7
%or.cond.us.3.2 = select i1 %cmp3.not.1.i.us.3, i1 %cmp3.not.2.i.us.3.2, i1 false
%cmp3.not.3.i.us.3.2 = icmp eq i32 %arrayidx5.i.i.promoted109, %8
%or.cond70.us.3.2 = select i1 %or.cond.us.3.2, i1 %cmp3.not.3.i.us.3.2, i1 false
%or.cond71.us.3.2 = select i1 %or.cond70.us.3.2, i1 %cmp3.not.4.i.us.3, i1 false
br i1 %or.cond71.us.3.2, label %if.then24.loopexit, label %if.end32.critedge.2
if.end32.critedge.2: ; preds = %for.inc27.us.2.2, %for.cond14.preheader.split.2
store i32 %arrayidx36.i.promoted117, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %arrayidx39.i.promoted121, ptr %arrayidx.4, align 16, !tbaa !5
br label %for.inc44.2
for.inc44.2: ; preds = %if.end32.critedge.2, %for.inc44.1
store i32 %A.promoted, ptr %arrayidx.3, align 4, !tbaa !5
store i32 %arrayidx3.i.i.promoted, ptr %arrayidx.2, align 8, !tbaa !5
store i32 %arrayidx5.i.i.promoted109, ptr %A, align 16
store i32 %arrayidx1.i.i.promoted105, ptr %arrayidx.5, align 4
br label %if.end50.sink.split
if.end50.critedge: ; preds = %for.inc27.us.2.peel289, %for.inc27.us.1.peel281, %for.inc27.us.peel273, %for.body16.us.preheader.peel264, %for.inc27.us.2.peel231, %for.inc27.us.1.peel223, %for.inc27.us.peel215, %for.body16.us.preheader.peel206, %for.inc27.us.2.peel173, %for.inc27.us.1.peel165, %for.inc27.us.peel157, %for.body16.us.preheader.peel148, %for.inc27.us.2.peel, %for.inc27.us.1.peel, %for.inc27.us.peel, %for.body16.us.preheader.peel
store i32 %6, ptr %arrayidx.1, align 4, !tbaa !5
store i32 %8, ptr %arrayidx.3, align 4, !tbaa !5
store i32 %9, ptr %arrayidx.4, align 16, !tbaa !5
store i32 %7, ptr %arrayidx.2, align 8, !tbaa !5
br label %if.end50.sink.split
if.end50.sink.split: ; preds = %for.inc44.2, %if.end50.critedge
%str.sink = phi ptr [ @str, %if.end50.critedge ], [ @str.3, %for.inc44.2 ]
%puts.c = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
br label %if.end50
if.end50: ; preds = %if.then24.loopexit, %if.end50.sink.split
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %B) #6
call void @llvm.lifetime.end.p0(i64 24, 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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @serch0(ptr nocapture noundef %A, ptr nocapture noundef readonly %B) local_unnamed_addr #3 {
entry:
%arrayidx1.i = getelementptr inbounds i32, ptr %A, i64 3
%arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 5
%arrayidx5.i = getelementptr inbounds i32, ptr %A, i64 2
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%cmp2 = icmp eq i32 %0, %1
br i1 %cmp2, label %if.end18, label %if.end
if.end: ; preds = %entry
%2 = load i32, ptr %arrayidx1.i, align 4, !tbaa !5
store i32 %2, ptr %A, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx1.i, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
store i32 %4, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx5.i, align 4, !tbaa !5
%5 = load i32, ptr %B, align 4, !tbaa !5
%cmp2.1 = icmp eq i32 %2, %5
br i1 %cmp2.1, label %if.end18, label %if.end.1
if.end.1: ; preds = %if.end
store i32 %3, ptr %A, align 4, !tbaa !5
store i32 %4, ptr %arrayidx1.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %2, ptr %arrayidx5.i, align 4, !tbaa !5
%6 = load i32, ptr %B, align 4, !tbaa !5
%cmp2.2 = icmp eq i32 %3, %6
br i1 %cmp2.2, label %if.end18, label %if.end.2
if.end.2: ; preds = %if.end.1
store i32 %4, ptr %A, align 4, !tbaa !5
store i32 %0, ptr %arrayidx1.i, align 4, !tbaa !5
store i32 %2, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx5.i, align 4, !tbaa !5
%7 = load i32, ptr %B, align 4, !tbaa !5
%cmp2.3 = icmp eq i32 %4, %7
br i1 %cmp2.3, label %if.end18, label %for.end
for.end: ; preds = %if.end.2
store i32 %0, ptr %A, align 4, !tbaa !5
store i32 %2, ptr %arrayidx1.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %4, ptr %arrayidx5.i, align 4, !tbaa !5
%.pre = load i32, ptr %B, align 4, !tbaa !5
%cmp5.not = icmp eq i32 %0, %.pre
br i1 %cmp5.not, label %if.end18, label %for.cond7.preheader
for.cond7.preheader: ; preds = %for.end
%arrayidx10.i = getelementptr inbounds i32, ptr %A, i64 1
%arrayidx14.i = getelementptr inbounds i32, ptr %A, i64 4
%8 = load i32, ptr %arrayidx10.i, align 4, !tbaa !5
store i32 %8, ptr %A, align 4, !tbaa !5
%9 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx10.i, align 4, !tbaa !5
%10 = load i32, ptr %arrayidx14.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx14.i, align 4, !tbaa !5
%11 = load i32, ptr %B, align 4, !tbaa !5
%cmp12 = icmp eq i32 %8, %11
br i1 %cmp12, label %if.end18, label %for.cond7
for.cond7: ; preds = %for.cond7.preheader
store i32 %9, ptr %A, align 4, !tbaa !5
store i32 %10, ptr %arrayidx10.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx14.i, align 4, !tbaa !5
%12 = load i32, ptr %B, align 4, !tbaa !5
%cmp12.1 = icmp eq i32 %9, %12
br i1 %cmp12.1, label %if.end18, label %for.cond7.1
for.cond7.1: ; preds = %for.cond7
store i32 %10, ptr %A, align 4, !tbaa !5
store i32 %0, ptr %arrayidx10.i, align 4, !tbaa !5
store i32 %8, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx14.i, align 4, !tbaa !5
%13 = load i32, ptr %B, align 4, !tbaa !5
%cmp12.2 = icmp eq i32 %10, %13
br i1 %cmp12.2, label %if.end18, label %for.cond7.2
for.cond7.2: ; preds = %for.cond7.1
store i32 %0, ptr %A, align 4, !tbaa !5
store i32 %8, ptr %arrayidx10.i, align 4, !tbaa !5
store i32 %9, ptr %arrayidx3.i, align 4, !tbaa !5
store i32 %10, ptr %arrayidx14.i, align 4, !tbaa !5
br label %if.end18
if.end18: ; preds = %for.cond7.2, %entry, %if.end, %if.end.1, %if.end.2, %for.cond7.preheader, %for.cond7, %for.cond7.1, %for.end
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @dicemove(i8 noundef signext %com, ptr nocapture noundef %A) local_unnamed_addr #3 {
entry:
%conv = sext i8 %com to i32
switch i32 %conv, label %sw.epilog [
i32 69, label %sw.bb
i32 78, label %sw.bb8
i32 83, label %sw.bb17
i32 87, label %sw.bb26
i32 77, label %sw.bb35
]
sw.bb: ; preds = %entry
%0 = load i32, ptr %A, align 4, !tbaa !5
%arrayidx1 = getelementptr inbounds i32, ptr %A, i64 3
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
store i32 %1, ptr %A, align 4, !tbaa !5
%arrayidx3 = getelementptr inbounds i32, ptr %A, i64 5
%2 = load i32, ptr %arrayidx3, align 4, !tbaa !5
store i32 %2, ptr %arrayidx1, align 4, !tbaa !5
%arrayidx5 = getelementptr inbounds i32, ptr %A, i64 2
%3 = load i32, ptr %arrayidx5, align 4, !tbaa !5
store i32 %3, ptr %arrayidx3, align 4, !tbaa !5
store i32 %0, ptr %arrayidx5, align 4, !tbaa !5
br label %sw.epilog
sw.bb8: ; preds = %entry
%4 = load i32, ptr %A, align 4, !tbaa !5
%arrayidx10 = getelementptr inbounds i32, ptr %A, i64 1
%5 = load i32, ptr %arrayidx10, align 4, !tbaa !5
store i32 %5, ptr %A, align 4, !tbaa !5
%arrayidx12 = getelementptr inbounds i32, ptr %A, i64 5
%6 = load i32, ptr %arrayidx12, align 4, !tbaa !5
store i32 %6, ptr %arrayidx10, align 4, !tbaa !5
%arrayidx14 = getelementptr inbounds i32, ptr %A, i64 4
%7 = load i32, ptr %arrayidx14, align 4, !tbaa !5
store i32 %7, ptr %arrayidx12, align 4, !tbaa !5
store i32 %4, ptr %arrayidx14, align 4, !tbaa !5
br label %sw.epilog
sw.bb17: ; preds = %entry
%8 = load i32, ptr %A, align 4, !tbaa !5
%arrayidx19 = getelementptr inbounds i32, ptr %A, i64 4
%9 = load i32, ptr %arrayidx19, align 4, !tbaa !5
store i32 %9, ptr %A, align 4, !tbaa !5
%arrayidx21 = getelementptr inbounds i32, ptr %A, i64 5
%10 = load i32, ptr %arrayidx21, align 4, !tbaa !5
store i32 %10, ptr %arrayidx19, align 4, !tbaa !5
%arrayidx23 = getelementptr inbounds i32, ptr %A, i64 1
%11 = load i32, ptr %arrayidx23, align 4, !tbaa !5
store i32 %11, ptr %arrayidx21, align 4, !tbaa !5
store i32 %8, ptr %arrayidx23, align 4, !tbaa !5
br label %sw.epilog
sw.bb26: ; preds = %entry
%12 = load i32, ptr %A, align 4, !tbaa !5
%arrayidx28 = getelementptr inbounds i32, ptr %A, i64 2
%13 = load i32, ptr %arrayidx28, align 4, !tbaa !5
store i32 %13, ptr %A, align 4, !tbaa !5
%arrayidx30 = getelementptr inbounds i32, ptr %A, i64 5
%14 = load i32, ptr %arrayidx30, align 4, !tbaa !5
store i32 %14, ptr %arrayidx28, align 4, !tbaa !5
%arrayidx32 = getelementptr inbounds i32, ptr %A, i64 3
%15 = load i32, ptr %arrayidx32, align 4, !tbaa !5
store i32 %15, ptr %arrayidx30, align 4, !tbaa !5
store i32 %12, ptr %arrayidx32, align 4, !tbaa !5
br label %sw.epilog
sw.bb35: ; preds = %entry
%arrayidx36 = getelementptr inbounds i32, ptr %A, i64 1
%16 = load <4 x i32>, ptr %arrayidx36, align 4, !tbaa !5
%17 = shufflevector <4 x i32> %16, <4 x i32> poison, <4 x i32> <i32 2, i32 0, i32 3, i32 1>
store <4 x i32> %17, ptr %arrayidx36, align 4, !tbaa !5
br label %sw.epilog
sw.epilog: ; preds = %entry, %sw.bb35, %sw.bb26, %sw.bb17, %sw.bb8, %sw.bb
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @check(ptr nocapture noundef readonly %A, ptr nocapture noundef readonly %B) local_unnamed_addr #4 {
entry:
%0 = load i32, ptr %A, align 4, !tbaa !5
%1 = load i32, ptr %B, align 4, !tbaa !5
%cmp3.not = icmp eq i32 %0, %1
br i1 %cmp3.not, label %for.inc, label %for.end
for.inc: ; preds = %entry
%arrayidx.1 = getelementptr inbounds i32, ptr %A, i64 1
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%arrayidx2.1 = getelementptr inbounds i32, ptr %B, i64 1
%3 = load i32, ptr %arrayidx2.1, align 4, !tbaa !5
%cmp3.not.1 = icmp eq i32 %2, %3
br i1 %cmp3.not.1, label %for.inc.1, label %for.end
for.inc.1: ; preds = %for.inc
%arrayidx.2 = getelementptr inbounds i32, ptr %A, i64 2
%4 = load i32, ptr %arrayidx.2, align 4, !tbaa !5
%arrayidx2.2 = getelementptr inbounds i32, ptr %B, i64 2
%5 = load i32, ptr %arrayidx2.2, align 4, !tbaa !5
%cmp3.not.2 = icmp eq i32 %4, %5
br i1 %cmp3.not.2, label %for.inc.2, label %for.end
for.inc.2: ; preds = %for.inc.1
%arrayidx.3 = getelementptr inbounds i32, ptr %A, i64 3
%6 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
%arrayidx2.3 = getelementptr inbounds i32, ptr %B, i64 3
%7 = load i32, ptr %arrayidx2.3, align 4, !tbaa !5
%cmp3.not.3 = icmp eq i32 %6, %7
br i1 %cmp3.not.3, label %for.inc.3, label %for.end
for.inc.3: ; preds = %for.inc.2
%arrayidx.4 = getelementptr inbounds i32, ptr %A, i64 4
%8 = load i32, ptr %arrayidx.4, align 4, !tbaa !5
%arrayidx2.4 = getelementptr inbounds i32, ptr %B, i64 4
%9 = load i32, ptr %arrayidx2.4, align 4, !tbaa !5
%cmp3.not.4 = icmp eq i32 %8, %9
br i1 %cmp3.not.4, label %for.inc.4, label %for.end
for.inc.4: ; preds = %for.inc.3
%arrayidx.5 = getelementptr inbounds i32, ptr %A, i64 5
%10 = load i32, ptr %arrayidx.5, align 4, !tbaa !5
%arrayidx2.5 = getelementptr inbounds i32, ptr %B, i64 5
%11 = load i32, ptr %arrayidx2.5, align 4, !tbaa !5
%cmp3.not.5 = icmp ne i32 %10, %11
%spec.select = zext i1 %cmp3.not.5 to i32
br label %for.end
for.end: ; preds = %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry
%cmp4 = phi i32 [ 1, %entry ], [ 1, %for.inc ], [ 1, %for.inc.1 ], [ 1, %for.inc.2 ], [ 1, %for.inc.3 ], [ %spec.select, %for.inc.4 ]
ret i32 %cmp4
}
; 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 @serch1(ptr nocapture noundef %A, ptr nocapture noundef readonly %B) local_unnamed_addr #3 {
entry:
%arrayidx = getelementptr inbounds i32, ptr %A, i64 1
%arrayidx1 = getelementptr inbounds i32, ptr %B, i64 1
%arrayidx37.i = getelementptr inbounds i32, ptr %A, i64 3
%arrayidx39.i = getelementptr inbounds i32, ptr %A, i64 4
%arrayidx41.i = getelementptr inbounds i32, ptr %A, i64 2
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%1 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp2 = icmp eq i32 %0, %1
br i1 %cmp2, label %for.end, label %if.end
if.end: ; preds = %entry
%2 = load i32, ptr %arrayidx37.i, align 4, !tbaa !5
store i32 %2, ptr %arrayidx, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx39.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx37.i, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx41.i, align 4, !tbaa !5
store i32 %4, ptr %arrayidx39.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx41.i, align 4, !tbaa !5
%5 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp2.1 = icmp eq i32 %2, %5
br i1 %cmp2.1, label %for.end, label %if.end.1
if.end.1: ; preds = %if.end
store i32 %3, ptr %arrayidx, align 4, !tbaa !5
store i32 %4, ptr %arrayidx37.i, align 4, !tbaa !5
store i32 %0, ptr %arrayidx39.i, align 4, !tbaa !5
store i32 %2, ptr %arrayidx41.i, align 4, !tbaa !5
%6 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp2.2 = icmp eq i32 %3, %6
br i1 %cmp2.2, label %for.end, label %if.end.2
if.end.2: ; preds = %if.end.1
store i32 %4, ptr %arrayidx, align 4, !tbaa !5
store i32 %0, ptr %arrayidx37.i, align 4, !tbaa !5
store i32 %2, ptr %arrayidx39.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx41.i, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx1, align 4, !tbaa !5
%cmp2.3 = icmp eq i32 %4, %7
br i1 %cmp2.3, label %for.end, label %if.end.3
if.end.3: ; preds = %if.end.2
store i32 %0, ptr %arrayidx, align 4, !tbaa !5
store i32 %2, ptr %arrayidx37.i, align 4, !tbaa !5
store i32 %3, ptr %arrayidx39.i, align 4, !tbaa !5
store i32 %4, ptr %arrayidx41.i, align 4, !tbaa !5
br label %for.end
for.end: ; preds = %if.end.3, %if.end.2, %if.end.1, %if.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress 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 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 diceo[6];
int dicet[6];
int copy[4];
int tatea[7] = { 0, 1, 5, 4, 0, 1, 5 };
int tateb[7] = { 0, 4, 5, 1, 0, 4, 5 };
int yokoa[7] = { 1, 2, 4, 3, 1, 2, 4 };
int yokob[7] = { 1, 3, 4, 2, 1, 3, 4 };
int hokaa[7] = { 0, 2, 5, 3, 0, 2, 5 };
int hokab[7] = { 0, 3, 5, 2, 0, 3, 5 };
int ue[6] = { 2, 3, 0, 5, 4, 1 };
int sita[6] = { 3, 2, 5, 0, 1, 4 };
int choice[7];
int co = 0;
int coo = 0;
int cot = 0;
int i, j, k;
for (i = 0; i < 6; i++) {
scanf("%d", &diceo[i]);
coo += diceo[i];
}
for (i = 0; i < 6; i++) {
scanf("%d", &dicet[i]);
cot += dicet[i];
}
for (i = 0; i < 6; i++) {
for (j = 0; j < 7; j++) {
switch (i) {
case 0:choice[j] = tatea[j];
break;
case 1:choice[j] = tateb[j];
break;
case 2:choice[j] = yokoa[j];
break;
case 3:choice[j] = yokob[j];
break;
case 4:choice[j] = hokaa[j];
break;
case 5:choice[j] = hokab[j];
break;
}
}
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
copy[k] = choice[k + j];
}
for (k = 0; k < 4; k++) {
coo = diceo[yokoa[k]];
cot = dicet[copy[k]];
if (coo == cot) co++;
}
if (co == 4) {
if (diceo[0] == dicet[ue[i]]) co++;
if (diceo[5] == dicet[sita[i]]) co++;
}
if (co == 6) {
printf("Yes\n");
return 0;
}
co = 0;
}
}
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117046/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117046/source.c"
target datalayout = "e-m:e-p270: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.ue = private unnamed_addr constant [6 x i32] [i32 2, i32 3, i32 0, i32 5, i32 4, i32 1], align 16
@__const.main.sita = private unnamed_addr constant [6 x i32] [i32 3, i32 2, i32 5, i32 0, i32 1, i32 4], 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
@switch.table.main.6 = private unnamed_addr constant [6 x i32] [i32 4, i32 1, i32 3, i32 2, i32 3, i32 2], align 4
@switch.table.main.7 = private unnamed_addr constant [6 x i32] [i32 5, i32 5, i32 4, i32 4, i32 5, i32 5], align 4
@switch.table.main.8 = private unnamed_addr constant [6 x i32] [i32 1, i32 4, i32 2, i32 3, i32 2, i32 3], align 4
@switch.table.main.9 = private unnamed_addr constant [6 x i32] [i32 0, i32 0, i32 1, i32 1, i32 0, i32 0], align 4
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%diceo = alloca [6 x i32], align 16
%dicet = alloca [6 x i32], align 16
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %diceo) #4
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %dicet) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %diceo)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %diceo, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %diceo, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [6 x i32], ptr %diceo, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [6 x i32], ptr %diceo, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [6 x i32], ptr %diceo, i64 0, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %dicet)
%arrayidx7.1 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 1
%call8.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.1)
%arrayidx7.2 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 2
%call8.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.2)
%arrayidx7.3 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 3
%call8.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.3)
%arrayidx7.4 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 4
%call8.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.4)
%arrayidx7.5 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 5
%call8.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7.5)
%0 = load i32, ptr %diceo, align 16
%1 = load i32, ptr %arrayidx.5, align 4
%2 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%3 = load i32, ptr %arrayidx.2, align 8, !tbaa !5
%4 = load i32, ptr %arrayidx.4, align 16, !tbaa !5
%5 = load i32, ptr %arrayidx.3, align 4, !tbaa !5
br label %for.cond18.preheader
for.cond18.preheader: ; preds = %entry, %if.end107.3
%choice.sroa.23.0 = phi i32 [ undef, %entry ], [ %choice.sroa.23.1, %if.end107.3 ]
%choice.sroa.21.0 = phi i32 [ undef, %entry ], [ %choice.sroa.21.1, %if.end107.3 ]
%choice.sroa.18.0 = phi i32 [ undef, %entry ], [ %choice.sroa.18.1, %if.end107.3 ]
%choice.sroa.14.0 = phi i32 [ undef, %entry ], [ %choice.sroa.14.1, %if.end107.3 ]
%choice.sroa.11.0 = phi i32 [ undef, %entry ], [ %choice.sroa.11.1, %if.end107.3 ]
%choice.sroa.9.0 = phi i32 [ undef, %entry ], [ %choice.sroa.9.1, %if.end107.3 ]
%choice.sroa.0.0 = phi i32 [ undef, %entry ], [ %choice.sroa.0.1, %if.end107.3 ]
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %if.end107.3 ]
%6 = trunc i64 %indvars.iv to i32
%7 = icmp ult i32 %6, 6
br i1 %7, label %switch.lookup, label %for.cond53.preheader
switch.lookup: ; preds = %for.cond18.preheader
%sext = shl i64 %indvars.iv, 32
%8 = ashr exact i64 %sext, 32
%switch.gep = getelementptr inbounds [6 x i32], ptr @switch.table.main.7, i64 0, i64 %8
%switch.load = load i32, ptr %switch.gep, align 4
%sext332 = shl i64 %indvars.iv, 32
%9 = ashr exact i64 %sext332, 32
%switch.gep320 = getelementptr inbounds [6 x i32], ptr @switch.table.main.8, i64 0, i64 %9
%switch.load321 = load i32, ptr %switch.gep320, align 4
%sext333 = shl i64 %indvars.iv, 32
%10 = ashr exact i64 %sext333, 32
%switch.gep322 = getelementptr inbounds [6 x i32], ptr @switch.table.main.9, i64 0, i64 %10
%switch.load323 = load i32, ptr %switch.gep322, align 4
%sext334 = shl i64 %indvars.iv, 32
%11 = ashr exact i64 %sext334, 32
%switch.gep324 = getelementptr inbounds [6 x i32], ptr @switch.table.main.6, i64 0, i64 %11
%switch.load325 = load i32, ptr %switch.gep324, align 4
%sext335 = shl i64 %indvars.iv, 32
%12 = ashr exact i64 %sext335, 32
%switch.gep326 = getelementptr inbounds [6 x i32], ptr @switch.table.main.7, i64 0, i64 %12
%switch.load327 = load i32, ptr %switch.gep326, align 4
%sext336 = shl i64 %indvars.iv, 32
%13 = ashr exact i64 %sext336, 32
%switch.gep328 = getelementptr inbounds [6 x i32], ptr @switch.table.main.8, i64 0, i64 %13
%switch.load329 = load i32, ptr %switch.gep328, align 4
%sext337 = shl i64 %indvars.iv, 32
%14 = ashr exact i64 %sext337, 32
%switch.gep330 = getelementptr inbounds [6 x i32], ptr @switch.table.main.9, i64 0, i64 %14
%switch.load331 = load i32, ptr %switch.gep330, align 4
br label %for.cond53.preheader
for.cond53.preheader: ; preds = %for.cond18.preheader, %switch.lookup
%choice.sroa.23.1 = phi i32 [ %switch.load, %switch.lookup ], [ %choice.sroa.23.0, %for.cond18.preheader ]
%choice.sroa.21.1 = phi i32 [ %switch.load321, %switch.lookup ], [ %choice.sroa.21.0, %for.cond18.preheader ]
%choice.sroa.18.1 = phi i32 [ %switch.load323, %switch.lookup ], [ %choice.sroa.18.0, %for.cond18.preheader ]
%choice.sroa.14.1 = phi i32 [ %switch.load325, %switch.lookup ], [ %choice.sroa.14.0, %for.cond18.preheader ]
%choice.sroa.11.1 = phi i32 [ %switch.load327, %switch.lookup ], [ %choice.sroa.11.0, %for.cond18.preheader ]
%choice.sroa.9.1 = phi i32 [ %switch.load329, %switch.lookup ], [ %choice.sroa.9.0, %for.cond18.preheader ]
%choice.sroa.0.1 = phi i32 [ %switch.load331, %switch.lookup ], [ %choice.sroa.0.0, %for.cond18.preheader ]
%arrayidx87 = getelementptr inbounds [6 x i32], ptr @__const.main.ue, i64 0, i64 %indvars.iv
%arrayidx96 = getelementptr inbounds [6 x i32], ptr @__const.main.sita, i64 0, i64 %indvars.iv
%idxprom76 = sext i32 %choice.sroa.0.1 to i64
%arrayidx77 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom76
%15 = load i32, ptr %arrayidx77, align 4, !tbaa !5
%cmp78 = icmp eq i32 %2, %15
%inc79 = zext i1 %cmp78 to i32
%idxprom76.1 = sext i32 %choice.sroa.9.1 to i64
%arrayidx77.1 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom76.1
%16 = load i32, ptr %arrayidx77.1, align 4, !tbaa !5
%cmp78.1 = icmp eq i32 %3, %16
%inc79.1 = zext i1 %cmp78.1 to i32
%spec.select.1 = add nuw nsw i32 %inc79, %inc79.1
%idxprom76.2 = sext i32 %choice.sroa.11.1 to i64
%arrayidx77.2 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom76.2
%17 = load i32, ptr %arrayidx77.2, align 4, !tbaa !5
%cmp78.2 = icmp eq i32 %4, %17
%inc79.2 = zext i1 %cmp78.2 to i32
%spec.select.2 = add nuw nsw i32 %spec.select.1, %inc79.2
%idxprom76.3 = sext i32 %choice.sroa.14.1 to i64
%arrayidx77.3 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom76.3
%18 = load i32, ptr %arrayidx77.3, align 4, !tbaa !5
%cmp78.3 = icmp eq i32 %5, %18
%inc79.3 = zext i1 %cmp78.3 to i32
%spec.select.3 = add nuw nsw i32 %spec.select.2, %inc79.3
%cmp83 = icmp eq i32 %spec.select.3, 4
br i1 %cmp83, label %if.then84, label %if.end107
if.then84: ; preds = %for.cond53.preheader
%19 = load i32, ptr %arrayidx87, align 4, !tbaa !5
%idxprom88 = sext i32 %19 to i64
%arrayidx89 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom88
%20 = load i32, ptr %arrayidx89, align 4, !tbaa !5
%cmp90 = icmp eq i32 %0, %20
%21 = load i32, ptr %arrayidx96, align 4, !tbaa !5
%idxprom97 = sext i32 %21 to i64
%arrayidx98 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom97
%22 = load i32, ptr %arrayidx98, align 4, !tbaa !5
%cmp99 = icmp eq i32 %1, %22
%or.cond = select i1 %cmp99, i1 %cmp90, i1 false
br i1 %or.cond, label %cleanup, label %if.end107
if.end107: ; preds = %for.cond53.preheader, %if.then84
%cmp78.1237 = icmp eq i32 %2, %16
%inc79.1238 = zext i1 %cmp78.1237 to i32
%cmp78.1.1 = icmp eq i32 %3, %17
%inc79.1.1 = zext i1 %cmp78.1.1 to i32
%spec.select.1.1 = add nuw nsw i32 %inc79.1238, %inc79.1.1
%cmp78.2.1 = icmp eq i32 %4, %18
%inc79.2.1 = zext i1 %cmp78.2.1 to i32
%spec.select.2.1 = add nuw nsw i32 %spec.select.1.1, %inc79.2.1
%idxprom76.3.1 = sext i32 %choice.sroa.18.1 to i64
%arrayidx77.3.1 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom76.3.1
%23 = load i32, ptr %arrayidx77.3.1, align 4, !tbaa !5
%cmp78.3.1 = icmp eq i32 %5, %23
%inc79.3.1 = zext i1 %cmp78.3.1 to i32
%spec.select.3.1 = add nuw nsw i32 %spec.select.2.1, %inc79.3.1
%cmp83.1 = icmp eq i32 %spec.select.3.1, 4
br i1 %cmp83.1, label %if.then84.1, label %if.end107.1
if.then84.1: ; preds = %if.end107
%24 = load i32, ptr %arrayidx87, align 4, !tbaa !5
%idxprom88.1 = sext i32 %24 to i64
%arrayidx89.1 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom88.1
%25 = load i32, ptr %arrayidx89.1, align 4, !tbaa !5
%cmp90.1 = icmp eq i32 %0, %25
%26 = load i32, ptr %arrayidx96, align 4, !tbaa !5
%idxprom97.1 = sext i32 %26 to i64
%arrayidx98.1 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom97.1
%27 = load i32, ptr %arrayidx98.1, align 4, !tbaa !5
%cmp99.1 = icmp eq i32 %1, %27
%or.cond317 = select i1 %cmp99.1, i1 %cmp90.1, i1 false
br i1 %or.cond317, label %cleanup, label %if.end107.1
if.end107.1: ; preds = %if.end107, %if.then84.1
%cmp78.2242 = icmp eq i32 %2, %17
%inc79.2243 = zext i1 %cmp78.2242 to i32
%cmp78.1.2 = icmp eq i32 %3, %18
%inc79.1.2 = zext i1 %cmp78.1.2 to i32
%spec.select.1.2 = add nuw nsw i32 %inc79.2243, %inc79.1.2
%cmp78.2.2 = icmp eq i32 %4, %23
%inc79.2.2 = zext i1 %cmp78.2.2 to i32
%spec.select.2.2 = add nuw nsw i32 %spec.select.1.2, %inc79.2.2
%idxprom76.3.2 = sext i32 %choice.sroa.21.1 to i64
%arrayidx77.3.2 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom76.3.2
%28 = load i32, ptr %arrayidx77.3.2, align 4, !tbaa !5
%cmp78.3.2 = icmp eq i32 %5, %28
%inc79.3.2 = zext i1 %cmp78.3.2 to i32
%spec.select.3.2 = add nuw nsw i32 %spec.select.2.2, %inc79.3.2
%cmp83.2 = icmp eq i32 %spec.select.3.2, 4
br i1 %cmp83.2, label %if.then84.2, label %if.end107.2
if.then84.2: ; preds = %if.end107.1
%29 = load i32, ptr %arrayidx87, align 4, !tbaa !5
%idxprom88.2 = sext i32 %29 to i64
%arrayidx89.2 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom88.2
%30 = load i32, ptr %arrayidx89.2, align 4, !tbaa !5
%cmp90.2 = icmp eq i32 %0, %30
%31 = load i32, ptr %arrayidx96, align 4, !tbaa !5
%idxprom97.2 = sext i32 %31 to i64
%arrayidx98.2 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom97.2
%32 = load i32, ptr %arrayidx98.2, align 4, !tbaa !5
%cmp99.2 = icmp eq i32 %1, %32
%or.cond318 = select i1 %cmp99.2, i1 %cmp90.2, i1 false
br i1 %or.cond318, label %cleanup, label %if.end107.2
if.end107.2: ; preds = %if.end107.1, %if.then84.2
%cmp78.3247 = icmp eq i32 %2, %18
%inc79.3248 = zext i1 %cmp78.3247 to i32
%cmp78.1.3 = icmp eq i32 %3, %23
%inc79.1.3 = zext i1 %cmp78.1.3 to i32
%spec.select.1.3 = add nuw nsw i32 %inc79.3248, %inc79.1.3
%cmp78.2.3 = icmp eq i32 %4, %28
%inc79.2.3 = zext i1 %cmp78.2.3 to i32
%spec.select.2.3 = add nuw nsw i32 %spec.select.1.3, %inc79.2.3
%idxprom76.3.3 = sext i32 %choice.sroa.23.1 to i64
%arrayidx77.3.3 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom76.3.3
%33 = load i32, ptr %arrayidx77.3.3, align 4, !tbaa !5
%cmp78.3.3 = icmp eq i32 %5, %33
%inc79.3.3 = zext i1 %cmp78.3.3 to i32
%spec.select.3.3 = add nuw nsw i32 %spec.select.2.3, %inc79.3.3
%cmp83.3 = icmp eq i32 %spec.select.3.3, 4
br i1 %cmp83.3, label %if.then84.3, label %if.end107.3
if.then84.3: ; preds = %if.end107.2
%34 = load i32, ptr %arrayidx87, align 4, !tbaa !5
%idxprom88.3 = sext i32 %34 to i64
%arrayidx89.3 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom88.3
%35 = load i32, ptr %arrayidx89.3, align 4, !tbaa !5
%cmp90.3 = icmp eq i32 %0, %35
%36 = load i32, ptr %arrayidx96, align 4, !tbaa !5
%idxprom97.3 = sext i32 %36 to i64
%arrayidx98.3 = getelementptr inbounds [6 x i32], ptr %dicet, i64 0, i64 %idxprom97.3
%37 = load i32, ptr %arrayidx98.3, align 4, !tbaa !5
%cmp99.3 = icmp eq i32 %1, %37
%or.cond319 = select i1 %cmp99.3, i1 %cmp90.3, i1 false
br i1 %or.cond319, label %cleanup, label %if.end107.3
if.end107.3: ; preds = %if.end107.2, %if.then84.3
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 6
br i1 %exitcond.not, label %cleanup, label %for.cond18.preheader, !llvm.loop !9
cleanup: ; preds = %if.end107.3, %if.then84, %if.then84.1, %if.then84.2, %if.then84.3
%str.sink = phi ptr [ @str.3, %if.then84.3 ], [ @str.3, %if.then84.2 ], [ @str.3, %if.then84.1 ], [ @str.3, %if.then84 ], [ @str, %if.end107.3 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %dicet) #4
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %diceo) #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"
int main(){
int i, n, t, maxa, maxb, m, a[110], b[110];
scanf("%d", &t);
while(t--){
scanf("%d", &n);
maxa = maxb = 0;
for(i = 1; i <= n; i++){
scanf("%d", &a[i]);
if(a[i] > maxa)
maxa = a[i];
}
for(i = 1; i <= n; i++){
scanf("%d", &b[i]);
if(b[i] > maxb)
maxb = b[i];
}
if(n == 1) printf("%d\n", a[1]*b[1]);
else{
if(maxa >= maxb){
m = 0;
for(i = 1; i <= n; i++){
if(a[i] < b[i]){
a[0] = a[i];
a[i] = b[i];
b[i] = a[0];
}
if(b[i] > m)
m = b[i];
}
printf("%d\n", maxa*m);
}
else{
m = 0;
for(i = 1; i <= n; i++){
if(a[i] > b[i]){
a[0] = a[i];
a[i] = b[i];
b[i] = a[0];
}
if(a[i] > m)
m = a[i];
}
printf("%d\n", maxb*m);
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11709/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11709/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%t = alloca i32, align 4
%a = alloca [110 x i32], align 16
%b = alloca [110 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 %t) #4
call void @llvm.lifetime.start.p0(i64 440, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 440, 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
%dec161 = add nsw i32 %0, -1
store i32 %dec161, ptr %t, align 4, !tbaa !5
%tobool.not162 = icmp eq i32 %0, 0
br i1 %tobool.not162, label %while.end, label %while.body.lr.ph
while.body.lr.ph: ; preds = %entry
%arrayidx26 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 1
%arrayidx27 = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 1
br label %while.body
while.body: ; preds = %while.body.lr.ph, %if.end97
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp.not144 = icmp slt i32 %1, 1
br i1 %cmp.not144, label %for.end60, label %for.body
for.cond8.preheader: ; preds = %for.body
%cmp9.not148 = icmp slt i32 %3, 1
br i1 %cmp9.not148, label %if.else, label %for.body10
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %while.body ]
%maxa.0146 = phi i32 [ %spec.select, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %2, i32 %maxa.0146)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp.not.not = icmp slt i64 %indvars.iv, %4
br i1 %cmp.not.not, label %for.body, label %for.cond8.preheader, !llvm.loop !9
for.body10: ; preds = %for.cond8.preheader, %for.body10
%indvars.iv165 = phi i64 [ %indvars.iv.next166, %for.body10 ], [ 1, %for.cond8.preheader ]
%maxb.0150 = phi i32 [ %spec.select140, %for.body10 ], [ 0, %for.cond8.preheader ]
%arrayidx12 = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv165
%call13 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx12)
%5 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%spec.select140 = call i32 @llvm.smax.i32(i32 %5, i32 %maxb.0150)
%indvars.iv.next166 = add nuw nsw i64 %indvars.iv165, 1
%.pr = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %.pr to i64
%cmp9.not.not = icmp slt i64 %indvars.iv165, %6
br i1 %cmp9.not.not, label %for.body10, label %for.end23, !llvm.loop !11
for.end23: ; preds = %for.body10
%cmp24 = icmp eq i32 %.pr, 1
br i1 %cmp24, label %if.then25, label %if.else
if.then25: ; preds = %for.end23
%7 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%8 = load i32, ptr %arrayidx27, align 4, !tbaa !5
%mul = mul nsw i32 %8, %7
br label %if.end97
if.else: ; preds = %for.cond8.preheader, %for.end23
%maxb.0.lcssa186 = phi i32 [ %spec.select140, %for.end23 ], [ 0, %for.cond8.preheader ]
%.lcssa143185 = phi i32 [ %.pr, %for.end23 ], [ %3, %for.cond8.preheader ]
%cmp29.not = icmp slt i32 %spec.select, %maxb.0.lcssa186
%cmp65.not157 = icmp slt i32 %.lcssa143185, 1
br i1 %cmp29.not, label %for.cond64.preheader, label %for.cond31.preheader
for.cond31.preheader: ; preds = %if.else
br i1 %cmp65.not157, label %for.end60, label %for.body33.preheader
for.body33.preheader: ; preds = %for.cond31.preheader
%9 = add i32 %.lcssa143185, 1
%wide.trip.count = zext i32 %9 to i64
%10 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %10, 1
%11 = icmp eq i32 %9, 2
br i1 %11, label %for.end60.loopexit.unr-lcssa, label %for.body33.preheader.new
for.body33.preheader.new: ; preds = %for.body33.preheader
%unroll_iter = and i64 %10, -2
br label %for.body33
for.cond64.preheader: ; preds = %if.else
br i1 %cmp65.not157, label %for.end93, label %for.body66.preheader
for.body66.preheader: ; preds = %for.cond64.preheader
%12 = add i32 %.lcssa143185, 1
%wide.trip.count174 = zext i32 %12 to i64
%13 = add nsw i64 %wide.trip.count174, -1
%xtraiter198 = and i64 %13, 1
%14 = icmp eq i32 %12, 2
br i1 %14, label %for.end93.loopexit.unr-lcssa, label %for.body66.preheader.new
for.body66.preheader.new: ; preds = %for.body66.preheader
%unroll_iter201 = and i64 %13, -2
br label %for.body66
for.body33: ; preds = %if.end50.1, %for.body33.preheader.new
%indvars.iv168 = phi i64 [ 1, %for.body33.preheader.new ], [ %indvars.iv.next169.1, %if.end50.1 ]
%m.0155 = phi i32 [ 0, %for.body33.preheader.new ], [ %spec.select141.1, %if.end50.1 ]
%niter = phi i64 [ 0, %for.body33.preheader.new ], [ %niter.next.1, %if.end50.1 ]
%arrayidx35 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv168
%15 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%arrayidx37 = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv168
%16 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%cmp38 = icmp slt i32 %15, %16
br i1 %cmp38, label %if.then39, label %if.end50
if.then39: ; preds = %for.body33
store i32 %15, ptr %a, align 16, !tbaa !5
store i32 %16, ptr %arrayidx35, align 4, !tbaa !5
store i32 %15, ptr %arrayidx37, align 4, !tbaa !5
br label %if.end50
if.end50: ; preds = %if.then39, %for.body33
%17 = phi i32 [ %15, %if.then39 ], [ %16, %for.body33 ]
%spec.select141 = call i32 @llvm.smax.i32(i32 %17, i32 %m.0155)
%indvars.iv.next169 = add nuw nsw i64 %indvars.iv168, 1
%arrayidx35.1 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv.next169
%18 = load i32, ptr %arrayidx35.1, align 4, !tbaa !5
%arrayidx37.1 = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv.next169
%19 = load i32, ptr %arrayidx37.1, align 4, !tbaa !5
%cmp38.1 = icmp slt i32 %18, %19
br i1 %cmp38.1, label %if.then39.1, label %if.end50.1
if.then39.1: ; preds = %if.end50
store i32 %18, ptr %a, align 16, !tbaa !5
store i32 %19, ptr %arrayidx35.1, align 4, !tbaa !5
store i32 %18, ptr %arrayidx37.1, align 4, !tbaa !5
br label %if.end50.1
if.end50.1: ; preds = %if.then39.1, %if.end50
%20 = phi i32 [ %18, %if.then39.1 ], [ %19, %if.end50 ]
%spec.select141.1 = call i32 @llvm.smax.i32(i32 %20, i32 %spec.select141)
%indvars.iv.next169.1 = add nuw nsw i64 %indvars.iv168, 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.end60.loopexit.unr-lcssa, label %for.body33, !llvm.loop !12
for.end60.loopexit.unr-lcssa: ; preds = %if.end50.1, %for.body33.preheader
%spec.select141.lcssa.ph = phi i32 [ undef, %for.body33.preheader ], [ %spec.select141.1, %if.end50.1 ]
%indvars.iv168.unr = phi i64 [ 1, %for.body33.preheader ], [ %indvars.iv.next169.1, %if.end50.1 ]
%m.0155.unr = phi i32 [ 0, %for.body33.preheader ], [ %spec.select141.1, %if.end50.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end60, label %for.body33.epil
for.body33.epil: ; preds = %for.end60.loopexit.unr-lcssa
%arrayidx35.epil = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv168.unr
%21 = load i32, ptr %arrayidx35.epil, align 4, !tbaa !5
%arrayidx37.epil = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv168.unr
%22 = load i32, ptr %arrayidx37.epil, align 4, !tbaa !5
%cmp38.epil = icmp slt i32 %21, %22
br i1 %cmp38.epil, label %if.then39.epil, label %if.end50.epil
if.then39.epil: ; preds = %for.body33.epil
store i32 %21, ptr %a, align 16, !tbaa !5
store i32 %22, ptr %arrayidx35.epil, align 4, !tbaa !5
store i32 %21, ptr %arrayidx37.epil, align 4, !tbaa !5
br label %if.end50.epil
if.end50.epil: ; preds = %if.then39.epil, %for.body33.epil
%23 = phi i32 [ %21, %if.then39.epil ], [ %22, %for.body33.epil ]
%spec.select141.epil = call i32 @llvm.smax.i32(i32 %23, i32 %m.0155.unr)
br label %for.end60
for.end60: ; preds = %if.end50.epil, %for.end60.loopexit.unr-lcssa, %while.body, %for.cond31.preheader
%maxa.0.lcssa179184192196 = phi i32 [ %spec.select, %for.cond31.preheader ], [ 0, %while.body ], [ %spec.select, %for.end60.loopexit.unr-lcssa ], [ %spec.select, %if.end50.epil ]
%m.0.lcssa = phi i32 [ 0, %for.cond31.preheader ], [ 0, %while.body ], [ %spec.select141.lcssa.ph, %for.end60.loopexit.unr-lcssa ], [ %spec.select141.epil, %if.end50.epil ]
%mul61 = mul nsw i32 %m.0.lcssa, %maxa.0.lcssa179184192196
br label %if.end97
for.body66: ; preds = %if.end83.1, %for.body66.preheader.new
%indvars.iv171 = phi i64 [ 1, %for.body66.preheader.new ], [ %indvars.iv.next172.1, %if.end83.1 ]
%m.2159 = phi i32 [ 0, %for.body66.preheader.new ], [ %spec.select142.1, %if.end83.1 ]
%niter202 = phi i64 [ 0, %for.body66.preheader.new ], [ %niter202.next.1, %if.end83.1 ]
%arrayidx68 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv171
%24 = load i32, ptr %arrayidx68, align 4, !tbaa !5
%arrayidx70 = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv171
%25 = load i32, ptr %arrayidx70, align 4, !tbaa !5
%cmp71 = icmp sgt i32 %24, %25
br i1 %cmp71, label %if.then72, label %if.end83
if.then72: ; preds = %for.body66
store i32 %24, ptr %a, align 16, !tbaa !5
store i32 %25, ptr %arrayidx68, align 4, !tbaa !5
store i32 %24, ptr %arrayidx70, align 4, !tbaa !5
br label %if.end83
if.end83: ; preds = %if.then72, %for.body66
%26 = phi i32 [ %25, %if.then72 ], [ %24, %for.body66 ]
%spec.select142 = call i32 @llvm.smax.i32(i32 %26, i32 %m.2159)
%indvars.iv.next172 = add nuw nsw i64 %indvars.iv171, 1
%arrayidx68.1 = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv.next172
%27 = load i32, ptr %arrayidx68.1, align 4, !tbaa !5
%arrayidx70.1 = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv.next172
%28 = load i32, ptr %arrayidx70.1, align 4, !tbaa !5
%cmp71.1 = icmp sgt i32 %27, %28
br i1 %cmp71.1, label %if.then72.1, label %if.end83.1
if.then72.1: ; preds = %if.end83
store i32 %27, ptr %a, align 16, !tbaa !5
store i32 %28, ptr %arrayidx68.1, align 4, !tbaa !5
store i32 %27, ptr %arrayidx70.1, align 4, !tbaa !5
br label %if.end83.1
if.end83.1: ; preds = %if.then72.1, %if.end83
%29 = phi i32 [ %28, %if.then72.1 ], [ %27, %if.end83 ]
%spec.select142.1 = call i32 @llvm.smax.i32(i32 %29, i32 %spec.select142)
%indvars.iv.next172.1 = add nuw nsw i64 %indvars.iv171, 2
%niter202.next.1 = add i64 %niter202, 2
%niter202.ncmp.1 = icmp eq i64 %niter202.next.1, %unroll_iter201
br i1 %niter202.ncmp.1, label %for.end93.loopexit.unr-lcssa, label %for.body66, !llvm.loop !13
for.end93.loopexit.unr-lcssa: ; preds = %if.end83.1, %for.body66.preheader
%spec.select142.lcssa.ph = phi i32 [ undef, %for.body66.preheader ], [ %spec.select142.1, %if.end83.1 ]
%indvars.iv171.unr = phi i64 [ 1, %for.body66.preheader ], [ %indvars.iv.next172.1, %if.end83.1 ]
%m.2159.unr = phi i32 [ 0, %for.body66.preheader ], [ %spec.select142.1, %if.end83.1 ]
%lcmp.mod199.not = icmp eq i64 %xtraiter198, 0
br i1 %lcmp.mod199.not, label %for.end93, label %for.body66.epil
for.body66.epil: ; preds = %for.end93.loopexit.unr-lcssa
%arrayidx68.epil = getelementptr inbounds [110 x i32], ptr %a, i64 0, i64 %indvars.iv171.unr
%30 = load i32, ptr %arrayidx68.epil, align 4, !tbaa !5
%arrayidx70.epil = getelementptr inbounds [110 x i32], ptr %b, i64 0, i64 %indvars.iv171.unr
%31 = load i32, ptr %arrayidx70.epil, align 4, !tbaa !5
%cmp71.epil = icmp sgt i32 %30, %31
br i1 %cmp71.epil, label %if.then72.epil, label %if.end83.epil
if.then72.epil: ; preds = %for.body66.epil
store i32 %30, ptr %a, align 16, !tbaa !5
store i32 %31, ptr %arrayidx68.epil, align 4, !tbaa !5
store i32 %30, ptr %arrayidx70.epil, align 4, !tbaa !5
br label %if.end83.epil
if.end83.epil: ; preds = %if.then72.epil, %for.body66.epil
%32 = phi i32 [ %31, %if.then72.epil ], [ %30, %for.body66.epil ]
%spec.select142.epil = call i32 @llvm.smax.i32(i32 %32, i32 %m.2159.unr)
br label %for.end93
for.end93: ; preds = %if.end83.epil, %for.end93.loopexit.unr-lcssa, %for.cond64.preheader
%m.2.lcssa = phi i32 [ 0, %for.cond64.preheader ], [ %spec.select142.lcssa.ph, %for.end93.loopexit.unr-lcssa ], [ %spec.select142.epil, %if.end83.epil ]
%mul94 = mul nsw i32 %m.2.lcssa, %maxb.0.lcssa186
br label %if.end97
if.end97: ; preds = %for.end60, %for.end93, %if.then25
%mul61.sink = phi i32 [ %mul61, %for.end60 ], [ %mul94, %for.end93 ], [ %mul, %if.then25 ]
%call62 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul61.sink)
%33 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %33, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %33, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %if.end97, %entry
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %b) #4
call void @llvm.lifetime.end.p0(i64 440, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
|
#include <stdio.h>
int main(void){
int i,j,k;
int dice1[7];
int dice2[7];
for(i=1;i<=6;i++) scanf("%d",&dice1[i]);
for(i=1;i<=6;i++) scanf("%d",&dice2[i]);
for(i=1;i<=6;i++){
if(dice2[1]==dice1[1]) {
for(j=1;j<=4;j++){
for(k=1;k<=7;k++){
if(k==7){
printf("Yes\n");
return 0;
}
if(dice2[k]!=dice1[k]) break;
}
dice2[0]=dice2[2];
dice2[2]=dice2[3];
dice2[3]=dice2[5];
dice2[5]=dice2[4];
dice2[4]=dice2[0];
}
}
dice2[0]=dice2[1];
switch(i){
case 3:
dice2[1]=dice2[3];
dice2[3]=dice2[6];
dice2[6]=dice2[4];
dice2[4]=dice2[0];
break;
default:
dice2[1]=dice2[2];
dice2[2]=dice2[6];
dice2[6]=dice2[5];
dice2[5]=dice2[0];
break;
}
}
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117132/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117132/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%dice1 = alloca [7 x i32], align 16
%dice2 = alloca [7 x i32], align 16
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %dice1) #4
call void @llvm.lifetime.start.p0(i64 28, ptr nonnull %dice2) #4
%arrayidx = getelementptr inbounds [7 x i32], ptr %dice1, 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 %dice1, 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 %dice1, 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 %dice1, 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 %dice1, 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 %dice1, 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)
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%arrayidx13.promoted = load i32, ptr %arrayidx5, align 4, !tbaa !5
%arrayidx59.promoted = load i32, ptr %arrayidx5.1, align 8, !tbaa !5
%arrayidx61.promoted = load i32, ptr %arrayidx5.5, align 8, !tbaa !5
%arrayidx63.promoted = load i32, ptr %arrayidx5.4, align 4, !tbaa !5
%arrayidx51.promoted = load i32, ptr %arrayidx5.2, align 4, !tbaa !5
%arrayidx55.promoted = load i32, ptr %arrayidx5.3, align 16, !tbaa !5
%1 = load i32, ptr %arrayidx.1, align 8
%2 = load i32, ptr %arrayidx.2, align 4
%3 = load i32, ptr %arrayidx.3, align 16
%4 = load i32, ptr %arrayidx.4, align 4
%5 = load i32, ptr %arrayidx.5, align 8
br label %for.body12
for.body12: ; preds = %entry, %for.inc67
%6 = phi i32 [ %arrayidx63.promoted, %entry ], [ %20, %for.inc67 ]
%7 = phi i32 [ %arrayidx55.promoted, %entry ], [ %21, %for.inc67 ]
%8 = phi i32 [ %arrayidx51.promoted, %entry ], [ %22, %for.inc67 ]
%9 = phi i32 [ %arrayidx59.promoted, %entry ], [ %23, %for.inc67 ]
%10 = phi i32 [ %arrayidx55.promoted, %entry ], [ %24, %for.inc67 ]
%11 = phi i32 [ %arrayidx51.promoted, %entry ], [ %25, %for.inc67 ]
%12 = phi i32 [ %arrayidx63.promoted, %entry ], [ %26, %for.inc67 ]
%13 = phi i32 [ %arrayidx61.promoted, %entry ], [ %27, %for.inc67 ]
%14 = phi i32 [ %arrayidx59.promoted, %entry ], [ %28, %for.inc67 ]
%i.293 = phi i32 [ 1, %entry ], [ %inc68, %for.inc67 ]
%15 = phi i32 [ %arrayidx13.promoted, %entry ], [ %29, %for.inc67 ]
%cmp15 = icmp eq i32 %15, %0
br i1 %cmp15, label %for.body21, label %if.end48
for.body21: ; preds = %for.body12
%cmp29.not.1 = icmp eq i32 %9, %1
%cmp29.not.2 = icmp eq i32 %8, %2
%or.cond = select i1 %cmp29.not.1, i1 %cmp29.not.2, i1 false
%cmp29.not.3 = icmp eq i32 %7, %3
%or.cond123 = select i1 %or.cond, i1 %cmp29.not.3, i1 false
%cmp29.not.4 = icmp eq i32 %6, %4
%or.cond124 = select i1 %or.cond123, i1 %cmp29.not.4, i1 false
%cmp29.not.5 = icmp eq i32 %13, %5
%or.cond125 = select i1 %or.cond124, i1 %cmp29.not.5, i1 false
br i1 %or.cond125, label %cleanup, label %for.body21.1114
for.body21.1114: ; preds = %for.body21
store i32 %14, ptr %dice2, align 16, !tbaa !5
store i32 %11, ptr %arrayidx5.1, align 8, !tbaa !5
store i32 %12, ptr %arrayidx5.2, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.4, align 4, !tbaa !5
store i32 %14, ptr %arrayidx5.3, align 16, !tbaa !5
%cmp29.not.1.1 = icmp eq i32 %11, %1
%cmp29.not.2.1 = icmp eq i32 %12, %2
%or.cond126 = select i1 %cmp29.not.1.1, i1 %cmp29.not.2.1, i1 false
%cmp29.not.3.1 = icmp eq i32 %14, %3
%or.cond127 = select i1 %or.cond126, i1 %cmp29.not.3.1, i1 false
%cmp29.not.4.1 = icmp eq i32 %10, %4
%or.cond128 = select i1 %or.cond127, i1 %cmp29.not.4.1, i1 false
%cmp29.not.5.1 = icmp eq i32 %13, %5
%or.cond129 = select i1 %or.cond128, i1 %cmp29.not.5.1, i1 false
br i1 %or.cond129, label %cleanup, label %for.body21.2118
for.body21.2118: ; preds = %for.body21.1114
store i32 %11, ptr %dice2, align 16, !tbaa !5
store i32 %12, ptr %arrayidx5.1, align 8, !tbaa !5
store i32 %10, ptr %arrayidx5.2, align 4, !tbaa !5
store i32 %14, ptr %arrayidx5.4, align 4, !tbaa !5
store i32 %11, ptr %arrayidx5.3, align 16, !tbaa !5
%cmp29.not.1.2 = icmp eq i32 %12, %1
%cmp29.not.2.2 = icmp eq i32 %10, %2
%or.cond130 = select i1 %cmp29.not.1.2, i1 %cmp29.not.2.2, i1 false
%cmp29.not.3.2 = icmp eq i32 %11, %3
%or.cond131 = select i1 %or.cond130, i1 %cmp29.not.3.2, i1 false
%cmp29.not.4.2 = icmp eq i32 %14, %4
%or.cond132 = select i1 %or.cond131, i1 %cmp29.not.4.2, i1 false
%cmp29.not.5.2 = icmp eq i32 %13, %5
%or.cond133 = select i1 %or.cond132, i1 %cmp29.not.5.2, i1 false
br i1 %or.cond133, label %cleanup, label %for.body21.3122
for.body21.3122: ; preds = %for.body21.2118
store i32 %12, ptr %dice2, align 16, !tbaa !5
store i32 %10, ptr %arrayidx5.1, align 8, !tbaa !5
store i32 %14, ptr %arrayidx5.2, align 4, !tbaa !5
store i32 %11, ptr %arrayidx5.4, align 4, !tbaa !5
store i32 %12, ptr %arrayidx5.3, align 16, !tbaa !5
%cmp29.not.1.3 = icmp eq i32 %10, %1
%cmp29.not.2.3 = icmp eq i32 %14, %2
%or.cond134 = select i1 %cmp29.not.1.3, i1 %cmp29.not.2.3, i1 false
%cmp29.not.3.3 = icmp eq i32 %12, %3
%or.cond135 = select i1 %or.cond134, i1 %cmp29.not.3.3, i1 false
%cmp29.not.4.3 = icmp eq i32 %11, %4
%or.cond136 = select i1 %or.cond135, i1 %cmp29.not.4.3, i1 false
%cmp29.not.5.3 = icmp eq i32 %13, %5
%or.cond137 = select i1 %or.cond136, i1 %cmp29.not.5.3, i1 false
br i1 %or.cond137, label %cleanup, label %for.end34.3
for.end34.3: ; preds = %for.body21.3122
store i32 %14, ptr %arrayidx5.1, align 8, !tbaa !5
store i32 %11, ptr %arrayidx5.2, align 4, !tbaa !5
store i32 %12, ptr %arrayidx5.4, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.3, align 16, !tbaa !5
br label %if.end48
if.end48: ; preds = %for.end34.3, %for.body12
%16 = phi i32 [ %12, %for.end34.3 ], [ %6, %for.body12 ]
%17 = phi i32 [ %10, %for.end34.3 ], [ %7, %for.body12 ]
%18 = phi i32 [ %11, %for.end34.3 ], [ %8, %for.body12 ]
%19 = phi i32 [ %14, %for.end34.3 ], [ %9, %for.body12 ]
store i32 %15, ptr %dice2, align 16, !tbaa !5
%cond = icmp eq i32 %i.293, 3
br i1 %cond, label %sw.bb, label %sw.default
sw.bb: ; preds = %if.end48
store i32 %11, ptr %arrayidx5, align 4, !tbaa !5
store i32 %13, ptr %arrayidx5.2, align 4, !tbaa !5
store i32 %10, ptr %arrayidx5.5, align 8, !tbaa !5
store i32 %15, ptr %arrayidx5.3, align 16, !tbaa !5
br label %for.inc67
sw.default: ; preds = %if.end48
store i32 %14, ptr %arrayidx5, align 4, !tbaa !5
store i32 %13, ptr %arrayidx5.1, align 8, !tbaa !5
store i32 %12, ptr %arrayidx5.5, align 8, !tbaa !5
store i32 %15, ptr %arrayidx5.4, align 4, !tbaa !5
br label %for.inc67
for.inc67: ; preds = %sw.bb, %sw.default
%20 = phi i32 [ %16, %sw.bb ], [ %15, %sw.default ]
%21 = phi i32 [ %15, %sw.bb ], [ %17, %sw.default ]
%22 = phi i32 [ %13, %sw.bb ], [ %18, %sw.default ]
%23 = phi i32 [ %19, %sw.bb ], [ %13, %sw.default ]
%24 = phi i32 [ %15, %sw.bb ], [ %10, %sw.default ]
%25 = phi i32 [ %13, %sw.bb ], [ %11, %sw.default ]
%26 = phi i32 [ %12, %sw.bb ], [ %15, %sw.default ]
%27 = phi i32 [ %10, %sw.bb ], [ %12, %sw.default ]
%28 = phi i32 [ %14, %sw.bb ], [ %13, %sw.default ]
%29 = phi i32 [ %11, %sw.bb ], [ %14, %sw.default ]
%inc68 = add nuw nsw i32 %i.293, 1
%exitcond.not = icmp eq i32 %inc68, 7
br i1 %exitcond.not, label %cleanup, label %for.body12, !llvm.loop !9
cleanup: ; preds = %for.inc67, %for.body21, %for.body21.1114, %for.body21.2118, %for.body21.3122
%str.sink = phi ptr [ @str.3, %for.body21.3122 ], [ @str.3, %for.body21.2118 ], [ @str.3, %for.body21.1114 ], [ @str.3, %for.body21 ], [ @str, %for.inc67 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %dice2) #4
call void @llvm.lifetime.end.p0(i64 28, ptr nonnull %dice1) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<math.h>
#include<string.h>
void rotation(int Dice1[],int Dice2[])
{
int i,tmp,flag=0,count,loop=1;
while(1)
{
for(i=0;i<4;i++)
{
if((Dice1[0]==Dice2[0])&&(Dice1[5]==Dice2[5])) {flag++; break;}
tmp=Dice1[0];
Dice1[0]=Dice1[1];
Dice1[1]=Dice1[5];
Dice1[5]=Dice1[4];
Dice1[4]=tmp;
}
if(flag==1) break;
for(i=0;i<4;i++)
{
if((Dice1[0]==Dice2[0])&&(Dice1[5]==Dice2[5])) {flag++;break;}
tmp=Dice1[0];
Dice1[0]=Dice1[3];
Dice1[3]=Dice1[5];
Dice1[5]=Dice1[2];
Dice1[2]=tmp;
}
if(flag==1) break;
break;
}
//上面と下面合わせ終了
// printf("%d\n",flag);
while(1)
{
count=0;
for(i=1;i<=4;i++)
{
if(Dice1[i]==Dice2[i]) count++;
if(count==4) {flag++; break;}
}
tmp=Dice1[1];
Dice1[1]=Dice1[3];
Dice1[3]=Dice1[4];
Dice1[4]=Dice1[2];
Dice1[2]=tmp;
if(loop==4) break;
loop++;
}
//側面合わせ終了
// printf("%d\n",flag);
if(flag>=2) printf("Yes\n");
else printf("No\n");
}
int main(void)
{
int i,j,Dice1[6],Dice2[6],q,a,b;
for(i=0;i<6;i++)
{
scanf("%d",&Dice1[i]);
}
for(i=0;i<6;i++)
{
scanf("%d",&Dice2[i]);
}
rotation(Dice1,Dice2);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117176/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117176/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str.2 = 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 void @rotation(ptr nocapture noundef %Dice1, ptr nocapture noundef readonly %Dice2) local_unnamed_addr #0 {
entry:
%arrayidx3 = getelementptr inbounds i32, ptr %Dice1, i64 5
%arrayidx4 = getelementptr inbounds i32, ptr %Dice2, i64 5
%arrayidx7 = getelementptr inbounds i32, ptr %Dice1, i64 1
%arrayidx11 = getelementptr inbounds i32, ptr %Dice1, i64 4
%0 = load i32, ptr %Dice1, align 4, !tbaa !5
%1 = load i32, ptr %Dice2, align 4, !tbaa !5
%cmp2 = icmp eq i32 %0, %1
%.pre = load i32, ptr %arrayidx3, align 4, !tbaa !5
br i1 %cmp2, label %land.lhs.true, label %if.end
land.lhs.true: ; preds = %entry
%2 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5 = icmp eq i32 %.pre, %2
br i1 %cmp5, label %land.lhs.true.while.end.loopexit134_crit_edge, label %if.end
land.lhs.true.while.end.loopexit134_crit_edge: ; preds = %land.lhs.true
%arrayidx64.promoted.pre.pre = load i32, ptr %arrayidx7, align 4, !tbaa !5
%arrayidx67.promoted.pre.pre = load i32, ptr %arrayidx11, align 4, !tbaa !5
br label %for.cond47.2
if.end: ; preds = %land.lhs.true, %entry
%3 = load i32, ptr %arrayidx7, align 4, !tbaa !5
store i32 %3, ptr %Dice1, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx7, align 4, !tbaa !5
%4 = load i32, ptr %arrayidx11, align 4, !tbaa !5
store i32 %4, ptr %arrayidx3, align 4, !tbaa !5
store i32 %0, ptr %arrayidx11, align 4, !tbaa !5
%5 = load i32, ptr %Dice2, align 4, !tbaa !5
%cmp2.1 = icmp eq i32 %3, %5
br i1 %cmp2.1, label %land.lhs.true.1, label %if.end.1
land.lhs.true.1: ; preds = %if.end
%6 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5.1 = icmp eq i32 %4, %6
br i1 %cmp5.1, label %for.cond47.2, label %if.end.1
if.end.1: ; preds = %land.lhs.true.1, %if.end
store i32 %.pre, ptr %Dice1, align 4, !tbaa !5
store i32 %4, ptr %arrayidx7, align 4, !tbaa !5
store i32 %0, ptr %arrayidx3, align 4, !tbaa !5
store i32 %3, ptr %arrayidx11, align 4, !tbaa !5
%7 = load i32, ptr %Dice2, align 4, !tbaa !5
%cmp2.2 = icmp eq i32 %.pre, %7
br i1 %cmp2.2, label %land.lhs.true.2, label %if.end.2
land.lhs.true.2: ; preds = %if.end.1
%8 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5.2 = icmp eq i32 %0, %8
br i1 %cmp5.2, label %for.cond47.2, label %if.end.2
if.end.2: ; preds = %land.lhs.true.2, %if.end.1
store i32 %4, ptr %Dice1, align 4, !tbaa !5
store i32 %0, ptr %arrayidx7, align 4, !tbaa !5
store i32 %3, ptr %arrayidx3, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx11, align 4, !tbaa !5
%9 = load i32, ptr %Dice2, align 4, !tbaa !5
%cmp2.3 = icmp eq i32 %4, %9
br i1 %cmp2.3, label %land.lhs.true.3, label %if.end.3
land.lhs.true.3: ; preds = %if.end.2
%10 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5.3 = icmp eq i32 %3, %10
br i1 %cmp5.3, label %for.cond47.2, label %if.end.3
if.end.3: ; preds = %land.lhs.true.3, %if.end.2
store i32 %0, ptr %Dice1, align 4, !tbaa !5
store i32 %3, ptr %arrayidx7, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx3, align 4, !tbaa !5
store i32 %4, ptr %arrayidx11, align 4, !tbaa !5
%arrayidx32 = getelementptr inbounds i32, ptr %Dice1, i64 3
%arrayidx36 = getelementptr inbounds i32, ptr %Dice1, i64 2
%11 = load i32, ptr %Dice2, align 4, !tbaa !5
%cmp23 = icmp eq i32 %0, %11
br i1 %cmp23, label %land.lhs.true24, label %if.end30
land.lhs.true24: ; preds = %if.end.3
%12 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp27 = icmp eq i32 %.pre, %12
br i1 %cmp27, label %for.cond47.2, label %if.end30
if.end30: ; preds = %land.lhs.true24, %if.end.3
%13 = load i32, ptr %arrayidx32, align 4, !tbaa !5
store i32 %13, ptr %Dice1, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx32, align 4, !tbaa !5
%14 = load i32, ptr %arrayidx36, align 4, !tbaa !5
store i32 %14, ptr %arrayidx3, align 4, !tbaa !5
store i32 %0, ptr %arrayidx36, align 4, !tbaa !5
%15 = load i32, ptr %Dice2, align 4, !tbaa !5
%cmp23.1 = icmp eq i32 %13, %15
br i1 %cmp23.1, label %land.lhs.true24.1, label %if.end30.1
land.lhs.true24.1: ; preds = %if.end30
%16 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp27.1 = icmp eq i32 %14, %16
br i1 %cmp27.1, label %for.cond47.2, label %if.end30.1
if.end30.1: ; preds = %land.lhs.true24.1, %if.end30
store i32 %.pre, ptr %Dice1, align 4, !tbaa !5
store i32 %14, ptr %arrayidx32, align 4, !tbaa !5
store i32 %0, ptr %arrayidx3, align 4, !tbaa !5
store i32 %13, ptr %arrayidx36, align 4, !tbaa !5
%17 = load i32, ptr %Dice2, align 4, !tbaa !5
%cmp23.2 = icmp eq i32 %.pre, %17
br i1 %cmp23.2, label %land.lhs.true24.2, label %if.end30.2
land.lhs.true24.2: ; preds = %if.end30.1
%18 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp27.2 = icmp eq i32 %0, %18
br i1 %cmp27.2, label %for.cond47.2, label %if.end30.2
if.end30.2: ; preds = %land.lhs.true24.2, %if.end30.1
store i32 %14, ptr %Dice1, align 4, !tbaa !5
store i32 %0, ptr %arrayidx32, align 4, !tbaa !5
store i32 %13, ptr %arrayidx3, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx36, align 4, !tbaa !5
%19 = load i32, ptr %Dice2, align 4, !tbaa !5
%cmp23.3 = icmp eq i32 %14, %19
br i1 %cmp23.3, label %land.lhs.true24.3, label %if.end30.3
land.lhs.true24.3: ; preds = %if.end30.2
%20 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp27.3 = icmp eq i32 %13, %20
br i1 %cmp27.3, label %for.cond47.2, label %if.end30.3
if.end30.3: ; preds = %land.lhs.true24.3, %if.end30.2
store i32 %0, ptr %Dice1, align 4, !tbaa !5
store i32 %13, ptr %arrayidx32, align 4, !tbaa !5
store i32 %.pre, ptr %arrayidx3, align 4, !tbaa !5
store i32 %14, ptr %arrayidx36, align 4, !tbaa !5
br label %for.cond47.2
for.cond47.2: ; preds = %if.end30.3, %land.lhs.true24.3, %land.lhs.true24.2, %land.lhs.true24.1, %land.lhs.true24, %land.lhs.true.while.end.loopexit134_crit_edge, %land.lhs.true.3, %land.lhs.true.2, %land.lhs.true.1
%21 = phi i32 [ %4, %if.end30.3 ], [ %4, %land.lhs.true24.3 ], [ %4, %land.lhs.true24.2 ], [ %4, %land.lhs.true24.1 ], [ %4, %land.lhs.true24 ], [ %arrayidx67.promoted.pre.pre, %land.lhs.true.while.end.loopexit134_crit_edge ], [ %.pre, %land.lhs.true.3 ], [ %3, %land.lhs.true.2 ], [ %0, %land.lhs.true.1 ]
%22 = phi i32 [ %3, %if.end30.3 ], [ %3, %land.lhs.true24.3 ], [ %3, %land.lhs.true24.2 ], [ %3, %land.lhs.true24.1 ], [ %3, %land.lhs.true24 ], [ %arrayidx64.promoted.pre.pre, %land.lhs.true.while.end.loopexit134_crit_edge ], [ %0, %land.lhs.true.3 ], [ %4, %land.lhs.true.2 ], [ %.pre, %land.lhs.true.1 ]
%flag.1 = phi i32 [ 0, %if.end30.3 ], [ 1, %land.lhs.true24.3 ], [ 1, %land.lhs.true24.2 ], [ 1, %land.lhs.true24.1 ], [ 1, %land.lhs.true24 ], [ 1, %land.lhs.true.while.end.loopexit134_crit_edge ], [ 1, %land.lhs.true.3 ], [ 1, %land.lhs.true.2 ], [ 1, %land.lhs.true.1 ]
%arrayidx65 = getelementptr inbounds i32, ptr %Dice1, i64 3
%arrayidx69 = getelementptr inbounds i32, ptr %Dice1, i64 2
%arrayidx65.promoted = load i32, ptr %arrayidx65, align 4, !tbaa !5
%arrayidx69.promoted = load i32, ptr %arrayidx69, align 4, !tbaa !5
%arrayidx52 = getelementptr inbounds i32, ptr %Dice2, i64 1
%23 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%arrayidx52.1 = getelementptr inbounds i32, ptr %Dice2, i64 2
%24 = load i32, ptr %arrayidx52.1, align 4, !tbaa !5
%arrayidx52.2 = getelementptr inbounds i32, ptr %Dice2, i64 3
%25 = load i32, ptr %arrayidx52.2, align 4, !tbaa !5
%arrayidx52.3 = getelementptr inbounds i32, ptr %Dice2, i64 4
%26 = load i32, ptr %arrayidx52.3, align 4, !tbaa !5
store i32 %arrayidx65.promoted, ptr %arrayidx7, align 4, !tbaa !5
store i32 %21, ptr %arrayidx65, align 4, !tbaa !5
store i32 %arrayidx69.promoted, ptr %arrayidx11, align 4, !tbaa !5
store i32 %22, ptr %arrayidx69, align 4, !tbaa !5
%27 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%arrayidx52.1.1 = getelementptr inbounds i32, ptr %Dice2, i64 2
%28 = load i32, ptr %arrayidx52.1.1, align 4, !tbaa !5
%arrayidx52.2.1 = getelementptr inbounds i32, ptr %Dice2, i64 3
%29 = load i32, ptr %arrayidx52.2.1, align 4, !tbaa !5
%arrayidx52.3.1 = getelementptr inbounds i32, ptr %Dice2, i64 4
%30 = load i32, ptr %arrayidx52.3.1, align 4, !tbaa !5
store i32 %21, ptr %arrayidx7, align 4, !tbaa !5
store i32 %arrayidx69.promoted, ptr %arrayidx65, align 4, !tbaa !5
store i32 %22, ptr %arrayidx11, align 4, !tbaa !5
store i32 %arrayidx65.promoted, ptr %arrayidx69, align 4, !tbaa !5
%31 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%arrayidx52.1.2 = getelementptr inbounds i32, ptr %Dice2, i64 2
%32 = load i32, ptr %arrayidx52.1.2, align 4, !tbaa !5
%arrayidx52.2.2 = getelementptr inbounds i32, ptr %Dice2, i64 3
%33 = load i32, ptr %arrayidx52.2.2, align 4, !tbaa !5
%arrayidx52.3.2 = getelementptr inbounds i32, ptr %Dice2, i64 4
%34 = load i32, ptr %arrayidx52.3.2, align 4, !tbaa !5
store i32 %arrayidx69.promoted, ptr %arrayidx7, align 4, !tbaa !5
store i32 %22, ptr %arrayidx65, align 4, !tbaa !5
store i32 %arrayidx65.promoted, ptr %arrayidx11, align 4, !tbaa !5
store i32 %21, ptr %arrayidx69, align 4, !tbaa !5
%35 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%arrayidx52.1.3 = getelementptr inbounds i32, ptr %Dice2, i64 2
%36 = load i32, ptr %arrayidx52.1.3, align 4, !tbaa !5
%arrayidx52.2.3 = getelementptr inbounds i32, ptr %Dice2, i64 3
%37 = load i32, ptr %arrayidx52.2.3, align 4, !tbaa !5
%arrayidx52.3.3 = getelementptr inbounds i32, ptr %Dice2, i64 4
%38 = load i32, ptr %arrayidx52.3.3, align 4, !tbaa !5
%39 = insertelement <4 x i32> poison, i32 %22, i64 0
%40 = insertelement <4 x i32> %39, i32 %arrayidx65.promoted, i64 1
%41 = insertelement <4 x i32> %40, i32 %21, i64 2
%42 = insertelement <4 x i32> %41, i32 %arrayidx69.promoted, i64 3
%43 = insertelement <4 x i32> poison, i32 %23, i64 0
%44 = insertelement <4 x i32> %43, i32 %27, i64 1
%45 = insertelement <4 x i32> %44, i32 %31, i64 2
%46 = insertelement <4 x i32> %45, i32 %35, i64 3
%47 = icmp eq <4 x i32> %42, %46
%48 = zext <4 x i1> %47 to <4 x i32>
%49 = shufflevector <4 x i32> %42, <4 x i32> poison, <4 x i32> <i32 3, i32 0, i32 1, i32 2>
%50 = insertelement <4 x i32> poison, i32 %24, i64 0
%51 = insertelement <4 x i32> %50, i32 %28, i64 1
%52 = insertelement <4 x i32> %51, i32 %32, i64 2
%53 = insertelement <4 x i32> %52, i32 %36, i64 3
%54 = icmp eq <4 x i32> %49, %53
%55 = zext <4 x i1> %54 to <4 x i32>
%56 = add nuw nsw <4 x i32> %48, %55
%57 = shufflevector <4 x i32> %42, <4 x i32> poison, <4 x i32> <i32 1, i32 2, i32 3, i32 0>
%58 = insertelement <4 x i32> poison, i32 %25, i64 0
%59 = insertelement <4 x i32> %58, i32 %29, i64 1
%60 = insertelement <4 x i32> %59, i32 %33, i64 2
%61 = insertelement <4 x i32> %60, i32 %37, i64 3
%62 = icmp eq <4 x i32> %57, %61
%63 = zext <4 x i1> %62 to <4 x i32>
%64 = add nuw nsw <4 x i32> %56, %63
%65 = shufflevector <4 x i32> %42, <4 x i32> poison, <4 x i32> <i32 2, i32 3, i32 0, i32 1>
%66 = insertelement <4 x i32> poison, i32 %26, i64 0
%67 = insertelement <4 x i32> %66, i32 %30, i64 1
%68 = insertelement <4 x i32> %67, i32 %34, i64 2
%69 = insertelement <4 x i32> %68, i32 %38, i64 3
%70 = icmp eq <4 x i32> %65, %69
%71 = zext <4 x i1> %70 to <4 x i32>
%72 = add nuw nsw <4 x i32> %64, %71
%73 = icmp eq <4 x i32> %72, <i32 4, i32 4, i32 4, i32 4>
%74 = bitcast <4 x i1> %73 to i4
%75 = tail call i4 @llvm.ctpop.i4(i4 %74), !range !9
%76 = zext i4 %75 to i32
%op.rdx = add nuw nsw i32 %flag.1, %76
store i32 %22, ptr %arrayidx7, align 4, !tbaa !5
store i32 %arrayidx65.promoted, ptr %arrayidx65, align 4, !tbaa !5
store i32 %21, ptr %arrayidx11, align 4, !tbaa !5
store i32 %arrayidx69.promoted, ptr %arrayidx69, align 4, !tbaa !5
%cmp77 = icmp ugt i32 %op.rdx, 1
%str.sink = select i1 %cmp77, ptr @str.3, ptr @str
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
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 #0 {
entry:
%Dice1 = alloca [6 x i32], align 16
%Dice2 = alloca [6 x i32], align 16
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %Dice1) #5
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %Dice2) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %Dice1)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %Dice1, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %Dice1, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [6 x i32], ptr %Dice1, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [6 x i32], ptr %Dice1, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [6 x i32], ptr %Dice1, i64 0, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx.5)
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %Dice2)
%arrayidx5.1 = getelementptr inbounds [6 x i32], ptr %Dice2, i64 0, i64 1
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [6 x i32], ptr %Dice2, i64 0, i64 2
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.3 = getelementptr inbounds [6 x i32], ptr %Dice2, i64 0, i64 3
%call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5.3)
%arrayidx5.4 = getelementptr inbounds [6 x i32], ptr %Dice2, i64 0, i64 4
%call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5.4)
%arrayidx5.5 = getelementptr inbounds [6 x i32], ptr %Dice2, i64 0, i64 5
%call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %arrayidx5.5)
call void @rotation(ptr noundef nonnull %Dice1, ptr noundef nonnull %Dice2)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %Dice2) #5
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %Dice1) #5
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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i4 @llvm.ctpop.i4(i4) #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 = !{i4 0, i4 5}
|
#include <stdio.h>
int main(int argc, const char * argv[]) {
int dice[24][6] = {{2 ,6 ,3 ,4 ,1 ,5},
{6 ,5 ,3 ,4 ,2 ,1},
{5 ,1 ,3 ,4 ,6 ,2},
{4 ,1 ,5 ,2 ,6 ,3},
{6 ,4 ,5 ,2 ,3 ,1},
{3 ,6 ,5 ,2 ,1 ,4},
{1 ,3 ,5 ,2 ,4 ,6},
{5 ,3 ,6 ,1 ,4 ,2},
{3 ,2 ,6 ,1 ,5 ,4},
{2 ,4 ,6 ,1 ,3 ,5},
{4 ,5 ,6 ,1 ,2 ,3},
{1 ,5 ,4 ,3 ,2 ,6},
{2 ,1 ,4 ,3 ,6 ,5},
{6 ,2 ,4 ,3 ,5 ,1},
{5 ,6 ,4 ,3 ,1 ,2},
{4 ,6 ,2 ,5 ,1 ,3},
{6 ,3 ,2 ,5 ,4 ,1},
{3 ,1 ,2 ,5 ,6 ,4},
{1 ,4 ,2 ,5 ,3 ,6},
{5 ,4 ,1 ,6 ,3 ,2},
{3 ,5 ,1 ,6 ,2 ,4},
{2 ,3 ,1 ,6 ,4 ,5},
{4 ,2 ,1 ,6 ,5 ,3},
{1 ,2 ,3 ,4 ,5 ,6}};
int num2[6],i,j,count=0,num[6]={0};
for (i = 0; i < 6; i++) {
scanf("%d",&num[i]);
}
for (i = 0 ; i < 6; i++) {
scanf("%d",&num2[i]);
}
for (i = 0; i < 24; i++) {
for (j = 0; j < 6; j++) {
if(num[j] != num2[dice[i][j]-1]){
break;
}
count++;
}
if (count == 6) {
printf("Yes\n");
return 0;
}
count = 0;
}
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117219/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117219/source.c"
target datalayout = "e-m:e-p270: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.dice = private unnamed_addr constant [24 x [6 x i32]] [[6 x i32] [i32 2, i32 6, i32 3, i32 4, i32 1, i32 5], [6 x i32] [i32 6, i32 5, i32 3, i32 4, i32 2, i32 1], [6 x i32] [i32 5, i32 1, i32 3, i32 4, i32 6, i32 2], [6 x i32] [i32 4, i32 1, i32 5, i32 2, i32 6, i32 3], [6 x i32] [i32 6, i32 4, i32 5, i32 2, i32 3, i32 1], [6 x i32] [i32 3, i32 6, i32 5, i32 2, i32 1, i32 4], [6 x i32] [i32 1, i32 3, i32 5, i32 2, i32 4, i32 6], [6 x i32] [i32 5, i32 3, i32 6, i32 1, i32 4, i32 2], [6 x i32] [i32 3, i32 2, i32 6, i32 1, i32 5, i32 4], [6 x i32] [i32 2, i32 4, i32 6, i32 1, i32 3, i32 5], [6 x i32] [i32 4, i32 5, i32 6, i32 1, i32 2, i32 3], [6 x i32] [i32 1, i32 5, i32 4, i32 3, i32 2, i32 6], [6 x i32] [i32 2, i32 1, i32 4, i32 3, i32 6, i32 5], [6 x i32] [i32 6, i32 2, i32 4, i32 3, i32 5, i32 1], [6 x i32] [i32 5, i32 6, i32 4, i32 3, i32 1, i32 2], [6 x i32] [i32 4, i32 6, i32 2, i32 5, i32 1, i32 3], [6 x i32] [i32 6, i32 3, i32 2, i32 5, i32 4, i32 1], [6 x i32] [i32 3, i32 1, i32 2, i32 5, i32 6, i32 4], [6 x i32] [i32 1, i32 4, i32 2, i32 5, i32 3, i32 6], [6 x i32] [i32 5, i32 4, i32 1, i32 6, i32 3, i32 2], [6 x i32] [i32 3, i32 5, i32 1, i32 6, i32 2, i32 4], [6 x i32] [i32 2, i32 3, i32 1, i32 6, i32 4, i32 5], [6 x i32] [i32 4, i32 2, i32 1, i32 6, i32 5, i32 3], [6 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6]], 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(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #0 {
entry:
%num2 = alloca [6 x i32], align 16
%num = alloca [6 x i32], align 16
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %num2) #5
call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %num) #5
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %num, i8 0, i64 24, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num)
%arrayidx.1 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 1
%call.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.1)
%arrayidx.2 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 2
%call.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.2)
%arrayidx.3 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 3
%call.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.3)
%arrayidx.4 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 4
%call.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.4)
%arrayidx.5 = getelementptr inbounds [6 x i32], ptr %num, i64 0, i64 5
%call.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx.5)
%call6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %num2)
%arrayidx5.1 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 1
%call6.1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.1)
%arrayidx5.2 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 2
%call6.2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.2)
%arrayidx5.3 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 3
%call6.3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.3)
%arrayidx5.4 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 4
%call6.4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.4)
%arrayidx5.5 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 5
%call6.5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx5.5)
%.pre = load i32, ptr %num, align 16, !tbaa !5
%0 = load i32, ptr %arrayidx.1, align 4
%1 = load i32, ptr %arrayidx.2, align 8
%2 = load i32, ptr %arrayidx.3, align 4
%3 = load i32, ptr %arrayidx.4, align 16
%4 = load i32, ptr %arrayidx.5, align 4
br label %for.cond13.preheader
for.cond10: ; preds = %for.cond13.preheader, %if.end, %if.end.1, %if.end.2, %if.end.3, %if.end.4
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 24
br i1 %exitcond.not, label %cleanup, label %for.cond13.preheader, !llvm.loop !9
for.cond13.preheader: ; preds = %entry, %for.cond10
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.cond10 ]
%arrayidx21 = getelementptr inbounds [24 x [6 x i32]], ptr @__const.main.dice, i64 0, i64 %indvars.iv, i64 0
%5 = load i32, ptr %arrayidx21, align 8, !tbaa !5
%sub = add nsw i32 %5, -1
%idxprom22 = sext i32 %sub to i64
%arrayidx23 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 %idxprom22
%6 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp24.not = icmp eq i32 %.pre, %6
br i1 %cmp24.not, label %if.end, label %for.cond10
if.end: ; preds = %for.cond13.preheader
%arrayidx21.1 = getelementptr inbounds [24 x [6 x i32]], ptr @__const.main.dice, i64 0, i64 %indvars.iv, i64 1
%7 = load i32, ptr %arrayidx21.1, align 4, !tbaa !5
%sub.1 = add nsw i32 %7, -1
%idxprom22.1 = sext i32 %sub.1 to i64
%arrayidx23.1 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 %idxprom22.1
%8 = load i32, ptr %arrayidx23.1, align 4, !tbaa !5
%cmp24.not.1 = icmp eq i32 %0, %8
br i1 %cmp24.not.1, label %if.end.1, label %for.cond10
if.end.1: ; preds = %if.end
%arrayidx21.2 = getelementptr inbounds [24 x [6 x i32]], ptr @__const.main.dice, i64 0, i64 %indvars.iv, i64 2
%9 = load i32, ptr %arrayidx21.2, align 8, !tbaa !5
%sub.2 = add nsw i32 %9, -1
%idxprom22.2 = sext i32 %sub.2 to i64
%arrayidx23.2 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 %idxprom22.2
%10 = load i32, ptr %arrayidx23.2, align 4, !tbaa !5
%cmp24.not.2 = icmp eq i32 %1, %10
br i1 %cmp24.not.2, label %if.end.2, label %for.cond10
if.end.2: ; preds = %if.end.1
%arrayidx21.3 = getelementptr inbounds [24 x [6 x i32]], ptr @__const.main.dice, i64 0, i64 %indvars.iv, i64 3
%11 = load i32, ptr %arrayidx21.3, align 4, !tbaa !5
%sub.3 = add nsw i32 %11, -1
%idxprom22.3 = sext i32 %sub.3 to i64
%arrayidx23.3 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 %idxprom22.3
%12 = load i32, ptr %arrayidx23.3, align 4, !tbaa !5
%cmp24.not.3 = icmp eq i32 %2, %12
br i1 %cmp24.not.3, label %if.end.3, label %for.cond10
if.end.3: ; preds = %if.end.2
%arrayidx21.4 = getelementptr inbounds [24 x [6 x i32]], ptr @__const.main.dice, i64 0, i64 %indvars.iv, i64 4
%13 = load i32, ptr %arrayidx21.4, align 8, !tbaa !5
%sub.4 = add nsw i32 %13, -1
%idxprom22.4 = sext i32 %sub.4 to i64
%arrayidx23.4 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 %idxprom22.4
%14 = load i32, ptr %arrayidx23.4, align 4, !tbaa !5
%cmp24.not.4 = icmp eq i32 %3, %14
br i1 %cmp24.not.4, label %if.end.4, label %for.cond10
if.end.4: ; preds = %if.end.3
%arrayidx21.5 = getelementptr inbounds [24 x [6 x i32]], ptr @__const.main.dice, i64 0, i64 %indvars.iv, i64 5
%15 = load i32, ptr %arrayidx21.5, align 4, !tbaa !5
%sub.5 = add nsw i32 %15, -1
%idxprom22.5 = sext i32 %sub.5 to i64
%arrayidx23.5 = getelementptr inbounds [6 x i32], ptr %num2, i64 0, i64 %idxprom22.5
%16 = load i32, ptr %arrayidx23.5, align 4, !tbaa !5
%cmp24.not.5 = icmp eq i32 %4, %16
br i1 %cmp24.not.5, label %cleanup, label %for.cond10
cleanup: ; preds = %for.cond10, %if.end.4
%str.sink = phi ptr [ @str.3, %if.end.4 ], [ @str, %for.cond10 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %num) #5
call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %num2) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 dice{
int a[6];
};
struct dice dice1;
struct dice dice2;
void tate(){
int cmp=dice2.a[0];
dice2.a[0]=dice2.a[4];
dice2.a[4]=dice2.a[5];
dice2.a[5]=dice2.a[1];
dice2.a[1]=cmp;
}
void yoko(){
int cmp=dice2.a[1];
dice2.a[1]=dice2.a[2];
dice2.a[2]=dice2.a[4];
dice2.a[4]=dice2.a[3];
dice2.a[3]=cmp;
}
int main(){
int i,j;
for(i=0;i<6;i++){
scanf("%d",&dice1.a[i]);
}
for(i=0;i<6;i++){
scanf("%d",&dice2.a[i]);
}
for(i=0;i<5;i++){
for(j=0;j<5;j++){
if(dice1.a[0]==dice2.a[0])break;
tate();
}
for(j=0;j<5;j++){
if(dice1.a[1]==dice2.a[1])break;
yoko();
}
}
if(dice1.a[0]==dice2.a[0]&&dice1.a[1]==dice2.a[1]&&dice1.a[2]==dice2.a[2])printf("Yes\n");
else printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117262/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117262/source.c"
target datalayout = "e-m:e-p270: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 { [6 x i32] }
@dice2 = dso_local global %struct.dice zeroinitializer, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@dice1 = dso_local global %struct.dice zeroinitializer, align 4
@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(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @tate() local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @dice2, align 4, !tbaa !5
%1 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %1, ptr @dice2, align 4, !tbaa !5
%2 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
%3 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %0, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), 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 @yoko() local_unnamed_addr #0 {
entry:
%0 = load <4 x i32>, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%1 = shufflevector <4 x i32> %0, <4 x i32> poison, <4 x i32> <i32 1, i32 3, i32 0, i32 2>
store <4 x i32> %1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @dice1)
%call.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 1))
%call.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 2))
%call.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 3))
%call.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 4))
%call.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 5))
%call6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @dice2)
%call6.1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1))
%call6.2 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2))
%call6.3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3))
%call6.4 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4))
%call6.5 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5))
%0 = load i32, ptr @dice1, align 4, !tbaa !5
%1 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 1), align 4, !tbaa !5
%dice2.promoted61 = load i32, ptr @dice2, align 4, !tbaa !5
%.promoted65 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
%.promoted = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
%.promoted74 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%.promoted80 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
%.promoted84 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp16 = icmp eq i32 %0, %dice2.promoted61
br i1 %cmp16, label %for.end19, label %if.end
if.end: ; preds = %entry
store i32 %.promoted65, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted74, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %dice2.promoted61, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.1 = icmp eq i32 %0, %.promoted65
br i1 %cmp16.1, label %for.end19, label %if.end.1
if.end.1: ; preds = %if.end
store i32 %.promoted, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted74, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %dice2.promoted61, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %.promoted65, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.2 = icmp eq i32 %0, %.promoted
br i1 %cmp16.2, label %for.end19, label %if.end.2
if.end.2: ; preds = %if.end.1
store i32 %.promoted74, ptr @dice2, align 4, !tbaa !5
store i32 %dice2.promoted61, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted65, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %.promoted, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.3 = icmp eq i32 %0, %.promoted74
br i1 %cmp16.3, label %for.end19, label %if.end.4
if.end.4: ; preds = %if.end.2
store i32 %.promoted65, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted74, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %dice2.promoted61, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
br label %for.end19
for.end19: ; preds = %if.end.4, %if.end.2, %if.end.1, %if.end, %entry
%.promoted5678 = phi i32 [ %.promoted74, %entry ], [ %dice2.promoted61, %if.end ], [ %.promoted65, %if.end.1 ], [ %.promoted, %if.end.2 ], [ %dice2.promoted61, %if.end.4 ]
%.promoted5371 = phi i32 [ %.promoted, %entry ], [ %.promoted74, %if.end ], [ %dice2.promoted61, %if.end.1 ], [ %.promoted65, %if.end.2 ], [ %.promoted74, %if.end.4 ]
%.promoted5869 = phi i32 [ %.promoted65, %entry ], [ %.promoted, %if.end ], [ %.promoted74, %if.end.1 ], [ %dice2.promoted61, %if.end.2 ], [ %.promoted, %if.end.4 ]
%dice2.promoted62 = phi i32 [ %0, %entry ], [ %0, %if.end ], [ %0, %if.end.1 ], [ %0, %if.end.2 ], [ %.promoted65, %if.end.4 ]
%cmp23 = icmp eq i32 %1, %.promoted5678
br i1 %cmp23, label %for.inc29, label %if.end25
if.end25: ; preds = %for.end19
store i32 %.promoted80, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5869, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted84, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5678, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.1 = icmp eq i32 %1, %.promoted80
br i1 %cmp23.1, label %for.inc29, label %if.end25.1
if.end25.1: ; preds = %if.end25
store i32 %.promoted5869, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted84, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5678, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted80, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.2 = icmp eq i32 %1, %.promoted5869
br i1 %cmp23.2, label %for.inc29, label %if.end25.2
if.end25.2: ; preds = %if.end25.1
store i32 %.promoted84, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5678, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted80, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5869, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.3 = icmp eq i32 %1, %.promoted84
br i1 %cmp23.3, label %for.inc29, label %if.end25.4
if.end25.4: ; preds = %if.end25.2
store i32 %.promoted80, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5869, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted84, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5678, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
br label %for.inc29
for.inc29: ; preds = %if.end25.4, %if.end25.2, %if.end25.1, %if.end25, %for.end19
%2 = phi i32 [ %.promoted5678, %for.end19 ], [ %1, %if.end25 ], [ %1, %if.end25.1 ], [ %1, %if.end25.2 ], [ %.promoted80, %if.end25.4 ]
%.promoted5985 = phi i32 [ %.promoted84, %for.end19 ], [ %.promoted5678, %if.end25 ], [ %.promoted80, %if.end25.1 ], [ %.promoted5869, %if.end25.2 ], [ %.promoted5678, %if.end25.4 ]
%.promoted5781 = phi i32 [ %.promoted80, %for.end19 ], [ %.promoted5869, %if.end25 ], [ %.promoted84, %if.end25.1 ], [ %.promoted5678, %if.end25.2 ], [ %.promoted5869, %if.end25.4 ]
%.promoted5676 = phi i32 [ %1, %for.end19 ], [ %1, %if.end25 ], [ %1, %if.end25.1 ], [ %1, %if.end25.2 ], [ %.promoted80, %if.end25.4 ]
%.promoted5867 = phi i32 [ %.promoted5869, %for.end19 ], [ %.promoted84, %if.end25 ], [ %.promoted5678, %if.end25.1 ], [ %.promoted80, %if.end25.2 ], [ %.promoted84, %if.end25.4 ]
%cmp16.197 = icmp eq i32 %0, %dice2.promoted62
br i1 %cmp16.197, label %for.end19.1, label %if.end.198
if.end.198: ; preds = %for.inc29
store i32 %.promoted5867, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5371, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5676, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %dice2.promoted62, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.1.1 = icmp eq i32 %0, %.promoted5867
br i1 %cmp16.1.1, label %for.end19.1, label %if.end.1.1
if.end.1.1: ; preds = %if.end.198
store i32 %.promoted5371, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5676, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %dice2.promoted62, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %.promoted5867, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.2.1 = icmp eq i32 %0, %.promoted5371
br i1 %cmp16.2.1, label %for.end19.1, label %if.end.2.1
if.end.2.1: ; preds = %if.end.1.1
store i32 %.promoted5676, ptr @dice2, align 4, !tbaa !5
store i32 %dice2.promoted62, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5867, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %.promoted5371, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.3.1 = icmp eq i32 %0, %.promoted5676
br i1 %cmp16.3.1, label %for.end19.1, label %if.end.4.1
if.end.4.1: ; preds = %if.end.2.1
store i32 %.promoted5867, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5371, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5676, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %dice2.promoted62, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
br label %for.end19.1
for.end19.1: ; preds = %if.end.4.1, %if.end.2.1, %if.end.1.1, %if.end.198, %for.inc29
%3 = phi i32 [ %2, %for.inc29 ], [ %dice2.promoted62, %if.end.198 ], [ %.promoted5867, %if.end.1.1 ], [ %.promoted5371, %if.end.2.1 ], [ %dice2.promoted62, %if.end.4.1 ]
%4 = phi i32 [ %dice2.promoted62, %for.inc29 ], [ %0, %if.end.198 ], [ %0, %if.end.1.1 ], [ %0, %if.end.2.1 ], [ %.promoted5867, %if.end.4.1 ]
%.promoted5678.1 = phi i32 [ %.promoted5676, %for.inc29 ], [ %dice2.promoted62, %if.end.198 ], [ %.promoted5867, %if.end.1.1 ], [ %.promoted5371, %if.end.2.1 ], [ %dice2.promoted62, %if.end.4.1 ]
%.promoted5371.1 = phi i32 [ %.promoted5371, %for.inc29 ], [ %.promoted5676, %if.end.198 ], [ %dice2.promoted62, %if.end.1.1 ], [ %.promoted5867, %if.end.2.1 ], [ %.promoted5676, %if.end.4.1 ]
%.promoted5869.1 = phi i32 [ %.promoted5867, %for.inc29 ], [ %.promoted5371, %if.end.198 ], [ %.promoted5676, %if.end.1.1 ], [ %dice2.promoted62, %if.end.2.1 ], [ %.promoted5371, %if.end.4.1 ]
%dice2.promoted62.1 = phi i32 [ %0, %for.inc29 ], [ %0, %if.end.198 ], [ %0, %if.end.1.1 ], [ %0, %if.end.2.1 ], [ %.promoted5867, %if.end.4.1 ]
%cmp23.199 = icmp eq i32 %1, %.promoted5678.1
br i1 %cmp23.199, label %for.inc29.1, label %if.end25.1100
if.end25.1100: ; preds = %for.end19.1
store i32 %.promoted5781, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5869.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5985, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5678.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.1.1 = icmp eq i32 %1, %.promoted5781
br i1 %cmp23.1.1, label %for.inc29.1, label %if.end25.1.1
if.end25.1.1: ; preds = %if.end25.1100
store i32 %.promoted5869.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5985, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5678.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5781, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.2.1 = icmp eq i32 %1, %.promoted5869.1
br i1 %cmp23.2.1, label %for.inc29.1, label %if.end25.2.1
if.end25.2.1: ; preds = %if.end25.1.1
store i32 %.promoted5985, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5678.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5781, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5869.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.3.1 = icmp eq i32 %1, %.promoted5985
br i1 %cmp23.3.1, label %for.inc29.1, label %if.end25.4.1
if.end25.4.1: ; preds = %if.end25.2.1
store i32 %.promoted5781, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5869.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5985, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5678.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
br label %for.inc29.1
for.inc29.1: ; preds = %if.end25.4.1, %if.end25.2.1, %if.end25.1.1, %if.end25.1100, %for.end19.1
%5 = phi i32 [ %3, %for.end19.1 ], [ %1, %if.end25.1100 ], [ %1, %if.end25.1.1 ], [ %1, %if.end25.2.1 ], [ %.promoted5781, %if.end25.4.1 ]
%.promoted5985.1 = phi i32 [ %.promoted5985, %for.end19.1 ], [ %.promoted5678.1, %if.end25.1100 ], [ %.promoted5781, %if.end25.1.1 ], [ %.promoted5869.1, %if.end25.2.1 ], [ %.promoted5678.1, %if.end25.4.1 ]
%.promoted5781.1 = phi i32 [ %.promoted5781, %for.end19.1 ], [ %.promoted5869.1, %if.end25.1100 ], [ %.promoted5985, %if.end25.1.1 ], [ %.promoted5678.1, %if.end25.2.1 ], [ %.promoted5869.1, %if.end25.4.1 ]
%.promoted5676.1 = phi i32 [ %1, %for.end19.1 ], [ %1, %if.end25.1100 ], [ %1, %if.end25.1.1 ], [ %1, %if.end25.2.1 ], [ %.promoted5781, %if.end25.4.1 ]
%.promoted5867.1 = phi i32 [ %.promoted5869.1, %for.end19.1 ], [ %.promoted5985, %if.end25.1100 ], [ %.promoted5678.1, %if.end25.1.1 ], [ %.promoted5781, %if.end25.2.1 ], [ %.promoted5985, %if.end25.4.1 ]
%cmp16.2101 = icmp eq i32 %0, %dice2.promoted62.1
br i1 %cmp16.2101, label %for.end19.2, label %if.end.2102
if.end.2102: ; preds = %for.inc29.1
store i32 %.promoted5867.1, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5371.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5676.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %dice2.promoted62.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.1.2 = icmp eq i32 %0, %.promoted5867.1
br i1 %cmp16.1.2, label %for.end19.2, label %if.end.1.2
if.end.1.2: ; preds = %if.end.2102
store i32 %.promoted5371.1, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5676.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %dice2.promoted62.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %.promoted5867.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.2.2 = icmp eq i32 %0, %.promoted5371.1
br i1 %cmp16.2.2, label %for.end19.2, label %if.end.2.2
if.end.2.2: ; preds = %if.end.1.2
store i32 %.promoted5676.1, ptr @dice2, align 4, !tbaa !5
store i32 %dice2.promoted62.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5867.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %.promoted5371.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.3.2 = icmp eq i32 %0, %.promoted5676.1
br i1 %cmp16.3.2, label %for.end19.2, label %if.end.4.2
if.end.4.2: ; preds = %if.end.2.2
store i32 %.promoted5867.1, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5371.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5676.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %dice2.promoted62.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
br label %for.end19.2
for.end19.2: ; preds = %if.end.4.2, %if.end.2.2, %if.end.1.2, %if.end.2102, %for.inc29.1
%6 = phi i32 [ %5, %for.inc29.1 ], [ %dice2.promoted62.1, %if.end.2102 ], [ %.promoted5867.1, %if.end.1.2 ], [ %.promoted5371.1, %if.end.2.2 ], [ %dice2.promoted62.1, %if.end.4.2 ]
%7 = phi i32 [ %4, %for.inc29.1 ], [ %0, %if.end.2102 ], [ %0, %if.end.1.2 ], [ %0, %if.end.2.2 ], [ %.promoted5867.1, %if.end.4.2 ]
%.promoted5678.2 = phi i32 [ %.promoted5676.1, %for.inc29.1 ], [ %dice2.promoted62.1, %if.end.2102 ], [ %.promoted5867.1, %if.end.1.2 ], [ %.promoted5371.1, %if.end.2.2 ], [ %dice2.promoted62.1, %if.end.4.2 ]
%.promoted5371.2 = phi i32 [ %.promoted5371.1, %for.inc29.1 ], [ %.promoted5676.1, %if.end.2102 ], [ %dice2.promoted62.1, %if.end.1.2 ], [ %.promoted5867.1, %if.end.2.2 ], [ %.promoted5676.1, %if.end.4.2 ]
%.promoted5869.2 = phi i32 [ %.promoted5867.1, %for.inc29.1 ], [ %.promoted5371.1, %if.end.2102 ], [ %.promoted5676.1, %if.end.1.2 ], [ %dice2.promoted62.1, %if.end.2.2 ], [ %.promoted5371.1, %if.end.4.2 ]
%dice2.promoted62.2 = phi i32 [ %0, %for.inc29.1 ], [ %0, %if.end.2102 ], [ %0, %if.end.1.2 ], [ %0, %if.end.2.2 ], [ %.promoted5867.1, %if.end.4.2 ]
%cmp23.2103 = icmp eq i32 %1, %.promoted5678.2
br i1 %cmp23.2103, label %for.inc29.2, label %if.end25.2104
if.end25.2104: ; preds = %for.end19.2
store i32 %.promoted5781.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5869.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5985.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5678.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.1.2 = icmp eq i32 %1, %.promoted5781.1
br i1 %cmp23.1.2, label %for.inc29.2, label %if.end25.1.2
if.end25.1.2: ; preds = %if.end25.2104
store i32 %.promoted5869.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5985.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5678.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5781.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.2.2 = icmp eq i32 %1, %.promoted5869.2
br i1 %cmp23.2.2, label %for.inc29.2, label %if.end25.2.2
if.end25.2.2: ; preds = %if.end25.1.2
store i32 %.promoted5985.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5678.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5781.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5869.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.3.2 = icmp eq i32 %1, %.promoted5985.1
br i1 %cmp23.3.2, label %for.inc29.2, label %if.end25.4.2
if.end25.4.2: ; preds = %if.end25.2.2
store i32 %.promoted5781.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5869.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5985.1, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5678.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
br label %for.inc29.2
for.inc29.2: ; preds = %if.end25.4.2, %if.end25.2.2, %if.end25.1.2, %if.end25.2104, %for.end19.2
%8 = phi i32 [ %6, %for.end19.2 ], [ %1, %if.end25.2104 ], [ %1, %if.end25.1.2 ], [ %1, %if.end25.2.2 ], [ %.promoted5781.1, %if.end25.4.2 ]
%.promoted5985.2 = phi i32 [ %.promoted5985.1, %for.end19.2 ], [ %.promoted5678.2, %if.end25.2104 ], [ %.promoted5781.1, %if.end25.1.2 ], [ %.promoted5869.2, %if.end25.2.2 ], [ %.promoted5678.2, %if.end25.4.2 ]
%.promoted5781.2 = phi i32 [ %.promoted5781.1, %for.end19.2 ], [ %.promoted5869.2, %if.end25.2104 ], [ %.promoted5985.1, %if.end25.1.2 ], [ %.promoted5678.2, %if.end25.2.2 ], [ %.promoted5869.2, %if.end25.4.2 ]
%.promoted5676.2 = phi i32 [ %1, %for.end19.2 ], [ %1, %if.end25.2104 ], [ %1, %if.end25.1.2 ], [ %1, %if.end25.2.2 ], [ %.promoted5781.1, %if.end25.4.2 ]
%.promoted5867.2 = phi i32 [ %.promoted5869.2, %for.end19.2 ], [ %.promoted5985.1, %if.end25.2104 ], [ %.promoted5678.2, %if.end25.1.2 ], [ %.promoted5781.1, %if.end25.2.2 ], [ %.promoted5985.1, %if.end25.4.2 ]
%cmp16.3105 = icmp eq i32 %0, %dice2.promoted62.2
br i1 %cmp16.3105, label %for.end19.3, label %if.end.3106
if.end.3106: ; preds = %for.inc29.2
store i32 %.promoted5867.2, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5371.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5676.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %dice2.promoted62.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.1.3 = icmp eq i32 %0, %.promoted5867.2
br i1 %cmp16.1.3, label %for.end19.3, label %if.end.1.3
if.end.1.3: ; preds = %if.end.3106
store i32 %.promoted5371.2, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5676.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %dice2.promoted62.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %.promoted5867.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.2.3 = icmp eq i32 %0, %.promoted5371.2
br i1 %cmp16.2.3, label %for.end19.3, label %if.end.2.3
if.end.2.3: ; preds = %if.end.1.3
store i32 %.promoted5676.2, ptr @dice2, align 4, !tbaa !5
store i32 %dice2.promoted62.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5867.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %.promoted5371.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.3.3 = icmp eq i32 %0, %.promoted5676.2
br i1 %cmp16.3.3, label %for.end19.3, label %if.end.4.3
if.end.4.3: ; preds = %if.end.2.3
store i32 %.promoted5867.2, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5371.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5676.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %dice2.promoted62.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
br label %for.end19.3
for.end19.3: ; preds = %if.end.4.3, %if.end.2.3, %if.end.1.3, %if.end.3106, %for.inc29.2
%9 = phi i32 [ %8, %for.inc29.2 ], [ %dice2.promoted62.2, %if.end.3106 ], [ %.promoted5867.2, %if.end.1.3 ], [ %.promoted5371.2, %if.end.2.3 ], [ %dice2.promoted62.2, %if.end.4.3 ]
%10 = phi i32 [ %7, %for.inc29.2 ], [ %0, %if.end.3106 ], [ %0, %if.end.1.3 ], [ %0, %if.end.2.3 ], [ %.promoted5867.2, %if.end.4.3 ]
%.promoted5678.3 = phi i32 [ %.promoted5676.2, %for.inc29.2 ], [ %dice2.promoted62.2, %if.end.3106 ], [ %.promoted5867.2, %if.end.1.3 ], [ %.promoted5371.2, %if.end.2.3 ], [ %dice2.promoted62.2, %if.end.4.3 ]
%.promoted5371.3 = phi i32 [ %.promoted5371.2, %for.inc29.2 ], [ %.promoted5676.2, %if.end.3106 ], [ %dice2.promoted62.2, %if.end.1.3 ], [ %.promoted5867.2, %if.end.2.3 ], [ %.promoted5676.2, %if.end.4.3 ]
%.promoted5869.3 = phi i32 [ %.promoted5867.2, %for.inc29.2 ], [ %.promoted5371.2, %if.end.3106 ], [ %.promoted5676.2, %if.end.1.3 ], [ %dice2.promoted62.2, %if.end.2.3 ], [ %.promoted5371.2, %if.end.4.3 ]
%dice2.promoted62.3 = phi i32 [ %0, %for.inc29.2 ], [ %0, %if.end.3106 ], [ %0, %if.end.1.3 ], [ %0, %if.end.2.3 ], [ %.promoted5867.2, %if.end.4.3 ]
%cmp23.3107 = icmp eq i32 %1, %.promoted5678.3
br i1 %cmp23.3107, label %for.inc29.3, label %if.end25.3108
if.end25.3108: ; preds = %for.end19.3
store i32 %.promoted5781.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5869.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5985.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5678.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.1.3 = icmp eq i32 %1, %.promoted5781.2
br i1 %cmp23.1.3, label %for.inc29.3, label %if.end25.1.3
if.end25.1.3: ; preds = %if.end25.3108
store i32 %.promoted5869.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5985.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5678.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5781.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.2.3 = icmp eq i32 %1, %.promoted5869.3
br i1 %cmp23.2.3, label %for.inc29.3, label %if.end25.2.3
if.end25.2.3: ; preds = %if.end25.1.3
store i32 %.promoted5985.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5678.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5781.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5869.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.3.3 = icmp eq i32 %1, %.promoted5985.2
br i1 %cmp23.3.3, label %for.inc29.3, label %if.end25.4.3
if.end25.4.3: ; preds = %if.end25.2.3
store i32 %.promoted5781.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5869.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5985.2, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5678.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
br label %for.inc29.3
for.inc29.3: ; preds = %if.end25.4.3, %if.end25.2.3, %if.end25.1.3, %if.end25.3108, %for.end19.3
%11 = phi i32 [ %9, %for.end19.3 ], [ %1, %if.end25.3108 ], [ %1, %if.end25.1.3 ], [ %1, %if.end25.2.3 ], [ %.promoted5781.2, %if.end25.4.3 ]
%.promoted5985.3 = phi i32 [ %.promoted5985.2, %for.end19.3 ], [ %.promoted5678.3, %if.end25.3108 ], [ %.promoted5781.2, %if.end25.1.3 ], [ %.promoted5869.3, %if.end25.2.3 ], [ %.promoted5678.3, %if.end25.4.3 ]
%.promoted5781.3 = phi i32 [ %.promoted5781.2, %for.end19.3 ], [ %.promoted5869.3, %if.end25.3108 ], [ %.promoted5985.2, %if.end25.1.3 ], [ %.promoted5678.3, %if.end25.2.3 ], [ %.promoted5869.3, %if.end25.4.3 ]
%.promoted5676.3 = phi i32 [ %1, %for.end19.3 ], [ %1, %if.end25.3108 ], [ %1, %if.end25.1.3 ], [ %1, %if.end25.2.3 ], [ %.promoted5781.2, %if.end25.4.3 ]
%.promoted5867.3 = phi i32 [ %.promoted5869.3, %for.end19.3 ], [ %.promoted5985.2, %if.end25.3108 ], [ %.promoted5678.3, %if.end25.1.3 ], [ %.promoted5781.2, %if.end25.2.3 ], [ %.promoted5985.2, %if.end25.4.3 ]
%cmp16.4 = icmp eq i32 %0, %dice2.promoted62.3
br i1 %cmp16.4, label %for.end19.4, label %if.end.4109
if.end.4109: ; preds = %for.inc29.3
store i32 %.promoted5867.3, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5371.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5676.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %dice2.promoted62.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.1.4 = icmp eq i32 %0, %.promoted5867.3
br i1 %cmp16.1.4, label %for.end19.4, label %if.end.1.4
if.end.1.4: ; preds = %if.end.4109
store i32 %.promoted5371.3, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5676.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %dice2.promoted62.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %.promoted5867.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.2.4 = icmp eq i32 %0, %.promoted5371.3
br i1 %cmp16.2.4, label %for.end19.4, label %if.end.2.4
if.end.2.4: ; preds = %if.end.1.4
store i32 %.promoted5676.3, ptr @dice2, align 4, !tbaa !5
store i32 %dice2.promoted62.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5867.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %.promoted5371.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
%cmp16.3.4 = icmp eq i32 %0, %.promoted5676.3
br i1 %cmp16.3.4, label %for.end19.4, label %if.end.4.4
if.end.4.4: ; preds = %if.end.2.4
store i32 %.promoted5867.3, ptr @dice2, align 4, !tbaa !5
store i32 %.promoted5371.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5676.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 5), align 4, !tbaa !5
store i32 %dice2.promoted62.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
br label %for.end19.4
for.end19.4: ; preds = %if.end.4.4, %if.end.2.4, %if.end.1.4, %if.end.4109, %for.inc29.3
%12 = phi i32 [ %11, %for.inc29.3 ], [ %dice2.promoted62.3, %if.end.4109 ], [ %.promoted5867.3, %if.end.1.4 ], [ %.promoted5371.3, %if.end.2.4 ], [ %dice2.promoted62.3, %if.end.4.4 ]
%13 = phi i32 [ %10, %for.inc29.3 ], [ %0, %if.end.4109 ], [ %0, %if.end.1.4 ], [ %0, %if.end.2.4 ], [ %.promoted5867.3, %if.end.4.4 ]
%.promoted5678.4 = phi i32 [ %.promoted5676.3, %for.inc29.3 ], [ %dice2.promoted62.3, %if.end.4109 ], [ %.promoted5867.3, %if.end.1.4 ], [ %.promoted5371.3, %if.end.2.4 ], [ %dice2.promoted62.3, %if.end.4.4 ]
%.promoted5869.4 = phi i32 [ %.promoted5867.3, %for.inc29.3 ], [ %.promoted5371.3, %if.end.4109 ], [ %.promoted5676.3, %if.end.1.4 ], [ %dice2.promoted62.3, %if.end.2.4 ], [ %.promoted5371.3, %if.end.4.4 ]
%cmp23.4110 = icmp eq i32 %1, %.promoted5678.4
br i1 %cmp23.4110, label %for.inc29.4, label %if.end25.4111
if.end25.4111: ; preds = %for.end19.4
store i32 %.promoted5781.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5869.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5985.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5678.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.1.4 = icmp eq i32 %1, %.promoted5781.3
br i1 %cmp23.1.4, label %for.inc29.4, label %if.end25.1.4
if.end25.1.4: ; preds = %if.end25.4111
store i32 %.promoted5869.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5985.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5678.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5781.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.2.4 = icmp eq i32 %1, %.promoted5869.4
br i1 %cmp23.2.4, label %for.inc29.4, label %if.end25.2.4
if.end25.2.4: ; preds = %if.end25.1.4
store i32 %.promoted5985.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5678.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5781.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5869.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
%cmp23.3.4 = icmp eq i32 %1, %.promoted5985.3
br i1 %cmp23.3.4, label %for.inc29.4, label %if.end25.4.4
if.end25.4.4: ; preds = %if.end25.2.4
store i32 %.promoted5781.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 1), align 4, !tbaa !5
store i32 %.promoted5869.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 2), align 4, !tbaa !5
store i32 %.promoted5985.3, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 4), align 4, !tbaa !5
store i32 %.promoted5678.4, ptr getelementptr inbounds (%struct.dice, ptr @dice2, i64 0, i32 0, i64 3), align 4, !tbaa !5
br label %for.inc29.4
for.inc29.4: ; preds = %if.end25.4.4, %if.end25.2.4, %if.end25.1.4, %if.end25.4111, %for.end19.4
%14 = phi i32 [ %.promoted5869.4, %if.end25.4.4 ], [ %.promoted5678.4, %if.end25.2.4 ], [ %.promoted5985.3, %if.end25.1.4 ], [ %.promoted5869.4, %if.end25.4111 ], [ %.promoted5781.3, %for.end19.4 ]
%15 = phi i32 [ %.promoted5781.3, %if.end25.4.4 ], [ %1, %if.end25.2.4 ], [ %1, %if.end25.1.4 ], [ %1, %if.end25.4111 ], [ %12, %for.end19.4 ]
%cmp32 = icmp eq i32 %0, %13
%cmp33 = icmp eq i32 %1, %15
%or.cond = select i1 %cmp32, i1 %cmp33, i1 false
%16 = load i32, ptr getelementptr inbounds (%struct.dice, ptr @dice1, i64 0, i32 0, i64 2), align 4
%cmp35 = icmp eq i32 %16, %14
%or.cond112 = select i1 %or.cond, i1 %cmp35, i1 false
%str.3.str = select i1 %or.cond112, ptr @str.3, ptr @str
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
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 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
#include<stdlib.h>
int main(){
int A,B,C,a,b,c;
int counter=0;
scanf("%d%d%d",&A,&B,&C);
if ( A==B && B==C )
{
(A%2 == 0) ? puts("-1"):puts("0");
exit(0);
}
while (A%2==0 && B%2==0 && C%2==0)
{
counter++;
a = B/2 + C/2;
b = A/2 + C/2;
c = A/2 + B/2;
A = a;
B = b;
C = c;
}
printf("%d",counter);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117305/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117305/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
@.str.2 = private unnamed_addr constant [2 x i8] c"0\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: 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 = icmp eq i32 %0, %1
%2 = load i32, ptr %C, align 4
%cmp1 = icmp eq i32 %1, %2
%or.cond = select i1 %cmp, i1 %cmp1, i1 false
%3 = and i32 %0, 1
%cmp2 = icmp eq i32 %3, 0
br i1 %or.cond, label %if.then, label %while.cond.preheader
while.cond.preheader: ; preds = %entry
br i1 %cmp2, label %land.lhs.true7, label %while.end
if.then: ; preds = %entry
%.str.1..str.2 = select i1 %cmp2, ptr @.str.1, ptr @.str.2
%call4 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @exit(i32 noundef 0) #5
unreachable
land.lhs.true7: ; preds = %while.cond.preheader, %while.body
%counter.029 = phi i32 [ %inc, %while.body ], [ 0, %while.cond.preheader ]
%add2228 = phi i32 [ %add, %while.body ], [ %0, %while.cond.preheader ]
%add152327 = phi i32 [ %add15, %while.body ], [ %1, %while.cond.preheader ]
%add182426 = phi i32 [ %add18, %while.body ], [ %2, %while.cond.preheader ]
%4 = and i32 %add152327, 1
%cmp9 = icmp eq i32 %4, 0
%5 = and i32 %add182426, 1
%cmp11 = icmp eq i32 %5, 0
%or.cond32 = select i1 %cmp9, i1 %cmp11, i1 false
br i1 %or.cond32, label %while.body, label %while.end
while.body: ; preds = %land.lhs.true7
%inc = add nuw nsw i32 %counter.029, 1
%div = sdiv i32 %add152327, 2
%div12 = sdiv i32 %add182426, 2
%add = add nsw i32 %div12, %div
%div13 = sdiv i32 %add2228, 2
%add15 = add nsw i32 %div12, %div13
%add18 = add nsw i32 %div, %div13
store i32 %add, ptr %A, align 4, !tbaa !5
store i32 %add15, ptr %B, align 4, !tbaa !5
store i32 %add18, ptr %C, align 4, !tbaa !5
%6 = and i32 %add, 1
%cmp6 = icmp eq i32 %6, 0
br i1 %cmp6, label %land.lhs.true7, label %while.end, !llvm.loop !9
while.end: ; preds = %while.body, %land.lhs.true7, %while.cond.preheader
%counter.0.lcssa = phi i32 [ 0, %while.cond.preheader ], [ %counter.029, %land.lhs.true7 ], [ %inc, %while.body ]
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %counter.0.lcssa)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %C) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %B) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(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
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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = { nounwind }
attributes #5 = { noreturn nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
int solve(int a, int b, int c) {
int ta, tb, tc;
int i = 0;
while(a % 2 == 0 && b % 2 == 0 && c % 2 == 0) {
if(i >= 1000000) return -1;
ta = a, tb = b, tc = c;
a = tb / 2 + tc / 2;
b = ta / 2 + tc / 2;
c = ta / 2 + tb / 2;
i++;
}
return i;
}
int main(void) {
int a, b, c;
scanf("%d%d%d", &a, &b, &c);
printf("%d\n", solve(a, b, c));
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117349/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117349/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [7 x i8] c"%d%d%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i32 @solve(i32 noundef %a, i32 noundef %b, i32 noundef %c) local_unnamed_addr #0 {
entry:
%0 = or i32 %a, %b
%1 = or i32 %0, %c
%2 = and i32 %1, 1
%or.cond2429 = icmp eq i32 %2, 0
br i1 %or.cond2429, label %while.body, label %cleanup
while.body: ; preds = %entry, %if.end
%i.033 = phi i32 [ %inc, %if.end ], [ 0, %entry ]
%a.addr.032 = phi i32 [ %add, %if.end ], [ %a, %entry ]
%b.addr.031 = phi i32 [ %add9, %if.end ], [ %b, %entry ]
%c.addr.030 = phi i32 [ %add12, %if.end ], [ %c, %entry ]
%exitcond = icmp eq i32 %i.033, 1000000
br i1 %exitcond, label %cleanup, label %if.end
if.end: ; preds = %while.body
%div = sdiv i32 %b.addr.031, 2
%div6 = sdiv i32 %c.addr.030, 2
%add = add nsw i32 %div, %div6
%div7 = sdiv i32 %a.addr.032, 2
%add9 = add nsw i32 %div7, %div6
%add12 = add nsw i32 %div7, %div
%inc = add nuw nsw i32 %i.033, 1
%3 = and i32 %add, 1
%cmp = icmp eq i32 %3, 0
%4 = and i32 %add9, 1
%cmp2 = icmp eq i32 %4, 0
%or.cond = select i1 %cmp, i1 %cmp2, i1 false
%5 = and i32 %add12, 1
%cmp4 = icmp eq i32 %5, 0
%or.cond24 = select i1 %or.cond, i1 %cmp4, i1 false
br i1 %or.cond24, label %while.body, label %cleanup, !llvm.loop !5
cleanup: ; preds = %while.body, %if.end, %entry
%retval.0 = phi i32 [ 0, %entry ], [ %inc, %if.end ], [ -1, %while.body ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
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 !7
%1 = load i32, ptr %b, align 4, !tbaa !7
%2 = load i32, ptr %c, align 4, !tbaa !7
%3 = or i32 %1, %0
%4 = or i32 %3, %2
%5 = and i32 %4, 1
%or.cond2429.i = icmp eq i32 %5, 0
br i1 %or.cond2429.i, label %while.body.i, label %solve.exit
while.body.i: ; preds = %entry, %if.end.i
%i.033.i = phi i32 [ %inc.i, %if.end.i ], [ 0, %entry ]
%a.addr.032.i = phi i32 [ %add.i, %if.end.i ], [ %0, %entry ]
%b.addr.031.i = phi i32 [ %add9.i, %if.end.i ], [ %1, %entry ]
%c.addr.030.i = phi i32 [ %add12.i, %if.end.i ], [ %2, %entry ]
%exitcond.i = icmp eq i32 %i.033.i, 1000000
br i1 %exitcond.i, label %solve.exit, label %if.end.i
if.end.i: ; preds = %while.body.i
%div.i = sdiv i32 %b.addr.031.i, 2
%div6.i = sdiv i32 %c.addr.030.i, 2
%add.i = add nsw i32 %div6.i, %div.i
%div7.i = sdiv i32 %a.addr.032.i, 2
%add9.i = add nsw i32 %div6.i, %div7.i
%add12.i = add nsw i32 %div.i, %div7.i
%inc.i = add nuw nsw i32 %i.033.i, 1
%6 = and i32 %add.i, 1
%cmp.i = icmp eq i32 %6, 0
%7 = and i32 %add9.i, 1
%cmp2.i = icmp eq i32 %7, 0
%or.cond.i = select i1 %cmp.i, i1 %cmp2.i, i1 false
%8 = and i32 %add12.i, 1
%cmp4.i = icmp eq i32 %8, 0
%or.cond24.i = select i1 %or.cond.i, i1 %cmp4.i, i1 false
br i1 %or.cond24.i, label %while.body.i, label %solve.exit, !llvm.loop !5
solve.exit: ; preds = %while.body.i, %if.end.i, %entry
%retval.0.i = phi i32 [ 0, %entry ], [ -1, %while.body.i ], [ %inc.i, %if.end.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %retval.0.i)
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: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main(){
int n,m,i,j,k,l;
scanf("%d%d",&n,&m);
char a[n+1][n+1],b[m+1][m+1];
for(i=0;i<n;i++)
scanf("%*c%s",a[i]);
for(i=0;i<m;i++)
scanf("%*c%s",b[i]);
for(i=0;i<=n-m;i++){
for(j=0;j<=n-m;j++){
int check=0;
for(k=0;k<m;k++){
for(l=0;l<m;l++){
if(a[i+k][j+l]!=b[k][l])
check=1;
}
}
if(check==0){
puts("Yes");
return 0;
}
}
}
puts("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117392/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117392/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [6 x i8] c"%*c%s\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
@.str.3 = private unnamed_addr constant [3 x i8] c"No\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%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
%add = add nsw i32 %0, 1
%1 = zext i32 %add to i64
%2 = call ptr @llvm.stacksave.p0()
%3 = mul nuw i64 %1, %1
%vla = alloca i8, i64 %3, align 16
%4 = load i32, ptr %m, align 4, !tbaa !5
%add2 = add nsw i32 %4, 1
%5 = zext i32 %add2 to i64
%6 = mul nuw i64 %5, %5
%vla4 = alloca i8, i64 %6, align 16
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp82 = icmp sgt i32 %7, 0
br i1 %cmp82, label %for.body, label %for.cond6.preheader
for.cond6.preheader.loopexit: ; preds = %for.body
%.pre = load i32, ptr %m, align 4, !tbaa !5
br label %for.cond6.preheader
for.cond6.preheader: ; preds = %for.cond6.preheader.loopexit, %entry
%8 = phi i32 [ %11, %for.cond6.preheader.loopexit ], [ %7, %entry ]
%9 = phi i32 [ %.pre, %for.cond6.preheader.loopexit ], [ %4, %entry ]
%cmp784 = icmp sgt i32 %9, 0
br i1 %cmp784, label %for.body8, label %for.cond15.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%10 = mul nuw nsw i64 %indvars.iv, %1
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %10
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%11 = load i32, ptr %n, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp = icmp slt i64 %indvars.iv.next, %12
br i1 %cmp, label %for.body, label %for.cond6.preheader.loopexit, !llvm.loop !9
for.cond15.preheader.loopexit: ; preds = %for.body8
%.pre128 = load i32, ptr %n, align 4, !tbaa !5
br label %for.cond15.preheader
for.cond15.preheader: ; preds = %for.cond15.preheader.loopexit, %for.cond6.preheader
%13 = phi i32 [ %8, %for.cond6.preheader ], [ %.pre128, %for.cond15.preheader.loopexit ]
%.lcssa = phi i32 [ %9, %for.cond6.preheader ], [ %32, %for.cond15.preheader.loopexit ]
%cmp16.not96 = icmp slt i32 %13, %.lcssa
br i1 %cmp16.not96, label %cleanup59, label %for.cond18.preheader.lr.ph
for.cond18.preheader.lr.ph: ; preds = %for.cond15.preheader
%cmp2390 = icmp sgt i32 %.lcssa, 0
br i1 %cmp2390, label %for.cond18.preheader.us99.preheader, label %cleanup59
for.cond18.preheader.us99.preheader: ; preds = %for.cond18.preheader.lr.ph
%14 = add i32 %13, 1
%15 = sub i32 %14, %.lcssa
%wide.trip.count126 = zext i32 %15 to i64
%wide.trip.count116 = zext i32 %.lcssa to i64
%min.iters.check = icmp ult i32 %.lcssa, 8
%n.vec = and i64 %wide.trip.count116, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count116
br label %for.cond18.preheader.us99
for.cond18.preheader.us99: ; preds = %for.cond18.preheader.us99.preheader, %for.cond18.for.inc55_crit_edge.split.us.us
%indvars.iv123 = phi i64 [ 0, %for.cond18.preheader.us99.preheader ], [ %indvars.iv.next124, %for.cond18.for.inc55_crit_edge.split.us.us ]
br label %for.cond22.preheader.us.us
for.cond22.preheader.us.us: ; preds = %for.cond18.us.us, %for.cond18.preheader.us99
%indvars.iv118 = phi i64 [ %indvars.iv.next119, %for.cond18.us.us ], [ 0, %for.cond18.preheader.us99 ]
%invariant.gep131 = getelementptr i8, ptr %vla, i64 %indvars.iv118
br label %for.cond25.preheader.us.us.us
for.cond18.us.us: ; preds = %for.cond22.for.end46_crit_edge.split.us.us.us
%indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
%exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count126
br i1 %exitcond122.not, label %for.cond18.for.inc55_crit_edge.split.us.us, label %for.cond22.preheader.us.us, !llvm.loop !11
for.cond25.preheader.us.us.us: ; preds = %for.cond25.for.inc44_crit_edge.us.us.us, %for.cond22.preheader.us.us
%indvars.iv112 = phi i64 [ %indvars.iv.next113, %for.cond25.for.inc44_crit_edge.us.us.us ], [ 0, %for.cond22.preheader.us.us ]
%check.092.us.us.us = phi i32 [ %spec.select.us.us.us.lcssa, %for.cond25.for.inc44_crit_edge.us.us.us ], [ 0, %for.cond22.preheader.us.us ]
%16 = add nuw nsw i64 %indvars.iv112, %indvars.iv123
%17 = mul nuw nsw i64 %16, %1
%18 = mul nuw nsw i64 %indvars.iv112, %5
%arrayidx35.us.us.us = getelementptr inbounds i8, ptr %vla4, i64 %18
%gep132 = getelementptr i8, ptr %invariant.gep131, i64 %17
br i1 %min.iters.check, label %for.body27.us.us.us.preheader, label %vector.ph
vector.ph: ; preds = %for.cond25.preheader.us.us.us
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %check.092.us.us.us, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %25, %vector.body ]
%vec.phi136 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %26, %vector.body ]
%19 = getelementptr i8, ptr %gep132, i64 %index
%wide.load = load <4 x i8>, ptr %19, align 1, !tbaa !12
%20 = getelementptr i8, ptr %19, i64 4
%wide.load137 = load <4 x i8>, ptr %20, align 1, !tbaa !12
%21 = getelementptr inbounds i8, ptr %arrayidx35.us.us.us, i64 %index
%wide.load138 = load <4 x i8>, ptr %21, align 1, !tbaa !12
%22 = getelementptr inbounds i8, ptr %21, i64 4
%wide.load139 = load <4 x i8>, ptr %22, align 1, !tbaa !12
%23 = icmp eq <4 x i8> %wide.load, %wide.load138
%24 = icmp eq <4 x i8> %wide.load137, %wide.load139
%25 = select <4 x i1> %23, <4 x i32> %vec.phi, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%26 = select <4 x i1> %24, <4 x i32> %vec.phi136, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
%index.next = add nuw i64 %index, 8
%27 = icmp eq i64 %index.next, %n.vec
br i1 %27, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%.splatinsert = insertelement <4 x i32> poison, i32 %check.092.us.us.us, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%rdx.select.cmp.not = icmp eq <4 x i32> %25, %.splat
%rdx.select = select <4 x i1> %rdx.select.cmp.not, <4 x i32> %26, <4 x i32> %25
%.splatinsert140 = insertelement <4 x i32> poison, i32 %check.092.us.us.us, i64 0
%.splat141 = shufflevector <4 x i32> %.splatinsert140, <4 x i32> poison, <4 x i32> zeroinitializer
%rdx.select.cmp142 = icmp ne <4 x i32> %rdx.select, %.splat141
%28 = bitcast <4 x i1> %rdx.select.cmp142 to i4
%.not = icmp eq i4 %28, 0
%rdx.select143 = select i1 %.not, i32 %check.092.us.us.us, i32 1
br i1 %cmp.n, label %for.cond25.for.inc44_crit_edge.us.us.us, label %for.body27.us.us.us.preheader
for.body27.us.us.us.preheader: ; preds = %for.cond25.preheader.us.us.us, %middle.block
%indvars.iv108.ph = phi i64 [ 0, %for.cond25.preheader.us.us.us ], [ %n.vec, %middle.block ]
%check.188.us.us.us.ph = phi i32 [ %check.092.us.us.us, %for.cond25.preheader.us.us.us ], [ %rdx.select143, %middle.block ]
br label %for.body27.us.us.us
for.body27.us.us.us: ; preds = %for.body27.us.us.us.preheader, %for.body27.us.us.us
%indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.body27.us.us.us ], [ %indvars.iv108.ph, %for.body27.us.us.us.preheader ]
%check.188.us.us.us = phi i32 [ %spec.select.us.us.us, %for.body27.us.us.us ], [ %check.188.us.us.us.ph, %for.body27.us.us.us.preheader ]
%gep = getelementptr i8, ptr %gep132, i64 %indvars.iv108
%29 = load i8, ptr %gep, align 1, !tbaa !12
%arrayidx37.us.us.us = getelementptr inbounds i8, ptr %arrayidx35.us.us.us, i64 %indvars.iv108
%30 = load i8, ptr %arrayidx37.us.us.us, align 1, !tbaa !12
%cmp39.not.us.us.us = icmp eq i8 %29, %30
%spec.select.us.us.us = select i1 %cmp39.not.us.us.us, i32 %check.188.us.us.us, i32 1
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%exitcond.not = icmp eq i64 %indvars.iv.next109, %wide.trip.count116
br i1 %exitcond.not, label %for.cond25.for.inc44_crit_edge.us.us.us, label %for.body27.us.us.us, !llvm.loop !16
for.cond25.for.inc44_crit_edge.us.us.us: ; preds = %for.body27.us.us.us, %middle.block
%spec.select.us.us.us.lcssa = phi i32 [ %rdx.select143, %middle.block ], [ %spec.select.us.us.us, %for.body27.us.us.us ]
%indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
%exitcond117.not = icmp eq i64 %indvars.iv.next113, %wide.trip.count116
br i1 %exitcond117.not, label %for.cond22.for.end46_crit_edge.split.us.us.us, label %for.cond25.preheader.us.us.us, !llvm.loop !17
for.cond22.for.end46_crit_edge.split.us.us.us: ; preds = %for.cond25.for.inc44_crit_edge.us.us.us
%cmp47.not.us.us = icmp eq i32 %spec.select.us.us.us.lcssa, 0
br i1 %cmp47.not.us.us, label %cleanup59, label %for.cond18.us.us
for.cond18.for.inc55_crit_edge.split.us.us: ; preds = %for.cond18.us.us
%indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
%exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126
br i1 %exitcond127.not, label %cleanup59, label %for.cond18.preheader.us99, !llvm.loop !18
for.body8: ; preds = %for.cond6.preheader, %for.body8
%indvars.iv105 = phi i64 [ %indvars.iv.next106, %for.body8 ], [ 0, %for.cond6.preheader ]
%31 = mul nuw nsw i64 %indvars.iv105, %5
%arrayidx10 = getelementptr inbounds i8, ptr %vla4, i64 %31
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx10)
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%32 = load i32, ptr %m, align 4, !tbaa !5
%33 = sext i32 %32 to i64
%cmp7 = icmp slt i64 %indvars.iv.next106, %33
br i1 %cmp7, label %for.body8, label %for.cond15.preheader.loopexit, !llvm.loop !19
cleanup59: ; preds = %for.cond18.for.inc55_crit_edge.split.us.us, %for.cond22.for.end46_crit_edge.split.us.us.us, %for.cond15.preheader, %for.cond18.preheader.lr.ph
%.str.2.sink = phi ptr [ @.str.2, %for.cond18.preheader.lr.ph ], [ @.str.3, %for.cond15.preheader ], [ @.str.2, %for.cond22.for.end46_crit_edge.split.us.us.us ], [ @.str.3, %for.cond18.for.inc55_crit_edge.split.us.us ]
%call50 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10, !15, !14}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
|
#include <stdio.h>
int main(void){
int N,M;
scanf("%d %d",&N,&M);
int f;
char A[N][N+1];
char B[M][M+1];
for(int i=0; i<N; i++){
scanf("%s",A[i]);
}
for(int i=0; i<M; i++){
scanf("%s",B[i]);
}
for(int i=0; i<=N-M; i++){
for(int l=0; l<=N-M; l++){
f=0;
for(int j=0; j<M; j++){
for(int k=0; k<M; k++){
if(A[j+i][k+l]!=B[j][k]){ f=1; break; }
}
}
if(f==0){ printf("Yes\n");return 0; }
}
}
printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117435/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117435/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%N = alloca i32, align 4
%M = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %M) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %M)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%add = add nsw i32 %0, 1
%2 = zext i32 %add to i64
%3 = call ptr @llvm.stacksave.p0()
%4 = mul nuw i64 %2, %1
%vla = alloca i8, i64 %4, align 16
%5 = load i32, ptr %M, align 4, !tbaa !5
%6 = zext i32 %5 to i64
%add1 = add nsw i32 %5, 1
%7 = zext i32 %add1 to i64
%8 = mul nuw i64 %7, %6
%vla2 = alloca i8, i64 %8, align 16
%9 = load i32, ptr %N, align 4, !tbaa !5
%cmp89 = icmp sgt i32 %9, 0
br i1 %cmp89, label %for.body, label %for.cond5.preheader
for.cond5.preheader.loopexit: ; preds = %for.body
%.pre = load i32, ptr %M, align 4, !tbaa !5
br label %for.cond5.preheader
for.cond5.preheader: ; preds = %for.cond5.preheader.loopexit, %entry
%10 = phi i32 [ %13, %for.cond5.preheader.loopexit ], [ %9, %entry ]
%11 = phi i32 [ %.pre, %for.cond5.preheader.loopexit ], [ %5, %entry ]
%cmp691 = icmp sgt i32 %11, 0
br i1 %cmp691, label %for.body8, label %for.cond16.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%12 = mul nuw nsw i64 %indvars.iv, %2
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %12
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%13 = load i32, ptr %N, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp = icmp slt i64 %indvars.iv.next, %14
br i1 %cmp, label %for.body, label %for.cond5.preheader.loopexit, !llvm.loop !9
for.cond16.preheader.loopexit: ; preds = %for.body8
%.pre129 = load i32, ptr %N, align 4, !tbaa !5
br label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.cond16.preheader.loopexit, %for.cond5.preheader
%15 = phi i32 [ %20, %for.cond16.preheader.loopexit ], [ %11, %for.cond5.preheader ]
%16 = phi i32 [ %.pre129, %for.cond16.preheader.loopexit ], [ %10, %for.cond5.preheader ]
%sub101 = sub nsw i32 %16, %15
%cmp17.not102 = icmp slt i32 %sub101, 0
br i1 %cmp17.not102, label %cleanup68, label %for.cond20.preheader.preheader
for.cond20.preheader.preheader: ; preds = %for.cond16.preheader
%cmp2696 = icmp sgt i32 %15, 0
%17 = add nuw i32 %sub101, 1
%wide.trip.count124 = zext i32 %17 to i64
%wide.trip.count119 = zext i32 %15 to i64
%18 = sext i32 %sub101 to i64
br label %for.cond25.preheader.lr.ph
for.body8: ; preds = %for.cond5.preheader, %for.body8
%indvars.iv108 = phi i64 [ %indvars.iv.next109, %for.body8 ], [ 0, %for.cond5.preheader ]
%19 = mul nuw nsw i64 %indvars.iv108, %7
%arrayidx10 = getelementptr inbounds i8, ptr %vla2, i64 %19
%call11 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx10)
%indvars.iv.next109 = add nuw nsw i64 %indvars.iv108, 1
%20 = load i32, ptr %M, align 4, !tbaa !5
%21 = sext i32 %20 to i64
%cmp6 = icmp slt i64 %indvars.iv.next109, %21
br i1 %cmp6, label %for.body8, label %for.cond16.preheader.loopexit, !llvm.loop !11
for.cond25.preheader.lr.ph: ; preds = %for.inc62, %for.cond20.preheader.preheader
%indvars.iv126 = phi i64 [ 0, %for.cond20.preheader.preheader ], [ %indvars.iv.next127, %for.inc62 ]
br i1 %cmp2696, label %for.cond25.preheader.us, label %cleanup68
for.cond25.preheader.us: ; preds = %for.cond25.preheader.lr.ph, %for.cond20.us
%indvars.iv121 = phi i64 [ %indvars.iv.next122, %for.cond20.us ], [ 0, %for.cond25.preheader.lr.ph ]
%invariant.gep140 = getelementptr i8, ptr %vla, i64 %indvars.iv121
br label %for.cond29.preheader.us.us.outer
for.cond29.preheader.us.us.outer: ; preds = %cleanup.us.us.thread, %for.cond25.preheader.us
%indvars.iv115.ph = phi i64 [ %indvars.iv.next116131, %cleanup.us.us.thread ], [ 0, %for.cond25.preheader.us ]
%cmp53.us = phi i1 [ false, %cleanup.us.us.thread ], [ true, %for.cond25.preheader.us ]
br label %for.cond29.preheader.us.us
for.cond20.us: ; preds = %cleanup.us.us.thread, %for.cond25.for.cond.cleanup27_crit_edge.split.us.us
%indvars.iv.next122 = add nuw nsw i64 %indvars.iv121, 1
%exitcond125.not = icmp eq i64 %indvars.iv.next122, %wide.trip.count124
br i1 %exitcond125.not, label %for.inc62, label %for.cond25.preheader.us, !llvm.loop !12
for.cond29.preheader.us.us: ; preds = %for.cond29.preheader.us.us.outer, %cleanup.us.us
%indvars.iv115 = phi i64 [ %indvars.iv.next116, %cleanup.us.us ], [ %indvars.iv115.ph, %for.cond29.preheader.us.us.outer ]
%22 = add nuw nsw i64 %indvars.iv115, %indvars.iv126
%23 = mul nuw nsw i64 %22, %2
%24 = mul nuw nsw i64 %indvars.iv115, %7
%arrayidx40.us.us = getelementptr inbounds i8, ptr %vla2, i64 %24
%gep141 = getelementptr i8, ptr %invariant.gep140, i64 %23
br label %for.body32.us.us
for.cond29.us.us: ; preds = %for.body32.us.us
%indvars.iv.next112 = add nuw nsw i64 %indvars.iv111, 1
%exitcond.not = icmp eq i64 %indvars.iv.next112, %wide.trip.count119
br i1 %exitcond.not, label %cleanup.us.us, label %for.body32.us.us, !llvm.loop !13
for.body32.us.us: ; preds = %for.cond29.us.us, %for.cond29.preheader.us.us
%indvars.iv111 = phi i64 [ %indvars.iv.next112, %for.cond29.us.us ], [ 0, %for.cond29.preheader.us.us ]
%gep = getelementptr i8, ptr %gep141, i64 %indvars.iv111
%25 = load i8, ptr %gep, align 1, !tbaa !14
%arrayidx42.us.us = getelementptr inbounds i8, ptr %arrayidx40.us.us, i64 %indvars.iv111
%26 = load i8, ptr %arrayidx42.us.us, align 1, !tbaa !14
%cmp44.not.us.us = icmp eq i8 %25, %26
br i1 %cmp44.not.us.us, label %for.cond29.us.us, label %cleanup.us.us.thread
cleanup.us.us: ; preds = %for.cond29.us.us
%indvars.iv.next116 = add nuw nsw i64 %indvars.iv115, 1
%exitcond120.not = icmp eq i64 %indvars.iv.next116, %wide.trip.count119
br i1 %exitcond120.not, label %for.cond25.for.cond.cleanup27_crit_edge.split.us.us, label %for.cond29.preheader.us.us, !llvm.loop !15
cleanup.us.us.thread: ; preds = %for.body32.us.us
%indvars.iv.next116131 = add nuw nsw i64 %indvars.iv115, 1
%exitcond120.not132 = icmp eq i64 %indvars.iv.next116131, %wide.trip.count119
br i1 %exitcond120.not132, label %for.cond20.us, label %for.cond29.preheader.us.us.outer, !llvm.loop !15
for.cond25.for.cond.cleanup27_crit_edge.split.us.us: ; preds = %cleanup.us.us
br i1 %cmp53.us, label %cleanup68, label %for.cond20.us
for.inc62: ; preds = %for.cond20.us
%indvars.iv.next127 = add nuw nsw i64 %indvars.iv126, 1
%cmp17.not.not = icmp slt i64 %indvars.iv126, %18
br i1 %cmp17.not.not, label %for.cond25.preheader.lr.ph, label %cleanup68, !llvm.loop !16
cleanup68: ; preds = %for.inc62, %for.cond25.preheader.lr.ph, %for.cond25.for.cond.cleanup27_crit_edge.split.us.us, %for.cond16.preheader
%str.sink = phi ptr [ @str.4, %for.cond16.preheader ], [ @str, %for.cond25.for.cond.cleanup27_crit_edge.split.us.us ], [ @str, %for.cond25.preheader.lr.ph ], [ @str.4, %for.inc62 ]
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
call void @llvm.stackrestore.p0(ptr %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!7, !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int descending_compare(const void *a, const void *b){
if (*(int*)a > *(int*)b){
return -1;
}else if (*(int*)a == *(int*)b){
return 0;
}else{
return 1;
}
}
int ascending_compare(const void *a, const void *b){
if (*(int*)a < *(int*)b){
return -1;
}else if (*(int*)a == *(int*)b){
return 0;
}else{
return 1;
}
}
int lower_bound(int *a, int n, int key){
int left, mid, right;
left = 0, right = n;
mid = (left + right)/2;
while ((left+1 != mid || mid+1 != right) && mid != left){
if (key > a[mid]){
left = mid;
}else{
right = mid+1;
}
mid = (left + right)/2;
}
if (a[left] >= key)return left;
if (a[mid] >= key)return mid;
if (a[right] >= key)return right;
return n;
}
//greatest common divisor
unsigned long gcd(unsigned long x, unsigned long y){
if (y == 0){
return x;
}else if (x > y){
return gcd(y, x % y);
}else{
return gcd(x, y % x);
}
}
long long factorial(int x){
long long rtn = 1;
int i;
for (i = x; i > 1; i--){
rtn = (rtn*i);
}
return rtn;
}
char pic[55][55];
char temp[55][55];
int n, m;
int find_pic(int x, int y){
int flag = 1;
for (int i = 0; i < m; i++){
for (int j = 0; j < m; j++){
if ((x+i > n && y+j > n) || (pic[x+i][y+j] != temp[i][j])) flag = 0;
}
}
return flag;
}
int main(void){
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
scanf(" %c", &pic[i][j]);
}
}
for (int i = 0; i < m; i++){
for (int j = 0; j < m; j++){
scanf(" %c", &temp[i][j]);
}
}
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++){
if (find_pic(i, j)){
printf("Yes\n");
return 0;
}
}
}
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117479/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117479/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@m = dso_local global i32 0, align 4
@n = dso_local global i32 0, align 4
@pic = dso_local global [55 x [55 x i8]] zeroinitializer, align 16
@temp = dso_local global [55 x [55 x i8]] zeroinitializer, align 16
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c" %c\00", align 1
@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 @descending_compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ascending_compare(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%cmp = icmp slt i32 %0, %1
%cmp1 = icmp ne i32 %0, %1
%. = zext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 -1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @lower_bound(ptr nocapture noundef readonly %a, i32 noundef %n, i32 noundef %key) local_unnamed_addr #1 {
entry:
%mid.050 = sdiv i32 %n, 2
%0 = and i32 %n, -2
%cmp.not51 = icmp eq i32 %0, 2
%add252 = add nsw i32 %mid.050, 1
%cmp3.not53 = icmp eq i32 %add252, %n
%or.cond54 = select i1 %cmp.not51, i1 %cmp3.not53, i1 false
%n.off = add i32 %n, 1
%cmp4.not55 = icmp ult i32 %n.off, 3
%or.cond4956 = or i1 %cmp4.not55, %or.cond54
br i1 %or.cond4956, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%add260 = phi i32 [ %add2, %while.body ], [ %add252, %entry ]
%mid.059 = phi i32 [ %mid.0, %while.body ], [ %mid.050, %entry ]
%right.058 = phi i32 [ %right.1, %while.body ], [ %n, %entry ]
%left.057 = phi i32 [ %left.1, %while.body ], [ 0, %entry ]
%idxprom = sext i32 %mid.059 to i64
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %idxprom
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp5 = icmp slt i32 %1, %key
%left.1 = select i1 %cmp5, i32 %mid.059, i32 %left.057
%right.1 = select i1 %cmp5, i32 %right.058, i32 %add260
%add7 = add nsw i32 %left.1, %right.1
%mid.0 = sdiv i32 %add7, 2
%add1 = add nsw i32 %left.1, 1
%cmp.not = icmp eq i32 %add1, %mid.0
%add2 = add nsw i32 %mid.0, 1
%cmp3.not = icmp eq i32 %add2, %right.1
%or.cond = select i1 %cmp.not, i1 %cmp3.not, i1 false
%cmp4.not = icmp eq i32 %mid.0, %left.1
%or.cond49 = or i1 %cmp4.not, %or.cond
br i1 %or.cond49, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
%left.0.lcssa = phi i32 [ 0, %entry ], [ %left.1, %while.body ]
%right.0.lcssa = phi i32 [ %n, %entry ], [ %right.1, %while.body ]
%mid.0.lcssa = phi i32 [ %mid.050, %entry ], [ %mid.0, %while.body ]
%idxprom9 = sext i32 %left.0.lcssa to i64
%arrayidx10 = getelementptr inbounds i32, ptr %a, i64 %idxprom9
%2 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%cmp11.not = icmp slt i32 %2, %key
br i1 %cmp11.not, label %if.end13, label %cleanup
if.end13: ; preds = %while.end
%idxprom14 = sext i32 %mid.0.lcssa to i64
%arrayidx15 = getelementptr inbounds i32, ptr %a, i64 %idxprom14
%3 = load i32, ptr %arrayidx15, align 4, !tbaa !5
%cmp16.not = icmp slt i32 %3, %key
br i1 %cmp16.not, label %if.end18, label %cleanup
if.end18: ; preds = %if.end13
%idxprom19 = sext i32 %right.0.lcssa to i64
%arrayidx20 = getelementptr inbounds i32, ptr %a, i64 %idxprom19
%4 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%cmp21.not = icmp slt i32 %4, %key
%n.right.0 = select i1 %cmp21.not, i32 %n, i32 %right.0.lcssa
br label %cleanup
cleanup: ; preds = %if.end18, %if.end13, %while.end
%retval.0 = phi i32 [ %left.0.lcssa, %while.end ], [ %mid.0.lcssa, %if.end13 ], [ %n.right.0, %if.end18 ]
ret i32 %retval.0
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @gcd(i64 noundef %x, i64 noundef %y) local_unnamed_addr #2 {
entry:
%cmp1518 = icmp eq i64 %y, 0
br i1 %cmp1518, label %return, label %if.else.lr.ph
if.else.lr.ph: ; preds = %entry, %if.then2
%y.tr.ph20 = phi i64 [ %rem, %if.then2 ], [ %y, %entry ]
%x.tr.ph19 = phi i64 [ %y.tr16, %if.then2 ], [ %x, %entry ]
br label %if.else
if.else: ; preds = %if.else.lr.ph, %if.else3
%y.tr16 = phi i64 [ %y.tr.ph20, %if.else.lr.ph ], [ %rem4, %if.else3 ]
%cmp1 = icmp ugt i64 %x.tr.ph19, %y.tr16
br i1 %cmp1, label %if.then2, label %if.else3
if.then2: ; preds = %if.else
%rem = urem i64 %x.tr.ph19, %y.tr16
%cmp15 = icmp eq i64 %rem, 0
br i1 %cmp15, label %return, label %if.else.lr.ph
if.else3: ; preds = %if.else
%rem4 = urem i64 %y.tr16, %x.tr.ph19
%cmp = icmp eq i64 %rem4, 0
br i1 %cmp, label %return, label %if.else
return: ; preds = %if.then2, %if.else3, %entry
%x.tr.ph.lcssa = phi i64 [ %x, %entry ], [ %x.tr.ph19, %if.else3 ], [ %y.tr16, %if.then2 ]
ret i64 %x.tr.ph.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(none) uwtable
define dso_local i64 @factorial(i32 noundef %x) local_unnamed_addr #2 {
entry:
%cmp4 = icmp sgt i32 %x, 1
br i1 %cmp4, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = zext i32 %x 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 ]
%rtn.05 = phi i64 [ 1, %for.body.preheader ], [ %mul, %for.body ]
%mul = mul nsw i64 %rtn.05, %indvars.iv
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%cmp = icmp ugt i64 %indvars.iv, 2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !11
for.end: ; preds = %for.body, %entry
%rtn.0.lcssa = phi i64 [ 1, %entry ], [ %mul, %for.body ]
ret i64 %rtn.0.lcssa
}
; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i32 @find_pic(i32 noundef %x, i32 noundef %y) local_unnamed_addr #3 {
entry:
%0 = load i32, ptr @m, align 4, !tbaa !5
%cmp35 = icmp sgt i32 %0, 0
br i1 %cmp35, label %for.cond1.preheader.lr.ph, label %for.cond.cleanup
for.cond1.preheader.lr.ph: ; preds = %entry
%1 = load i32, ptr @n, align 4
%2 = sext i32 %y to i64
%3 = sext i32 %1 to i64
%4 = sext i32 %x to i64
%wide.trip.count70 = zext i32 %0 to i64
%min.iters.check = icmp ult i32 %0, 8
%n.vec = and i64 %wide.trip.count70, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count70
%xtraiter = and i64 %wide.trip.count70, 1
%5 = icmp eq i32 %0, 1
%unroll_iter = and i64 %wide.trip.count70, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.cond1.preheader.us
for.cond1.preheader.us: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.us, %for.cond1.preheader.lr.ph
%indvars.iv66 = phi i64 [ %indvars.iv.next67, %for.cond1.for.cond.cleanup3_crit_edge.us ], [ 0, %for.cond1.preheader.lr.ph ]
%flag.036.us = phi i32 [ %.us-phi.us, %for.cond1.for.cond.cleanup3_crit_edge.us ], [ 1, %for.cond1.preheader.lr.ph ]
%6 = add nsw i64 %indvars.iv66, %4
%cmp5.us = icmp sgt i64 %6, %3
%cmp5.fr.us = freeze i1 %cmp5.us
br i1 %cmp5.fr.us, label %for.body4.us39.preheader, label %for.body4.us.us.preheader
for.body4.us39.preheader: ; preds = %for.cond1.preheader.us
br i1 %5, label %for.cond1.for.cond.cleanup3_crit_edge.us.loopexit.unr-lcssa, label %for.body4.us39
for.body4.us.us.preheader: ; preds = %for.cond1.preheader.us
br i1 %min.iters.check, label %for.body4.us.us.preheader82, label %vector.ph
vector.ph: ; preds = %for.body4.us.us.preheader
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %flag.036.us, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %14, %vector.body ]
%vec.phi74 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %15, %vector.body ]
%7 = add nsw i64 %index, %2
%8 = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %6, i64 %7
%wide.load = load <4 x i8>, ptr %8, align 1, !tbaa !12
%9 = getelementptr inbounds i8, ptr %8, i64 4
%wide.load75 = load <4 x i8>, ptr %9, align 1, !tbaa !12
%10 = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv66, i64 %index
%wide.load76 = load <4 x i8>, ptr %10, align 1, !tbaa !12
%11 = getelementptr inbounds i8, ptr %10, i64 4
%wide.load77 = load <4 x i8>, ptr %11, align 1, !tbaa !12
%12 = icmp eq <4 x i8> %wide.load, %wide.load76
%13 = icmp eq <4 x i8> %wide.load75, %wide.load77
%14 = select <4 x i1> %12, <4 x i32> %vec.phi, <4 x i32> zeroinitializer
%15 = select <4 x i1> %13, <4 x i32> %vec.phi74, <4 x i32> zeroinitializer
%index.next = add nuw i64 %index, 8
%16 = icmp eq i64 %index.next, %n.vec
br i1 %16, label %middle.block, label %vector.body, !llvm.loop !13
middle.block: ; preds = %vector.body
%.splatinsert = insertelement <4 x i32> poison, i32 %flag.036.us, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%rdx.select.cmp.not = icmp eq <4 x i32> %14, %.splat
%rdx.select = select <4 x i1> %rdx.select.cmp.not, <4 x i32> %15, <4 x i32> %14
%.splatinsert78 = insertelement <4 x i32> poison, i32 %flag.036.us, i64 0
%.splat79 = shufflevector <4 x i32> %.splatinsert78, <4 x i32> poison, <4 x i32> zeroinitializer
%rdx.select.cmp80 = icmp ne <4 x i32> %rdx.select, %.splat79
%17 = bitcast <4 x i1> %rdx.select.cmp80 to i4
%.not = icmp eq i4 %17, 0
%rdx.select81 = select i1 %.not, i32 %flag.036.us, i32 0
br i1 %cmp.n, label %for.cond1.for.cond.cleanup3_crit_edge.us, label %for.body4.us.us.preheader82
for.body4.us.us.preheader82: ; preds = %for.body4.us.us.preheader, %middle.block
%indvars.iv.ph = phi i64 [ 0, %for.body4.us.us.preheader ], [ %n.vec, %middle.block ]
%flag.133.us.us.ph = phi i32 [ %flag.036.us, %for.body4.us.us.preheader ], [ %rdx.select81, %middle.block ]
br label %for.body4.us.us
for.body4.us39: ; preds = %for.body4.us39.preheader, %for.inc.us49.1
%indvars.iv60 = phi i64 [ %indvars.iv.next61.1, %for.inc.us49.1 ], [ 0, %for.body4.us39.preheader ]
%flag.133.us41 = phi i32 [ %flag.2.us50.1, %for.inc.us49.1 ], [ %flag.036.us, %for.body4.us39.preheader ]
%niter = phi i64 [ %niter.next.1, %for.inc.us49.1 ], [ 0, %for.body4.us39.preheader ]
%18 = add nsw i64 %indvars.iv60, %2
%cmp7.us = icmp sgt i64 %18, %3
br i1 %cmp7.us, label %if.then.us48, label %lor.lhs.false.us
lor.lhs.false.us: ; preds = %for.body4.us39
%arrayidx11.us44 = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %6, i64 %18
%19 = load i8, ptr %arrayidx11.us44, align 1, !tbaa !12
%arrayidx15.us46 = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv66, i64 %indvars.iv60
%20 = load i8, ptr %arrayidx15.us46, align 1, !tbaa !12
%cmp17.not.us47 = icmp eq i8 %19, %20
br i1 %cmp17.not.us47, label %for.inc.us49, label %if.then.us48
if.then.us48: ; preds = %lor.lhs.false.us, %for.body4.us39
br label %for.inc.us49
for.inc.us49: ; preds = %if.then.us48, %lor.lhs.false.us
%flag.2.us50 = phi i32 [ 0, %if.then.us48 ], [ %flag.133.us41, %lor.lhs.false.us ]
%indvars.iv.next61 = or i64 %indvars.iv60, 1
%21 = add nsw i64 %indvars.iv.next61, %2
%cmp7.us.1 = icmp sgt i64 %21, %3
br i1 %cmp7.us.1, label %if.then.us48.1, label %lor.lhs.false.us.1
lor.lhs.false.us.1: ; preds = %for.inc.us49
%arrayidx11.us44.1 = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %6, i64 %21
%22 = load i8, ptr %arrayidx11.us44.1, align 1, !tbaa !12
%arrayidx15.us46.1 = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv66, i64 %indvars.iv.next61
%23 = load i8, ptr %arrayidx15.us46.1, align 1, !tbaa !12
%cmp17.not.us47.1 = icmp eq i8 %22, %23
br i1 %cmp17.not.us47.1, label %for.inc.us49.1, label %if.then.us48.1
if.then.us48.1: ; preds = %lor.lhs.false.us.1, %for.inc.us49
br label %for.inc.us49.1
for.inc.us49.1: ; preds = %if.then.us48.1, %lor.lhs.false.us.1
%flag.2.us50.1 = phi i32 [ 0, %if.then.us48.1 ], [ %flag.2.us50, %lor.lhs.false.us.1 ]
%indvars.iv.next61.1 = add nuw nsw i64 %indvars.iv60, 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.cond1.for.cond.cleanup3_crit_edge.us.loopexit.unr-lcssa, label %for.body4.us39, !llvm.loop !16
for.cond1.for.cond.cleanup3_crit_edge.us.loopexit.unr-lcssa: ; preds = %for.inc.us49.1, %for.body4.us39.preheader
%flag.2.us50.lcssa.ph = phi i32 [ undef, %for.body4.us39.preheader ], [ %flag.2.us50.1, %for.inc.us49.1 ]
%indvars.iv60.unr = phi i64 [ 0, %for.body4.us39.preheader ], [ %indvars.iv.next61.1, %for.inc.us49.1 ]
%flag.133.us41.unr = phi i32 [ %flag.036.us, %for.body4.us39.preheader ], [ %flag.2.us50.1, %for.inc.us49.1 ]
br i1 %lcmp.mod.not, label %for.cond1.for.cond.cleanup3_crit_edge.us, label %for.body4.us39.epil
for.body4.us39.epil: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.us.loopexit.unr-lcssa
%24 = add nsw i64 %indvars.iv60.unr, %2
%cmp7.us.epil = icmp sgt i64 %24, %3
br i1 %cmp7.us.epil, label %if.then.us48.epil, label %lor.lhs.false.us.epil
lor.lhs.false.us.epil: ; preds = %for.body4.us39.epil
%arrayidx11.us44.epil = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %6, i64 %24
%25 = load i8, ptr %arrayidx11.us44.epil, align 1, !tbaa !12
%arrayidx15.us46.epil = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv66, i64 %indvars.iv60.unr
%26 = load i8, ptr %arrayidx15.us46.epil, align 1, !tbaa !12
%cmp17.not.us47.epil = icmp eq i8 %25, %26
br i1 %cmp17.not.us47.epil, label %for.cond1.for.cond.cleanup3_crit_edge.us, label %if.then.us48.epil
if.then.us48.epil: ; preds = %lor.lhs.false.us.epil, %for.body4.us39.epil
br label %for.cond1.for.cond.cleanup3_crit_edge.us
for.cond1.for.cond.cleanup3_crit_edge.us: ; preds = %for.body4.us.us, %for.cond1.for.cond.cleanup3_crit_edge.us.loopexit.unr-lcssa, %if.then.us48.epil, %lor.lhs.false.us.epil, %middle.block
%.us-phi.us = phi i32 [ %rdx.select81, %middle.block ], [ %flag.2.us50.lcssa.ph, %for.cond1.for.cond.cleanup3_crit_edge.us.loopexit.unr-lcssa ], [ 0, %if.then.us48.epil ], [ %flag.133.us41.unr, %lor.lhs.false.us.epil ], [ %spec.select, %for.body4.us.us ]
%indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
%exitcond71.not = icmp eq i64 %indvars.iv.next67, %wide.trip.count70
br i1 %exitcond71.not, label %for.cond.cleanup, label %for.cond1.preheader.us, !llvm.loop !17
for.body4.us.us: ; preds = %for.body4.us.us.preheader82, %for.body4.us.us
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4.us.us ], [ %indvars.iv.ph, %for.body4.us.us.preheader82 ]
%flag.133.us.us = phi i32 [ %spec.select, %for.body4.us.us ], [ %flag.133.us.us.ph, %for.body4.us.us.preheader82 ]
%27 = add nsw i64 %indvars.iv, %2
%arrayidx11.us.us = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %6, i64 %27
%28 = load i8, ptr %arrayidx11.us.us, align 1, !tbaa !12
%arrayidx15.us.us = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv66, i64 %indvars.iv
%29 = load i8, ptr %arrayidx15.us.us, align 1, !tbaa !12
%cmp17.not.us.us = icmp eq i8 %28, %29
%spec.select = select i1 %cmp17.not.us.us, i32 %flag.133.us.us, i32 0
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count70
br i1 %exitcond.not, label %for.cond1.for.cond.cleanup3_crit_edge.us, label %for.body4.us.us, !llvm.loop !18
for.cond.cleanup: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.us, %entry
%flag.0.lcssa = phi i32 [ 1, %entry ], [ %.us-phi.us, %for.cond1.for.cond.cleanup3_crit_edge.us ]
ret i32 %flag.0.lcssa
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #4 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
%0 = load i32, ptr @n, align 4
%cmp78 = icmp sgt i32 %0, 0
br i1 %cmp78, label %for.cond1.preheader, label %for.cond12.preheader
for.cond1.preheader: ; preds = %entry, %for.cond.cleanup3
%1 = phi i32 [ %4, %for.cond.cleanup3 ], [ %0, %entry ]
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.cond.cleanup3 ], [ 0, %entry ]
%cmp276 = icmp sgt i32 %1, 0
br i1 %cmp276, label %for.body4, label %for.cond1.preheader.for.cond.cleanup3_crit_edge
for.cond1.preheader.for.cond.cleanup3_crit_edge: ; preds = %for.cond1.preheader
%.pre109 = sext i32 %1 to i64
br label %for.cond.cleanup3
for.cond12.preheader: ; preds = %for.cond.cleanup3, %entry
%2 = phi i32 [ %0, %entry ], [ %4, %for.cond.cleanup3 ]
%3 = load i32, ptr @m, align 4, !tbaa !5
%cmp1382 = icmp sgt i32 %3, 0
br i1 %cmp1382, label %for.cond17.preheader, label %for.cond33.preheader
for.cond.cleanup3: ; preds = %for.body4, %for.cond1.preheader.for.cond.cleanup3_crit_edge
%.pre-phi110 = phi i64 [ %.pre109, %for.cond1.preheader.for.cond.cleanup3_crit_edge ], [ %6, %for.body4 ]
%4 = phi i32 [ %1, %for.cond1.preheader.for.cond.cleanup3_crit_edge ], [ %5, %for.body4 ]
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%cmp = icmp slt i64 %indvars.iv.next94, %.pre-phi110
br i1 %cmp, label %for.cond1.preheader, label %for.cond12.preheader, !llvm.loop !19
for.body4: ; preds = %for.cond1.preheader, %for.body4
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body4 ], [ 0, %for.cond1.preheader ]
%arrayidx6 = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %indvars.iv93, i64 %indvars.iv
%call7 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx6)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%5 = load i32, ptr @n, align 4
%6 = sext i32 %5 to i64
%cmp2 = icmp slt i64 %indvars.iv.next, %6
br i1 %cmp2, label %for.body4, label %for.cond.cleanup3, !llvm.loop !21
for.cond17.preheader: ; preds = %for.cond12.preheader, %for.cond.cleanup19
%7 = phi i32 [ %12, %for.cond.cleanup19 ], [ %3, %for.cond12.preheader ]
%indvars.iv99 = phi i64 [ %indvars.iv.next100, %for.cond.cleanup19 ], [ 0, %for.cond12.preheader ]
%cmp1880 = icmp sgt i32 %7, 0
br i1 %cmp1880, label %for.body20, label %for.cond17.preheader.for.cond.cleanup19_crit_edge
for.cond17.preheader.for.cond.cleanup19_crit_edge: ; preds = %for.cond17.preheader
%.pre111 = sext i32 %7 to i64
br label %for.cond.cleanup19
for.cond33.preheader.loopexit: ; preds = %for.cond.cleanup19
%.pre = load i32, ptr @n, align 4
br label %for.cond33.preheader
for.cond33.preheader: ; preds = %for.cond33.preheader.loopexit, %for.cond12.preheader
%8 = phi i32 [ %12, %for.cond33.preheader.loopexit ], [ %3, %for.cond12.preheader ]
%9 = phi i32 [ %.pre, %for.cond33.preheader.loopexit ], [ %2, %for.cond12.preheader ]
%cmp3486 = icmp sgt i32 %9, 0
br i1 %cmp3486, label %for.cond38.preheader.preheader, label %return
for.cond38.preheader.preheader: ; preds = %for.cond33.preheader
%cmp35.i = icmp sgt i32 %8, 0
%10 = sext i32 %9 to i64
%wide.trip.count70.i = zext i32 %8 to i64
%wide.trip.count = zext i32 %9 to i64
%min.iters.check = icmp ult i32 %8, 8
%n.vec = and i64 %wide.trip.count70.i, 4294967288
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count70.i
%xtraiter = and i64 %wide.trip.count70.i, 1
%11 = icmp eq i32 %8, 1
%unroll_iter = and i64 %wide.trip.count70.i, 4294967294
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br label %for.body41.lr.ph
for.cond.cleanup19: ; preds = %for.body20, %for.cond17.preheader.for.cond.cleanup19_crit_edge
%.pre-phi112 = phi i64 [ %.pre111, %for.cond17.preheader.for.cond.cleanup19_crit_edge ], [ %14, %for.body20 ]
%12 = phi i32 [ %7, %for.cond17.preheader.for.cond.cleanup19_crit_edge ], [ %13, %for.body20 ]
%indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
%cmp13 = icmp slt i64 %indvars.iv.next100, %.pre-phi112
br i1 %cmp13, label %for.cond17.preheader, label %for.cond33.preheader.loopexit, !llvm.loop !22
for.body20: ; preds = %for.cond17.preheader, %for.body20
%indvars.iv96 = phi i64 [ %indvars.iv.next97, %for.body20 ], [ 0, %for.cond17.preheader ]
%arrayidx24 = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv99, i64 %indvars.iv96
%call25 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx24)
%indvars.iv.next97 = add nuw nsw i64 %indvars.iv96, 1
%13 = load i32, ptr @m, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp18 = icmp slt i64 %indvars.iv.next97, %14
br i1 %cmp18, label %for.body20, label %for.cond.cleanup19, !llvm.loop !23
for.body41.lr.ph: ; preds = %for.inc47, %for.cond38.preheader.preheader
%indvars.iv105 = phi i64 [ 0, %for.cond38.preheader.preheader ], [ %indvars.iv.next106, %for.inc47 ]
br i1 %cmp35.i, label %for.body41, label %return
for.cond38: ; preds = %find_pic.exit
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%exitcond.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count
br i1 %exitcond.not, label %for.inc47, label %for.body41, !llvm.loop !24
for.body41: ; preds = %for.body41.lr.ph, %for.cond38
%indvars.iv102 = phi i64 [ %indvars.iv.next103, %for.cond38 ], [ 0, %for.body41.lr.ph ]
br label %for.cond1.preheader.us.i
for.cond1.preheader.us.i: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.us.i, %for.body41
%indvars.iv66.i = phi i64 [ %indvars.iv.next67.i, %for.cond1.for.cond.cleanup3_crit_edge.us.i ], [ 0, %for.body41 ]
%flag.036.us.i = phi i32 [ %.us-phi.us.i, %for.cond1.for.cond.cleanup3_crit_edge.us.i ], [ 1, %for.body41 ]
%15 = add nuw nsw i64 %indvars.iv66.i, %indvars.iv105
%cmp5.us.i = icmp sgt i64 %15, %10
%cmp5.fr.us.i = freeze i1 %cmp5.us.i
br i1 %cmp5.fr.us.i, label %for.body4.us39.i.preheader, label %for.body4.us.us.i.preheader
for.body4.us39.i.preheader: ; preds = %for.cond1.preheader.us.i
br i1 %11, label %for.cond1.for.cond.cleanup3_crit_edge.us.i.loopexit.unr-lcssa, label %for.body4.us39.i
for.body4.us.us.i.preheader: ; preds = %for.cond1.preheader.us.i
br i1 %min.iters.check, label %for.body4.us.us.i.preheader134, label %vector.ph
vector.ph: ; preds = %for.body4.us.us.i.preheader
%minmax.ident.splatinsert = insertelement <4 x i32> poison, i32 %flag.036.us.i, i64 0
%minmax.ident.splat = shufflevector <4 x i32> %minmax.ident.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %23, %vector.body ]
%vec.phi126 = phi <4 x i32> [ %minmax.ident.splat, %vector.ph ], [ %24, %vector.body ]
%16 = add nuw nsw i64 %index, %indvars.iv102
%17 = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %15, i64 %16
%wide.load = load <4 x i8>, ptr %17, align 1, !tbaa !12
%18 = getelementptr inbounds i8, ptr %17, i64 4
%wide.load127 = load <4 x i8>, ptr %18, align 1, !tbaa !12
%19 = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv66.i, i64 %index
%wide.load128 = load <4 x i8>, ptr %19, align 1, !tbaa !12
%20 = getelementptr inbounds i8, ptr %19, i64 4
%wide.load129 = load <4 x i8>, ptr %20, align 1, !tbaa !12
%21 = icmp eq <4 x i8> %wide.load, %wide.load128
%22 = icmp eq <4 x i8> %wide.load127, %wide.load129
%23 = select <4 x i1> %21, <4 x i32> %vec.phi, <4 x i32> zeroinitializer
%24 = select <4 x i1> %22, <4 x i32> %vec.phi126, <4 x i32> zeroinitializer
%index.next = add nuw i64 %index, 8
%25 = icmp eq i64 %index.next, %n.vec
br i1 %25, label %middle.block, label %vector.body, !llvm.loop !25
middle.block: ; preds = %vector.body
%.splatinsert = insertelement <4 x i32> poison, i32 %flag.036.us.i, i64 0
%.splat = shufflevector <4 x i32> %.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
%rdx.select.cmp.not = icmp eq <4 x i32> %23, %.splat
%rdx.select = select <4 x i1> %rdx.select.cmp.not, <4 x i32> %24, <4 x i32> %23
%.splatinsert130 = insertelement <4 x i32> poison, i32 %flag.036.us.i, i64 0
%.splat131 = shufflevector <4 x i32> %.splatinsert130, <4 x i32> poison, <4 x i32> zeroinitializer
%rdx.select.cmp132 = icmp ne <4 x i32> %rdx.select, %.splat131
%26 = bitcast <4 x i1> %rdx.select.cmp132 to i4
%.not = icmp eq i4 %26, 0
%rdx.select133 = select i1 %.not, i32 %flag.036.us.i, i32 0
br i1 %cmp.n, label %for.cond1.for.cond.cleanup3_crit_edge.us.i, label %for.body4.us.us.i.preheader134
for.body4.us.us.i.preheader134: ; preds = %for.body4.us.us.i.preheader, %middle.block
%indvars.iv.i.ph = phi i64 [ 0, %for.body4.us.us.i.preheader ], [ %n.vec, %middle.block ]
%flag.133.us.us.i.ph = phi i32 [ %flag.036.us.i, %for.body4.us.us.i.preheader ], [ %rdx.select133, %middle.block ]
br label %for.body4.us.us.i
for.body4.us39.i: ; preds = %for.body4.us39.i.preheader, %for.inc.us49.i.1
%indvars.iv60.i = phi i64 [ %indvars.iv.next61.i.1, %for.inc.us49.i.1 ], [ 0, %for.body4.us39.i.preheader ]
%flag.133.us41.i = phi i32 [ %flag.2.us50.i.1, %for.inc.us49.i.1 ], [ %flag.036.us.i, %for.body4.us39.i.preheader ]
%niter = phi i64 [ %niter.next.1, %for.inc.us49.i.1 ], [ 0, %for.body4.us39.i.preheader ]
%27 = add nuw nsw i64 %indvars.iv60.i, %indvars.iv102
%cmp7.us.i = icmp sgt i64 %27, %10
br i1 %cmp7.us.i, label %if.then.us48.i, label %lor.lhs.false.us.i
lor.lhs.false.us.i: ; preds = %for.body4.us39.i
%arrayidx11.us44.i = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %15, i64 %27
%28 = load i8, ptr %arrayidx11.us44.i, align 1, !tbaa !12
%arrayidx15.us46.i = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv66.i, i64 %indvars.iv60.i
%29 = load i8, ptr %arrayidx15.us46.i, align 1, !tbaa !12
%cmp17.not.us47.i = icmp eq i8 %28, %29
br i1 %cmp17.not.us47.i, label %for.inc.us49.i, label %if.then.us48.i
if.then.us48.i: ; preds = %lor.lhs.false.us.i, %for.body4.us39.i
br label %for.inc.us49.i
for.inc.us49.i: ; preds = %if.then.us48.i, %lor.lhs.false.us.i
%flag.2.us50.i = phi i32 [ 0, %if.then.us48.i ], [ %flag.133.us41.i, %lor.lhs.false.us.i ]
%indvars.iv.next61.i = or i64 %indvars.iv60.i, 1
%30 = add nuw nsw i64 %indvars.iv.next61.i, %indvars.iv102
%cmp7.us.i.1 = icmp sgt i64 %30, %10
br i1 %cmp7.us.i.1, label %if.then.us48.i.1, label %lor.lhs.false.us.i.1
lor.lhs.false.us.i.1: ; preds = %for.inc.us49.i
%arrayidx11.us44.i.1 = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %15, i64 %30
%31 = load i8, ptr %arrayidx11.us44.i.1, align 1, !tbaa !12
%arrayidx15.us46.i.1 = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv66.i, i64 %indvars.iv.next61.i
%32 = load i8, ptr %arrayidx15.us46.i.1, align 1, !tbaa !12
%cmp17.not.us47.i.1 = icmp eq i8 %31, %32
br i1 %cmp17.not.us47.i.1, label %for.inc.us49.i.1, label %if.then.us48.i.1
if.then.us48.i.1: ; preds = %lor.lhs.false.us.i.1, %for.inc.us49.i
br label %for.inc.us49.i.1
for.inc.us49.i.1: ; preds = %if.then.us48.i.1, %lor.lhs.false.us.i.1
%flag.2.us50.i.1 = phi i32 [ 0, %if.then.us48.i.1 ], [ %flag.2.us50.i, %lor.lhs.false.us.i.1 ]
%indvars.iv.next61.i.1 = add nuw nsw i64 %indvars.iv60.i, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond1.for.cond.cleanup3_crit_edge.us.i.loopexit.unr-lcssa, label %for.body4.us39.i, !llvm.loop !16
for.cond1.for.cond.cleanup3_crit_edge.us.i.loopexit.unr-lcssa: ; preds = %for.inc.us49.i.1, %for.body4.us39.i.preheader
%flag.2.us50.i.lcssa.ph = phi i32 [ undef, %for.body4.us39.i.preheader ], [ %flag.2.us50.i.1, %for.inc.us49.i.1 ]
%indvars.iv60.i.unr = phi i64 [ 0, %for.body4.us39.i.preheader ], [ %indvars.iv.next61.i.1, %for.inc.us49.i.1 ]
%flag.133.us41.i.unr = phi i32 [ %flag.036.us.i, %for.body4.us39.i.preheader ], [ %flag.2.us50.i.1, %for.inc.us49.i.1 ]
br i1 %lcmp.mod.not, label %for.cond1.for.cond.cleanup3_crit_edge.us.i, label %for.body4.us39.i.epil
for.body4.us39.i.epil: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.us.i.loopexit.unr-lcssa
%33 = add nuw nsw i64 %indvars.iv60.i.unr, %indvars.iv102
%cmp7.us.i.epil = icmp sgt i64 %33, %10
br i1 %cmp7.us.i.epil, label %if.then.us48.i.epil, label %lor.lhs.false.us.i.epil
lor.lhs.false.us.i.epil: ; preds = %for.body4.us39.i.epil
%arrayidx11.us44.i.epil = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %15, i64 %33
%34 = load i8, ptr %arrayidx11.us44.i.epil, align 1, !tbaa !12
%arrayidx15.us46.i.epil = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv66.i, i64 %indvars.iv60.i.unr
%35 = load i8, ptr %arrayidx15.us46.i.epil, align 1, !tbaa !12
%cmp17.not.us47.i.epil = icmp eq i8 %34, %35
br i1 %cmp17.not.us47.i.epil, label %for.cond1.for.cond.cleanup3_crit_edge.us.i, label %if.then.us48.i.epil
if.then.us48.i.epil: ; preds = %lor.lhs.false.us.i.epil, %for.body4.us39.i.epil
br label %for.cond1.for.cond.cleanup3_crit_edge.us.i
for.cond1.for.cond.cleanup3_crit_edge.us.i: ; preds = %for.body4.us.us.i, %for.cond1.for.cond.cleanup3_crit_edge.us.i.loopexit.unr-lcssa, %if.then.us48.i.epil, %lor.lhs.false.us.i.epil, %middle.block
%.us-phi.us.i = phi i32 [ %rdx.select133, %middle.block ], [ %flag.2.us50.i.lcssa.ph, %for.cond1.for.cond.cleanup3_crit_edge.us.i.loopexit.unr-lcssa ], [ 0, %if.then.us48.i.epil ], [ %flag.133.us41.i.unr, %lor.lhs.false.us.i.epil ], [ %spec.select.i, %for.body4.us.us.i ]
%indvars.iv.next67.i = add nuw nsw i64 %indvars.iv66.i, 1
%exitcond71.not.i = icmp eq i64 %indvars.iv.next67.i, %wide.trip.count70.i
br i1 %exitcond71.not.i, label %find_pic.exit, label %for.cond1.preheader.us.i, !llvm.loop !17
for.body4.us.us.i: ; preds = %for.body4.us.us.i.preheader134, %for.body4.us.us.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body4.us.us.i ], [ %indvars.iv.i.ph, %for.body4.us.us.i.preheader134 ]
%flag.133.us.us.i = phi i32 [ %spec.select.i, %for.body4.us.us.i ], [ %flag.133.us.us.i.ph, %for.body4.us.us.i.preheader134 ]
%36 = add nuw nsw i64 %indvars.iv.i, %indvars.iv102
%arrayidx11.us.us.i = getelementptr inbounds [55 x [55 x i8]], ptr @pic, i64 0, i64 %15, i64 %36
%37 = load i8, ptr %arrayidx11.us.us.i, align 1, !tbaa !12
%arrayidx15.us.us.i = getelementptr inbounds [55 x [55 x i8]], ptr @temp, i64 0, i64 %indvars.iv66.i, i64 %indvars.iv.i
%38 = load i8, ptr %arrayidx15.us.us.i, align 1, !tbaa !12
%cmp17.not.us.us.i = icmp eq i8 %37, %38
%spec.select.i = select i1 %cmp17.not.us.us.i, i32 %flag.133.us.us.i, i32 0
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count70.i
br i1 %exitcond.not.i, label %for.cond1.for.cond.cleanup3_crit_edge.us.i, label %for.body4.us.us.i, !llvm.loop !26
find_pic.exit: ; preds = %for.cond1.for.cond.cleanup3_crit_edge.us.i
%tobool.not = icmp eq i32 %.us-phi.us.i, 0
br i1 %tobool.not, label %for.cond38, label %return
for.inc47: ; preds = %for.cond38
%indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
%cmp34 = icmp slt i64 %indvars.iv.next106, %10
br i1 %cmp34, label %for.body41.lr.ph, label %return, !llvm.loop !27
return: ; preds = %for.inc47, %for.body41.lr.ph, %find_pic.exit, %for.cond33.preheader
%str.sink = phi ptr [ @str.4, %for.cond33.preheader ], [ @str, %find_pic.exit ], [ @str, %for.body41.lr.ph ], [ @str.4, %for.inc47 ]
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.sink)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #5
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #6
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree 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 #2 = { nofree norecurse nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~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 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10, !14, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10, !15, !14}
!19 = distinct !{!19, !10, !20}
!20 = !{!"llvm.loop.unswitch.partial.disable"}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10, !20}
!23 = distinct !{!23, !10}
!24 = distinct !{!24, !10}
!25 = distinct !{!25, !10, !14, !15}
!26 = distinct !{!26, !10, !15, !14}
!27 = distinct !{!27, !10}
|
#include <stdio.h>
int main(void){
int N, M;
scanf("%d %d", &N, &M);
char A[N][N+1];
char B[M][M+1];
int i;
int j;
int x, y;
int cnt;
int ans = 0;
for( i = 0; i < N; i++ ){
scanf("%s", A[i] );
}
for( i = 0; i < M; i++ ){
scanf("%s", B[i] );
}
for( x = 0; x < N - M + 1; x++ ){
for( y = 0; y < N - M + 1; y++ ){
cnt = 0;
for( i = 0; i < M; i++ ){
for( j = 0; j < M; j++ ){
if(A[x+i][y+j] == B[i][j])cnt++;
else{break;}
}
}
if( cnt == M*M ) ans = 1;
if( ans ) break;
}
if( ans )break;
}
if( ans ) puts("Yes");
else{ puts("No");}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117521/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117521/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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.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
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 = zext i32 %0 to i64
%add = add nsw i32 %0, 1
%2 = zext i32 %add to i64
%3 = call ptr @llvm.stacksave.p0()
%4 = mul nuw i64 %2, %1
%vla = alloca i8, i64 %4, align 16
%5 = load i32, ptr %M, align 4, !tbaa !5
%6 = zext i32 %5 to i64
%add1 = add nsw i32 %5, 1
%7 = zext i32 %add1 to i64
%8 = mul nuw i64 %7, %6
%vla2 = alloca i8, i64 %8, align 16
%9 = load i32, ptr %N, align 4, !tbaa !5
%cmp88 = icmp sgt i32 %9, 0
br i1 %cmp88, label %for.body, label %for.cond4.preheader
for.cond4.preheader.loopexit: ; preds = %for.body
%.pre = load i32, ptr %M, align 4, !tbaa !5
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.cond4.preheader.loopexit, %entry
%10 = phi i32 [ %13, %for.cond4.preheader.loopexit ], [ %9, %entry ]
%11 = phi i32 [ %.pre, %for.cond4.preheader.loopexit ], [ %5, %entry ]
%cmp590 = icmp sgt i32 %11, 0
br i1 %cmp590, label %for.body6, label %for.cond13.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%12 = mul nuw nsw i64 %indvars.iv, %2
%arrayidx = getelementptr inbounds i8, ptr %vla, i64 %12
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%13 = load i32, ptr %N, align 4, !tbaa !5
%14 = sext i32 %13 to i64
%cmp = icmp slt i64 %indvars.iv.next, %14
br i1 %cmp, label %for.body, label %for.cond4.preheader.loopexit, !llvm.loop !9
for.cond13.preheader.loopexit: ; preds = %for.body6
%.pre143 = load i32, ptr %N, align 4, !tbaa !5
br label %for.cond13.preheader
for.cond13.preheader: ; preds = %for.cond13.preheader.loopexit, %for.cond4.preheader
%15 = phi i32 [ %10, %for.cond4.preheader ], [ %.pre143, %for.cond13.preheader.loopexit ]
%.lcssa = phi i32 [ %11, %for.cond4.preheader ], [ %25, %for.cond13.preheader.loopexit ]
%cmp15.not103 = icmp slt i32 %15, %.lcssa
br i1 %cmp15.not103, label %if.else66, label %for.cond17.preheader.lr.ph
for.cond17.preheader.lr.ph: ; preds = %for.cond13.preheader
%cmp2397 = icmp sgt i32 %.lcssa, 0
%mul = mul nsw i32 %.lcssa, %.lcssa
br i1 %cmp2397, label %for.cond17.preheader.us107.preheader, label %for.cond17.preheader.lr.ph.split.split
for.cond17.preheader.us107.preheader: ; preds = %for.cond17.preheader.lr.ph
%16 = add i32 %15, 1
%17 = sub i32 %16, %.lcssa
%wide.trip.count141 = zext i32 %17 to i64
%wide.trip.count131 = zext i32 %.lcssa to i64
br label %for.cond17.preheader.us107
for.cond17.preheader.us107: ; preds = %for.cond17.preheader.us107.preheader, %for.cond17.for.inc60.loopexit_crit_edge.split.us.us
%indvars.iv138 = phi i64 [ 0, %for.cond17.preheader.us107.preheader ], [ %indvars.iv.next139, %for.cond17.for.inc60.loopexit_crit_edge.split.us.us ]
br label %for.cond22.preheader.us.us
for.cond22.preheader.us.us: ; preds = %for.cond17.us.us, %for.cond17.preheader.us107
%indvars.iv133 = phi i64 [ %indvars.iv.next134, %for.cond17.us.us ], [ 0, %for.cond17.preheader.us107 ]
%invariant.gep146 = getelementptr i8, ptr %vla, i64 %indvars.iv133
br label %for.cond25.preheader.us.us.us
for.cond17.us.us: ; preds = %for.cond22.for.end47_crit_edge.split.us.us.us
%indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
%exitcond137.not = icmp eq i64 %indvars.iv.next134, %wide.trip.count141
br i1 %exitcond137.not, label %for.cond17.for.inc60.loopexit_crit_edge.split.us.us, label %for.cond22.preheader.us.us, !llvm.loop !11
for.cond25.preheader.us.us.us: ; preds = %for.inc45.us.us.us, %for.cond22.preheader.us.us
%indvars.iv127 = phi i64 [ %indvars.iv.next128, %for.inc45.us.us.us ], [ 0, %for.cond22.preheader.us.us ]
%cnt.099.us.us.us = phi i32 [ %cnt.1.lcssa.us.us.us, %for.inc45.us.us.us ], [ 0, %for.cond22.preheader.us.us ]
%18 = add nuw nsw i64 %indvars.iv127, %indvars.iv138
%19 = mul nuw nsw i64 %18, %2
%20 = mul nuw nsw i64 %indvars.iv127, %7
%arrayidx35.us.us.us = getelementptr inbounds i8, ptr %vla2, i64 %20
%21 = add i32 %.lcssa, %cnt.099.us.us.us
%gep147 = getelementptr i8, ptr %invariant.gep146, i64 %19
br label %for.body27.us.us.us
for.body27.us.us.us: ; preds = %if.then.us.us.us, %for.cond25.preheader.us.us.us
%indvars.iv123 = phi i64 [ %indvars.iv.next124, %if.then.us.us.us ], [ 0, %for.cond25.preheader.us.us.us ]
%cnt.194.us.us.us = phi i32 [ %inc41.us.us.us, %if.then.us.us.us ], [ %cnt.099.us.us.us, %for.cond25.preheader.us.us.us ]
%gep = getelementptr i8, ptr %gep147, i64 %indvars.iv123
%22 = load i8, ptr %gep, align 1, !tbaa !12
%arrayidx37.us.us.us = getelementptr inbounds i8, ptr %arrayidx35.us.us.us, i64 %indvars.iv123
%23 = load i8, ptr %arrayidx37.us.us.us, align 1, !tbaa !12
%cmp39.us.us.us = icmp eq i8 %22, %23
br i1 %cmp39.us.us.us, label %if.then.us.us.us, label %for.inc45.us.us.us
for.inc45.us.us.us: ; preds = %for.body27.us.us.us, %if.then.us.us.us
%cnt.1.lcssa.us.us.us = phi i32 [ %21, %if.then.us.us.us ], [ %cnt.194.us.us.us, %for.body27.us.us.us ]
%indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
%exitcond132.not = icmp eq i64 %indvars.iv.next128, %wide.trip.count131
br i1 %exitcond132.not, label %for.cond22.for.end47_crit_edge.split.us.us.us, label %for.cond25.preheader.us.us.us, !llvm.loop !13
if.then.us.us.us: ; preds = %for.body27.us.us.us
%inc41.us.us.us = add nsw i32 %cnt.194.us.us.us, 1
%indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
%exitcond.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count131
br i1 %exitcond.not, label %for.inc45.us.us.us, label %for.body27.us.us.us, !llvm.loop !14
for.cond22.for.end47_crit_edge.split.us.us.us: ; preds = %for.inc45.us.us.us
%cmp48.not.us.us = icmp eq i32 %cnt.1.lcssa.us.us.us, %mul
br i1 %cmp48.not.us.us, label %if.end68, label %for.cond17.us.us
for.cond17.for.inc60.loopexit_crit_edge.split.us.us: ; preds = %for.cond17.us.us
%indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
%exitcond142.not = icmp eq i64 %indvars.iv.next139, %wide.trip.count141
br i1 %exitcond142.not, label %if.else66, label %for.cond17.preheader.us107, !llvm.loop !15
for.cond17.preheader.lr.ph.split.split: ; preds = %for.cond17.preheader.lr.ph
%cmp48.not = icmp eq i32 %.lcssa, 0
br i1 %cmp48.not, label %if.end68, label %if.else66
for.body6: ; preds = %for.cond4.preheader, %for.body6
%indvars.iv120 = phi i64 [ %indvars.iv.next121, %for.body6 ], [ 0, %for.cond4.preheader ]
%24 = mul nuw nsw i64 %indvars.iv120, %7
%arrayidx8 = getelementptr inbounds i8, ptr %vla2, i64 %24
%call9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx8)
%indvars.iv.next121 = add nuw nsw i64 %indvars.iv120, 1
%25 = load i32, ptr %M, align 4, !tbaa !5
%26 = sext i32 %25 to i64
%cmp5 = icmp slt i64 %indvars.iv.next121, %26
br i1 %cmp5, label %for.body6, label %for.cond13.preheader.loopexit, !llvm.loop !16
if.else66: ; preds = %for.cond17.for.inc60.loopexit_crit_edge.split.us.us, %for.cond17.preheader.lr.ph.split.split, %for.cond13.preheader
br label %if.end68
if.end68: ; preds = %for.cond22.for.end47_crit_edge.split.us.us.us, %for.cond17.preheader.lr.ph.split.split, %if.else66
%.str.3.sink = phi ptr [ @.str.3, %if.else66 ], [ @.str.2, %for.cond17.preheader.lr.ph.split.split ], [ @.str.2, %for.cond22.for.end47_crit_edge.split.us.us.us ]
%call67 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.stackrestore.p0(ptr %3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include <stdio.h>
int main(void)
{
int S,W;
scanf("%d %d",&S,&W);
if(S<=W){
printf("unsafe");
}else{
printf("safe");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117572/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117572/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(void){
int s,w;
scanf("%d", &s);
scanf("%d", &w);
if(s>w)
printf("safe\n");
else
printf("unsafe\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117615/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117615/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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)
%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 = 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 <stdlib.h>
int main(void){
int s,w;
scanf("%d",&s);
if(1>s || s>100){
while(1>s || s>100){
scanf("%d",&s);
}
}
scanf("%d",&w);
if(1>w || w>100){
while(1>w || w>100){
scanf("%d",&w);
}
}
if(s>w){
printf("safe\n");
}else{
printf("unsafe\n");
}
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117659/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117659/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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)
%0 = load i32, ptr %s, align 4
%1 = add i32 %0, -101
%or.cond = icmp ult i32 %1, -100
br i1 %or.cond, label %while.body, label %if.end
while.body: ; preds = %entry, %while.body
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s)
%2 = load i32, ptr %s, align 4
%3 = add i32 %2, -101
%4 = icmp ult i32 %3, -100
br i1 %4, label %while.body, label %if.end, !llvm.loop !5
if.end: ; preds = %while.body, %entry
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
%5 = load i32, ptr %w, align 4
%6 = add i32 %5, -101
%or.cond24 = icmp ult i32 %6, -100
br i1 %or.cond24, label %while.body15, label %if.end18
while.body15: ; preds = %if.end, %while.body15
%call16 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %w)
%7 = load i32, ptr %w, align 4
%8 = add i32 %7, -101
%9 = icmp ult i32 %8, -100
br i1 %9, label %while.body15, label %if.end18, !llvm.loop !7
if.end18: ; preds = %while.body15, %if.end
%10 = phi i32 [ %5, %if.end ], [ %7, %while.body15 ]
%11 = load i32, ptr %s, align 4, !tbaa !8
%cmp19 = icmp sgt i32 %11, %10
%str.3.str = select i1 %cmp19, 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
|
#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_117701/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117701/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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()
{
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_117752/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117752/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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>
#include <math.h>
int main()
{
int s, w;
scanf("%d", &s);
scanf("%d", &w);
if(s <= w){
printf("unsafe\n");
}
else{
printf("safe\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117796/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117796/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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)
%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.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;
int w;
fscanf(stdin, "%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_117839/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117839/source.c"
target datalayout = "e-m:e-p270: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 [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: 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
%0 = load ptr, ptr @stdin, align 8, !tbaa !5
%call = call i32 (ptr, ptr, ...) @__isoc99_fscanf(ptr noundef %0, ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %w) #4
%1 = load i32, ptr %w, align 4, !tbaa !9
%2 = load i32, ptr %s, align 4, !tbaa !9
%cmp.not = icmp slt i32 %1, %2
%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
declare i32 @__isoc99_fscanf(ptr noundef, ptr noundef, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
|
#include <stdio.h>
#include <stdlib.h>
int main(){
int S,W;
if(scanf("%d%d",&S,&W) < 2) {
fprintf(stderr, "error: ill-formed fraction.\n");
exit(1);
}
if(S > W){
printf("safe");
} else {
printf("unsafe");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117897/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117897/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = private unnamed_addr constant [29 x i8] c"error: ill-formed fraction.\0A\00", align 1
@.str.2 = 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: 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) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %W) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %S, ptr noundef nonnull %W)
%cmp = icmp slt i32 %call, 2
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%0 = load ptr, ptr @stderr, align 8, !tbaa !5
%1 = call i64 @fwrite(ptr nonnull @.str.1, i64 28, i64 1, ptr %0) #6
call void @exit(i32 noundef 1) #7
unreachable
if.end: ; preds = %entry
%2 = load i32, ptr %S, align 4, !tbaa !9
%3 = load i32, ptr %W, align 4, !tbaa !9
%cmp2 = icmp sgt i32 %2, %3
%.str.2..str.3 = select i1 %cmp2, ptr @.str.2, ptr @.str.3
%call5 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2..str.3)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %W) #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: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 }
attributes #5 = { nounwind }
attributes #6 = { cold }
attributes #7 = { 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}
|
#include<stdio.h>
int main()
{
int t,n,i,a[100],b[100],maxb,maxa,c;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
scanf("%d",&b[i]);
}
for(i=0;i<n;i++)
{
if(a[i]<b[i])
{
c = a[i];
a[i] = b[i];
b[i] = c;
}
}
maxa = 0;
maxb = 0;
for(i=0;i<n;i++)
{
if(a[i]>maxa)
maxa = a[i];
if(b[i]>maxb)
maxb = b[i];
}
printf("%d\n",maxa*maxb);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11794/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11794/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%dec88 = add nsw i32 %0, -1
store i32 %dec88, ptr %t, align 4, !tbaa !5
%tobool.not89 = icmp eq i32 %0, 0
br i1 %tobool.not89, label %while.end, label %while.body
while.body: ; preds = %entry, %for.end50
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp76 = icmp sgt i32 %1, 0
br i1 %cmp76, label %for.body, label %for.end50
for.cond3.preheader: ; preds = %for.body
%cmp478 = icmp sgt i32 %2, 0
br i1 %cmp478, label %for.body5, label %for.end50
for.body: ; preds = %while.body, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %while.body ]
%arrayidx = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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.cond3.preheader, !llvm.loop !9
for.cond12.preheader: ; preds = %for.body5
%cmp1380 = icmp sgt i32 %5, 0
br i1 %cmp1380, label %for.body14.preheader, label %for.end50
for.body14.preheader: ; preds = %for.cond12.preheader
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 1
%4 = icmp eq i32 %5, 1
br i1 %4, label %for.cond31.preheader.unr-lcssa, label %for.body14.preheader.new
for.body14.preheader.new: ; preds = %for.body14.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body14
for.body5: ; preds = %for.cond3.preheader, %for.body5
%indvars.iv92 = phi i64 [ %indvars.iv.next93, %for.body5 ], [ 0, %for.cond3.preheader ]
%arrayidx7 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv92
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx7)
%indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
%5 = load i32, ptr %n, align 4, !tbaa !5
%6 = sext i32 %5 to i64
%cmp4 = icmp slt i64 %indvars.iv.next93, %6
br i1 %cmp4, label %for.body5, label %for.cond12.preheader, !llvm.loop !11
for.cond31.preheader.unr-lcssa: ; preds = %for.inc28.1, %for.body14.preheader
%indvars.iv95.unr = phi i64 [ 0, %for.body14.preheader ], [ %indvars.iv.next96.1, %for.inc28.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond31.preheader, label %for.body14.epil
for.body14.epil: ; preds = %for.cond31.preheader.unr-lcssa
%arrayidx16.epil = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv95.unr
%7 = load i32, ptr %arrayidx16.epil, align 4, !tbaa !5
%arrayidx18.epil = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv95.unr
%8 = load i32, ptr %arrayidx18.epil, align 4, !tbaa !5
%cmp19.epil = icmp slt i32 %7, %8
br i1 %cmp19.epil, label %if.then.epil, label %for.cond31.preheader
if.then.epil: ; preds = %for.body14.epil
store i32 %8, ptr %arrayidx16.epil, align 4, !tbaa !5
store i32 %7, ptr %arrayidx18.epil, align 4, !tbaa !5
br label %for.cond31.preheader
for.cond31.preheader: ; preds = %for.body14.epil, %if.then.epil, %for.cond31.preheader.unr-lcssa
br i1 %cmp1380, label %for.body33.preheader, label %for.end50
for.body33.preheader: ; preds = %for.cond31.preheader
%wide.trip.count101 = zext i32 %5 to i64
%min.iters.check = icmp ult i32 %5, 8
br i1 %min.iters.check, label %for.body33.preheader121, label %vector.ph
vector.ph: ; preds = %for.body33.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 ], [ %11, %vector.body ]
%vec.phi113 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%vec.phi114 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%vec.phi115 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%9 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
%wide.load116 = load <4 x i32>, ptr %10, align 16, !tbaa !5
%11 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load, <4 x i32> %vec.phi)
%12 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load116, <4 x i32> %vec.phi113)
%13 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %index
%wide.load117 = load <4 x i32>, ptr %13, align 16, !tbaa !5
%14 = getelementptr inbounds i32, ptr %13, i64 4
%wide.load118 = load <4 x i32>, ptr %14, align 16, !tbaa !5
%15 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load117, <4 x i32> %vec.phi114)
%16 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %wide.load118, <4 x i32> %vec.phi115)
%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 !12
middle.block: ; preds = %vector.body
%rdx.minmax119 = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %15, <4 x i32> %16)
%18 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax119)
%rdx.minmax = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %11, <4 x i32> %12)
%19 = call i32 @llvm.vector.reduce.smax.v4i32(<4 x i32> %rdx.minmax)
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.end50.loopexit, label %for.body33.preheader121
for.body33.preheader121: ; preds = %for.body33.preheader, %middle.block
%indvars.iv98.ph = phi i64 [ 0, %for.body33.preheader ], [ %n.vec, %middle.block ]
%maxa.084.ph = phi i32 [ 0, %for.body33.preheader ], [ %19, %middle.block ]
%maxb.083.ph = phi i32 [ 0, %for.body33.preheader ], [ %18, %middle.block ]
br label %for.body33
for.body14: ; preds = %for.inc28.1, %for.body14.preheader.new
%indvars.iv95 = phi i64 [ 0, %for.body14.preheader.new ], [ %indvars.iv.next96.1, %for.inc28.1 ]
%niter = phi i64 [ 0, %for.body14.preheader.new ], [ %niter.next.1, %for.inc28.1 ]
%arrayidx16 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv95
%20 = load i32, ptr %arrayidx16, align 8, !tbaa !5
%arrayidx18 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv95
%21 = load i32, ptr %arrayidx18, align 8, !tbaa !5
%cmp19 = icmp slt i32 %20, %21
br i1 %cmp19, label %if.then, label %for.inc28
if.then: ; preds = %for.body14
store i32 %21, ptr %arrayidx16, align 8, !tbaa !5
store i32 %20, ptr %arrayidx18, align 8, !tbaa !5
br label %for.inc28
for.inc28: ; preds = %for.body14, %if.then
%indvars.iv.next96 = or i64 %indvars.iv95, 1
%arrayidx16.1 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv.next96
%22 = load i32, ptr %arrayidx16.1, align 4, !tbaa !5
%arrayidx18.1 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv.next96
%23 = load i32, ptr %arrayidx18.1, align 4, !tbaa !5
%cmp19.1 = icmp slt i32 %22, %23
br i1 %cmp19.1, label %if.then.1, label %for.inc28.1
if.then.1: ; preds = %for.inc28
store i32 %23, ptr %arrayidx16.1, align 4, !tbaa !5
store i32 %22, ptr %arrayidx18.1, align 4, !tbaa !5
br label %for.inc28.1
for.inc28.1: ; preds = %if.then.1, %for.inc28
%indvars.iv.next96.1 = add nuw nsw i64 %indvars.iv95, 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.cond31.preheader.unr-lcssa, label %for.body14, !llvm.loop !15
for.body33: ; preds = %for.body33.preheader121, %for.body33
%indvars.iv98 = phi i64 [ %indvars.iv.next99, %for.body33 ], [ %indvars.iv98.ph, %for.body33.preheader121 ]
%maxa.084 = phi i32 [ %spec.select, %for.body33 ], [ %maxa.084.ph, %for.body33.preheader121 ]
%maxb.083 = phi i32 [ %maxb.1, %for.body33 ], [ %maxb.083.ph, %for.body33.preheader121 ]
%arrayidx35 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv98
%24 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%spec.select = call i32 @llvm.smax.i32(i32 %24, i32 %maxa.084)
%arrayidx42 = getelementptr inbounds [100 x i32], ptr %b, i64 0, i64 %indvars.iv98
%25 = load i32, ptr %arrayidx42, align 4, !tbaa !5
%maxb.1 = call i32 @llvm.smax.i32(i32 %25, i32 %maxb.083)
%indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
%exitcond102.not = icmp eq i64 %indvars.iv.next99, %wide.trip.count101
br i1 %exitcond102.not, label %for.end50.loopexit, label %for.body33, !llvm.loop !16
for.end50.loopexit: ; preds = %for.body33, %middle.block
%spec.select.lcssa = phi i32 [ %19, %middle.block ], [ %spec.select, %for.body33 ]
%maxb.1.lcssa = phi i32 [ %18, %middle.block ], [ %maxb.1, %for.body33 ]
%26 = mul nsw i32 %spec.select.lcssa, %maxb.1.lcssa
br label %for.end50
for.end50: ; preds = %for.cond12.preheader, %while.body, %for.cond3.preheader, %for.end50.loopexit, %for.cond31.preheader
%mul = phi i32 [ 0, %for.cond31.preheader ], [ %26, %for.end50.loopexit ], [ 0, %for.cond3.preheader ], [ 0, %while.body ], [ 0, %for.cond12.preheader ]
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %mul)
%27 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %27, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %27, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !17
while.end: ; preds = %for.end50, %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}
!16 = distinct !{!16, !10, !14, !13}
!17 = distinct !{!17, !10}
|
#include<stdio.h>
int main(void){
int S,W;
scanf("%d%d",&S,&W);
puts(S<=W ? "unsafe":"safe");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_117983/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_117983/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%cond = select i1 %cmp.not, ptr @.str.2, ptr @.str.1
%call1 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %cond)
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 a,b;
scanf("%d%d",&a,&b);
if(a>b)
{
printf("safe");
}
else printf("unsafe");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118025/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118025/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%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 %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 s,w;
scanf("%d %d",&s,&w);
if(s<=w){
printf("unsafe\n");
}else if(s>w){
printf("safe\n");
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118069/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118069/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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");
else
printf("unsafe");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118111/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118111/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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:
%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 = 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 %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 sheep, wolf;
scanf("%d", &sheep);
scanf("%d", &wolf);
if(sheep > wolf){
printf("safe");
}else{
printf("unsafe");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118162/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118162/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"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:
%sheep = alloca i32, align 4
%wolf = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %sheep) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %wolf) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %sheep)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %wolf)
%0 = load i32, ptr %sheep, align 4, !tbaa !5
%1 = load i32, ptr %wolf, align 4, !tbaa !5
%cmp = icmp sgt i32 %0, %1
%.str.1..str.2 = select i1 %cmp, ptr @.str.1, ptr @.str.2
%call3 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %wolf) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %sheep) #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\n");
}else{
printf("safe\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118205/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118205/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 %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("unsafe");
else printf("safe");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118249/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118249/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define REP(i,n) for(i=0;i<n;i++)
#define MAX 1000000
#define MOD 1000000007
long long fac[MAX], finv[MAX], inv[MAX];
//prototype declaration
int i_in();
long long ll_in();
double d_in();
char c_in();
void s_in(char *s);
void i_out(int i);
void ll_out(long long i);
void d_out(double i);
void c_out(char c);
void s_out(char *s);
int gcd(int a, int b);
int lcm(int a, int b);
long long ll_gcd(long long a, long long b);
long long ll_lcm(long long a, long long b);
void sort_asc(int *a);
void sort_desc(int *a);
int asc(const void *a, const void *b);
int desc(const void *a, const void *b);
void ll_sort_asc(long long *a);
void ll_sort_desc(long long *a);
int ll_asc(const void *a, const void *b);
int ll_desc(const void *a, const void *b);
double to_deg(double rad);
double distance(int xi, int yi, int xj, int yj);
void initComb();
long long comb(int n, int k);
//main function
int main() {
int s = i_in(), w = i_in();
if (s > w) s_out("safe");
else s_out("unsafe");
return 0;
}
//body function
int i_in() {
int i;
scanf("%d", &i);
return i;
}
long long ll_in() {
long long i;
scanf("%lld", &i);
return i;
}
double d_in() {
double i;
scanf("%lf", &i);
return i;
}
char c_in() {
char c;
scanf("%c", &c);
return c;
}
void s_in(char *s) {
scanf("%s", s);
}
void i_out(int i) {
printf("%d\n", i);
}
void ll_out(long long i) {
printf("%lld\n", i);
}
void d_out(double i) {
printf("%lf\n", i);
}
void c_out(char c) {
printf("%c\n", c);
}
void s_out(char *s) {
printf("%s\n", s);
}
/*
int型の最大公約数
*/
int gcd(int a, int b) {
int r;
if (a < b) {
r = a;
a = b;
b = r;
}
r = a % b;
while (r != 0) {
a = b;
b = r;
r = a % b;
}
return b;
}
/*
int型の最小公倍数
*/
int lcm(int a, int b) {
int r = ll_gcd(a, b);
a /= r;
return a * b;
}
/*
long long型の最大公約数
*/
long long ll_gcd(long long a, long long b) {
long long r;
if (a < b) {
r = a;
a = b;
b = r;
}
r = a % b;
while (r != 0) {
a = b;
b = r;
r = a % b;
}
return b;
}
/*
long long型の最小公倍数
*/
long long ll_lcm(long long a, long long b) {
long long r = ll_gcd(a, b);
a /= r;
return a * b;
}
/*
int型の昇順ソート
*/
void sort_asc(int *a) {
qsort(a, sizeof(a)/sizeof(int), sizeof(int), asc);
}
/*
int型の降順ソート
*/
void sort_desc(int *a) {
qsort(a, sizeof(a)/sizeof(int), sizeof(int), desc);
}
/*
int型の昇順用比較関数
*/
int asc(const void *a, const void *b) {
return *(int *)a - *(int *)b;
}
/*
int型の降順用比較関数
*/
int desc(const void *a, const void *b) {
return *(int *)b - *(int *)a;
}
/*
long long型の昇順ソート
*/
void ll_sort_asc(long long *a) {
qsort(a, sizeof(a)/sizeof(long long), sizeof(long long), ll_asc);
}
/*
long long型の降順ソート
*/
void ll_sort_desc(long long *a) {
qsort(a, sizeof(a)/sizeof(long long), sizeof(long long), ll_desc);
}
/*
long long型の昇順用比較関数
*/
int ll_asc(const void *a, const void *b) {
long long *A = (long long *)a;
long long *B = (long long *)b;
if (*A > *B) return 1;
else if (*A < *B) return -1;
else return 0;
}
/*
long long型の降順用比較関数
*/
int ll_desc(const void *a, const void *b) {
long long *A = (long long *)a;
long long *B = (long long *)b;
if (*A < *B) return 1;
else if (*A > *B) return -1;
else return 0;
}
/*
弧度法を度数法に
*/
double to_deg(double rad) {
return rad * 180.0 / (atan(1.0) * 4.0);
}
/*
二点間の距離
*/
double distance(int xi, int yi, int xj, int yj) {
return hypot(xj - xi, yj - yi);
}
/*
組み合わせ用配列の初期化
*/
void initComb() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for (int i = 2; i < MAX; i++){
fac[i] = fac[i - 1] * i % MOD;
inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
finv[i] = finv[i - 1] * inv[i] % MOD;
}
}
/*
nCkの組み合わせ計算
*/
long long comb(int n, int k){
if (n < k) return 0;
if (n < 0 || k < 0) return 0;
return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118292/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118292/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"safe\00", align 1
@.str.1 = private unnamed_addr constant [7 x i8] c"unsafe\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.4 = private unnamed_addr constant [4 x i8] c"%lf\00", align 1
@.str.5 = private unnamed_addr constant [3 x i8] c"%c\00", align 1
@.str.6 = private unnamed_addr constant [3 x i8] c"%s\00", align 1
@.str.7 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.8 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
@.str.9 = private unnamed_addr constant [5 x i8] c"%lf\0A\00", align 1
@.str.10 = private unnamed_addr constant [4 x i8] c"%c\0A\00", align 1
@fac = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@finv = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
@inv = dso_local local_unnamed_addr global [1000000 x i64] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%i.i2 = alloca i32, align 4
%i.i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i) #13
%call.i = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i.i)
%0 = load i32, ptr %i.i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i) #13
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i.i2) #13
%call.i3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i.i2)
%1 = load i32, ptr %i.i2, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i.i2) #13
%cmp = icmp sgt i32 %0, %1
%.str..str.1 = select i1 %cmp, ptr @.str, ptr @.str.1
%puts.i4 = call i32 @puts(ptr nonnull dereferenceable(1) %.str..str.1)
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @s_out(ptr nocapture noundef readonly %s) local_unnamed_addr #0 {
entry:
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %s)
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 uwtable
define dso_local i32 @i_in() local_unnamed_addr #0 {
entry:
%i = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %i) #13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %i)
%0 = load i32, ptr %i, align 4, !tbaa !5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %i) #13
ret i32 %0
}
; 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 i64 @ll_in() local_unnamed_addr #0 {
entry:
%i = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.3, ptr noundef nonnull %i)
%0 = load i64, ptr %i, align 8, !tbaa !9
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #13
ret i64 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local double @d_in() local_unnamed_addr #0 {
entry:
%i = alloca double, align 8
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %i) #13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.4, ptr noundef nonnull %i)
%0 = load double, ptr %i, align 8, !tbaa !11
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %i) #13
ret double %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local signext i8 @c_in() local_unnamed_addr #0 {
entry:
%c = alloca i8, align 1
call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %c) #13
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %c)
%0 = load i8, ptr %c, align 1, !tbaa !13
call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %c) #13
ret i8 %0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @s_in(ptr noundef %s) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.6, ptr noundef %s)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @i_out(i32 noundef %i) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %i)
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 @ll_out(i64 noundef %i) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, i64 noundef %i)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @d_out(double noundef %i) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, double noundef %i)
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @c_out(i8 noundef signext %c) local_unnamed_addr #0 {
entry:
%conv = sext i8 %c to i32
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %conv)
ret void
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%spec.select = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
%spec.select13 = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
%rem = srem i32 %spec.select, %spec.select13
%cmp1.not14 = icmp eq i32 %rem, 0
br i1 %cmp1.not14, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.016 = phi i32 [ %rem2, %while.body ], [ %rem, %entry ]
%b.addr.115 = phi i32 [ %r.016, %while.body ], [ %spec.select13, %entry ]
%rem2 = srem i32 %b.addr.115, %r.016
%cmp1.not = icmp eq i32 %rem2, 0
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !14
while.end: ; preds = %while.body, %entry
%b.addr.1.lcssa = phi i32 [ %spec.select13, %entry ], [ %r.016, %while.body ]
ret i32 %b.addr.1.lcssa
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @lcm(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%conv = sext i32 %a to i64
%conv1 = sext i32 %b to i64
%spec.select.i = tail call i64 @llvm.smax.i64(i64 %conv, i64 %conv1)
%spec.select13.i = tail call i64 @llvm.smin.i64(i64 %conv, i64 %conv1)
%rem.i = srem i64 %spec.select.i, %spec.select13.i
%cmp1.not14.i = icmp eq i64 %rem.i, 0
br i1 %cmp1.not14.i, label %ll_gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%r.016.i = phi i64 [ %rem2.i, %while.body.i ], [ %rem.i, %entry ]
%b.addr.115.i = phi i64 [ %r.016.i, %while.body.i ], [ %spec.select13.i, %entry ]
%rem2.i = srem i64 %b.addr.115.i, %r.016.i
%cmp1.not.i = icmp eq i64 %rem2.i, 0
br i1 %cmp1.not.i, label %ll_gcd.exit, label %while.body.i, !llvm.loop !16
ll_gcd.exit: ; preds = %while.body.i, %entry
%b.addr.1.lcssa.i = phi i64 [ %spec.select13.i, %entry ], [ %r.016.i, %while.body.i ]
%conv2 = trunc i64 %b.addr.1.lcssa.i to i32
%div = sdiv i32 %a, %conv2
%mul = mul nsw i32 %div, %b
ret i32 %mul
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @ll_gcd(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%spec.select = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
%spec.select13 = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
%rem = srem i64 %spec.select, %spec.select13
%cmp1.not14 = icmp eq i64 %rem, 0
br i1 %cmp1.not14, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%r.016 = phi i64 [ %rem2, %while.body ], [ %rem, %entry ]
%b.addr.115 = phi i64 [ %r.016, %while.body ], [ %spec.select13, %entry ]
%rem2 = srem i64 %b.addr.115, %r.016
%cmp1.not = icmp eq i64 %rem2, 0
br i1 %cmp1.not, label %while.end, label %while.body, !llvm.loop !16
while.end: ; preds = %while.body, %entry
%b.addr.1.lcssa = phi i64 [ %spec.select13, %entry ], [ %r.016, %while.body ]
ret i64 %b.addr.1.lcssa
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i64 @ll_lcm(i64 noundef %a, i64 noundef %b) local_unnamed_addr #3 {
entry:
%spec.select.i = tail call i64 @llvm.smax.i64(i64 %a, i64 %b)
%spec.select13.i = tail call i64 @llvm.smin.i64(i64 %a, i64 %b)
%rem.i = srem i64 %spec.select.i, %spec.select13.i
%cmp1.not14.i = icmp eq i64 %rem.i, 0
br i1 %cmp1.not14.i, label %ll_gcd.exit, label %while.body.i
while.body.i: ; preds = %entry, %while.body.i
%r.016.i = phi i64 [ %rem2.i, %while.body.i ], [ %rem.i, %entry ]
%b.addr.115.i = phi i64 [ %r.016.i, %while.body.i ], [ %spec.select13.i, %entry ]
%rem2.i = srem i64 %b.addr.115.i, %r.016.i
%cmp1.not.i = icmp eq i64 %rem2.i, 0
br i1 %cmp1.not.i, label %ll_gcd.exit, label %while.body.i, !llvm.loop !16
ll_gcd.exit: ; preds = %while.body.i, %entry
%b.addr.1.lcssa.i = phi i64 [ %spec.select13.i, %entry ], [ %r.016.i, %while.body.i ]
%div = sdiv i64 %a, %b.addr.1.lcssa.i
%mul = mul nsw i64 %div, %b
ret i64 %mul
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sort_asc(ptr noundef %a) local_unnamed_addr #0 {
entry:
tail call void @qsort(ptr noundef %a, i64 noundef 2, i64 noundef 4, ptr noundef nonnull @asc) #13
ret void
}
; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @sort_desc(ptr noundef %a) local_unnamed_addr #0 {
entry:
tail call void @qsort(ptr noundef %a, i64 noundef 2, i64 noundef 4, ptr noundef nonnull @desc) #13
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @ll_sort_asc(ptr noundef %a) local_unnamed_addr #0 {
entry:
tail call void @qsort(ptr noundef %a, i64 noundef 1, i64 noundef 8, ptr noundef nonnull @ll_asc) #13
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ll_asc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !9
%1 = load i64, ptr %b, align 8, !tbaa !9
%cmp = icmp sgt i64 %0, %1
%cmp1 = icmp slt i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @ll_sort_desc(ptr noundef %a) local_unnamed_addr #0 {
entry:
tail call void @qsort(ptr noundef %a, i64 noundef 1, i64 noundef 8, ptr noundef nonnull @ll_desc) #13
ret void
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @ll_desc(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) #5 {
entry:
%0 = load i64, ptr %a, align 8, !tbaa !9
%1 = load i64, ptr %b, align 8, !tbaa !9
%cmp = icmp slt i64 %0, %1
%cmp1 = icmp sgt i64 %0, %1
%. = sext i1 %cmp1 to i32
%retval.0 = select i1 %cmp, i32 1, i32 %.
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local double @to_deg(double noundef %rad) local_unnamed_addr #6 {
entry:
%mul = fmul double %rad, 1.800000e+02
%div = fdiv double %mul, 0x400921FB54442D18
ret double %div
}
; Function Attrs: nounwind uwtable
define dso_local double @distance(i32 noundef %xi, i32 noundef %yi, i32 noundef %xj, i32 noundef %yj) local_unnamed_addr #7 {
entry:
%sub = sub nsw i32 %xj, %xi
%conv = sitofp i32 %sub to double
%sub1 = sub nsw i32 %yj, %yi
%conv2 = sitofp i32 %sub1 to double
%call = tail call double @hypot(double noundef %conv, double noundef %conv2) #13
ret double %call
}
; Function Attrs: nounwind
declare double @hypot(double noundef, double noundef) local_unnamed_addr #8
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @initComb() local_unnamed_addr #9 {
entry:
store i64 1, ptr getelementptr inbounds ([1000000 x i64], ptr @fac, i64 0, i64 1), align 8, !tbaa !9
store i64 1, ptr @fac, align 16, !tbaa !9
store i64 1, ptr getelementptr inbounds ([1000000 x i64], ptr @finv, i64 0, i64 1), align 8, !tbaa !9
store i64 1, ptr @finv, align 16, !tbaa !9
store i64 1, ptr getelementptr inbounds ([1000000 x i64], ptr @inv, i64 0, i64 1), align 8, !tbaa !9
br label %for.body
for.cond.cleanup: ; preds = %for.body
ret void
for.body: ; preds = %entry, %for.body
%0 = phi i64 [ 1, %entry ], [ %rem18, %for.body ]
%1 = phi i64 [ 1, %entry ], [ %rem, %for.body ]
%indvars.iv = phi i64 [ 2, %entry ], [ %indvars.iv.next, %for.body ]
%mul = mul nsw i64 %1, %indvars.iv
%rem = srem i64 %mul, 1000000007
%arrayidx2 = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %indvars.iv
store i64 %rem, ptr %arrayidx2, align 8, !tbaa !9
%2 = trunc i64 %indvars.iv to i32
%rem3 = urem i32 1000000007, %2
%idxprom4 = zext i32 %rem3 to i64
%arrayidx5 = getelementptr inbounds [1000000 x i64], ptr @inv, i64 0, i64 %idxprom4
%3 = load i64, ptr %arrayidx5, align 8, !tbaa !9
%div = udiv i32 1000000007, %2
%conv6 = zext i32 %div to i64
%mul7 = mul nsw i64 %3, %conv6
%rem8 = srem i64 %mul7, 1000000007
%sub9 = sub nsw i64 1000000007, %rem8
%arrayidx11 = getelementptr inbounds [1000000 x i64], ptr @inv, i64 0, i64 %indvars.iv
store i64 %sub9, ptr %arrayidx11, align 8, !tbaa !9
%mul17 = mul nuw nsw i64 %sub9, %0
%rem18 = urem i64 %mul17, 1000000007
%arrayidx20 = getelementptr inbounds [1000000 x i64], ptr @finv, i64 0, i64 %indvars.iv
store i64 %rem18, ptr %arrayidx20, align 8, !tbaa !9
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 1000000
br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !17
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable
define dso_local i64 @comb(i32 noundef %n, i32 noundef %k) local_unnamed_addr #10 {
entry:
%cmp = icmp sge i32 %n, %k
%0 = or i32 %k, %n
%or.cond.not = icmp sgt i32 %0, -1
%or.cond = and i1 %cmp, %or.cond.not
br i1 %or.cond, label %if.end4, label %return
if.end4: ; preds = %entry
%idxprom = zext i32 %n to i64
%arrayidx = getelementptr inbounds [1000000 x i64], ptr @fac, i64 0, i64 %idxprom
%1 = load i64, ptr %arrayidx, align 8, !tbaa !9
%idxprom5 = zext i32 %k to i64
%arrayidx6 = getelementptr inbounds [1000000 x i64], ptr @finv, i64 0, i64 %idxprom5
%2 = load i64, ptr %arrayidx6, align 8, !tbaa !9
%sub = sub nsw i32 %n, %k
%idxprom7 = sext i32 %sub to i64
%arrayidx8 = getelementptr inbounds [1000000 x i64], ptr @finv, i64 0, i64 %idxprom7
%3 = load i64, ptr %arrayidx8, align 8, !tbaa !9
%mul = mul nsw i64 %3, %2
%rem = srem i64 %mul, 1000000007
%mul9 = mul nsw i64 %rem, %1
%rem10 = srem i64 %mul9, 1000000007
br label %return
return: ; preds = %entry, %if.end4
%retval.0 = phi i64 [ %rem10, %if.end4 ], [ 0, %entry ]
ret i64 %retval.0
}
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #11
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smax.i64(i64, i64) #12
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #12
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { 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 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 #7 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { mustprogress nofree norecurse nosync nounwind willreturn memory(read, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #11 = { nofree nounwind }
attributes #12 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #13 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
|
#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_118335/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118335/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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(void) {
int n,m,i,g=0,ans=0;
int a[10010];
scanf("%d",&n);
scanf("%d",&m);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
g+=a[i];
}
for(i=0;i<n;i++)
{
if(a[i]*(4*m)>=g)
{
ans++;
}
}
if(ans>=m)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118386/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118386/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%a = alloca [10010 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 40040, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp30 = icmp sgt i32 %0, 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.end15
for.cond5.preheader: ; preds = %for.body
%cmp634 = icmp sgt i32 %16, 0
%.pre = load i32, ptr %m, align 4, !tbaa !5
br i1 %cmp634, label %for.body7.lr.ph, label %for.end15
for.body7.lr.ph: ; preds = %for.cond5.preheader
%wide.trip.count = zext i32 %16 to i64
%min.iters.check = icmp ult i32 %16, 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.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 ], [ %11, %vector.body ]
%vec.phi48 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %12, %vector.body ]
%1 = getelementptr inbounds [10010 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.load49 = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = shl <4 x i32> %wide.load, <i32 2, i32 2, i32 2, i32 2>
%4 = shl <4 x i32> %wide.load49, <i32 2, i32 2, i32 2, i32 2>
%5 = mul <4 x i32> %3, %broadcast.splat
%6 = mul <4 x i32> %4, %broadcast.splat
%7 = icmp sge <4 x i32> %5, %broadcast.splat51
%8 = icmp sge <4 x i32> %6, %broadcast.splat51
%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.phi48, %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.end15, label %for.body7.preheader
for.body7.preheader: ; preds = %for.body7.lr.ph, %middle.block
%indvars.iv40.ph = phi i64 [ 0, %for.body7.lr.ph ], [ %n.vec, %middle.block ]
%ans.036.ph = phi i32 [ 0, %for.body7.lr.ph ], [ %14, %middle.block ]
br label %for.body7
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%g.032 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [10010 x i32], ptr %a, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%15 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %15, %g.032
%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.cond5.preheader, !llvm.loop !13
for.body7: ; preds = %for.body7.preheader, %for.body7
%indvars.iv40 = phi i64 [ %indvars.iv.next41, %for.body7 ], [ %indvars.iv40.ph, %for.body7.preheader ]
%ans.036 = phi i32 [ %spec.select, %for.body7 ], [ %ans.036.ph, %for.body7.preheader ]
%arrayidx9 = getelementptr inbounds [10010 x i32], ptr %a, i64 0, i64 %indvars.iv40
%18 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%mul = shl i32 %18, 2
%mul10 = mul i32 %mul, %.pre
%cmp11.not = icmp sge i32 %mul10, %add
%inc12 = zext i1 %cmp11.not to i32
%spec.select = add nuw nsw i32 %ans.036, %inc12
%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.end15, label %for.body7, !llvm.loop !14
for.end15: ; preds = %for.body7, %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.body7 ]
%ans.0.lcssa = phi i32 [ 0, %for.cond5.preheader ], [ 0, %for.cond5.preheader.thread ], [ %14, %middle.block ], [ %spec.select, %for.body7 ]
%cmp16.not = icmp slt i32 %ans.0.lcssa, %.pre47
%str.str.3 = select i1 %cmp16.not, ptr @str, ptr @str.3
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.str.3)
call void @llvm.lifetime.end.p0(i64 40040, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !12, !11}
|
#include <stdio.h>
int main(){
int n, m;
scanf("%d %d", &n, &m);
int a[n], sum=0;
for(int i=0; i<n; i++){
scanf("%d", &a[i]);
sum+=a[i];
}
double t=(double) sum/(4*m);
int count=0;
for(int i=0; i<n; i++)
if((double) a[i]>=t)count++;
if(count>=m)printf("Yes\n");
else printf("No\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118429/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118429/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%mul = shl nsw i32 %6, 2
%conv4 = sitofp i32 %mul to double
%div = fdiv double %5, %conv4
%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 ]
%count.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.036 = 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.036
%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 ]
%count.0.lcssa = phi i32 [ 0, %for.cond.cleanup ], [ 0, %for.cond.cleanup.thread ], [ %18, %middle.block ], [ %count.1, %for.body10 ]
%cmp20.not = icmp slt i32 %count.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 ]
%count.039 = phi i32 [ %count.1, %for.body10 ], [ %count.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
%count.1 = add nuw nsw i32 %count.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}
|
#pragma warning(disable:4996)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <float.h>
#pragma region 定義
typedef long long ll;
typedef unsigned long long ull;
#define _itoa(A,N) sprintf(A, "%d", N);
int i_dsort(const void* a, const void* b);
int i_asort(const void* a, const void* b);
int _gcd(int a, int b);
int _swp(int* a, int* b);
int _cknum(char* a, int n);
int _atoi(char* s, int len);
int s_asort(const void* a, const void* b);
int s_dsort(const void* a, const void* b);
//昇順
int s_asort(const void* a, const void* b) {
return(strcmp((char*)a, (char*)b));
}
int s_dsort(const void* a, const void* b) {
return(strcmp((char*)b, (char*)a));
}
int i_dsort(const void* a, const void* b) {
return(*(int*)b - *(int*)a);
}
int i_asort(const void* a, const void* b) {
return(*(int*)a - *(int*)b);
}
int _gcd(int a, int b) {
int r, tmp;
if (a < b) { tmp = a; a = b; b = tmp; }
r = a % b;
while (r) {
if (!r) break;
a = b; b = r;
r = a % b;
}
return(b);
}
// puts("Yes\n") puts("No\n")
// scanf("%d.%d") 浮動小数点入力を整数2つで得る
//#define pai 3.1415926535
//#define _USE_MATH_DEFINES でM_PIが使える
#define deg_rad(X) (X*(M_PI/180))
int _swp(int* a, int* b)
{
int tmp;
tmp = *b; *b = *a; *a = tmp;
return 0;
}
#define _abs(x) ((x)>0?(x):-(x))
#define _min(x,y) ((x)<(y)?(x):(y))
#define _max(x,y) ((x)<(y)?(y):(x))
int _cknum(char* a, int n) {
int i;
char t = '0';
for (i = 0; i < n; i++) {
if (a[i] < '0' || a[i]>'9') return 1;
}
return 0;
}
int _atoi(char* s, int len) {
char tmp[20];
memcpy(tmp, s, len);
tmp[len] = 0x00;
return (atoi(tmp));
}
//素因数分解 pf素数が入る pc 素数の数
ll _pfact(ll a);
static ll pf[100000000];
static ll pc;
ll _pfact(ll a) {
long i, r;
if (a % 2 == 0) {
pf[pc] = 2; pc++;
return(_pfact(a / 2));
}
r = sqrt(a);
for (i = 3; i <= r; i += 2) {
if (a % i == 0) {
pf[pc] = i; pc++;
return(_pfact(a / i));
}
}
if (a != 1) {
pf[pc] = a; pc++;
}
return 0;
}
#pragma endregion
//ABC 161 -B
int main(void) {
int i,n,m,a[101];
float t = 0.0;
scanf("%d %d", &n,&m);
for (i = 0; i < n; i++) {
scanf("%d", &a[i]);
t += (float)a[i];
}
t = t / ((float)m*4);
int c = 0;
for(i=0;i<n;i++)
if (a[i] >= t) c++;
if(c>=m) printf("Yes\n");
else printf("No\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118472/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118472/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@pc = internal unnamed_addr global i64 0, align 8
@.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: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @s_asort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %a, ptr noundef nonnull dereferenceable(1) %b) #16
ret i32 %call
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #1
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @s_dsort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #0 {
entry:
%call = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %b, ptr noundef nonnull dereferenceable(1) %a) #16
ret i32 %call
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @i_dsort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local i32 @i_asort(ptr nocapture noundef readonly %a, ptr nocapture noundef readonly %b) local_unnamed_addr #2 {
entry:
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%sub = sub nsw i32 %0, %1
ret i32 %sub
}
; Function Attrs: nofree nosync nounwind memory(none) uwtable
define dso_local i32 @_gcd(i32 noundef %a, i32 noundef %b) local_unnamed_addr #3 {
entry:
%spec.select = tail call i32 @llvm.smin.i32(i32 %a, i32 %b)
%spec.select15 = tail call i32 @llvm.smax.i32(i32 %a, i32 %b)
%rem = srem i32 %spec.select15, %spec.select
%tobool.not16 = icmp eq i32 %rem, 0
br i1 %tobool.not16, label %while.end, label %if.end3
if.end3: ; preds = %entry, %if.end3
%r.018 = phi i32 [ %rem4, %if.end3 ], [ %rem, %entry ]
%b.addr.117 = phi i32 [ %r.018, %if.end3 ], [ %spec.select, %entry ]
%rem4 = srem i32 %b.addr.117, %r.018
%tobool.not = icmp eq i32 %rem4, 0
br i1 %tobool.not, label %while.end, label %if.end3, !llvm.loop !9
while.end: ; preds = %if.end3, %entry
%b.addr.1.lcssa = phi i32 [ %spec.select, %entry ], [ %r.018, %if.end3 ]
ret i32 %b.addr.1.lcssa
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #4
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local i32 @_swp(ptr nocapture noundef %a, ptr nocapture noundef %b) local_unnamed_addr #5 {
entry:
%0 = load i32, ptr %b, align 4, !tbaa !5
%1 = load i32, ptr %a, align 4, !tbaa !5
store i32 %1, ptr %b, align 4, !tbaa !5
store i32 %0, ptr %a, align 4, !tbaa !5
ret i32 0
}
; Function Attrs: nofree norecurse nosync nounwind memory(argmem: read) uwtable
define dso_local i32 @_cknum(ptr nocapture noundef readonly %a, i32 noundef %n) local_unnamed_addr #6 {
entry:
%cmp13 = icmp sgt i32 %n, 0
br i1 %cmp13, label %for.body.preheader, label %cleanup
for.body.preheader: ; preds = %entry
%wide.trip.count = zext i32 %n to i64
br label %for.body
for.cond: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %cleanup, label %for.body, !llvm.loop !11
for.body: ; preds = %for.body.preheader, %for.cond
%indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.cond ]
%arrayidx = getelementptr inbounds i8, ptr %a, i64 %indvars.iv
%0 = load i8, ptr %arrayidx, align 1, !tbaa !12
%1 = add i8 %0, -58
%or.cond = icmp ult i8 %1, -10
br i1 %or.cond, label %cleanup, label %for.cond
cleanup: ; preds = %for.body, %for.cond, %entry
%retval.0 = phi i32 [ 0, %entry ], [ 0, %for.cond ], [ 1, %for.body ]
ret i32 %retval.0
}
; Function Attrs: mustprogress nofree nounwind willreturn uwtable
define dso_local i32 @_atoi(ptr nocapture noundef readonly %s, i32 noundef %len) local_unnamed_addr #7 {
entry:
%tmp = alloca [20 x i8], align 16
call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %tmp) #17
%conv = sext i32 %len to i64
call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %tmp, ptr align 1 %s, i64 %conv, i1 false)
%arrayidx = getelementptr inbounds [20 x i8], ptr %tmp, i64 0, i64 %conv
store i8 0, ptr %arrayidx, align 1, !tbaa !12
%call.i = call i64 @strtol(ptr nocapture noundef nonnull %tmp, ptr noundef null, i32 noundef 10) #17
%conv.i = trunc i64 %call.i to i32
call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %tmp) #17
ret i32 %conv.i
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8
; Function Attrs: nofree nounwind memory(readwrite, argmem: write, inaccessiblemem: write) uwtable
define dso_local i64 @_pfact(i64 noundef %a) local_unnamed_addr #9 {
entry:
br label %tailrecurse
tailrecurse: ; preds = %tailrecurse.backedge, %entry
%a.tr = phi i64 [ %a, %entry ], [ %div, %tailrecurse.backedge ]
%0 = and i64 %a.tr, 1
%cmp = icmp eq i64 %0, 0
br i1 %cmp, label %tailrecurse.backedge, label %if.end
tailrecurse.backedge: ; preds = %for.body, %tailrecurse
%.sink = phi i64 [ 2, %tailrecurse ], [ %i.035, %for.body ]
%1 = load i64, ptr @pc, align 8, !tbaa !13
%inc = add nsw i64 %1, 1
store i64 %inc, ptr @pc, align 8, !tbaa !13
%div = sdiv i64 %a.tr, %.sink
br label %tailrecurse
if.end: ; preds = %tailrecurse
%conv = sitofp i64 %a.tr to double
%call1 = tail call double @sqrt(double noundef %conv) #17
%conv2 = fptosi double %call1 to i64
%cmp3.not34 = icmp slt i64 %conv2, 3
br i1 %cmp3.not34, label %for.end, label %for.body
for.body: ; preds = %if.end, %for.inc
%i.035 = phi i64 [ %add, %for.inc ], [ 3, %if.end ]
%rem5 = srem i64 %a.tr, %i.035
%cmp6 = icmp eq i64 %rem5, 0
br i1 %cmp6, label %tailrecurse.backedge, label %for.inc
for.inc: ; preds = %for.body
%add = add nuw nsw i64 %i.035, 2
%cmp3.not = icmp sgt i64 %add, %conv2
br i1 %cmp3.not, label %for.end, label %for.body, !llvm.loop !15
for.end: ; preds = %if.end, %for.inc
%cmp14.not = icmp eq i64 %a.tr, 1
br i1 %cmp14.not, label %cleanup, label %if.then16
if.then16: ; preds = %for.end
%2 = load i64, ptr @pc, align 8, !tbaa !13
%inc18 = add nsw i64 %2, 1
store i64 %inc18, ptr @pc, align 8, !tbaa !13
br label %cleanup
cleanup: ; preds = %for.end, %if.then16
ret i64 0
}
; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #10
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #11 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [101 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #17
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #17
call void @llvm.lifetime.start.p0(i64 404, ptr nonnull %a) #17
%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.end17
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%t.036 = phi float [ %add, %for.body ], [ 0.000000e+00, %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)
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%conv = sitofp i32 %2 to float
%add = fadd float %t.036, %conv
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%3 = load i32, ptr %n, align 4, !tbaa !5
%4 = sext i32 %3 to i64
%cmp = icmp slt i64 %indvars.iv.next, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !16
for.end: ; preds = %for.body
%5 = load i32, ptr %m, align 4, !tbaa !5
%conv4 = sitofp i32 %5 to float
%mul = fmul float %conv4, 4.000000e+00
%div = fdiv float %add, %mul
%cmp638 = icmp sgt i32 %3, 0
br i1 %cmp638, label %for.body8.preheader, label %for.end17
for.body8.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.body8.preheader55, label %vector.ph
vector.ph: ; preds = %for.body8.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
%broadcast.splatinsert = insertelement <4 x float> poison, float %div, i64 0
%broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> 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.phi53 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%6 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load54 = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = sitofp <4 x i32> %wide.load to <4 x float>
%9 = sitofp <4 x i32> %wide.load54 to <4 x float>
%10 = fcmp ole <4 x float> %broadcast.splat, %8
%11 = fcmp ole <4 x float> %broadcast.splat, %9
%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.phi53, %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 !17
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.end17, label %for.body8.preheader55
for.body8.preheader55: ; preds = %for.body8.preheader, %middle.block
%indvars.iv44.ph = phi i64 [ 0, %for.body8.preheader ], [ %n.vec, %middle.block ]
%c.040.ph = phi i32 [ 0, %for.body8.preheader ], [ %17, %middle.block ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader55, %for.body8
%indvars.iv44 = phi i64 [ %indvars.iv.next45, %for.body8 ], [ %indvars.iv44.ph, %for.body8.preheader55 ]
%c.040 = phi i32 [ %c.1, %for.body8 ], [ %c.040.ph, %for.body8.preheader55 ]
%arrayidx10 = getelementptr inbounds [101 x i32], ptr %a, i64 0, i64 %indvars.iv44
%18 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%conv11 = sitofp i32 %18 to float
%cmp12 = fcmp ole float %div, %conv11
%inc14 = zext i1 %cmp12 to i32
%c.1 = add nuw nsw i32 %c.040, %inc14
%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.end17, label %for.body8, !llvm.loop !20
for.end17: ; preds = %for.body8, %middle.block, %for.end.thread, %for.end
%19 = phi i32 [ %5, %for.end ], [ %1, %for.end.thread ], [ %5, %middle.block ], [ %5, %for.body8 ]
%c.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %for.end.thread ], [ %17, %middle.block ], [ %c.1, %for.body8 ]
%cmp18.not = icmp slt i32 %c.0.lcssa, %19
%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.lifetime.end.p0(i64 404, ptr nonnull %a) #17
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #17
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #17
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #12
; Function Attrs: mustprogress nofree nounwind willreturn
declare i64 @strtol(ptr noundef readonly, ptr nocapture noundef, i32 noundef) local_unnamed_addr #13
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #14
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #15
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #15
attributes #0 = { mustprogress nofree nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nosync nounwind memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nofree norecurse nosync nounwind memory(argmem: read) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { mustprogress nofree nounwind willreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { nofree nounwind memory(readwrite, argmem: write, inaccessiblemem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #10 = { 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 #11 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #12 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #13 = { mustprogress nofree nounwind willreturn "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #14 = { nofree nounwind }
attributes #15 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #16 = { nounwind willreturn memory(read) }
attributes #17 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!7, !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !10, !19, !18}
|
#include<stdio.h>
int main(void)
{
int n,m,a[100],x,i,b,c;
double y;
b=0; c=0;
scanf("%d%d",&n,&m);
x=4*m;
for(i=0; i<n; i++){
scanf("%d",&a[i]);
b+=a[i];
}
y=(double)b/(double)x;
for(i=0; i<n; i++){
if(a[i]>=y)
c=c+1;
}
if(c>=m)
printf("Yes\n");
else
printf("No\n");
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118515/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118515/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%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 4, ptr nonnull %m) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %a) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%mul = shl nsw i32 %0, 2
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp33 = icmp sgt i32 %1, 0
br i1 %cmp33, label %for.body, label %for.end17
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%b.034 = 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, %b.034
%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
%conv4 = sitofp i32 %mul to double
%div = fdiv double %5, %conv4
%cmp637 = icmp sgt i32 %3, 0
br i1 %cmp637, label %for.body8.preheader, label %for.end17
for.body8.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.body8.preheader53, label %vector.ph
vector.ph: ; preds = %for.body8.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 ], [ %14, %vector.body ]
%vec.phi51 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %15, %vector.body ]
%6 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %6, align 16, !tbaa !5
%7 = getelementptr inbounds i32, ptr %6, i64 4
%wide.load52 = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = sitofp <4 x i32> %wide.load to <4 x double>
%9 = sitofp <4 x i32> %wide.load52 to <4 x double>
%10 = fcmp ole <4 x double> %broadcast.splat, %8
%11 = fcmp ole <4 x double> %broadcast.splat, %9
%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.phi51, %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 !11
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.end17, label %for.body8.preheader53
for.body8.preheader53: ; preds = %for.body8.preheader, %middle.block
%indvars.iv43.ph = phi i64 [ 0, %for.body8.preheader ], [ %n.vec, %middle.block ]
%c.038.ph = phi i32 [ 0, %for.body8.preheader ], [ %17, %middle.block ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader53, %for.body8
%indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body8 ], [ %indvars.iv43.ph, %for.body8.preheader53 ]
%c.038 = phi i32 [ %c.1, %for.body8 ], [ %c.038.ph, %for.body8.preheader53 ]
%arrayidx10 = getelementptr inbounds [100 x i32], ptr %a, i64 0, i64 %indvars.iv43
%18 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%conv11 = sitofp i32 %18 to double
%cmp12 = fcmp ole double %div, %conv11
%add14 = zext i1 %cmp12 to i32
%c.1 = add nuw nsw i32 %c.038, %add14
%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.body8, !llvm.loop !14
for.end17: ; preds = %for.body8, %middle.block, %entry, %for.end
%c.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %entry ], [ %17, %middle.block ], [ %c.1, %for.body8 ]
%19 = load i32, ptr %m, align 4, !tbaa !5
%cmp18.not = icmp slt i32 %c.0.lcssa, %19
%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.lifetime.end.p0(i64 400, ptr nonnull %a) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree 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 = 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>
#include <stdlib.h>
int i,n,m,a[101],sum,c;
double x;
int main()
{
scanf("%d %d",&n ,&m);
for(i=1;i<=n;i++){
scanf("%d",& a[i]);
sum=sum+a[i];
}
x=sum/(4.0*m);
for(i=1;i<=n;i++){
if(a[i]>=x){
c++;
}
}
if(c>=m)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118559/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118559/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@n = dso_local global i32 0, align 4
@m = dso_local global i32 0, align 4
@i = dso_local local_unnamed_addr global i32 0, align 4
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@a = dso_local global [101 x i32] zeroinitializer, align 16
@sum = dso_local local_unnamed_addr global i32 0, align 4
@x = dso_local local_unnamed_addr global double 0.000000e+00, align 8
@c = dso_local local_unnamed_addr global i32 0, align 4
@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:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
store i32 1, ptr @i, align 4, !tbaa !5
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not27 = icmp slt i32 %0, 1
br i1 %cmp.not27, label %entry.for.end_crit_edge, label %for.body
entry.for.end_crit_edge: ; preds = %entry
%.pre = load i32, ptr @sum, align 4, !tbaa !5
br label %for.end
for.body: ; preds = %entry, %for.body
%storemerge28 = phi i32 [ %inc, %for.body ], [ 1, %entry ]
%idxprom = sext i32 %storemerge28 to i64
%arrayidx = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %idxprom
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr @sum, align 4, !tbaa !5
%2 = load i32, ptr @i, align 4, !tbaa !5
%idxprom2 = sext i32 %2 to i64
%arrayidx3 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %idxprom2
%3 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%add = add nsw i32 %3, %1
store i32 %add, ptr @sum, align 4, !tbaa !5
%inc = add nsw i32 %2, 1
store i32 %inc, ptr @i, align 4, !tbaa !5
%4 = load i32, ptr @n, align 4, !tbaa !5
%cmp.not.not = icmp slt i32 %2, %4
br i1 %cmp.not.not, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry.for.end_crit_edge
%5 = phi i32 [ %.pre, %entry.for.end_crit_edge ], [ %add, %for.body ]
%.lcssa = phi i32 [ %0, %entry.for.end_crit_edge ], [ %4, %for.body ]
%conv = sitofp i32 %5 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 %conv, %mul
store double %div, ptr @x, align 8, !tbaa !11
%c.promoted = load i32, ptr @c, align 4, !tbaa !5
%cmp6.not31 = icmp slt i32 %.lcssa, 1
br i1 %cmp6.not31, label %for.end17, label %for.body8.preheader
for.body8.preheader: ; preds = %for.end
%7 = add i32 %.lcssa, 1
%wide.trip.count = zext i32 %7 to i64
%8 = add nsw i64 %wide.trip.count, -1
%xtraiter = and i64 %8, 1
%9 = icmp eq i32 %7, 2
br i1 %9, label %for.end17.loopexit.unr-lcssa, label %for.body8.preheader.new
for.body8.preheader.new: ; preds = %for.body8.preheader
%unroll_iter = and i64 %8, -2
br label %for.body8
for.body8: ; preds = %for.inc15.1, %for.body8.preheader.new
%indvars.iv = phi i64 [ 1, %for.body8.preheader.new ], [ %indvars.iv.next.1, %for.inc15.1 ]
%inc143032 = phi i32 [ %c.promoted, %for.body8.preheader.new ], [ %inc1429.1, %for.inc15.1 ]
%niter = phi i64 [ 0, %for.body8.preheader.new ], [ %niter.next.1, %for.inc15.1 ]
%arrayidx10 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv
%10 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%conv11 = sitofp i32 %10 to double
%cmp12 = fcmp ugt double %div, %conv11
br i1 %cmp12, label %for.inc15, label %if.then
if.then: ; preds = %for.body8
%inc14 = add nsw i32 %inc143032, 1
store i32 %inc14, ptr @c, align 4, !tbaa !5
br label %for.inc15
for.inc15: ; preds = %for.body8, %if.then
%inc1429 = phi i32 [ %inc143032, %for.body8 ], [ %inc14, %if.then ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%arrayidx10.1 = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv.next
%11 = load i32, ptr %arrayidx10.1, align 4, !tbaa !5
%conv11.1 = sitofp i32 %11 to double
%cmp12.1 = fcmp ugt double %div, %conv11.1
br i1 %cmp12.1, label %for.inc15.1, label %if.then.1
if.then.1: ; preds = %for.inc15
%inc14.1 = add nsw i32 %inc1429, 1
store i32 %inc14.1, ptr @c, align 4, !tbaa !5
br label %for.inc15.1
for.inc15.1: ; preds = %if.then.1, %for.inc15
%inc1429.1 = phi i32 [ %inc1429, %for.inc15 ], [ %inc14.1, %if.then.1 ]
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end17.loopexit.unr-lcssa, label %for.body8, !llvm.loop !13
for.end17.loopexit.unr-lcssa: ; preds = %for.inc15.1, %for.body8.preheader
%inc1429.lcssa.ph = phi i32 [ undef, %for.body8.preheader ], [ %inc1429.1, %for.inc15.1 ]
%indvars.iv.unr = phi i64 [ 1, %for.body8.preheader ], [ %indvars.iv.next.1, %for.inc15.1 ]
%inc143032.unr = phi i32 [ %c.promoted, %for.body8.preheader ], [ %inc1429.1, %for.inc15.1 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end17.loopexit, label %for.body8.epil
for.body8.epil: ; preds = %for.end17.loopexit.unr-lcssa
%arrayidx10.epil = getelementptr inbounds [101 x i32], ptr @a, i64 0, i64 %indvars.iv.unr
%12 = load i32, ptr %arrayidx10.epil, align 4, !tbaa !5
%conv11.epil = sitofp i32 %12 to double
%cmp12.epil = fcmp ugt double %div, %conv11.epil
br i1 %cmp12.epil, label %for.end17.loopexit, label %if.then.epil
if.then.epil: ; preds = %for.body8.epil
%inc14.epil = add nsw i32 %inc143032.unr, 1
store i32 %inc14.epil, ptr @c, align 4, !tbaa !5
br label %for.end17.loopexit
for.end17.loopexit: ; preds = %for.body8.epil, %if.then.epil, %for.end17.loopexit.unr-lcssa
%inc1429.lcssa = phi i32 [ %inc1429.lcssa.ph, %for.end17.loopexit.unr-lcssa ], [ %inc143032.unr, %for.body8.epil ], [ %inc14.epil, %if.then.epil ]
%13 = add i32 %.lcssa, 1
br label %for.end17
for.end17: ; preds = %for.end17.loopexit, %for.end
%14 = phi i32 [ %c.promoted, %for.end ], [ %inc1429.lcssa, %for.end17.loopexit ]
%storemerge25.lcssa = phi i32 [ 1, %for.end ], [ %13, %for.end17.loopexit ]
store i32 %storemerge25.lcssa, ptr @i, align 4, !tbaa !5
%cmp18.not = icmp slt i32 %14, %6
%str.str.4 = select i1 %cmp18.not, ptr @str, ptr @str.4
%puts = tail call i32 @puts(ptr nonnull dereferenceable(1) %str.str.4)
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main() {
int n, m;
int sum = 0;
int a[255];
int cnt = 0;
scanf("%d %d", &n, &m);
for (int i = 0; i < n; i++) {
scanf("%d", &a[i]);
}
for (int i = 0; i < n; i++) {
int max = -1;
int pos, tmp;
for (int j = i; j < n; j++) {
if (max < a[j]) {
max = a[j];
pos = j;
}
}
tmp = a[i];
a[i] = max;
a[pos] = tmp;
sum += a[i];
}
for (int i = 0; i < m; i++) {
if (a[i] < (double)sum / (4*m)) {
break;
}
cnt++;
}
if (cnt < m) {
printf("No");
} else {
printf("Yes");
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118601/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118601/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [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
%a = alloca [255 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 1020, 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
%cmp77 = icmp sgt i32 %0, 0
br i1 %cmp77, label %for.body, label %for.cond31.preheader
for.cond3.preheader: ; preds = %for.body
%cmp482 = icmp sgt i32 %2, 0
br i1 %cmp482, label %for.cond7.preheader.preheader, label %for.cond31.preheader
for.cond7.preheader.preheader: ; preds = %for.cond3.preheader
%1 = zext i32 %2 to i64
%wide.trip.count = zext i32 %2 to i64
br label %for.cond7.preheader
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [255 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
%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.cond3.preheader, !llvm.loop !9
for.cond7.preheader: ; preds = %for.cond7.preheader.preheader, %for.cond.cleanup9
%indvars.iv95 = phi i64 [ 0, %for.cond7.preheader.preheader ], [ %indvars.iv.next96, %for.cond.cleanup9 ]
%pos.085 = phi i32 [ undef, %for.cond7.preheader.preheader ], [ %spec.select75, %for.cond.cleanup9 ]
%sum.083 = phi i32 [ 0, %for.cond7.preheader.preheader ], [ %add, %for.cond.cleanup9 ]
br label %for.body10
for.cond31.preheader.loopexit: ; preds = %for.cond.cleanup9
%4 = sitofp i32 %add to double
br label %for.cond31.preheader
for.cond31.preheader: ; preds = %entry, %for.cond31.preheader.loopexit, %for.cond3.preheader
%sum.0.lcssa = phi double [ 0.000000e+00, %for.cond3.preheader ], [ %4, %for.cond31.preheader.loopexit ], [ 0.000000e+00, %entry ]
%5 = load i32, ptr %m, align 4, !tbaa !5
%cmp3287 = icmp sgt i32 %5, 0
br i1 %cmp3287, label %for.body34.lr.ph, label %cleanup
for.body34.lr.ph: ; preds = %for.cond31.preheader
%mul = shl nsw i32 %5, 2
%conv38 = sitofp i32 %mul to double
%div = fdiv double %sum.0.lcssa, %conv38
%wide.trip.count106 = zext i32 %5 to i64
br label %for.body34
for.cond.cleanup9: ; preds = %for.body10
%arrayidx20 = getelementptr inbounds [255 x i32], ptr %a, i64 0, i64 %indvars.iv95
%6 = load i32, ptr %arrayidx20, align 4, !tbaa !5
store i32 %spec.select, ptr %arrayidx20, align 4, !tbaa !5
%idxprom23 = sext i32 %spec.select75 to i64
%arrayidx24 = getelementptr inbounds [255 x i32], ptr %a, i64 0, i64 %idxprom23
store i32 %6, ptr %arrayidx24, align 4, !tbaa !5
%7 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%add = add nsw i32 %7, %sum.083
%indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 1
%exitcond.not = icmp eq i64 %indvars.iv.next96, %wide.trip.count
br i1 %exitcond.not, label %for.cond31.preheader.loopexit, label %for.cond7.preheader, !llvm.loop !11
for.body10: ; preds = %for.cond7.preheader, %for.body10
%indvars.iv97 = phi i64 [ %indvars.iv95, %for.cond7.preheader ], [ %indvars.iv.next98, %for.body10 ]
%pos.180 = phi i32 [ %pos.085, %for.cond7.preheader ], [ %spec.select75, %for.body10 ]
%max.079 = phi i32 [ -1, %for.cond7.preheader ], [ %spec.select, %for.body10 ]
%arrayidx12 = getelementptr inbounds [255 x i32], ptr %a, i64 0, i64 %indvars.iv97
%8 = load i32, ptr %arrayidx12, align 4, !tbaa !5
%cmp13 = icmp slt i32 %max.079, %8
%spec.select = call i32 @llvm.smax.i32(i32 %max.079, i32 %8)
%9 = trunc i64 %indvars.iv97 to i32
%spec.select75 = select i1 %cmp13, i32 %9, i32 %pos.180
%indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
%cmp8 = icmp ult i64 %indvars.iv.next98, %1
br i1 %cmp8, label %for.body10, label %for.cond.cleanup9, !llvm.loop !12
for.body34: ; preds = %for.body34.lr.ph, %if.end42
%indvars.iv101 = phi i64 [ 0, %for.body34.lr.ph ], [ %indvars.iv.next102, %if.end42 ]
%arrayidx36 = getelementptr inbounds [255 x i32], ptr %a, i64 0, i64 %indvars.iv101
%10 = load i32, ptr %arrayidx36, align 4, !tbaa !5
%conv = sitofp i32 %10 to double
%cmp39 = fcmp ogt double %div, %conv
br i1 %cmp39, label %cleanup.loopexit, label %if.end42
if.end42: ; preds = %for.body34
%indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
%exitcond107.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count106
br i1 %exitcond107.not, label %if.else, label %for.body34, !llvm.loop !13
cleanup.loopexit: ; preds = %for.body34
%indvars105.le = trunc i64 %indvars.iv101 to i32
br label %cleanup
cleanup: ; preds = %cleanup.loopexit, %for.cond31.preheader
%cnt.0.lcssa = phi i32 [ 0, %for.cond31.preheader ], [ %indvars105.le, %cleanup.loopexit ]
%cmp47 = icmp slt i32 %cnt.0.lcssa, %5
br i1 %cmp47, label %if.end52, label %if.else
if.else: ; preds = %if.end42, %cleanup
br label %if.end52
if.end52: ; preds = %cleanup, %if.else
%.str.3.sink = phi ptr [ @.str.3, %if.else ], [ @.str.2, %cleanup ]
%call51 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3.sink)
call void @llvm.lifetime.end.p0(i64 1020, 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include <stdio.h>
int main(void)
{
int N, M;
int A[100];
int i;
int totalPoint = 0;
double passPoint;
int count = 0;
// input
scanf("%d %d", &N, &M);
for (i = 0; i < N; i++) {
scanf("%d", &A[i]);
totalPoint += A[i];
}
// printf("totalpoint: %d\n", totalPoint);
// 合格点
passPoint = (double)totalPoint / (double)(4 * M);
// printf("passPoint: %f\n", passPoint);
for (i = 0; i < N; i++) {
if ((double)(A[i]) >= passPoint) {
count += 1;
}
}
// output
if(count >= M) {
printf("Yes\n");
} else {
printf("No\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118645/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118645/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%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 4, ptr nonnull %M) #5
call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %A) #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
%cmp33 = icmp sgt i32 %0, 0
br i1 %cmp33, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%1 = load i32, ptr %M, align 4, !tbaa !5
br label %for.end17
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%totalPoint.034 = 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, %totalPoint.034
%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 = load i32, ptr %M, align 4, !tbaa !5
%mul = shl nsw i32 %6, 2
%conv4 = sitofp i32 %mul to double
%div = fdiv double %5, %conv4
%cmp637 = icmp sgt i32 %3, 0
br i1 %cmp637, label %for.body8.preheader, label %for.end17
for.body8.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.body8.preheader54, label %vector.ph
vector.ph: ; preds = %for.body8.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.phi52 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %16, %vector.body ]
%7 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %index
%wide.load = load <4 x i32>, ptr %7, align 16, !tbaa !5
%8 = getelementptr inbounds i32, ptr %7, i64 4
%wide.load53 = 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.load53 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.phi52, %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 !11
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.end17, label %for.body8.preheader54
for.body8.preheader54: ; preds = %for.body8.preheader, %middle.block
%indvars.iv43.ph = phi i64 [ 0, %for.body8.preheader ], [ %n.vec, %middle.block ]
%count.039.ph = phi i32 [ 0, %for.body8.preheader ], [ %18, %middle.block ]
br label %for.body8
for.body8: ; preds = %for.body8.preheader54, %for.body8
%indvars.iv43 = phi i64 [ %indvars.iv.next44, %for.body8 ], [ %indvars.iv43.ph, %for.body8.preheader54 ]
%count.039 = phi i32 [ %count.1, %for.body8 ], [ %count.039.ph, %for.body8.preheader54 ]
%arrayidx10 = getelementptr inbounds [100 x i32], ptr %A, i64 0, i64 %indvars.iv43
%19 = load i32, ptr %arrayidx10, align 4, !tbaa !5
%conv11 = sitofp i32 %19 to double
%cmp12 = fcmp ole double %div, %conv11
%add14 = zext i1 %cmp12 to i32
%count.1 = add nuw nsw i32 %count.039, %add14
%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.body8, !llvm.loop !14
for.end17: ; preds = %for.body8, %middle.block, %for.end.thread, %for.end
%20 = phi i32 [ %6, %for.end ], [ %1, %for.end.thread ], [ %6, %middle.block ], [ %6, %for.body8 ]
%count.0.lcssa = phi i32 [ 0, %for.end ], [ 0, %for.end.thread ], [ %18, %middle.block ], [ %count.1, %for.body8 ]
%cmp18.not = icmp slt i32 %count.0.lcssa, %20
%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.lifetime.end.p0(i64 400, ptr nonnull %A) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %M) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree 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 = 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>
#include<stdlib.h>
#include<string.h>
#include <assert.h>
int main(void){
int n,m;
int a[1001];
scanf("%d",&n);
scanf("%d",&m);
for(int i =0;i<n;i++){
scanf("%d",&a[i]);
}
int num = 0;
for(int j =0;j<n;j++){
num +=a[j];
}
int tmp = 0;
for (int i=0; i<n; ++i) {
for (int j=i+1; j<n; ++j) {
if (a[i] < a[j]) {
tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
}
}
int m1 = num/(4*m);
int m2 = num%(4*m);
if(m2 !=0){
m1 = m1+1;
}
if(m1 > a[m-1]){
puts("No");
}
else{
puts("Yes");
}
/*
printf("%d %d %d %f %d\n",n,m,num,m1,a[m-1]);
for(int i = 0;i<n;i++){
printf("%d\n",a[i]);
}
*/
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118696/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118696/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"No\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"Yes\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [1001 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 4004, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp71 = icmp sgt i32 %0, 0
br i1 %cmp71, label %for.body, label %for.cond.cleanup15
for.cond3.preheader: ; preds = %for.body
%cmp473 = icmp sgt i32 %7, 0
br i1 %cmp473, label %for.body6.preheader, label %for.cond.cleanup15
for.body6.preheader: ; preds = %for.cond3.preheader
%wide.trip.count = zext i32 %7 to i64
%min.iters.check = icmp ult i32 %7, 8
br i1 %min.iters.check, label %for.body6.preheader108, label %vector.ph
vector.ph: ; preds = %for.body6.preheader
%n.vec = and i64 %wide.trip.count, 4294967288
br label %vector.body
vector.body: ; preds = %vector.body, %vector.ph
%index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
%vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %3, %vector.body ]
%vec.phi106 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %4, %vector.body ]
%1 = getelementptr inbounds [1001 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.load107 = load <4 x i32>, ptr %2, align 16, !tbaa !5
%3 = add <4 x i32> %wide.load, %vec.phi
%4 = add <4 x i32> %wide.load107, %vec.phi106
%index.next = add nuw i64 %index, 8
%5 = icmp eq i64 %index.next, %n.vec
br i1 %5, label %middle.block, label %vector.body, !llvm.loop !9
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %4, %3
%6 = 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.cond13.preheader, label %for.body6.preheader108
for.body6.preheader108: ; preds = %for.body6.preheader, %middle.block
%indvars.iv83.ph = phi i64 [ 0, %for.body6.preheader ], [ %n.vec, %middle.block ]
%num.074.ph = phi i32 [ 0, %for.body6.preheader ], [ %6, %middle.block ]
br label %for.body6
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.cond3.preheader, !llvm.loop !13
for.cond13.preheader: ; preds = %for.body6, %middle.block
%add.lcssa = phi i32 [ %6, %middle.block ], [ %add, %for.body6 ]
br i1 %cmp473, label %for.body16.preheader, label %for.cond.cleanup15
for.body16.preheader: ; preds = %for.cond13.preheader
%9 = zext i32 %7 to i64
%wide.trip.count96 = zext i32 %7 to i64
br label %for.body16
for.body6: ; preds = %for.body6.preheader108, %for.body6
%indvars.iv83 = phi i64 [ %indvars.iv.next84, %for.body6 ], [ %indvars.iv83.ph, %for.body6.preheader108 ]
%num.074 = phi i32 [ %add, %for.body6 ], [ %num.074.ph, %for.body6.preheader108 ]
%arrayidx8 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv83
%10 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%add = add nsw i32 %10, %num.074
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%exitcond.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count
br i1 %exitcond.not, label %for.cond13.preheader, label %for.body6, !llvm.loop !14
for.cond13.loopexit: ; preds = %for.inc36, %for.body16
%indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
%exitcond97.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count96
br i1 %exitcond97.not, label %for.cond.cleanup15, label %for.body16, !llvm.loop !15
for.cond.cleanup15: ; preds = %for.cond13.loopexit, %entry, %for.cond3.preheader, %for.cond13.preheader
%num.0.lcssa105 = phi i32 [ %add.lcssa, %for.cond13.preheader ], [ 0, %for.cond3.preheader ], [ 0, %entry ], [ %add.lcssa, %for.cond13.loopexit ]
%11 = load i32, ptr %m, align 4, !tbaa !5
%mul = shl nsw i32 %11, 2
%div = sdiv i32 %num.0.lcssa105, %mul
%rem = srem i32 %num.0.lcssa105, %mul
%cmp43.not = icmp ne i32 %rem, 0
%add45 = zext i1 %cmp43.not to i32
%spec.select = add nsw i32 %div, %add45
%sub = add nsw i32 %11, -1
%idxprom47 = sext i32 %sub to i64
%arrayidx48 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %idxprom47
%12 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%cmp49 = icmp sgt i32 %spec.select, %12
%.str.1..str.2 = select i1 %cmp49, ptr @.str.1, ptr @.str.2
%call52 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %.str.1..str.2)
call void @llvm.lifetime.end.p0(i64 4004, 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
for.body16: ; preds = %for.body16.preheader, %for.cond13.loopexit
%indvars.iv93 = phi i64 [ 0, %for.body16.preheader ], [ %indvars.iv.next94, %for.cond13.loopexit ]
%indvars.iv86 = phi i64 [ 1, %for.body16.preheader ], [ %indvars.iv.next87, %for.cond13.loopexit ]
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%cmp2077 = icmp ult i64 %indvars.iv.next94, %9
br i1 %cmp2077, label %for.body22.lr.ph, label %for.cond13.loopexit
for.body22.lr.ph: ; preds = %for.body16
%arrayidx24 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv93
br label %for.body22
for.body22: ; preds = %for.body22.lr.ph, %for.inc36
%indvars.iv88 = phi i64 [ %indvars.iv86, %for.body22.lr.ph ], [ %indvars.iv.next89, %for.inc36 ]
%13 = load i32, ptr %arrayidx24, align 4, !tbaa !5
%arrayidx26 = getelementptr inbounds [1001 x i32], ptr %a, i64 0, i64 %indvars.iv88
%14 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp27 = icmp slt i32 %13, %14
br i1 %cmp27, label %if.then, label %for.inc36
if.then: ; preds = %for.body22
store i32 %14, ptr %arrayidx24, align 4, !tbaa !5
store i32 %13, ptr %arrayidx26, align 4, !tbaa !5
br label %for.inc36
for.inc36: ; preds = %for.body22, %if.then
%indvars.iv.next89 = add nuw nsw i64 %indvars.iv88, 1
%exitcond92.not = icmp eq i64 %indvars.iv.next89, %wide.trip.count96
br i1 %exitcond92.not, label %for.cond13.loopexit, label %for.body22, !llvm.loop !16
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: 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
; 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}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include<stdio.h>
int main()
{
int n,m;
scanf("%d %d", &n, &m);
float item[n];
float total=0;
for(int i = 0; i<n;i++)
{
scanf("%f", &item[i]);
total += item[i];
}
float min = total/(4*m);
int sudah = 0;
for(int j = 0; j<n;j++)
{
if(sudah>=m) break;
if(item[j] >= min) sudah++;
}
if(sudah >= m) printf("Yes\n");
else printf("No\n");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118739/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118739/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"%f\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) #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
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca float, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp36 = icmp sgt i32 %3, 0
br i1 %cmp36, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%total.0.lcssa = phi float [ 0.000000e+00, %entry ], [ %add, %for.body ]
%.lcssa = phi i32 [ %3, %entry ], [ %7, %for.body ]
%4 = load i32, ptr %m, align 4
%mul = shl nsw i32 %4, 2
%conv = sitofp i32 %mul to float
%div = fdiv float %total.0.lcssa, %conv
%cmp540 = icmp sgt i32 %.lcssa, 0
%cmp9.not41 = icmp sgt i32 %4, 0
%or.cond42 = select i1 %cmp540, i1 %cmp9.not41, i1 false
br i1 %or.cond42, label %if.end.preheader, label %cleanup
if.end.preheader: ; preds = %for.cond.cleanup
%5 = zext i32 %.lcssa to i64
br label %if.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%total.038 = phi float [ %add, %for.body ], [ 0.000000e+00, %entry ]
%arrayidx = getelementptr inbounds float, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%6 = load float, ptr %arrayidx, align 4, !tbaa !9
%add = fadd float %total.038, %6
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%7 = load i32, ptr %n, align 4, !tbaa !5
%8 = sext i32 %7 to i64
%cmp = icmp slt i64 %indvars.iv.next, %8
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !11
if.end: ; preds = %if.end.preheader, %if.end
%indvars.iv49 = phi i64 [ 0, %if.end.preheader ], [ %indvars.iv.next50, %if.end ]
%sudah.043 = phi i32 [ 0, %if.end.preheader ], [ %sudah.1, %if.end ]
%arrayidx12 = getelementptr inbounds float, ptr %vla, i64 %indvars.iv49
%9 = load float, ptr %arrayidx12, align 4, !tbaa !9
%cmp13 = fcmp oge float %9, %div
%inc16 = zext i1 %cmp13 to i32
%sudah.1 = add nuw nsw i32 %sudah.043, %inc16
%indvars.iv.next50 = add nuw nsw i64 %indvars.iv49, 1
%cmp5 = icmp ult i64 %indvars.iv.next50, %5
%cmp9.not = icmp slt i32 %sudah.1, %4
%or.cond = select i1 %cmp5, i1 %cmp9.not, i1 false
br i1 %or.cond, label %if.end, label %cleanup, !llvm.loop !13
cleanup: ; preds = %if.end, %for.cond.cleanup
%cmp9.not.lcssa = phi i1 [ %cmp9.not41, %for.cond.cleanup ], [ %cmp9.not, %if.end ]
%str.str.4 = select i1 %cmp9.not.lcssa, 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) #5
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
|
#include<stdio.h>
int main()
{
long long int n,m,a[1005];
long long int i,number=0;
double average=0;
scanf("%lld %lld",&n,&m);
for(i=0;i<n;i++)
{
scanf("%lld",&a[i]);
average+=a[i];
}
average=average*1.0/(4*m);
for(i=0;i<n;i++)
{
if(a[i]>=average)
number++;
if(number>=m)
break;
}
if(number>=m)
printf("Yes");
else printf("No");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118782/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118782/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [10 x i8] c"%lld %lld\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"%lld\00", align 1
@.str.2 = private unnamed_addr constant [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 i64, align 8
%m = alloca i64, align 8
%a = alloca [1005 x i64], align 16
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %m) #3
call void @llvm.lifetime.start.p0(i64 8040, ptr nonnull %a) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i64, ptr %n, align 8, !tbaa !5
%cmp37 = icmp sgt i64 %0, 0
br i1 %cmp37, label %for.body, label %for.end.thread
for.end.thread: ; preds = %entry
%1 = load i64, ptr %m, align 8, !tbaa !5
br label %for.end20
for.body: ; preds = %entry, %for.body
%average.039 = phi double [ %add, %for.body ], [ 0.000000e+00, %entry ]
%i.038 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1005 x i64], ptr %a, i64 0, i64 %i.038
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%2 = load i64, ptr %arrayidx, align 8, !tbaa !5
%conv = sitofp i64 %2 to double
%add = fadd double %average.039, %conv
%inc = add nuw nsw i64 %i.038, 1
%3 = load i64, ptr %n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%4 = load i64, ptr %m, align 8, !tbaa !5
%mul3 = shl nsw i64 %4, 2
%conv4 = sitofp i64 %mul3 to double
%div = fdiv double %add, %conv4
%cmp641 = icmp sgt i64 %3, 0
br i1 %cmp641, label %for.body8, label %for.end20
for.body8: ; preds = %for.end, %for.body8
%number.043 = phi i64 [ %number.1, %for.body8 ], [ 0, %for.end ]
%i.142 = phi i64 [ %inc19, %for.body8 ], [ 0, %for.end ]
%arrayidx9 = getelementptr inbounds [1005 x i64], ptr %a, i64 0, i64 %i.142
%5 = load i64, ptr %arrayidx9, align 8, !tbaa !5
%conv10 = sitofp i64 %5 to double
%cmp11 = fcmp ole double %div, %conv10
%inc13 = zext i1 %cmp11 to i64
%number.1 = add nuw nsw i64 %number.043, %inc13
%cmp14.not = icmp sge i64 %number.1, %4
%inc19 = add nuw nsw i64 %i.142, 1
%exitcond.not = icmp eq i64 %inc19, %3
%or.cond = select i1 %cmp14.not, i1 true, i1 %exitcond.not
br i1 %or.cond, label %for.end20, label %for.body8, !llvm.loop !11
for.end20: ; preds = %for.body8, %for.end.thread, %for.end
%6 = phi i64 [ %4, %for.end ], [ %1, %for.end.thread ], [ %4, %for.body8 ]
%number.2 = phi i64 [ 0, %for.end ], [ 0, %for.end.thread ], [ %number.1, %for.body8 ]
%cmp21.not = icmp slt i64 %number.2, %6
%.str.3..str.2 = select i1 %cmp21.not, ptr @.str.3, ptr @.str.2
%call25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.3..str.2)
call void @llvm.lifetime.end.p0(i64 8040, ptr nonnull %a) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %m) #3
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
#include <string.h>
int main()
{
int x, y, z, i, j, k, a, b, c, n, m, t;
scanf("%d",&t);
while(t--)
{
scanf("%d",&n);
printf("%d\n",(n + 1) / 10);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11884/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11884/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
%t = 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 %t) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec3 = add nsw i32 %0, -1
store i32 %dec3, ptr %t, align 4, !tbaa !5
%tobool.not4 = icmp eq i32 %0, 0
br i1 %tobool.not4, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%1 = load i32, ptr %n, align 4, !tbaa !5
%add = add nsw i32 %1, 1
%div = sdiv i32 %add, 10
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %div)
%2 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !9
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
ll n;
ll a[200010];
int main(){
scanf("%lld",&n);
rep(i,0,n)scanf("%lld",a+i);
ll index=n-1;
rep(i,0,n){
printf("%lld ",a[index]);
if(index%2!=n%2)index-=2;
else index+=2;
if(index<0)index=n%2;
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118883/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118883/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
@n = dso_local global i64 0, align 8
@a = dso_local global [200010 x i64] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [6 x i8] c"%lld \00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
%0 = load i64, ptr @n, align 8, !tbaa !5
%cmp25 = icmp sgt i64 %0, 0
br i1 %cmp25, label %for.body, label %for.cond.cleanup5
for.cond.cleanup: ; preds = %for.body
%cmp427 = icmp sgt i64 %1, 0
br i1 %cmp427, label %for.body6.preheader, label %for.cond.cleanup5
for.body6.preheader: ; preds = %for.cond.cleanup
%sub = add nsw i64 %1, -1
br label %for.body6
for.body: ; preds = %entry, %for.body
%i.026 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i64, ptr @a, i64 %i.026
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr)
%inc = add nuw nsw i64 %i.026, 1
%1 = load i64, ptr @n, align 8, !tbaa !5
%cmp = icmp slt i64 %inc, %1
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !9
for.cond.cleanup5: ; preds = %for.body6, %entry, %for.cond.cleanup
ret i32 0
for.body6: ; preds = %for.body6.preheader, %for.body6
%i2.029 = phi i64 [ %inc16, %for.body6 ], [ 0, %for.body6.preheader ]
%index.028 = phi i64 [ %spec.select, %for.body6 ], [ %sub, %for.body6.preheader ]
%arrayidx = getelementptr inbounds [200010 x i64], ptr @a, i64 0, i64 %index.028
%2 = load i64, ptr %arrayidx, align 8, !tbaa !5
%call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %2)
%rem = srem i64 %index.028, 2
%3 = load i64, ptr @n, align 8, !tbaa !5
%rem8 = srem i64 %3, 2
%cmp9.not = icmp eq i64 %rem, %rem8
%index.1.v = select i1 %cmp9.not, i64 2, i64 -2
%index.1 = add nsw i64 %index.1.v, %index.028
%cmp11 = icmp slt i64 %index.1, 0
%spec.select = select i1 %cmp11, i64 %rem8, i64 %index.1
%inc16 = add nuw nsw i64 %i2.029, 1
%cmp4 = icmp slt i64 %inc16, %3
br i1 %cmp4, label %for.body6, label %for.cond.cleanup5, !llvm.loop !11
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int min(int a, int b)
{
return (b > a ? a : b);
}
int main(void)
{
int q1, b, c1, c2, q2;
int aChick, bChick, newChick;
int flag;
while (1){
scanf("%d", &q1);
if (q1 == 0){
break;
}
scanf("%d%d%d%d", &b, &c1, &c2, &q2);
aChick = min(q2, b / c1);
b -= aChick * c1;
bChick = b / c2;
b -= bChick * c2;
flag = 0;
while (aChick != 0){
if (aChick + bChick >= q1){
printf("%d %d\n", aChick, bChick);
flag = 1;
break;
}
aChick--;
b += c1;
bChick += b / c2;
newChick = b / c2;
b -= newChick * c2;
}
if (!flag){
printf("NA\n");
}
}
return (0);
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_118926/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_118926/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [9 x i8] c"%d%d%d%d\00", align 1
@.str.2 = private unnamed_addr constant [7 x i8] c"%d %d\0A\00", align 1
@str = private unnamed_addr constant [3 x i8] c"NA\00", align 1
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none) uwtable
define dso_local i32 @min(i32 noundef %a, i32 noundef %b) local_unnamed_addr #0 {
entry:
%cond = tail call i32 @llvm.smin.i32(i32 %b, i32 %a)
ret i32 %cond
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%q1 = alloca i32, align 4
%b = alloca i32, align 4
%c1 = alloca i32, align 4
%c2 = alloca i32, align 4
%q2 = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q1) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c1) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c2) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q2) #6
%call37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q1)
%0 = load i32, ptr %q1, align 4, !tbaa !5
%cmp38 = icmp eq i32 %0, 0
br i1 %cmp38, label %while.end22, label %if.end
if.end: ; preds = %entry, %if.end21
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %b, ptr noundef nonnull %c1, ptr noundef nonnull %c2, ptr noundef nonnull %q2)
%1 = load i32, ptr %q2, align 4, !tbaa !5
%2 = load i32, ptr %b, align 4, !tbaa !5
%3 = load i32, ptr %c1, align 4, !tbaa !5
%div = sdiv i32 %2, %3
%cond.i = call i32 @llvm.smin.i32(i32 %div, i32 %1)
%mul = mul nsw i32 %cond.i, %3
%sub = sub nsw i32 %2, %mul
%4 = load i32, ptr %c2, align 4, !tbaa !5
%div3 = sdiv i32 %sub, %4
%mul4 = mul nsw i32 %div3, %4
%sub5.recomposed = srem i32 %sub, %4
%cmp7.not33 = icmp eq i32 %cond.i, 0
br i1 %cmp7.not33, label %if.then19, label %while.body8.lr.ph
while.body8.lr.ph: ; preds = %if.end
%5 = load i32, ptr %q1, align 4, !tbaa !5
br label %while.body8
while.body8: ; preds = %while.body8.lr.ph, %if.end12
%aChick.036 = phi i32 [ %cond.i, %while.body8.lr.ph ], [ %dec, %if.end12 ]
%bChick.035 = phi i32 [ %div3, %while.body8.lr.ph ], [ %add15, %if.end12 ]
%storemerge34 = phi i32 [ %sub5.recomposed, %while.body8.lr.ph ], [ %sub18.recomposed, %if.end12 ]
%add = add nsw i32 %aChick.036, %bChick.035
%cmp9.not = icmp slt i32 %add, %5
br i1 %cmp9.not, label %if.end12, label %if.then10
if.then10: ; preds = %while.body8
store i32 %storemerge34, ptr %b, align 4, !tbaa !5
%call11 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %aChick.036, i32 noundef %bChick.035)
br label %if.end21
if.end12: ; preds = %while.body8
%dec = add nsw i32 %aChick.036, -1
%add13 = add nsw i32 %storemerge34, %3
%div14 = sdiv i32 %add13, %4
%add15 = add nsw i32 %div14, %bChick.035
%mul17 = mul nsw i32 %div14, %4
%sub18.recomposed = srem i32 %add13, %4
%cmp7.not = icmp eq i32 %dec, 0
br i1 %cmp7.not, label %if.then19, label %while.body8, !llvm.loop !9
if.then19: ; preds = %if.end12, %if.end
%storemerge.lcssa = phi i32 [ %sub5.recomposed, %if.end ], [ %sub18.recomposed, %if.end12 ]
store i32 %storemerge.lcssa, ptr %b, align 4, !tbaa !5
%puts = call i32 @puts(ptr nonnull dereferenceable(1) @str)
br label %if.end21
if.end21: ; preds = %if.then10, %if.then19
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %q1)
%6 = load i32, ptr %q1, align 4, !tbaa !5
%cmp = icmp eq i32 %6, 0
br i1 %cmp, label %while.end22, label %if.end
while.end22: ; preds = %if.end21, %entry
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q2) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c2) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c1) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q1) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #4
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #5
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 t;
long n;
long long ans;
scanf("%d",&t);
while(t--)
{
scanf("%ld",&n);
ans = n / 10;
if(n % 10 == 9)
++ans;
printf("%lld\n",ans);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_11897/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_11897/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%ld\00", align 1
@.str.2 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%t = alloca i32, align 4
%n = alloca i64, align 8
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #3
call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %n) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %t)
%0 = load i32, ptr %t, align 4, !tbaa !5
%dec4 = add nsw i32 %0, -1
store i32 %dec4, ptr %t, align 4, !tbaa !5
%tobool.not5 = icmp eq i32 %0, 0
br i1 %tobool.not5, label %while.end, label %while.body
while.body: ; preds = %entry, %while.body
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%1 = load i64, ptr %n, align 8, !tbaa !9
%div = sdiv i64 %1, 10
%rem = srem i64 %1, 10
%cmp = icmp eq i64 %rem, 9
%inc = zext i1 %cmp to i64
%spec.select = add nsw i64 %div, %inc
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i64 noundef %spec.select)
%2 = load i32, ptr %t, align 4, !tbaa !5
%dec = add nsw i32 %2, -1
store i32 %dec, ptr %t, align 4, !tbaa !5
%tobool.not = icmp eq i32 %2, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !11
while.end: ; preds = %while.body, %entry
call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %n) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
|
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int count = 0;
/*1 insertionSort(A, n, g)
2 for i = g to n-1
3 v = A[i]
4 j = i - g
5 while j >= 0 && A[j] > v
6 A[j+g] = A[j]
7 j = j - g
8 cnt++
9 A[j+g] = v
10
11 shellSort(A, n)
12 cnt = 0
13 m = ?
14 G[] = {?, ?,..., ?}
15 for i = 0 to m-1
16 insertionSort(A, n, G[i])*/
void insertSort(int *A,int n,int g){
int i,j;
int key;
for(i = g; i < n; i++){
j = i;
key = A[i];
while(0 <= j - g){
if(A[j-g] <= key) break;
A[j] = A[j-g];
j -= g;
count++;
}
A[j] = key;
}
}
int main(){
int n;
int i,j;
int *A;
int G[20];
scanf("%d", &n);
A = malloc(n * sizeof(int));
for(i = 0; i < n; i++) scanf("%d", &A[i]);
int m = 0;
G[0] = 0;
while(1){
if(n < 3*G[m]+1) break;
G[m+1] = 3*G[m] + 1;
m++;
}
for(i = m; i > 0; i--) insertSort(A,n,G[i]);
printf("%d\n", m);
for(i = m; i >= 1; i--) printf("%d ", G[i]);
printf("\n");
printf("%d\n", count);
for(i = 0; i < n; i++) printf("%d\n", A[i]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119026/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119026/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@count = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insertSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #0 {
entry:
%cmp37 = icmp slt i32 %g, %n
br i1 %cmp37, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = sext i32 %g to i64
%wide.trip.count = sext i32 %n to i64
br label %while.body.preheader
while.body.preheader: ; preds = %while.end, %for.body.preheader
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = trunc i64 %indvars.iv to i32
%3 = trunc i64 %indvars.iv to i32
%4 = sub i32 %3, %g
br label %while.body
while.body: ; preds = %while.body.preheader, %if.end
%sub35 = phi i32 [ %sub, %if.end ], [ %4, %while.body.preheader ]
%j.034 = phi i32 [ %sub35, %if.end ], [ %2, %while.body.preheader ]
%idxprom3 = zext i32 %sub35 to i64
%arrayidx4 = getelementptr inbounds i32, ptr %A, i64 %idxprom3
%5 = load i32, ptr %arrayidx4, align 4, !tbaa !5
%cmp5.not = icmp sgt i32 %5, %1
br i1 %cmp5.not, label %if.end, label %while.end
if.end: ; preds = %while.body
%idxprom9 = sext i32 %j.034 to i64
%arrayidx10 = getelementptr inbounds i32, ptr %A, i64 %idxprom9
store i32 %5, ptr %arrayidx10, align 4, !tbaa !5
%6 = load i32, ptr @count, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @count, align 4, !tbaa !5
%sub = sub nsw i32 %sub35, %g
%cmp1 = icmp sgt i32 %sub, -1
br i1 %cmp1, label %while.body, label %while.end, !llvm.loop !9
while.end: ; preds = %if.end, %while.body
%j.0.lcssa.ph = phi i32 [ %sub35, %if.end ], [ %j.034, %while.body ]
%idxprom12 = sext i32 %j.0.lcssa.ph to i64
%arrayidx13 = getelementptr inbounds i32, ptr %A, i64 %idxprom12
store i32 %1, ptr %arrayidx13, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %while.body.preheader, !llvm.loop !11
for.end: ; preds = %while.end, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%G = alloca [20 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %G) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%conv = sext i32 %0 to i64
%mul = shl nsw i64 %conv, 2
%call1 = call noalias ptr @malloc(i64 noundef %mul) #7
%cmp68 = icmp sgt i32 %0, 0
br i1 %cmp68, label %for.body, label %for.end25.thread
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body
store i32 0, ptr %G, align 16, !tbaa !5
%cmp8.not71 = icmp sgt i32 %1, 0
br i1 %cmp8.not71, label %if.end, label %for.end25.thread
for.cond18.preheader: ; preds = %if.end
%3 = trunc i64 %indvars.iv.next95 to i32
%cmp1985 = icmp sgt i32 %3, 0
br i1 %cmp1985, label %for.body21.lr.ph, label %for.end25.thread
for.body21.lr.ph: ; preds = %for.cond18.preheader
%count.promoted = load i32, ptr @count, align 4, !tbaa !5
%wide.trip.count.i = sext i32 %1 to i64
%4 = and i64 %indvars.iv.next95, 4294967295
br label %for.body21
if.end: ; preds = %for.end, %if.end
%indvars.iv94 = phi i64 [ %indvars.iv.next95, %if.end ], [ 0, %for.end ]
%mul773 = phi i32 [ %mul7, %if.end ], [ 0, %for.end ]
%add = add nsw i32 %mul773, 1
%indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
%arrayidx16 = getelementptr inbounds [20 x i32], ptr %G, i64 0, i64 %indvars.iv.next95
store i32 %add, ptr %arrayidx16, align 4, !tbaa !5
%mul7 = mul nsw i32 %add, 3
%cmp8.not = icmp sgt i32 %1, %mul7
br i1 %cmp8.not, label %if.end, label %for.cond18.preheader
for.body21: ; preds = %for.body21.lr.ph, %insertSort.exit
%indvars.iv97 = phi i64 [ %4, %for.body21.lr.ph ], [ %indvars.iv.next98, %insertSort.exit ]
%count.promoted768486 = phi i32 [ %count.promoted, %for.body21.lr.ph ], [ %count.promoted7680, %insertSort.exit ]
%arrayidx23 = getelementptr inbounds [20 x i32], ptr %G, i64 0, i64 %indvars.iv97
%5 = load i32, ptr %arrayidx23, align 4, !tbaa !5
%cmp37.i = icmp slt i32 %5, %1
br i1 %cmp37.i, label %for.body.preheader.i, label %insertSort.exit
for.body.preheader.i: ; preds = %for.body21
%6 = sext i32 %5 to i64
br label %while.body.preheader.i
while.body.preheader.i: ; preds = %while.end.i, %for.body.preheader.i
%count.promoted7683 = phi i32 [ %count.promoted768486, %for.body.preheader.i ], [ %count.promoted7681, %while.end.i ]
%count.promoted79 = phi i32 [ %count.promoted768486, %for.body.preheader.i ], [ %count.promoted77, %while.end.i ]
%indvars.iv.i = phi i64 [ %6, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv.i
%7 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%8 = trunc i64 %indvars.iv.i to i32
%9 = sub i32 %8, %5
%idxprom3.i117 = zext i32 %9 to i64
%arrayidx4.i118 = getelementptr inbounds i32, ptr %call1, i64 %idxprom3.i117
%10 = load i32, ptr %arrayidx4.i118, align 4, !tbaa !5
%cmp5.not.i119 = icmp sgt i32 %10, %7
br i1 %cmp5.not.i119, label %if.end.i, label %while.end.i
while.body.i: ; preds = %if.end.i
%idxprom3.i = zext i32 %sub.i to i64
%arrayidx4.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom3.i
%11 = load i32, ptr %arrayidx4.i, align 4, !tbaa !5
%cmp5.not.i = icmp sgt i32 %11, %7
br i1 %cmp5.not.i, label %if.end.i, label %while.end.i.loopexit, !llvm.loop !9
if.end.i: ; preds = %while.body.preheader.i, %while.body.i
%12 = phi i32 [ %11, %while.body.i ], [ %10, %while.body.preheader.i ]
%j.034.i122 = phi i32 [ %sub35.i121, %while.body.i ], [ %8, %while.body.preheader.i ]
%sub35.i121 = phi i32 [ %sub.i, %while.body.i ], [ %9, %while.body.preheader.i ]
%count.promoted78120 = phi i32 [ %inc.i, %while.body.i ], [ %count.promoted79, %while.body.preheader.i ]
%idxprom9.i = sext i32 %j.034.i122 to i64
%arrayidx10.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom9.i
store i32 %12, ptr %arrayidx10.i, align 4, !tbaa !5
%inc.i = add nsw i32 %count.promoted78120, 1
%sub.i = sub nsw i32 %sub35.i121, %5
%cmp1.i = icmp sgt i32 %sub.i, -1
br i1 %cmp1.i, label %while.body.i, label %while.end.i.loopexit, !llvm.loop !9
while.end.i.loopexit: ; preds = %if.end.i, %while.body.i
store i32 %inc.i, ptr @count, align 4, !tbaa !5
br label %while.end.i
while.end.i: ; preds = %while.end.i.loopexit, %while.body.preheader.i
%count.promoted7681 = phi i32 [ %count.promoted7683, %while.body.preheader.i ], [ %inc.i, %while.end.i.loopexit ]
%count.promoted77 = phi i32 [ %count.promoted79, %while.body.preheader.i ], [ %inc.i, %while.end.i.loopexit ]
%j.0.lcssa.ph.i = phi i32 [ %8, %while.body.preheader.i ], [ %sub35.i121, %while.end.i.loopexit ]
%idxprom12.i = sext i32 %j.0.lcssa.ph.i to i64
%arrayidx13.i = getelementptr inbounds i32, ptr %call1, i64 %idxprom12.i
store i32 %7, ptr %arrayidx13.i, align 4, !tbaa !5
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %insertSort.exit, label %while.body.preheader.i, !llvm.loop !11
insertSort.exit: ; preds = %while.end.i, %for.body21
%count.promoted7680 = phi i32 [ %count.promoted768486, %for.body21 ], [ %count.promoted7681, %while.end.i ]
%indvars.iv.next98 = add nsw i64 %indvars.iv97, -1
%cmp19 = icmp sgt i64 %indvars.iv97, 1
br i1 %cmp19, label %for.body21, label %for.end25, !llvm.loop !13
for.end25.thread: ; preds = %entry, %for.cond18.preheader, %for.end
%m.0.lcssa112.ph = phi i32 [ %3, %for.cond18.preheader ], [ 0, %for.end ], [ 0, %entry ]
%call26116 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.0.lcssa112.ph)
br label %for.end36
for.end25: ; preds = %insertSort.exit
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
br i1 %cmp1985, label %for.body30.preheader, label %for.end36
for.body30.preheader: ; preds = %for.end25
%13 = and i64 %indvars.iv.next95, 4294967295
br label %for.body30
for.body30: ; preds = %for.body30.preheader, %for.body30
%indvars.iv100 = phi i64 [ %13, %for.body30.preheader ], [ %indvars.iv.next101, %for.body30 ]
%arrayidx32 = getelementptr inbounds [20 x i32], ptr %G, i64 0, i64 %indvars.iv100
%14 = load i32, ptr %arrayidx32, align 4, !tbaa !5
%call33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %14)
%indvars.iv.next101 = add nsw i64 %indvars.iv100, -1
%cmp28 = icmp ugt i64 %indvars.iv100, 1
br i1 %cmp28, label %for.body30, label %for.end36, !llvm.loop !14
for.end36: ; preds = %for.body30, %for.end25.thread, %for.end25
%putchar = call i32 @putchar(i32 10)
%15 = load i32, ptr @count, align 4, !tbaa !5
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
%16 = load i32, ptr %n, align 4, !tbaa !5
%cmp4090 = icmp sgt i32 %16, 0
br i1 %cmp4090, label %for.body42, label %for.end48
for.body42: ; preds = %for.end36, %for.body42
%indvars.iv103 = phi i64 [ %indvars.iv.next104, %for.body42 ], [ 0, %for.end36 ]
%arrayidx44 = getelementptr inbounds i32, ptr %call1, i64 %indvars.iv103
%17 = load i32, ptr %arrayidx44, align 4, !tbaa !5
%call45 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %17)
%indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 1
%18 = load i32, ptr %n, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp40 = icmp slt i64 %indvars.iv.next104, %19
br i1 %cmp40, label %for.body42, label %for.end48, !llvm.loop !15
for.end48: ; preds = %for.body42, %for.end36
call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %G) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#define dbg(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#define dpri(x) dbg(#x ": %d\n", x)
#define dprs(x) dbg(#x ": %s\n", x)
#include <stdio.h>
typedef long long ll;
#define MYINF (1000007)
static int A[MYINF];
static int n;
static int cnt;
static int m;
static int G[128];
void insertion_sort(int g) {
int i, j, v;
for (i = g; i < n; i++) {
v = A[i];
j = i - g;
while (j >= 0 && A[j] > v) {
A[j+g] = A[j];
j = j - g;
cnt++;
}
A[j+g] = v;
}
}
void shell_sort() {
int i, j;
cnt = 0;
for (i = 0, j = n/2; i < 127 && j > 0; i++, j /= 2) {
G[i] = j;
}
if (i == 0) {
G[i] = 1;
m = 1;
} else {
if (G[i-1] == 2) {
G[i++] = 1;
}
m = i;
}
for (i = 0; i < m; i++) {
insertion_sort(G[i]);
}
}
int main(int argc, char **argv)
{
int i;
const char *sp = "";
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &A[i]);
}
shell_sort();
printf("%d\n", m);
for (i = 0; i < m; i++) {
printf("%s%d", sp, G[i]);
sp = " ";
}
putchar('\n');
printf("%d\n", cnt);
for (i = 0; i < n; i++) {
printf("%d\n", A[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119084/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119084/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@n = internal global i32 0, align 4
@A = internal global [1000007 x i32] zeroinitializer, align 16
@cnt = internal unnamed_addr global i32 0, align 4
@G = internal unnamed_addr global [128 x i32] zeroinitializer, align 16
@m = internal unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.3 = private unnamed_addr constant [5 x i8] c"%s%d\00", align 1
@.str.4 = private unnamed_addr constant [2 x i8] c" \00", align 1
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @insertion_sort(i32 noundef %g) local_unnamed_addr #0 {
entry:
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp39 = icmp sgt i32 %0, %g
br i1 %cmp39, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%cnt.promoted34 = load i32, ptr @cnt, align 4, !tbaa !5
%1 = sext i32 %g to i64
%wide.trip.count = sext i32 %0 to i64
br label %land.rhs.preheader
land.rhs.preheader: ; preds = %while.end, %for.body.preheader
%indvars.iv = phi i64 [ %1, %for.body.preheader ], [ %indvars.iv.next, %while.end ]
%cnt.promoted3740 = phi i32 [ %cnt.promoted34, %for.body.preheader ], [ %cnt.promoted35.ph, %while.end ]
%arrayidx = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %indvars.iv
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%3 = trunc i64 %indvars.iv to i32
%4 = trunc i64 %indvars.iv to i32
%5 = sub i32 %4, %g
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%cnt.promoted36 = phi i32 [ %inc, %while.body ], [ %cnt.promoted3740, %land.rhs.preheader ]
%j.032 = phi i32 [ %j.0, %while.body ], [ %5, %land.rhs.preheader ]
%i.0.pn31 = phi i32 [ %j.032, %while.body ], [ %3, %land.rhs.preheader ]
%idxprom2 = zext i32 %j.032 to i64
%arrayidx3 = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom2
%6 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %6, %2
br i1 %cmp4, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%idxprom7 = sext i32 %i.0.pn31 to i64
%arrayidx8 = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom7
store i32 %6, ptr %arrayidx8, align 4, !tbaa !5
%inc = add nsw i32 %cnt.promoted36, 1
store i32 %inc, ptr @cnt, align 4, !tbaa !5
%j.0 = sub nsw i32 %j.032, %g
%cmp1 = icmp sgt i32 %j.0, -1
br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !9
while.end: ; preds = %land.rhs, %while.body
%cnt.promoted35.ph = phi i32 [ %cnt.promoted36, %land.rhs ], [ %inc, %while.body ]
%i.0.pn.lcssa.ph = phi i32 [ %i.0.pn31, %land.rhs ], [ %j.032, %while.body ]
%idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64
%arrayidx12 = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom11
store i32 %2, ptr %arrayidx12, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !11
for.end: ; preds = %while.end, %entry
ret void
}
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable
define dso_local void @shell_sort() local_unnamed_addr #0 {
entry:
store i32 0, ptr @cnt, align 4, !tbaa !5
%0 = load i32, ptr @n, align 4, !tbaa !5
%cmp135 = icmp sgt i32 %0, 1
br i1 %cmp135, label %for.body, label %if.end13.thread
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%j.037.in = phi i32 [ %j.037, %for.body ], [ %0, %entry ]
%j.037 = lshr i32 %j.037.in, 1
%arrayidx = getelementptr inbounds [128 x i32], ptr @G, i64 0, i64 %indvars.iv
store i32 %j.037, ptr %arrayidx, align 4, !tbaa !5
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%cmp1 = icmp ugt i32 %j.037.in, 3
br i1 %cmp1, label %for.body, label %for.end, !llvm.loop !12
for.end: ; preds = %for.body
%1 = trunc i64 %indvars.iv.next to i32
%cmp3 = icmp eq i32 %1, 0
br i1 %cmp3, label %if.end13.thread, label %if.else
if.end13.thread: ; preds = %for.end, %entry
store i32 1, ptr @G, align 16, !tbaa !5
store i32 1, ptr @m, align 4, !tbaa !5
br label %for.body16.lr.ph
if.else: ; preds = %for.end
%idxprom6 = and i64 %indvars.iv, 4294967295
%arrayidx7 = getelementptr inbounds [128 x i32], ptr @G, i64 0, i64 %idxprom6
%2 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%cmp8 = icmp eq i32 %2, 2
br i1 %cmp8, label %if.then9, label %if.end13
if.then9: ; preds = %if.else
%inc10 = add nuw nsw i32 %1, 1
%idxprom11 = and i64 %indvars.iv.next, 4294967295
%arrayidx12 = getelementptr inbounds [128 x i32], ptr @G, i64 0, i64 %idxprom11
store i32 1, ptr %arrayidx12, align 4, !tbaa !5
br label %if.end13
if.end13: ; preds = %if.else, %if.then9
%storemerge = phi i32 [ %inc10, %if.then9 ], [ %1, %if.else ]
store i32 %storemerge, ptr @m, align 4, !tbaa !5
%cmp1543 = icmp sgt i32 %storemerge, 0
br i1 %cmp1543, label %for.body16.lr.ph, label %for.end21
for.body16.lr.ph: ; preds = %if.end13.thread, %if.end13
%storemerge54 = phi i32 [ 1, %if.end13.thread ], [ %storemerge, %if.end13 ]
%wide.trip.count.i = sext i32 %0 to i64
%wide.trip.count = zext i32 %storemerge54 to i64
br label %for.body16
for.body16: ; preds = %for.body16.lr.ph, %insertion_sort.exit
%indvars.iv47 = phi i64 [ 0, %for.body16.lr.ph ], [ %indvars.iv.next48, %insertion_sort.exit ]
%inc.i4244 = phi i32 [ 0, %for.body16.lr.ph ], [ %inc.i38, %insertion_sort.exit ]
%arrayidx18 = getelementptr inbounds [128 x i32], ptr @G, i64 0, i64 %indvars.iv47
%3 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%cmp39.i = icmp sgt i32 %0, %3
br i1 %cmp39.i, label %for.body.preheader.i, label %insertion_sort.exit
for.body.preheader.i: ; preds = %for.body16
%4 = sext i32 %3 to i64
br label %land.rhs.preheader.i
land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i
%inc.i41 = phi i32 [ %inc.i4244, %for.body.preheader.i ], [ %inc.i39, %while.end.i ]
%indvars.iv.i = phi i64 [ %4, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ]
%cnt.promoted3740.i = phi i32 [ %inc.i4244, %for.body.preheader.i ], [ %cnt.promoted35.ph.i, %while.end.i ]
%arrayidx.i = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %indvars.iv.i
%5 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%6 = trunc i64 %indvars.iv.i to i32
%7 = sub i32 %6, %3
%idxprom2.i57 = zext i32 %7 to i64
%arrayidx3.i58 = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom2.i57
%8 = load i32, ptr %arrayidx3.i58, align 4, !tbaa !5
%cmp4.i59 = icmp sgt i32 %8, %5
br i1 %cmp4.i59, label %while.body.i, label %while.end.i
land.rhs.i: ; preds = %while.body.i
%idxprom2.i = zext i32 %j.0.i to i64
%arrayidx3.i = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom2.i
%9 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %9, %5
br i1 %cmp4.i, label %while.body.i, label %while.end.i.loopexit, !llvm.loop !9
while.body.i: ; preds = %land.rhs.preheader.i, %land.rhs.i
%10 = phi i32 [ %9, %land.rhs.i ], [ %8, %land.rhs.preheader.i ]
%i.0.pn31.i62 = phi i32 [ %j.032.i61, %land.rhs.i ], [ %6, %land.rhs.preheader.i ]
%j.032.i61 = phi i32 [ %j.0.i, %land.rhs.i ], [ %7, %land.rhs.preheader.i ]
%cnt.promoted36.i60 = phi i32 [ %inc.i, %land.rhs.i ], [ %cnt.promoted3740.i, %land.rhs.preheader.i ]
%idxprom7.i = sext i32 %i.0.pn31.i62 to i64
%arrayidx8.i = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom7.i
store i32 %10, ptr %arrayidx8.i, align 4, !tbaa !5
%inc.i = add nsw i32 %cnt.promoted36.i60, 1
%j.0.i = sub nsw i32 %j.032.i61, %3
%cmp1.i = icmp sgt i32 %j.0.i, -1
br i1 %cmp1.i, label %land.rhs.i, label %while.end.i.loopexit, !llvm.loop !9
while.end.i.loopexit: ; preds = %while.body.i, %land.rhs.i
store i32 %inc.i, ptr @cnt, align 4, !tbaa !5
br label %while.end.i
while.end.i: ; preds = %while.end.i.loopexit, %land.rhs.preheader.i
%inc.i39 = phi i32 [ %inc.i41, %land.rhs.preheader.i ], [ %inc.i, %while.end.i.loopexit ]
%cnt.promoted35.ph.i = phi i32 [ %cnt.promoted3740.i, %land.rhs.preheader.i ], [ %inc.i, %while.end.i.loopexit ]
%i.0.pn.lcssa.ph.i = phi i32 [ %6, %land.rhs.preheader.i ], [ %j.032.i61, %while.end.i.loopexit ]
%idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64
%arrayidx12.i = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom11.i
store i32 %5, ptr %arrayidx12.i, align 4, !tbaa !5
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %insertion_sort.exit, label %land.rhs.preheader.i, !llvm.loop !11
insertion_sort.exit: ; preds = %while.end.i, %for.body16
%inc.i38 = phi i32 [ %inc.i4244, %for.body16 ], [ %inc.i39, %while.end.i ]
%indvars.iv.next48 = add nuw nsw i64 %indvars.iv47, 1
%exitcond.not = icmp eq i64 %indvars.iv.next48, %wide.trip.count
br i1 %exitcond.not, label %for.end21, label %for.body16, !llvm.loop !13
for.end21: ; preds = %insertion_sort.exit, %if.end13
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main(i32 noundef %argc, ptr nocapture noundef readnone %argv) local_unnamed_addr #1 {
entry:
%call = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, 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.end.thread
for.end.thread: ; preds = %entry
store i32 0, ptr @cnt, align 4, !tbaa !5
br label %if.end13.thread.i
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %indvars.iv
%call1 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%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
store i32 0, ptr @cnt, align 4, !tbaa !5
%cmp135.i = icmp sgt i32 %1, 1
br i1 %cmp135.i, label %for.body.i, label %if.end13.thread.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 ]
%j.037.in.i = phi i32 [ %j.037.i, %for.body.i ], [ %1, %for.end ]
%j.037.i = lshr i32 %j.037.in.i, 1
%arrayidx.i = getelementptr inbounds [128 x i32], ptr @G, i64 0, i64 %indvars.iv.i
store i32 %j.037.i, ptr %arrayidx.i, align 4, !tbaa !5
%indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 1
%cmp1.i = icmp ugt i32 %j.037.in.i, 3
br i1 %cmp1.i, label %for.body.i, label %for.end.i, !llvm.loop !12
for.end.i: ; preds = %for.body.i
%3 = trunc i64 %indvars.iv.next.i to i32
%cmp3.i = icmp eq i32 %3, 0
br i1 %cmp3.i, label %if.end13.thread.i, label %if.else.i
if.end13.thread.i: ; preds = %for.end.thread, %for.end.i, %for.end
%.lcssa65 = phi i32 [ %0, %for.end.thread ], [ %1, %for.end.i ], [ %1, %for.end ]
store i32 1, ptr @G, align 16, !tbaa !5
store i32 1, ptr @m, align 4, !tbaa !5
br label %for.body16.lr.ph.i
if.else.i: ; preds = %for.end.i
%idxprom6.i = and i64 %indvars.iv.i, 4294967295
%arrayidx7.i = getelementptr inbounds [128 x i32], ptr @G, i64 0, i64 %idxprom6.i
%4 = load i32, ptr %arrayidx7.i, align 4, !tbaa !5
%cmp8.i = icmp eq i32 %4, 2
br i1 %cmp8.i, label %if.then9.i, label %if.end13.i
if.then9.i: ; preds = %if.else.i
%inc10.i = add nuw nsw i32 %3, 1
%idxprom11.i = and i64 %indvars.iv.next.i, 4294967295
%arrayidx12.i = getelementptr inbounds [128 x i32], ptr @G, i64 0, i64 %idxprom11.i
store i32 1, ptr %arrayidx12.i, align 4, !tbaa !5
br label %if.end13.i
if.end13.i: ; preds = %if.then9.i, %if.else.i
%storemerge.i = phi i32 [ %inc10.i, %if.then9.i ], [ %3, %if.else.i ]
store i32 %storemerge.i, ptr @m, align 4, !tbaa !5
%cmp1543.i = icmp sgt i32 %storemerge.i, 0
br i1 %cmp1543.i, label %for.body16.lr.ph.i, label %shell_sort.exit
for.body16.lr.ph.i: ; preds = %if.end13.i, %if.end13.thread.i
%.lcssa64 = phi i32 [ %.lcssa65, %if.end13.thread.i ], [ %1, %if.end13.i ]
%storemerge54.i = phi i32 [ 1, %if.end13.thread.i ], [ %storemerge.i, %if.end13.i ]
%wide.trip.count.i.i = sext i32 %.lcssa64 to i64
%wide.trip.count.i = zext i32 %storemerge54.i to i64
br label %for.body16.i
for.body16.i: ; preds = %insertion_sort.exit.i, %for.body16.lr.ph.i
%indvars.iv47.i = phi i64 [ 0, %for.body16.lr.ph.i ], [ %indvars.iv.next48.i, %insertion_sort.exit.i ]
%inc.i4244.i = phi i32 [ 0, %for.body16.lr.ph.i ], [ %inc.i38.i, %insertion_sort.exit.i ]
%arrayidx18.i = getelementptr inbounds [128 x i32], ptr @G, i64 0, i64 %indvars.iv47.i
%5 = load i32, ptr %arrayidx18.i, align 4, !tbaa !5
%cmp39.i.i = icmp sgt i32 %.lcssa64, %5
br i1 %cmp39.i.i, label %for.body.preheader.i.i, label %insertion_sort.exit.i
for.body.preheader.i.i: ; preds = %for.body16.i
%6 = sext i32 %5 to i64
br label %land.rhs.preheader.i.i
land.rhs.preheader.i.i: ; preds = %while.end.i.i, %for.body.preheader.i.i
%inc.i41.i = phi i32 [ %inc.i4244.i, %for.body.preheader.i.i ], [ %inc.i39.i, %while.end.i.i ]
%indvars.iv.i.i = phi i64 [ %6, %for.body.preheader.i.i ], [ %indvars.iv.next.i.i, %while.end.i.i ]
%cnt.promoted3740.i.i = phi i32 [ %inc.i4244.i, %for.body.preheader.i.i ], [ %cnt.promoted35.ph.i.i, %while.end.i.i ]
%arrayidx.i.i = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %indvars.iv.i.i
%7 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5
%8 = trunc i64 %indvars.iv.i.i to i32
%9 = sub i32 %8, %5
%idxprom2.i.i33 = zext i32 %9 to i64
%arrayidx3.i.i34 = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom2.i.i33
%10 = load i32, ptr %arrayidx3.i.i34, align 4, !tbaa !5
%cmp4.i.i35 = icmp sgt i32 %10, %7
br i1 %cmp4.i.i35, label %while.body.i.i, label %while.end.i.i
land.rhs.i.i: ; preds = %while.body.i.i
%idxprom2.i.i = zext i32 %j.0.i.i to i64
%arrayidx3.i.i = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom2.i.i
%11 = load i32, ptr %arrayidx3.i.i, align 4, !tbaa !5
%cmp4.i.i = icmp sgt i32 %11, %7
br i1 %cmp4.i.i, label %while.body.i.i, label %while.end.i.i.sink.split, !llvm.loop !9
while.body.i.i: ; preds = %land.rhs.preheader.i.i, %land.rhs.i.i
%12 = phi i32 [ %11, %land.rhs.i.i ], [ %10, %land.rhs.preheader.i.i ]
%i.0.pn31.i.i38 = phi i32 [ %j.032.i.i37, %land.rhs.i.i ], [ %8, %land.rhs.preheader.i.i ]
%j.032.i.i37 = phi i32 [ %j.0.i.i, %land.rhs.i.i ], [ %9, %land.rhs.preheader.i.i ]
%cnt.promoted36.i.i36 = phi i32 [ %inc.i.i, %land.rhs.i.i ], [ %cnt.promoted3740.i.i, %land.rhs.preheader.i.i ]
%idxprom7.i.i = sext i32 %i.0.pn31.i.i38 to i64
%arrayidx8.i.i = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom7.i.i
store i32 %12, ptr %arrayidx8.i.i, align 4, !tbaa !5
%inc.i.i = add nsw i32 %cnt.promoted36.i.i36, 1
%j.0.i.i = sub nsw i32 %j.032.i.i37, %5
%cmp1.i.i = icmp sgt i32 %j.0.i.i, -1
br i1 %cmp1.i.i, label %land.rhs.i.i, label %while.end.i.i.sink.split, !llvm.loop !9
while.end.i.i.sink.split: ; preds = %land.rhs.i.i, %while.body.i.i
store i32 %inc.i.i, ptr @cnt, align 4, !tbaa !5
br label %while.end.i.i
while.end.i.i: ; preds = %while.end.i.i.sink.split, %land.rhs.preheader.i.i
%inc.i39.i = phi i32 [ %inc.i41.i, %land.rhs.preheader.i.i ], [ %inc.i.i, %while.end.i.i.sink.split ]
%cnt.promoted35.ph.i.i = phi i32 [ %cnt.promoted3740.i.i, %land.rhs.preheader.i.i ], [ %inc.i.i, %while.end.i.i.sink.split ]
%i.0.pn.lcssa.ph.i.i = phi i32 [ %8, %land.rhs.preheader.i.i ], [ %j.032.i.i37, %while.end.i.i.sink.split ]
%idxprom11.i.i = sext i32 %i.0.pn.lcssa.ph.i.i to i64
%arrayidx12.i.i = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %idxprom11.i.i
store i32 %7, ptr %arrayidx12.i.i, align 4, !tbaa !5
%indvars.iv.next.i.i = add nsw i64 %indvars.iv.i.i, 1
%exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.i, label %insertion_sort.exit.i, label %land.rhs.preheader.i.i, !llvm.loop !11
insertion_sort.exit.i: ; preds = %while.end.i.i, %for.body16.i
%inc.i38.i = phi i32 [ %inc.i4244.i, %for.body16.i ], [ %inc.i39.i, %while.end.i.i ]
%indvars.iv.next48.i = add nuw nsw i64 %indvars.iv47.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next48.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %shell_sort.exit, label %for.body16.i, !llvm.loop !13
shell_sort.exit: ; preds = %insertion_sort.exit.i, %if.end13.i
%13 = phi i32 [ %storemerge.i, %if.end13.i ], [ %storemerge54.i, %insertion_sort.exit.i ]
%call2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %13)
%14 = load i32, ptr @m, align 4, !tbaa !5
%cmp446 = icmp sgt i32 %14, 0
br i1 %cmp446, label %for.body5.preheader, label %for.end11
for.body5.preheader: ; preds = %shell_sort.exit
%15 = load i32, ptr @G, align 16, !tbaa !5
%call8.peel = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull @.str, i32 noundef %15)
%16 = load i32, ptr @m, align 4, !tbaa !5
%cmp4.peel = icmp sgt i32 %16, 1
br i1 %cmp4.peel, label %for.body5, label %for.end11
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv55 = phi i64 [ %indvars.iv.next56, %for.body5 ], [ 1, %for.body5.preheader ]
%arrayidx7 = getelementptr inbounds [128 x i32], ptr @G, i64 0, i64 %indvars.iv55
%17 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%call8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull @.str.4, i32 noundef %17)
%indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
%18 = load i32, ptr @m, align 4, !tbaa !5
%19 = sext i32 %18 to i64
%cmp4 = icmp slt i64 %indvars.iv.next56, %19
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !15
for.end11: ; preds = %for.body5, %for.body5.preheader, %shell_sort.exit
%20 = load ptr, ptr @stdout, align 8, !tbaa !17
%call.i = tail call i32 @putc(i32 noundef 10, ptr noundef %20)
%21 = load i32, ptr @cnt, align 4, !tbaa !5
%call13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
%22 = load i32, ptr @n, align 4, !tbaa !5
%cmp1549 = icmp sgt i32 %22, 0
br i1 %cmp1549, label %for.body16, label %for.end22
for.body16: ; preds = %for.end11, %for.body16
%indvars.iv59 = phi i64 [ %indvars.iv.next60, %for.body16 ], [ 0, %for.end11 ]
%arrayidx18 = getelementptr inbounds [1000007 x i32], ptr @A, i64 0, i64 %indvars.iv59
%23 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%call19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %23)
%indvars.iv.next60 = add nuw nsw i64 %indvars.iv59, 1
%24 = load i32, ptr @n, align 4, !tbaa !5
%25 = sext i32 %24 to i64
%cmp15 = icmp slt i64 %indvars.iv.next60, %25
br i1 %cmp15, label %for.body16, label %for.end22, !llvm.loop !19
for.end22: ; preds = %for.body16, %for.end11
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #2
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, argmem: none, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10, !16}
!16 = !{!"llvm.loop.peeled.count", i32 1}
!17 = !{!18, !18, i64 0}
!18 = !{!"any pointer", !7, i64 0}
!19 = distinct !{!19, !10}
|
#include <stdio.h>
int cnt=0;
int m=0;
int G[1000000]={};
void insertion(int N,int a[],int g){
int i,j,v;
for(i=g; i<N; i++){
v = a[i];
j=i-g;
while(j>=0 && a[j]>v){
a[j+g]=a[j];
j-=g;
cnt++;
a[j+g]=v;
}
}
}
void shell(int N,int a[]){
int i;
G[0]=1;
for(m=1;m<15;m++){
G[m]=G[m-1]*3+1;
if(G[m]>N)break;
}
for(i=m-1;i>=0;i--){
insertion(N,a,G[i]);
}
}
int main(void){
int i,N,a[1000000]={};
scanf("%d",&N);
for(i=0;i<N;i++){
scanf("%d",&a[i]);
}
shell(N,a);
printf("%d\n",m);
for(i=m-1;i>=0;i--){
printf("%d",G[i]);
if(i==0)puts("");
else printf(" ");
}
printf("%d\n",cnt);
for(i=0;i<N;i++){
printf("%d\n",a[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119134/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119134/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@m = dso_local local_unnamed_addr global i32 0, align 4
@G = dso_local local_unnamed_addr global [1000000 x i32] zeroinitializer, align 16
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insertion(i32 noundef %N, ptr nocapture noundef %a, i32 noundef %g) local_unnamed_addr #0 {
entry:
%cmp36 = icmp slt i32 %g, %N
br i1 %cmp36, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = sext i32 %g to i64
%wide.trip.count = sext i32 %N to i64
br label %land.rhs.preheader
land.rhs.preheader: ; preds = %for.inc, %for.body.preheader
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %for.inc ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = trunc i64 %indvars.iv to i32
%3 = sub i32 %2, %g
%4 = trunc i64 %indvars.iv to i32
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%j.035 = phi i32 [ %j.0, %while.body ], [ %3, %land.rhs.preheader ]
%i.0.pn34 = phi i32 [ %j.035, %while.body ], [ %4, %land.rhs.preheader ]
%idxprom2 = zext i32 %j.035 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %a, i64 %idxprom2
%5 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %5, %1
br i1 %cmp4, label %while.body, label %for.inc
while.body: ; preds = %land.rhs
%idxprom7 = sext i32 %i.0.pn34 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %a, i64 %idxprom7
store i32 %5, ptr %arrayidx8, align 4, !tbaa !5
%6 = load i32, ptr @cnt, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @cnt, align 4, !tbaa !5
store i32 %1, ptr %arrayidx3, align 4, !tbaa !5
%j.0 = sub nsw i32 %j.035, %g
%cmp1 = icmp sgt i32 %j.0, -1
br i1 %cmp1, label %land.rhs, label %for.inc, !llvm.loop !9
for.inc: ; preds = %while.body, %land.rhs
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !11
for.end: ; preds = %for.inc, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @shell(i32 noundef %N, ptr nocapture noundef %a) local_unnamed_addr #0 {
entry:
store i32 1, ptr @G, align 16, !tbaa !5
store i32 4, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 1), align 4, !tbaa !5
%cmp5.not = icmp sgt i32 %N, 3
br i1 %cmp5.not, label %for.inc, label %for.end
for.inc: ; preds = %entry
store i32 13, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 2), align 8, !tbaa !5
%cmp5.not.1 = icmp ugt i32 %N, 12
br i1 %cmp5.not.1, label %for.inc.1, label %for.end
for.inc.1: ; preds = %for.inc
store i32 40, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 3), align 4, !tbaa !5
%cmp5.not.2 = icmp ugt i32 %N, 39
br i1 %cmp5.not.2, label %for.inc.2, label %for.end
for.inc.2: ; preds = %for.inc.1
store i32 121, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 4), align 16, !tbaa !5
%cmp5.not.3 = icmp ugt i32 %N, 120
br i1 %cmp5.not.3, label %for.inc.3, label %for.end
for.inc.3: ; preds = %for.inc.2
store i32 364, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 5), align 4, !tbaa !5
%cmp5.not.4 = icmp ugt i32 %N, 363
br i1 %cmp5.not.4, label %for.inc.4, label %for.end
for.inc.4: ; preds = %for.inc.3
store i32 1093, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 6), align 8, !tbaa !5
%cmp5.not.5 = icmp ugt i32 %N, 1092
br i1 %cmp5.not.5, label %for.inc.5, label %for.end
for.inc.5: ; preds = %for.inc.4
store i32 3280, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 7), align 4, !tbaa !5
%cmp5.not.6 = icmp ugt i32 %N, 3279
br i1 %cmp5.not.6, label %for.inc.6, label %for.end
for.inc.6: ; preds = %for.inc.5
store i32 9841, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 8), align 16, !tbaa !5
%cmp5.not.7 = icmp ugt i32 %N, 9840
br i1 %cmp5.not.7, label %for.inc.7, label %for.end
for.inc.7: ; preds = %for.inc.6
store i32 29524, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 9), align 4, !tbaa !5
%cmp5.not.8 = icmp ugt i32 %N, 29523
br i1 %cmp5.not.8, label %for.inc.8, label %for.end
for.inc.8: ; preds = %for.inc.7
store i32 88573, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 10), align 8, !tbaa !5
%cmp5.not.9 = icmp ugt i32 %N, 88572
br i1 %cmp5.not.9, label %for.inc.9, label %for.end
for.inc.9: ; preds = %for.inc.8
store i32 265720, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 11), align 4, !tbaa !5
%cmp5.not.10 = icmp ugt i32 %N, 265719
br i1 %cmp5.not.10, label %for.inc.10, label %for.end
for.inc.10: ; preds = %for.inc.9
store i32 797161, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 12), align 16, !tbaa !5
%cmp5.not.11 = icmp ugt i32 %N, 797160
br i1 %cmp5.not.11, label %for.inc.11, label %for.end
for.inc.11: ; preds = %for.inc.10
store i32 2391484, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 13), align 4, !tbaa !5
%cmp5.not.12 = icmp ugt i32 %N, 2391483
br i1 %cmp5.not.12, label %for.inc.12, label %for.end
for.inc.12: ; preds = %for.inc.11
store i32 7174453, ptr getelementptr inbounds ([1000000 x i32], ptr @G, i64 0, i64 14), align 8, !tbaa !5
%cmp5.not.13 = icmp ugt i32 %N, 7174452
%spec.select = select i1 %cmp5.not.13, i32 15, i32 14
br label %for.end
for.end: ; preds = %for.inc.12, %for.inc.11, %for.inc.10, %for.inc.9, %for.inc.8, %for.inc.7, %for.inc.6, %for.inc.5, %for.inc.4, %for.inc.3, %for.inc.2, %for.inc.1, %for.inc, %entry
%storemerge.lcssa17 = phi i32 [ 1, %entry ], [ 2, %for.inc ], [ 3, %for.inc.1 ], [ 4, %for.inc.2 ], [ 5, %for.inc.3 ], [ 6, %for.inc.4 ], [ 7, %for.inc.5 ], [ 8, %for.inc.6 ], [ 9, %for.inc.7 ], [ 10, %for.inc.8 ], [ 11, %for.inc.9 ], [ 12, %for.inc.10 ], [ 13, %for.inc.11 ], [ %spec.select, %for.inc.12 ]
store i32 %storemerge.lcssa17, ptr @m, align 4, !tbaa !5
%wide.trip.count.i = sext i32 %N to i64
%0 = zext i32 %storemerge.lcssa17 to i64
br label %for.body9
for.body9: ; preds = %for.end, %insertion.exit
%indvars.iv = phi i64 [ %0, %for.end ], [ %indvars.iv.next, %insertion.exit ]
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%arrayidx11 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv.next
%1 = load i32, ptr %arrayidx11, align 4, !tbaa !5
%cmp36.i = icmp slt i32 %1, %N
br i1 %cmp36.i, label %for.body.preheader.i, label %insertion.exit
for.body.preheader.i: ; preds = %for.body9
%2 = sext i32 %1 to i64
br label %land.rhs.preheader.i
land.rhs.preheader.i: ; preds = %for.inc.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %2, %for.body.preheader.i ], [ %indvars.iv.next.i, %for.inc.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%4 = trunc i64 %indvars.iv.i to i32
%5 = sub i32 %4, %1
br label %land.rhs.i
land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i
%j.035.i = phi i32 [ %j.0.i, %while.body.i ], [ %5, %land.rhs.preheader.i ]
%i.0.pn34.i = phi i32 [ %j.035.i, %while.body.i ], [ %4, %land.rhs.preheader.i ]
%idxprom2.i = zext i32 %j.035.i to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %a, i64 %idxprom2.i
%6 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %6, %3
br i1 %cmp4.i, label %while.body.i, label %for.inc.i
while.body.i: ; preds = %land.rhs.i
%idxprom7.i = sext i32 %i.0.pn34.i to i64
%arrayidx8.i = getelementptr inbounds i32, ptr %a, i64 %idxprom7.i
store i32 %6, ptr %arrayidx8.i, align 4, !tbaa !5
%7 = load i32, ptr @cnt, align 4, !tbaa !5
%inc.i = add nsw i32 %7, 1
store i32 %inc.i, ptr @cnt, align 4, !tbaa !5
store i32 %3, ptr %arrayidx3.i, align 4, !tbaa !5
%j.0.i = sub nsw i32 %j.035.i, %1
%cmp1.i = icmp sgt i32 %j.0.i, -1
br i1 %cmp1.i, label %land.rhs.i, label %for.inc.i, !llvm.loop !9
for.inc.i: ; preds = %while.body.i, %land.rhs.i
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %insertion.exit, label %land.rhs.preheader.i, !llvm.loop !11
insertion.exit: ; preds = %for.inc.i, %for.body9
%cmp8 = icmp sgt i64 %indvars.iv, 1
br i1 %cmp8, label %for.body9, label %for.end13, !llvm.loop !12
for.end13: ; preds = %insertion.exit
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%N = alloca i32, align 4
%a = alloca [1000000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #6
call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %a) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(4000000) %a, i8 0, i64 4000000, i1 false)
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N)
%0 = load i32, ptr %N, align 4, !tbaa !5
%cmp34 = icmp sgt i32 %0, 0
br i1 %cmp34, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %N, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !13
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @shell(i32 noundef %.lcssa, ptr noundef nonnull %a)
%3 = load i32, ptr @m, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%4 = load i32, ptr @m, align 4, !tbaa !5
%cmp437 = icmp sgt i32 %4, 0
br i1 %cmp437, label %for.body5.preheader, label %for.end13
for.body5.preheader: ; preds = %for.end
%5 = zext i32 %4 to i64
br label %for.body5
for.body5: ; preds = %for.body5.preheader, %for.body5
%indvars.iv43 = phi i64 [ %5, %for.body5.preheader ], [ %indvars.iv.next44, %for.body5 ]
%indvars.iv.next44 = add nsw i64 %indvars.iv43, -1
%idxprom6 = and i64 %indvars.iv.next44, 4294967295
%arrayidx7 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %idxprom6
%6 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6)
%7 = and i64 %indvars.iv.next44, 4294967295
%cmp9 = icmp eq i64 %7, 0
%. = select i1 %cmp9, i32 10, i32 32
%putchar33 = call i32 @putchar(i32 %.)
%cmp4 = icmp ugt i64 %indvars.iv43, 1
br i1 %cmp4, label %for.body5, label %for.end13, !llvm.loop !14
for.end13: ; preds = %for.body5, %for.end
%8 = load i32, ptr @cnt, align 4, !tbaa !5
%call14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %8)
%9 = load i32, ptr %N, align 4, !tbaa !5
%cmp1639 = icmp sgt i32 %9, 0
br i1 %cmp1639, label %for.body17, label %for.end23
for.body17: ; preds = %for.end13, %for.body17
%indvars.iv46 = phi i64 [ %indvars.iv.next47, %for.body17 ], [ 0, %for.end13 ]
%arrayidx19 = getelementptr inbounds [1000000 x i32], ptr %a, i64 0, i64 %indvars.iv46
%10 = load i32, ptr %arrayidx19, align 4, !tbaa !5
%call20 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %10)
%indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
%11 = load i32, ptr %N, align 4, !tbaa !5
%12 = sext i32 %11 to i64
%cmp16 = icmp slt i64 %indvars.iv.next47, %12
br i1 %cmp16, label %for.body17, label %for.end23, !llvm.loop !15
for.end23: ; preds = %for.body17, %for.end13
call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %a) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #4
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #5
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nofree nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include<stdio.h>
int A[10000000];
int m,count=0;
int G[1000000];
void insert(int *A,int n,int g){
int v;
int i,j;
for(i=g;i<n;i++){
v=A[i];
j=i-g;
while(j>=0 && A[j]>v){
A[j+g]=A[j];
j-=g;
count++;
}
A[j+g]=v;
}
}
void shell(int *A,int n){
int h,i;
for(i=0,h=1;;i++){
if(h>n)break;
G[i]=h;
h=3*h+1;
}
m=i+1;
for(i=m-1;i>=0;i--){
insert(A,n,G[i]);
}
}
int main(){
int n,i,j;
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",&A[i]);
shell(A,n);
printf("%d\n",m-1);
for(i=m-2;i>=0;i--){
printf("%d",G[i]);
if(i)printf(" ");
}
printf("\n%d\n",count);
for(i=0;i<n;i++)printf("%d\n",A[i]);
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119178/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119178/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@count = dso_local local_unnamed_addr global i32 0, align 4
@G = dso_local local_unnamed_addr global [1000000 x i32] zeroinitializer, align 16
@m = dso_local local_unnamed_addr global i32 0, align 4
@.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
@.str.3 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insert(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #0 {
entry:
%cmp36 = icmp slt i32 %g, %n
br i1 %cmp36, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = sext i32 %g to i64
%wide.trip.count = sext i32 %n to i64
br label %land.rhs.preheader
land.rhs.preheader: ; preds = %while.end, %for.body.preheader
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = trunc i64 %indvars.iv to i32
%3 = trunc i64 %indvars.iv to i32
%4 = sub i32 %3, %g
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ]
%i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ]
%idxprom2 = zext i32 %j.034 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2
%5 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %5, %1
br i1 %cmp4, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%idxprom7 = sext i32 %i.0.pn33 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7
store i32 %5, ptr %arrayidx8, align 4, !tbaa !5
%6 = load i32, ptr @count, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @count, align 4, !tbaa !5
%j.0 = sub nsw i32 %j.034, %g
%cmp1 = icmp sgt i32 %j.0, -1
br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !9
while.end: ; preds = %land.rhs, %while.body
%i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ]
%idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64
%arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11
store i32 %1, ptr %arrayidx12, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !11
for.end: ; preds = %while.end, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @shell(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%cmp16 = icmp slt i32 %n, 1
br i1 %cmp16, label %for.end.thread, label %if.end
for.end.thread: ; preds = %entry
store i32 1, ptr @m, align 4, !tbaa !5
br label %for.body.lr.ph
if.end: ; preds = %entry, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%h.017 = phi i32 [ %add, %if.end ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv
store i32 %h.017, ptr %arrayidx, align 4, !tbaa !5
%mul = mul nsw i32 %h.017, 3
%add = add nsw i32 %mul, 1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%cmp.not = icmp slt i32 %mul, %n
br i1 %cmp.not, label %if.end, label %for.end
for.end: ; preds = %if.end
%0 = trunc i64 %indvars.iv.next to i32
%add1 = add nuw nsw i32 %0, 1
store i32 %add1, ptr @m, align 4, !tbaa !5
%cmp319 = icmp sgt i32 %0, -1
br i1 %cmp319, label %for.body.lr.ph, label %for.end7
for.body.lr.ph: ; preds = %for.end.thread, %for.end
%i.0.lcssa28 = phi i64 [ 0, %for.end.thread ], [ %indvars.iv.next, %for.end ]
%wide.trip.count.i = sext i32 %n to i64
%1 = and i64 %i.0.lcssa28, 4294967295
br label %for.body
for.body: ; preds = %for.body.lr.ph, %insert.exit
%indvars.iv22 = phi i64 [ %1, %for.body.lr.ph ], [ %indvars.iv.next23, %insert.exit ]
%arrayidx5 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv22
%2 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp36.i = icmp slt i32 %2, %n
br i1 %cmp36.i, label %for.body.preheader.i, label %insert.exit
for.body.preheader.i: ; preds = %for.body
%3 = sext i32 %2 to i64
br label %land.rhs.preheader.i
land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %3, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%5 = trunc i64 %indvars.iv.i to i32
%6 = sub i32 %5, %2
br label %land.rhs.i
land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i
%j.034.i = phi i32 [ %j.0.i, %while.body.i ], [ %6, %land.rhs.preheader.i ]
%i.0.pn33.i = phi i32 [ %j.034.i, %while.body.i ], [ %5, %land.rhs.preheader.i ]
%idxprom2.i = zext i32 %j.034.i to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i
%7 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %7, %4
br i1 %cmp4.i, label %while.body.i, label %while.end.i
while.body.i: ; preds = %land.rhs.i
%idxprom7.i = sext i32 %i.0.pn33.i to i64
%arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i
store i32 %7, ptr %arrayidx8.i, align 4, !tbaa !5
%8 = load i32, ptr @count, align 4, !tbaa !5
%inc.i = add nsw i32 %8, 1
store i32 %inc.i, ptr @count, align 4, !tbaa !5
%j.0.i = sub nsw i32 %j.034.i, %2
%cmp1.i = icmp sgt i32 %j.0.i, -1
br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !9
while.end.i: ; preds = %while.body.i, %land.rhs.i
%i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn33.i, %land.rhs.i ], [ %j.034.i, %while.body.i ]
%idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64
%arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i
store i32 %4, ptr %arrayidx12.i, align 4, !tbaa !5
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %insert.exit, label %land.rhs.preheader.i, !llvm.loop !11
insert.exit: ; preds = %while.end.i, %for.body
%indvars.iv.next23 = add nsw i64 %indvars.iv22, -1
%cmp3 = icmp sgt i64 %indvars.iv22, 0
br i1 %cmp3, label %for.body, label %for.end7, !llvm.loop !12
for.end7: ; preds = %insert.exit, %for.end
ret void
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp32 = icmp sgt i32 %0, 0
br i1 %cmp32, label %for.body, label %for.end.thread.i
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
%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
%cmp16.i = icmp slt i32 %1, 1
br i1 %cmp16.i, label %for.end.thread.i, label %if.end.i
for.end.thread.i: ; preds = %entry, %for.end
%.lcssa59 = phi i32 [ %1, %for.end ], [ %0, %entry ]
store i32 1, ptr @m, align 4, !tbaa !5
br label %for.body.lr.ph.i
if.end.i: ; preds = %for.end, %if.end.i
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %if.end.i ], [ 0, %for.end ]
%h.017.i = phi i32 [ %add.i, %if.end.i ], [ 1, %for.end ]
%arrayidx.i = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv.i
store i32 %h.017.i, ptr %arrayidx.i, align 4, !tbaa !5
%mul.i = mul nsw i32 %h.017.i, 3
%add.i = add nsw i32 %mul.i, 1
%indvars.iv.next.i = add nuw i64 %indvars.iv.i, 1
%cmp.not.i = icmp slt i32 %mul.i, %1
br i1 %cmp.not.i, label %if.end.i, label %for.end.i
for.end.i: ; preds = %if.end.i
%3 = trunc i64 %indvars.iv.next.i to i32
%add1.i = add nuw nsw i32 %3, 1
store i32 %add1.i, ptr @m, align 4, !tbaa !5
%cmp319.i = icmp sgt i32 %3, -1
br i1 %cmp319.i, label %for.body.lr.ph.i, label %shell.exit
for.body.lr.ph.i: ; preds = %for.end.i, %for.end.thread.i
%.lcssa58 = phi i32 [ %.lcssa59, %for.end.thread.i ], [ %1, %for.end.i ]
%4 = phi i32 [ 0, %for.end.thread.i ], [ %3, %for.end.i ]
%i.0.lcssa28.i = phi i64 [ 0, %for.end.thread.i ], [ %indvars.iv.next.i, %for.end.i ]
%wide.trip.count.i.i = sext i32 %.lcssa58 to i64
%5 = and i64 %i.0.lcssa28.i, 4294967295
%count.promoted = load i32, ptr @count, align 4, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %insert.exit.i, %for.body.lr.ph.i
%count.promoted3543 = phi i32 [ %count.promoted, %for.body.lr.ph.i ], [ %count.promoted3539, %insert.exit.i ]
%indvars.iv22.i = phi i64 [ %5, %for.body.lr.ph.i ], [ %indvars.iv.next23.i, %insert.exit.i ]
%arrayidx5.i = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv22.i
%6 = load i32, ptr %arrayidx5.i, align 4, !tbaa !5
%cmp36.i.i = icmp slt i32 %6, %.lcssa58
br i1 %cmp36.i.i, label %for.body.preheader.i.i, label %insert.exit.i
for.body.preheader.i.i: ; preds = %for.body.i
%7 = sext i32 %6 to i64
br label %land.rhs.preheader.i.i
land.rhs.preheader.i.i: ; preds = %while.end.i.i, %for.body.preheader.i.i
%count.promoted3542 = phi i32 [ %count.promoted3543, %for.body.preheader.i.i ], [ %count.promoted3540, %while.end.i.i ]
%count.promoted38 = phi i32 [ %count.promoted3543, %for.body.preheader.i.i ], [ %count.promoted36, %while.end.i.i ]
%indvars.iv.i.i = phi i64 [ %7, %for.body.preheader.i.i ], [ %indvars.iv.next.i.i, %while.end.i.i ]
%arrayidx.i.i = getelementptr inbounds i32, ptr @A, i64 %indvars.iv.i.i
%8 = load i32, ptr %arrayidx.i.i, align 4, !tbaa !5
%9 = trunc i64 %indvars.iv.i.i to i32
%10 = sub i32 %9, %6
%idxprom2.i.i62 = zext i32 %10 to i64
%arrayidx3.i.i63 = getelementptr inbounds i32, ptr @A, i64 %idxprom2.i.i62
%11 = load i32, ptr %arrayidx3.i.i63, align 4, !tbaa !5
%cmp4.i.i64 = icmp sgt i32 %11, %8
br i1 %cmp4.i.i64, label %while.body.i.i, label %while.end.i.i
land.rhs.i.i: ; preds = %while.body.i.i
%idxprom2.i.i = zext i32 %j.0.i.i to i64
%arrayidx3.i.i = getelementptr inbounds i32, ptr @A, i64 %idxprom2.i.i
%12 = load i32, ptr %arrayidx3.i.i, align 4, !tbaa !5
%cmp4.i.i = icmp sgt i32 %12, %8
br i1 %cmp4.i.i, label %while.body.i.i, label %while.end.i.i.loopexit, !llvm.loop !9
while.body.i.i: ; preds = %land.rhs.preheader.i.i, %land.rhs.i.i
%13 = phi i32 [ %12, %land.rhs.i.i ], [ %11, %land.rhs.preheader.i.i ]
%i.0.pn33.i.i67 = phi i32 [ %j.034.i.i66, %land.rhs.i.i ], [ %9, %land.rhs.preheader.i.i ]
%j.034.i.i66 = phi i32 [ %j.0.i.i, %land.rhs.i.i ], [ %10, %land.rhs.preheader.i.i ]
%count.promoted3765 = phi i32 [ %inc.i.i, %land.rhs.i.i ], [ %count.promoted38, %land.rhs.preheader.i.i ]
%idxprom7.i.i = sext i32 %i.0.pn33.i.i67 to i64
%arrayidx8.i.i = getelementptr inbounds i32, ptr @A, i64 %idxprom7.i.i
store i32 %13, ptr %arrayidx8.i.i, align 4, !tbaa !5
%inc.i.i = add nsw i32 %count.promoted3765, 1
%j.0.i.i = sub nsw i32 %j.034.i.i66, %6
%cmp1.i.i = icmp sgt i32 %j.0.i.i, -1
br i1 %cmp1.i.i, label %land.rhs.i.i, label %while.end.i.i.loopexit, !llvm.loop !9
while.end.i.i.loopexit: ; preds = %while.body.i.i, %land.rhs.i.i
store i32 %inc.i.i, ptr @count, align 4, !tbaa !5
br label %while.end.i.i
while.end.i.i: ; preds = %while.end.i.i.loopexit, %land.rhs.preheader.i.i
%count.promoted3540 = phi i32 [ %count.promoted3542, %land.rhs.preheader.i.i ], [ %inc.i.i, %while.end.i.i.loopexit ]
%count.promoted36 = phi i32 [ %count.promoted38, %land.rhs.preheader.i.i ], [ %inc.i.i, %while.end.i.i.loopexit ]
%i.0.pn.lcssa.ph.i.i = phi i32 [ %9, %land.rhs.preheader.i.i ], [ %j.034.i.i66, %while.end.i.i.loopexit ]
%idxprom11.i.i = sext i32 %i.0.pn.lcssa.ph.i.i to i64
%arrayidx12.i.i = getelementptr inbounds i32, ptr @A, i64 %idxprom11.i.i
store i32 %8, ptr %arrayidx12.i.i, align 4, !tbaa !5
%indvars.iv.next.i.i = add nsw i64 %indvars.iv.i.i, 1
%exitcond.not.i.i = icmp eq i64 %indvars.iv.next.i.i, %wide.trip.count.i.i
br i1 %exitcond.not.i.i, label %insert.exit.i, label %land.rhs.preheader.i.i, !llvm.loop !11
insert.exit.i: ; preds = %while.end.i.i, %for.body.i
%count.promoted3539 = phi i32 [ %count.promoted3543, %for.body.i ], [ %count.promoted3540, %while.end.i.i ]
%indvars.iv.next23.i = add nsw i64 %indvars.iv22.i, -1
%cmp3.i = icmp sgt i64 %indvars.iv22.i, 0
br i1 %cmp3.i, label %for.body.i, label %shell.exit, !llvm.loop !12
shell.exit: ; preds = %insert.exit.i, %for.end.i
%sub = phi i32 [ %3, %for.end.i ], [ %4, %insert.exit.i ]
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub)
%14 = load i32, ptr @m, align 4, !tbaa !5
%cmp544 = icmp sgt i32 %14, 1
br i1 %cmp544, label %for.body6.preheader, label %for.end12
for.body6.preheader: ; preds = %shell.exit
%sub3 = add nsw i32 %14, -2
%15 = zext i32 %sub3 to i64
%arrayidx873 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %15
%16 = load i32, ptr %arrayidx873, align 4, !tbaa !5
%call974 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %16)
%tobool.not75 = icmp eq i32 %sub3, 0
br i1 %tobool.not75, label %for.end12, label %for.inc11
for.inc11: ; preds = %for.body6.preheader, %for.inc11
%indvars.iv5076 = phi i64 [ %indvars.iv.next51, %for.inc11 ], [ %15, %for.body6.preheader ]
%putchar = call i32 @putchar(i32 32)
%indvars.iv.next51 = add nsw i64 %indvars.iv5076, -1
%arrayidx8 = getelementptr inbounds [1000000 x i32], ptr @G, i64 0, i64 %indvars.iv.next51
%17 = load i32, ptr %arrayidx8, align 4, !tbaa !5
%call9 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %17)
%tobool.not = icmp eq i64 %indvars.iv.next51, 0
br i1 %tobool.not, label %for.end12, label %for.inc11, !llvm.loop !14
for.end12: ; preds = %for.inc11, %for.body6.preheader, %shell.exit
%18 = load i32, ptr @count, align 4, !tbaa !5
%call13 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %18)
%19 = load i32, ptr %n, align 4, !tbaa !5
%cmp1546 = icmp sgt i32 %19, 0
br i1 %cmp1546, label %for.body16, label %for.end22
for.body16: ; preds = %for.end12, %for.body16
%indvars.iv53 = phi i64 [ %indvars.iv.next54, %for.body16 ], [ 0, %for.end12 ]
%arrayidx18 = getelementptr inbounds [10000000 x i32], ptr @A, i64 0, i64 %indvars.iv53
%20 = load i32, ptr %arrayidx18, align 4, !tbaa !5
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %20)
%indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
%21 = load i32, ptr %n, align 4, !tbaa !5
%22 = sext i32 %21 to i64
%cmp15 = icmp slt i64 %indvars.iv.next54, %22
br i1 %cmp15, label %for.body16, label %for.end22, !llvm.loop !15
for.end22: ; preds = %for.body16, %for.end12
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
int cnt = 0;
void insertionSort(int A[], int n, int g) {
int i, j, v;
for(i = g;i < n;i++) {
v = A[i];
j = i - g;
while(j >= 0 && A[j] > v) {
A[j + g] = A[j];
j -= g;
cnt++;
}
A[j + g] = v;
}
}
void shellSort(int A[], int n) {
int i, j, G[n], H[n];
G[0] = 1;
for(i = 1;G[i - 1] * 3 + 1 < n / 2;i++)
G[i] = G[i - 1] * 3 + 1;
for(j = 0;j < i;j++)
H[j] = G[i - j - 1];
for(j = 0;j < i;j++) {
insertionSort(A, n, H[j]);
}
printf("%d\n", i);
for(j = 0;j < i - 1;j++)
printf("%d ", H[j]);
printf("%d\n", H[j]);
printf("%d\n", cnt);
for(j = 0;j < n;j++)
printf("%d\n", A[j]);
}
int main() {
int n, i, A[1000000];
scanf("%d", &n);
for(i = 0;i < n;i++)
scanf("%d", &A[i]);
shellSort(A, n);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119228/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119228/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #0 {
entry:
%cmp36 = icmp slt i32 %g, %n
br i1 %cmp36, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = sext i32 %g to i64
%wide.trip.count = sext i32 %n to i64
br label %land.rhs.preheader
land.rhs.preheader: ; preds = %while.end, %for.body.preheader
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = trunc i64 %indvars.iv to i32
%3 = trunc i64 %indvars.iv to i32
%4 = sub i32 %3, %g
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ]
%i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ]
%idxprom2 = zext i32 %j.034 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2
%5 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %5, %1
br i1 %cmp4, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%idxprom7 = sext i32 %i.0.pn33 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7
store i32 %5, ptr %arrayidx8, align 4, !tbaa !5
%6 = load i32, ptr @cnt, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @cnt, align 4, !tbaa !5
%j.0 = sub nsw i32 %j.034, %g
%cmp1 = icmp sgt i32 %j.0, -1
br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !9
while.end: ; preds = %land.rhs, %while.body
%i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ]
%idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64
%arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11
store i32 %1, ptr %arrayidx12, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !11
for.end: ; preds = %while.end, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @shellSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #2 {
entry:
%0 = zext i32 %n to i64
%vla = alloca i32, i64 %0, align 16
%vla1 = alloca i32, i64 %0, align 16
store i32 1, ptr %vla, align 16, !tbaa !5
%div = sdiv i32 %n, 2
%cmp81 = icmp sgt i32 %n, 9
br i1 %cmp81, label %for.body, label %for.cond10.preheader
for.cond10.preheader.loopexit: ; preds = %for.body
%1 = trunc i64 %indvars.iv to i32
%2 = trunc i64 %indvars.iv.next to i32
br label %for.cond10.preheader
for.cond10.preheader: ; preds = %for.cond10.preheader.loopexit, %entry
%i.0.lcssa = phi i32 [ 1, %entry ], [ %2, %for.cond10.preheader.loopexit ]
%sub.lcssa = phi i32 [ 0, %entry ], [ %1, %for.cond10.preheader.loopexit ]
%3 = sext i32 %i.0.lcssa to i64
%wide.trip.count = zext i32 %i.0.lcssa to i64
%4 = getelementptr i32, ptr %vla, i64 %3
%min.iters.check = icmp ult i32 %i.0.lcssa, 8
br i1 %min.iters.check, label %for.body12.preheader, label %vector.ph
vector.ph: ; preds = %for.cond10.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 ]
%5 = xor i64 %index, -1
%6 = getelementptr i32, ptr %4, i64 %5
%7 = getelementptr i32, ptr %6, i64 -3
%wide.load = load <4 x i32>, ptr %7, align 4, !tbaa !5
%reverse = shufflevector <4 x i32> %wide.load, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%8 = getelementptr i32, ptr %6, i64 -7
%wide.load112 = load <4 x i32>, ptr %8, align 4, !tbaa !5
%reverse113 = shufflevector <4 x i32> %wide.load112, <4 x i32> poison, <4 x i32> <i32 3, i32 2, i32 1, i32 0>
%9 = getelementptr inbounds i32, ptr %vla1, i64 %index
store <4 x i32> %reverse, ptr %9, align 16, !tbaa !5
%10 = getelementptr inbounds i32, ptr %9, i64 4
store <4 x i32> %reverse113, ptr %10, align 16, !tbaa !5
%index.next = add nuw i64 %index, 8
%11 = icmp eq i64 %index.next, %n.vec
br i1 %11, label %middle.block, label %vector.body, !llvm.loop !12
middle.block: ; preds = %vector.body
%cmp.n = icmp eq i64 %n.vec, %wide.trip.count
br i1 %cmp.n, label %for.cond22.preheader, label %for.body12.preheader
for.body12.preheader: ; preds = %for.cond10.preheader, %middle.block
%indvars.iv93.ph = phi i64 [ 0, %for.cond10.preheader ], [ %n.vec, %middle.block ]
br label %for.body12
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%add83 = phi i32 [ %add, %for.body ], [ 4, %entry ]
%arrayidx9 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
store i32 %add83, ptr %arrayidx9, align 4, !tbaa !5
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%mul = mul nsw i32 %add83, 3
%add = add nsw i32 %mul, 1
%cmp = icmp slt i32 %add, %div
br i1 %cmp, label %for.body, label %for.cond10.preheader.loopexit, !llvm.loop !15
for.cond22.preheader: ; preds = %for.body12, %middle.block
%wide.trip.count.i = sext i32 %n to i64
br label %for.body24
for.body12: ; preds = %for.body12.preheader, %for.body12
%indvars.iv93 = phi i64 [ %indvars.iv.next94, %for.body12 ], [ %indvars.iv93.ph, %for.body12.preheader ]
%12 = xor i64 %indvars.iv93, -1
%arrayidx16 = getelementptr i32, ptr %4, i64 %12
%13 = load i32, ptr %arrayidx16, align 4, !tbaa !5
%arrayidx18 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv93
store i32 %13, ptr %arrayidx18, align 4, !tbaa !5
%indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
%exitcond.not = icmp eq i64 %indvars.iv.next94, %wide.trip.count
br i1 %exitcond.not, label %for.cond22.preheader, label %for.body12, !llvm.loop !16
for.body24: ; preds = %for.cond22.preheader, %insertionSort.exit
%indvars.iv97 = phi i64 [ 0, %for.cond22.preheader ], [ %indvars.iv.next98, %insertionSort.exit ]
%arrayidx26 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv97
%14 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp36.i = icmp slt i32 %14, %n
br i1 %cmp36.i, label %for.body.preheader.i, label %insertionSort.exit
for.body.preheader.i: ; preds = %for.body24
%15 = sext i32 %14 to i64
br label %land.rhs.preheader.i
land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %15, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%16 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%17 = trunc i64 %indvars.iv.i to i32
%18 = sub i32 %17, %14
br label %land.rhs.i
land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i
%j.034.i = phi i32 [ %j.0.i, %while.body.i ], [ %18, %land.rhs.preheader.i ]
%i.0.pn33.i = phi i32 [ %j.034.i, %while.body.i ], [ %17, %land.rhs.preheader.i ]
%idxprom2.i = zext i32 %j.034.i to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i
%19 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %19, %16
br i1 %cmp4.i, label %while.body.i, label %while.end.i
while.body.i: ; preds = %land.rhs.i
%idxprom7.i = sext i32 %i.0.pn33.i to i64
%arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i
store i32 %19, ptr %arrayidx8.i, align 4, !tbaa !5
%20 = load i32, ptr @cnt, align 4, !tbaa !5
%inc.i = add nsw i32 %20, 1
store i32 %inc.i, ptr @cnt, align 4, !tbaa !5
%j.0.i = sub nsw i32 %j.034.i, %14
%cmp1.i = icmp sgt i32 %j.0.i, -1
br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !9
while.end.i: ; preds = %while.body.i, %land.rhs.i
%i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn33.i, %land.rhs.i ], [ %j.034.i, %while.body.i ]
%idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64
%arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i
store i32 %16, ptr %arrayidx12.i, align 4, !tbaa !5
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !11
insertionSort.exit: ; preds = %while.end.i, %for.body24
%indvars.iv.next98 = add nuw nsw i64 %indvars.iv97, 1
%exitcond101.not = icmp eq i64 %indvars.iv.next98, %wide.trip.count
br i1 %exitcond101.not, label %for.end29, label %for.body24, !llvm.loop !17
for.end29: ; preds = %insertionSort.exit
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %i.0.lcssa)
%cmp3287.not = icmp eq i32 %sub.lcssa, 0
br i1 %cmp3287.not, label %for.end39, label %for.body33.preheader
for.body33.preheader: ; preds = %for.end29
%wide.trip.count105 = zext i32 %sub.lcssa to i64
br label %for.body33
for.body33: ; preds = %for.body33.preheader, %for.body33
%indvars.iv102 = phi i64 [ 0, %for.body33.preheader ], [ %indvars.iv.next103, %for.body33 ]
%arrayidx35 = getelementptr inbounds i32, ptr %vla1, i64 %indvars.iv102
%21 = load i32, ptr %arrayidx35, align 4, !tbaa !5
%call36 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %21)
%indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
%exitcond106.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count105
br i1 %exitcond106.not, label %for.end39.loopexit, label %for.body33, !llvm.loop !18
for.end39.loopexit: ; preds = %for.body33
%22 = zext i32 %sub.lcssa to i64
br label %for.end39
for.end39: ; preds = %for.end29, %for.end39.loopexit
%j.2.lcssa = phi i64 [ %22, %for.end39.loopexit ], [ 0, %for.end29 ]
%arrayidx41 = getelementptr inbounds i32, ptr %vla1, i64 %j.2.lcssa
%23 = load i32, ptr %arrayidx41, align 4, !tbaa !5
%call42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %23)
%24 = load i32, ptr @cnt, align 4, !tbaa !5
%call43 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %24)
%cmp4590 = icmp sgt i32 %n, 0
br i1 %cmp4590, label %for.body46, label %for.end52
for.body46: ; preds = %for.end39, %for.body46
%indvars.iv107 = phi i64 [ %indvars.iv.next108, %for.body46 ], [ 0, %for.end39 ]
%arrayidx48 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv107
%25 = load i32, ptr %arrayidx48, align 4, !tbaa !5
%call49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %25)
%indvars.iv.next108 = add nuw nsw i64 %indvars.iv107, 1
%exitcond111.not = icmp eq i64 %indvars.iv.next108, %0
br i1 %exitcond111.not, label %for.end52, label %for.body46, !llvm.loop !19
for.end52: ; preds = %for.body46, %for.end39
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
%A = alloca [1000000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %A) #4
%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 [1000000 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 !20
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @shellSort(ptr noundef nonnull %A, i32 noundef %.lcssa)
call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %A) #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 #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !14, !13}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
|
#include <stdio.h>
int cnt;
void insertionSort(int A[], int n, int g)
{
int i;
for (i = g; i < n; i++) {
int v, j;
v = A[i];
j = i - g;
while (j >= 0 && A[j] > v) {
A[j + g] = A[j];
j -= g;
cnt++;
}
A[j + g] = v;
}
}
void shellSort(int A[], int n)
{
int i, m = 0;
int G[10] = {262913, 65921, 16577, 4193, 1073, 281, 77, 23, 8, 1};
for (i = 0; i < 10; i++) {
if (G[i] <= n) {
m++;
insertionSort(A, n, G[i]);
}
}
printf("%d\n", m);
i = 10 - m;
printf("%d", G[i]);
for (i++; i < 10; i++) printf(" %d", G[i]);
putchar('\n');
}
int main(void)
{
int n;
scanf("%d", &n);
int A[n];
int i;
for (i = 0; i < n; i++)
scanf("%d", &A[i]);
shellSort(A, n);
printf("%d\n", cnt);
for (i = 0; i < n; i++)
printf("%d\n", A[i]);
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119279/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119279/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@__const.shellSort.G = private unnamed_addr constant [10 x i32] [i32 262913, i32 65921, i32 16577, i32 4193, i32 1073, i32 281, i32 77, i32 23, i32 8, i32 1], align 16
@.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
@stdout = external local_unnamed_addr global ptr, align 8
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #0 {
entry:
%cmp36 = icmp slt i32 %g, %n
br i1 %cmp36, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = sext i32 %g to i64
%wide.trip.count = sext i32 %n to i64
br label %land.rhs.preheader
land.rhs.preheader: ; preds = %while.end, %for.body.preheader
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = trunc i64 %indvars.iv to i32
%3 = trunc i64 %indvars.iv to i32
%4 = sub i32 %3, %g
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ]
%i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ]
%idxprom2 = zext i32 %j.034 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2
%5 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %5, %1
br i1 %cmp4, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%idxprom7 = sext i32 %i.0.pn33 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7
store i32 %5, ptr %arrayidx8, align 4, !tbaa !5
%6 = load i32, ptr @cnt, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @cnt, align 4, !tbaa !5
%j.0 = sub nsw i32 %j.034, %g
%cmp1 = icmp sgt i32 %j.0, -1
br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !9
while.end: ; preds = %land.rhs, %while.body
%i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ]
%idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64
%arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11
store i32 %1, ptr %arrayidx12, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !11
for.end: ; preds = %while.end, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local void @shellSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #2 {
entry:
%wide.trip.count.i = sext i32 %n to i64
br label %for.body
for.body: ; preds = %entry, %for.inc
%indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.inc ]
%m.031 = phi i32 [ 0, %entry ], [ %m.1, %for.inc ]
%arrayidx = getelementptr inbounds [10 x i32], ptr @__const.shellSort.G, i64 0, i64 %indvars.iv
%0 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp1.not = icmp sgt i32 %0, %n
br i1 %cmp1.not, label %for.inc, label %if.then
if.then: ; preds = %for.body
%inc = add nsw i32 %m.031, 1
%cmp36.i = icmp slt i32 %0, %n
br i1 %cmp36.i, label %for.body.preheader.i, label %for.inc
for.body.preheader.i: ; preds = %if.then
%1 = sext i32 %0 to i64
br label %land.rhs.preheader.i
land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %1, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%2 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%3 = trunc i64 %indvars.iv.i to i32
%4 = sub i32 %3, %0
br label %land.rhs.i
land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i
%j.034.i = phi i32 [ %j.0.i, %while.body.i ], [ %4, %land.rhs.preheader.i ]
%i.0.pn33.i = phi i32 [ %j.034.i, %while.body.i ], [ %3, %land.rhs.preheader.i ]
%idxprom2.i = zext i32 %j.034.i to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i
%5 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %5, %2
br i1 %cmp4.i, label %while.body.i, label %while.end.i
while.body.i: ; preds = %land.rhs.i
%idxprom7.i = sext i32 %i.0.pn33.i to i64
%arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i
store i32 %5, ptr %arrayidx8.i, align 4, !tbaa !5
%6 = load i32, ptr @cnt, align 4, !tbaa !5
%inc.i = add nsw i32 %6, 1
store i32 %inc.i, ptr @cnt, align 4, !tbaa !5
%j.0.i = sub nsw i32 %j.034.i, %0
%cmp1.i = icmp sgt i32 %j.0.i, -1
br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !9
while.end.i: ; preds = %while.body.i, %land.rhs.i
%i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn33.i, %land.rhs.i ], [ %j.034.i, %while.body.i ]
%idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64
%arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i
store i32 %2, ptr %arrayidx12.i, align 4, !tbaa !5
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %for.inc, label %land.rhs.preheader.i, !llvm.loop !11
for.inc: ; preds = %while.end.i, %if.then, %for.body
%m.1 = phi i32 [ %m.031, %for.body ], [ %inc, %if.then ], [ %inc, %while.end.i ]
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, 10
br i1 %exitcond.not, label %for.end, label %for.body, !llvm.loop !12
for.end: ; preds = %for.inc
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %m.1)
%sub = sub nsw i32 10, %m.1
%idxprom5 = sext i32 %sub to i64
%arrayidx6 = getelementptr inbounds [10 x i32], ptr @__const.shellSort.G, i64 0, i64 %idxprom5
%7 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%call7 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %7)
%inc8 = sub i32 11, %m.1
%cmp1032 = icmp slt i32 %inc8, 10
br i1 %cmp1032, label %for.body11.preheader, label %for.end17
for.body11.preheader: ; preds = %for.end
%8 = sext i32 %inc8 to i64
br label %for.body11
for.body11: ; preds = %for.body11.preheader, %for.body11
%indvars.iv35 = phi i64 [ %8, %for.body11.preheader ], [ %indvars.iv.next36, %for.body11 ]
%arrayidx13 = getelementptr inbounds [10 x i32], ptr @__const.shellSort.G, i64 0, i64 %indvars.iv35
%9 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %9)
%indvars.iv.next36 = add nsw i64 %indvars.iv35, 1
%10 = and i64 %indvars.iv.next36, 4294967295
%exitcond38.not = icmp eq i64 %10, 10
br i1 %exitcond38.not, label %for.end17, label %for.body11, !llvm.loop !13
for.end17: ; preds = %for.body11, %for.end
%11 = load ptr, ptr @stdout, align 8, !tbaa !14
%call.i = tail call i32 @putc(i32 noundef 10, ptr noundef %11)
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = zext i32 %0 to i64
%2 = call ptr @llvm.stacksave.p0()
%vla = alloca i32, i64 %1, align 16
%3 = load i32, ptr %n, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %3, 0
br i1 %cmp17, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%4 = load i32, ptr %n, align 4, !tbaa !5
%5 = sext i32 %4 to i64
%cmp = icmp slt i64 %indvars.iv.next, %5
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !16
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %3, %entry ], [ %4, %for.body ]
call void @shellSort(ptr noundef nonnull %vla, i32 noundef %.lcssa)
%6 = load i32, ptr @cnt, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %6)
%7 = load i32, ptr %n, align 4, !tbaa !5
%cmp419 = icmp sgt i32 %7, 0
br i1 %cmp419, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %for.body5
%indvars.iv23 = phi i64 [ %indvars.iv.next24, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv23
%8 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %8)
%indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
%9 = load i32, ptr %n, align 4, !tbaa !5
%10 = sext i32 %9 to i64
%cmp4 = icmp slt i64 %indvars.iv.next24, %10
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !17
for.end11: ; preds = %for.body5, %for.end
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #4
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #4
; Function Attrs: nofree nounwind
declare noundef i32 @putc(i32 noundef, ptr nocapture noundef) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nosync nounwind willreturn }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = !{!15, !15, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
|
#include <stdio.h>
#include <stdlib.h>
#define N 1000000
int cnt = 0;
void insertionSort(int *A, int n, int g) {
int i, j, v;
for (i = g; i < n; i++) {
v = A[i];
j = i - g;
while (j >= 0 && A[j] > v) {
A[j+g] = A[j];
j = j - g;
cnt++;
}
A[j+g] = v;
}
}
int main(){
int A[N], G[N], n, i, j, m, g;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%d", &A[i]);
}
m = 1;
for (g = 1; g * 3 + 1 < n; g = g * 3 + 1, m++);
for (i = 0; i <= m - 1; i++) {
G[i] = g;
insertionSort(A, n, g);
g = (g - 1) / 3;
}
printf("%d\n", m);
for (i = 0; i < m - 1; i++) {
printf("%d ", G[i]);
}
printf("%d\n%d\n", G[i], cnt);
for (i = 0; i < n; i++) {
printf("%d\n", A[i]);
}
return 0;
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119321/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119321/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d \00", align 1
@.str.3 = private unnamed_addr constant [7 x i8] c"%d\0A%d\0A\00", align 1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #0 {
entry:
%cmp36 = icmp slt i32 %g, %n
br i1 %cmp36, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = sext i32 %g to i64
%wide.trip.count = sext i32 %n to i64
br label %land.rhs.preheader
land.rhs.preheader: ; preds = %while.end, %for.body.preheader
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = trunc i64 %indvars.iv to i32
%3 = trunc i64 %indvars.iv to i32
%4 = sub i32 %3, %g
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ]
%i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ]
%idxprom2 = zext i32 %j.034 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2
%5 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %5, %1
br i1 %cmp4, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%idxprom7 = sext i32 %i.0.pn33 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7
store i32 %5, ptr %arrayidx8, align 4, !tbaa !5
%6 = load i32, ptr @cnt, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @cnt, align 4, !tbaa !5
%j.0 = sub nsw i32 %j.034, %g
%cmp1 = icmp sgt i32 %j.0, -1
br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !9
while.end: ; preds = %land.rhs, %while.body
%i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ]
%idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64
%arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11
store i32 %1, ptr %arrayidx12, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !11
for.end: ; preds = %while.end, %entry
ret void
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #2 {
entry:
%A = alloca [1000000 x i32], align 16
%G = alloca [1000000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %A) #4
call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %G) #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 %for.body, label %for.cond2.preheader
for.cond2.preheader: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
br label %for.cond2
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.cond2.preheader, !llvm.loop !12
for.cond2: ; preds = %for.cond2, %for.cond2.preheader
%indvars.iv90 = phi i32 [ %indvars.iv.next91, %for.cond2 ], [ 0, %for.cond2.preheader ]
%m.0 = phi i32 [ %inc8, %for.cond2 ], [ 1, %for.cond2.preheader ]
%g.0 = phi i32 [ %add, %for.cond2 ], [ 1, %for.cond2.preheader ]
%mul = mul nsw i32 %g.0, 3
%add = add nsw i32 %mul, 1
%cmp3 = icmp slt i32 %add, %.lcssa
%inc8 = add nuw nsw i32 %m.0, 1
%indvars.iv.next91 = add nuw nsw i32 %indvars.iv90, 1
br i1 %cmp3, label %for.cond2, label %for.cond10.preheader, !llvm.loop !13
for.cond10.preheader: ; preds = %for.cond2
%cnt.promoted = load i32, ptr @cnt, align 4, !tbaa !5
%wide.trip.count.i = sext i32 %.lcssa to i64
%wide.trip.count = zext i32 %m.0 to i64
br label %for.body12
for.body12: ; preds = %for.cond10.preheader, %insertionSort.exit
%indvars.iv83 = phi i64 [ 0, %for.cond10.preheader ], [ %indvars.iv.next84, %insertionSort.exit ]
%g.175 = phi i32 [ %g.0, %for.cond10.preheader ], [ %div, %insertionSort.exit ]
%cnt.promoted647273 = phi i32 [ %cnt.promoted, %for.cond10.preheader ], [ %cnt.promoted6468, %insertionSort.exit ]
%arrayidx14 = getelementptr inbounds [1000000 x i32], ptr %G, i64 0, i64 %indvars.iv83
store i32 %g.175, ptr %arrayidx14, align 4, !tbaa !5
%cmp36.i = icmp slt i32 %g.175, %.lcssa
br i1 %cmp36.i, label %for.body.preheader.i, label %insertionSort.exit
for.body.preheader.i: ; preds = %for.body12
%3 = sext i32 %g.175 to i64
br label %land.rhs.preheader.i
land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i
%cnt.promoted6471 = phi i32 [ %cnt.promoted647273, %for.body.preheader.i ], [ %cnt.promoted6469, %while.end.i ]
%cnt.promoted67 = phi i32 [ %cnt.promoted647273, %for.body.preheader.i ], [ %cnt.promoted65, %while.end.i ]
%indvars.iv.i = phi i64 [ %3, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%4 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%5 = trunc i64 %indvars.iv.i to i32
%6 = sub i32 %5, %g.175
%idxprom2.i99 = zext i32 %6 to i64
%arrayidx3.i100 = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i99
%7 = load i32, ptr %arrayidx3.i100, align 4, !tbaa !5
%cmp4.i101 = icmp sgt i32 %7, %4
br i1 %cmp4.i101, label %while.body.i, label %while.end.i
land.rhs.i: ; preds = %while.body.i
%idxprom2.i = zext i32 %j.0.i to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i
%8 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %8, %4
br i1 %cmp4.i, label %while.body.i, label %while.end.i.loopexit, !llvm.loop !9
while.body.i: ; preds = %land.rhs.preheader.i, %land.rhs.i
%9 = phi i32 [ %8, %land.rhs.i ], [ %7, %land.rhs.preheader.i ]
%i.0.pn33.i104 = phi i32 [ %j.034.i103, %land.rhs.i ], [ %5, %land.rhs.preheader.i ]
%j.034.i103 = phi i32 [ %j.0.i, %land.rhs.i ], [ %6, %land.rhs.preheader.i ]
%cnt.promoted66102 = phi i32 [ %inc.i, %land.rhs.i ], [ %cnt.promoted67, %land.rhs.preheader.i ]
%idxprom7.i = sext i32 %i.0.pn33.i104 to i64
%arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i
store i32 %9, ptr %arrayidx8.i, align 4, !tbaa !5
%inc.i = add nsw i32 %cnt.promoted66102, 1
%j.0.i = sub nsw i32 %j.034.i103, %g.175
%cmp1.i = icmp sgt i32 %j.0.i, -1
br i1 %cmp1.i, label %land.rhs.i, label %while.end.i.loopexit, !llvm.loop !9
while.end.i.loopexit: ; preds = %while.body.i, %land.rhs.i
store i32 %inc.i, ptr @cnt, align 4, !tbaa !5
br label %while.end.i
while.end.i: ; preds = %while.end.i.loopexit, %land.rhs.preheader.i
%cnt.promoted6469 = phi i32 [ %cnt.promoted6471, %land.rhs.preheader.i ], [ %inc.i, %while.end.i.loopexit ]
%cnt.promoted65 = phi i32 [ %cnt.promoted67, %land.rhs.preheader.i ], [ %inc.i, %while.end.i.loopexit ]
%i.0.pn.lcssa.ph.i = phi i32 [ %5, %land.rhs.preheader.i ], [ %j.034.i103, %while.end.i.loopexit ]
%idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64
%arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i
store i32 %4, ptr %arrayidx12.i, align 4, !tbaa !5
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !11
insertionSort.exit: ; preds = %while.end.i, %for.body12
%cnt.promoted6468 = phi i32 [ %cnt.promoted647273, %for.body12 ], [ %cnt.promoted6469, %while.end.i ]
%sub15 = add nsw i32 %g.175, -1
%div = sdiv i32 %sub15, 3
%indvars.iv.next84 = add nuw nsw i64 %indvars.iv83, 1
%exitcond.not = icmp eq i64 %indvars.iv.next84, %wide.trip.count
br i1 %exitcond.not, label %for.end18, label %for.body12, !llvm.loop !14
for.end18: ; preds = %insertionSort.exit
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.0)
%cmp2276 = icmp ugt i32 %m.0, 1
br i1 %cmp2276, label %for.body23.preheader, label %for.end29
for.body23.preheader: ; preds = %for.end18
%wide.trip.count92 = zext i32 %indvars.iv90 to i64
br label %for.body23
for.body23: ; preds = %for.body23.preheader, %for.body23
%indvars.iv87 = phi i64 [ 0, %for.body23.preheader ], [ %indvars.iv.next88, %for.body23 ]
%arrayidx25 = getelementptr inbounds [1000000 x i32], ptr %G, i64 0, i64 %indvars.iv87
%10 = load i32, ptr %arrayidx25, align 4, !tbaa !5
%call26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %10)
%indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
%exitcond93.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count92
br i1 %exitcond93.not, label %for.end29.loopexit, label %for.body23, !llvm.loop !15
for.end29.loopexit: ; preds = %for.body23
%11 = zext i32 %indvars.iv90 to i64
br label %for.end29
for.end29: ; preds = %for.end18, %for.end29.loopexit
%i.2.lcssa = phi i64 [ %11, %for.end29.loopexit ], [ 0, %for.end18 ]
%arrayidx31 = getelementptr inbounds [1000000 x i32], ptr %G, i64 0, i64 %i.2.lcssa
%12 = load i32, ptr %arrayidx31, align 4, !tbaa !5
%13 = load i32, ptr @cnt, align 4, !tbaa !5
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %12, i32 noundef %13)
%14 = load i32, ptr %n, align 4, !tbaa !5
%cmp3479 = icmp sgt i32 %14, 0
br i1 %cmp3479, label %for.body35, label %for.end41
for.body35: ; preds = %for.end29, %for.body35
%indvars.iv94 = phi i64 [ %indvars.iv.next95, %for.body35 ], [ 0, %for.end29 ]
%arrayidx37 = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv94
%15 = load i32, ptr %arrayidx37, align 4, !tbaa !5
%call38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %15)
%indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
%16 = load i32, ptr %n, align 4, !tbaa !5
%17 = sext i32 %16 to i64
%cmp34 = icmp slt i64 %indvars.iv.next95, %17
br i1 %cmp34, label %for.body35, label %for.end41, !llvm.loop !16
for.end41: ; preds = %for.body35, %for.end29
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %G) #4
call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %A) #4
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3
attributes #0 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
void insertionSort(int *A,int n,int g);
void shellSort(int *A,int n);
int cnt=0;
int main(void){
int A[1000000],G[1000];
int i,n;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
shellSort(A,n);
printf("%d\n",cnt);
for(i=0;i<n;i++){
printf("%d\n",A[i]);
}
return 0;
}
void insertionSort(int *A,int n,int g){
int i,j,v;
for(i=g;i<n;i++){
v=A[i];
j=i-g;
while(j>=0 && A[j]>v){
A[j+g]=A[j];
j=j-g;
cnt++;
}
A[j+g]=v;
}
}
void shellSort(int *A,int n){
int cnt,m=0,i,h;
int G[1000];
cnt=0;
for(h=1,i=0;;i++){
if(h>n){
break;
}
G[i]=h;
h=3*h+1;
m++;
}
for(i=m-1;i>=0;i--){
insertionSort(A,n,G[i]);
}
printf("%d\n",m);
for(i=m-1;i>=0;i--){
printf("%d",G[i]);
if(i!=0){
printf(" ");
}
}
printf("\n");
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119365/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119365/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [1000000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %0, 0
br i1 %cmp17, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @shellSort(ptr noundef nonnull %A, i32 noundef %.lcssa)
%3 = load i32, ptr @cnt, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp419 = icmp sgt i32 %4, 0
br i1 %cmp419, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %for.body5
%indvars.iv23 = phi i64 [ %indvars.iv.next24, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv23
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %5)
%indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp4 = icmp slt i64 %indvars.iv.next24, %7
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !11
for.end11: ; preds = %for.body5, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @shellSort(ptr nocapture noundef %A, i32 noundef %n) local_unnamed_addr #0 {
entry:
%G = alloca [1000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4000, ptr nonnull %G) #5
%cmp38 = icmp slt i32 %n, 1
br i1 %cmp38, label %for.end7.thread, label %if.end
if.end: ; preds = %entry, %if.end
%indvars.iv = phi i64 [ %indvars.iv.next, %if.end ], [ 0, %entry ]
%h.041 = phi i32 [ %add, %if.end ], [ 1, %entry ]
%arrayidx = getelementptr inbounds [1000 x i32], ptr %G, i64 0, i64 %indvars.iv
store i32 %h.041, ptr %arrayidx, align 4, !tbaa !5
%mul = mul nsw i32 %h.041, 3
%add = add nsw i32 %mul, 1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%cmp.not = icmp slt i32 %mul, %n
br i1 %cmp.not, label %if.end, label %for.end
for.end: ; preds = %if.end
%indvars47 = trunc i64 %indvars.iv.next to i32
%sub = add i32 %indvars47, -1
%cmp342 = icmp sgt i32 %indvars47, 0
br i1 %cmp342, label %for.body.lr.ph, label %for.end7.thread
for.body.lr.ph: ; preds = %for.end
%wide.trip.count.i = sext i32 %n to i64
%0 = zext i32 %sub to i64
br label %for.body
for.body: ; preds = %for.body.lr.ph, %insertionSort.exit
%indvars.iv49 = phi i64 [ %0, %for.body.lr.ph ], [ %indvars.iv.next50, %insertionSort.exit ]
%arrayidx5 = getelementptr inbounds [1000 x i32], ptr %G, i64 0, i64 %indvars.iv49
%1 = load i32, ptr %arrayidx5, align 4, !tbaa !5
%cmp36.i = icmp slt i32 %1, %n
br i1 %cmp36.i, label %for.body.preheader.i, label %insertionSort.exit
for.body.preheader.i: ; preds = %for.body
%2 = sext i32 %1 to i64
br label %land.rhs.preheader.i
land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %2, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %A, i64 %indvars.iv.i
%3 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%4 = trunc i64 %indvars.iv.i to i32
%5 = sub i32 %4, %1
br label %land.rhs.i
land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i
%j.034.i = phi i32 [ %j.0.i, %while.body.i ], [ %5, %land.rhs.preheader.i ]
%i.0.pn33.i = phi i32 [ %j.034.i, %while.body.i ], [ %4, %land.rhs.preheader.i ]
%idxprom2.i = zext i32 %j.034.i to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %A, i64 %idxprom2.i
%6 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %6, %3
br i1 %cmp4.i, label %while.body.i, label %while.end.i
while.body.i: ; preds = %land.rhs.i
%idxprom7.i = sext i32 %i.0.pn33.i to i64
%arrayidx8.i = getelementptr inbounds i32, ptr %A, i64 %idxprom7.i
store i32 %6, ptr %arrayidx8.i, align 4, !tbaa !5
%7 = load i32, ptr @cnt, align 4, !tbaa !5
%inc.i = add nsw i32 %7, 1
store i32 %inc.i, ptr @cnt, align 4, !tbaa !5
%j.0.i = sub nsw i32 %j.034.i, %1
%cmp1.i = icmp sgt i32 %j.0.i, -1
br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !12
while.end.i: ; preds = %while.body.i, %land.rhs.i
%i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn33.i, %land.rhs.i ], [ %j.034.i, %while.body.i ]
%idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64
%arrayidx12.i = getelementptr inbounds i32, ptr %A, i64 %idxprom11.i
store i32 %3, ptr %arrayidx12.i, align 4, !tbaa !5
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %insertionSort.exit, label %land.rhs.preheader.i, !llvm.loop !13
insertionSort.exit: ; preds = %while.end.i, %for.body
%indvars.iv.next50 = add nsw i64 %indvars.iv49, -1
%cmp3 = icmp sgt i64 %indvars.iv49, 0
br i1 %cmp3, label %for.body, label %for.end7, !llvm.loop !14
for.end7.thread: ; preds = %for.end, %entry
%m.0.lcssa58.ph = phi i32 [ %indvars47, %for.end ], [ 0, %entry ]
%call64 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %m.0.lcssa58.ph)
br label %for.end21
for.end7: ; preds = %insertionSort.exit
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %indvars47)
br i1 %cmp342, label %for.body11.preheader, label %for.end21
for.body11.preheader: ; preds = %for.end7
%8 = zext i32 %sub to i64
%arrayidx1367 = getelementptr inbounds [1000 x i32], ptr %G, i64 0, i64 %8
%9 = load i32, ptr %arrayidx1367, align 4, !tbaa !5
%call1468 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %9)
%cmp15.not69 = icmp eq i32 %sub, 0
br i1 %cmp15.not69, label %for.end21, label %for.inc19
for.inc19: ; preds = %for.body11.preheader, %for.inc19
%indvars.iv5270 = phi i64 [ %indvars.iv.next53, %for.inc19 ], [ %8, %for.body11.preheader ]
%putchar37 = tail call i32 @putchar(i32 32)
%indvars.iv.next53 = add nsw i64 %indvars.iv5270, -1
%arrayidx13 = getelementptr inbounds [1000 x i32], ptr %G, i64 0, i64 %indvars.iv.next53
%10 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %10)
%cmp15.not = icmp eq i64 %indvars.iv.next53, 0
br i1 %cmp15.not, label %for.end21, label %for.inc19, !llvm.loop !15
for.end21: ; preds = %for.inc19, %for.body11.preheader, %for.end7.thread, %for.end7
%putchar = tail call i32 @putchar(i32 10)
call void @llvm.lifetime.end.p0(i64 4000, ptr nonnull %G) #5
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insertionSort(ptr nocapture noundef %A, i32 noundef %n, i32 noundef %g) local_unnamed_addr #3 {
entry:
%cmp36 = icmp slt i32 %g, %n
br i1 %cmp36, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = sext i32 %g to i64
%wide.trip.count = sext i32 %n to i64
br label %land.rhs.preheader
land.rhs.preheader: ; preds = %while.end, %for.body.preheader
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ]
%arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = trunc i64 %indvars.iv to i32
%3 = trunc i64 %indvars.iv to i32
%4 = sub i32 %3, %g
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ]
%i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ]
%idxprom2 = zext i32 %j.034 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %A, i64 %idxprom2
%5 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %5, %1
br i1 %cmp4, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%idxprom7 = sext i32 %i.0.pn33 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %A, i64 %idxprom7
store i32 %5, ptr %arrayidx8, align 4, !tbaa !5
%6 = load i32, ptr @cnt, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @cnt, align 4, !tbaa !5
%j.0 = sub nsw i32 %j.034, %g
%cmp1 = icmp sgt i32 %j.0, -1
br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !12
while.end: ; preds = %land.rhs, %while.body
%i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ]
%idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64
%arrayidx12 = getelementptr inbounds i32, ptr %A, i64 %idxprom11
store i32 %1, ptr %arrayidx12, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !13
for.end: ; preds = %while.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
|
#include <stdio.h>
#include <math.h>
#define Z 1000000
void insertionsort(int *,int,int);
void shellsort(int *,int);
void swap(int *,int *);
int cnt=0;
int g[Z];
int main(){
int A[Z],i,j,n;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&A[i]);
shellsort(A,n);
printf("\n%d\n",cnt);
for(i=0;i<n;i++){
printf("%d\n",A[i]);
}
return 0;
}
void insertionsort(int a[],int n,int g){
int i,v,j;
for(i=g;i<n;i++){
v=a[i];
j=i-g;
while(j>=0&&a[j]>v){
a[j+g]=a[j];
j=j-g;
cnt++;
}
a[j+g]=v;
}
}
void shellsort(int a[],int n){
int i,j,m=0,c=2;
cnt=0;
g[0]=1;
for(i=1;g[i-1]<=n;i++){
g[i]=g[i-1]*3+1;
m++;
}
printf("%d\n",m);
for(j=0;j<m;j++){
printf("%d",g[m-1-j]);
if(j<m)printf(" ");
}
for(i=0;i<m;i++)
insertionsort(a,n,g[m-i-1]);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119408/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119408/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@cnt = dso_local local_unnamed_addr global i32 0, align 4
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [5 x i8] c"\0A%d\0A\00", align 1
@.str.2 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
@g = dso_local local_unnamed_addr global [1000000 x i32] zeroinitializer, align 16
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%A = alloca [1000000 x i32], align 16
%n = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4000000, ptr nonnull %A) #5
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #5
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp17 = icmp sgt i32 %0, 0
br i1 %cmp17, label %for.body, label %for.end
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%1 = load i32, ptr %n, align 4, !tbaa !5
%2 = sext i32 %1 to i64
%cmp = icmp slt i64 %indvars.iv.next, %2
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body, %entry
%.lcssa = phi i32 [ %0, %entry ], [ %1, %for.body ]
call void @shellsort(ptr noundef nonnull %A, i32 noundef %.lcssa)
%3 = load i32, ptr @cnt, align 4, !tbaa !5
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %3)
%4 = load i32, ptr %n, align 4, !tbaa !5
%cmp419 = icmp sgt i32 %4, 0
br i1 %cmp419, label %for.body5, label %for.end11
for.body5: ; preds = %for.end, %for.body5
%indvars.iv23 = phi i64 [ %indvars.iv.next24, %for.body5 ], [ 0, %for.end ]
%arrayidx7 = getelementptr inbounds [1000000 x i32], ptr %A, i64 0, i64 %indvars.iv23
%5 = load i32, ptr %arrayidx7, align 4, !tbaa !5
%call8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %5)
%indvars.iv.next24 = add nuw nsw i64 %indvars.iv23, 1
%6 = load i32, ptr %n, align 4, !tbaa !5
%7 = sext i32 %6 to i64
%cmp4 = icmp slt i64 %indvars.iv.next24, %7
br i1 %cmp4, label %for.body5, label %for.end11, !llvm.loop !11
for.end11: ; preds = %for.body5, %for.end
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #5
call void @llvm.lifetime.end.p0(i64 4000000, ptr nonnull %A) #5
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind uwtable
define dso_local void @shellsort(ptr nocapture noundef %a, i32 noundef %n) local_unnamed_addr #0 {
entry:
store i32 0, ptr @cnt, align 4, !tbaa !5
store i32 1, ptr @g, align 16, !tbaa !5
%cmp.not46 = icmp slt i32 %n, 1
br i1 %cmp.not46, label %for.cond20.preheader.thread, label %for.body
for.cond20.preheader.thread: ; preds = %entry
%call65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 0)
br label %for.end29
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 1, %entry ]
%0 = phi i32 [ %add, %for.body ], [ 1, %entry ]
%m.047 = phi i32 [ %inc, %for.body ], [ 0, %entry ]
%mul = mul nsw i32 %0, 3
%add = add nsw i32 %mul, 1
%arrayidx5 = getelementptr inbounds [1000000 x i32], ptr @g, i64 0, i64 %indvars.iv
store i32 %add, ptr %arrayidx5, align 4, !tbaa !5
%inc = add nuw nsw i32 %m.047, 1
%indvars.iv.next = add nuw i64 %indvars.iv, 1
%cmp.not.not = icmp slt i32 %mul, %n
br i1 %cmp.not.not, label %for.body, label %for.body9.preheader, !llvm.loop !12
for.body9.preheader: ; preds = %for.body
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %inc)
%1 = zext i32 %inc to i64
%wide.trip.count = zext i32 %inc to i64
br label %for.body9
for.body22.lr.ph: ; preds = %for.body9
%wide.trip.count.i = sext i32 %n to i64
%2 = zext i32 %inc to i64
%wide.trip.count62 = zext i32 %inc to i64
br label %for.body22
for.body9: ; preds = %for.body9.preheader, %for.body9
%indvars.iv54 = phi i64 [ 0, %for.body9.preheader ], [ %indvars.iv.next55, %for.body9 ]
%3 = xor i64 %indvars.iv54, -1
%4 = add nsw i64 %1, %3
%arrayidx13 = getelementptr inbounds [1000000 x i32], ptr @g, i64 0, i64 %4
%5 = load i32, ptr %arrayidx13, align 4, !tbaa !5
%call14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
%putchar = tail call i32 @putchar(i32 32)
%indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
%exitcond.not = icmp eq i64 %indvars.iv.next55, %wide.trip.count
br i1 %exitcond.not, label %for.body22.lr.ph, label %for.body9, !llvm.loop !13
for.body22: ; preds = %for.body22.lr.ph, %insertionsort.exit
%indvars.iv58 = phi i64 [ 0, %for.body22.lr.ph ], [ %indvars.iv.next59, %insertionsort.exit ]
%6 = xor i64 %indvars.iv58, -1
%7 = add nsw i64 %2, %6
%arrayidx26 = getelementptr inbounds [1000000 x i32], ptr @g, i64 0, i64 %7
%8 = load i32, ptr %arrayidx26, align 4, !tbaa !5
%cmp36.i = icmp slt i32 %8, %n
br i1 %cmp36.i, label %for.body.preheader.i, label %insertionsort.exit
for.body.preheader.i: ; preds = %for.body22
%9 = sext i32 %8 to i64
br label %land.rhs.preheader.i
land.rhs.preheader.i: ; preds = %while.end.i, %for.body.preheader.i
%indvars.iv.i = phi i64 [ %9, %for.body.preheader.i ], [ %indvars.iv.next.i, %while.end.i ]
%arrayidx.i = getelementptr inbounds i32, ptr %a, i64 %indvars.iv.i
%10 = load i32, ptr %arrayidx.i, align 4, !tbaa !5
%11 = trunc i64 %indvars.iv.i to i32
%12 = sub i32 %11, %8
br label %land.rhs.i
land.rhs.i: ; preds = %while.body.i, %land.rhs.preheader.i
%j.034.i = phi i32 [ %j.0.i, %while.body.i ], [ %12, %land.rhs.preheader.i ]
%i.0.pn33.i = phi i32 [ %j.034.i, %while.body.i ], [ %11, %land.rhs.preheader.i ]
%idxprom2.i = zext i32 %j.034.i to i64
%arrayidx3.i = getelementptr inbounds i32, ptr %a, i64 %idxprom2.i
%13 = load i32, ptr %arrayidx3.i, align 4, !tbaa !5
%cmp4.i = icmp sgt i32 %13, %10
br i1 %cmp4.i, label %while.body.i, label %while.end.i
while.body.i: ; preds = %land.rhs.i
%idxprom7.i = sext i32 %i.0.pn33.i to i64
%arrayidx8.i = getelementptr inbounds i32, ptr %a, i64 %idxprom7.i
store i32 %13, ptr %arrayidx8.i, align 4, !tbaa !5
%14 = load i32, ptr @cnt, align 4, !tbaa !5
%inc.i = add nsw i32 %14, 1
store i32 %inc.i, ptr @cnt, align 4, !tbaa !5
%j.0.i = sub nsw i32 %j.034.i, %8
%cmp1.i = icmp sgt i32 %j.0.i, -1
br i1 %cmp1.i, label %land.rhs.i, label %while.end.i, !llvm.loop !14
while.end.i: ; preds = %while.body.i, %land.rhs.i
%i.0.pn.lcssa.ph.i = phi i32 [ %i.0.pn33.i, %land.rhs.i ], [ %j.034.i, %while.body.i ]
%idxprom11.i = sext i32 %i.0.pn.lcssa.ph.i to i64
%arrayidx12.i = getelementptr inbounds i32, ptr %a, i64 %idxprom11.i
store i32 %10, ptr %arrayidx12.i, align 4, !tbaa !5
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, 1
%exitcond.not.i = icmp eq i64 %indvars.iv.next.i, %wide.trip.count.i
br i1 %exitcond.not.i, label %insertionsort.exit, label %land.rhs.preheader.i, !llvm.loop !15
insertionsort.exit: ; preds = %while.end.i, %for.body22
%indvars.iv.next59 = add nuw nsw i64 %indvars.iv58, 1
%exitcond63.not = icmp eq i64 %indvars.iv.next59, %wide.trip.count62
br i1 %exitcond63.not, label %for.end29, label %for.body22, !llvm.loop !16
for.end29: ; preds = %insertionsort.exit, %for.cond20.preheader.thread
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @insertionsort(ptr nocapture noundef %a, i32 noundef %n, i32 noundef %g) local_unnamed_addr #3 {
entry:
%cmp36 = icmp slt i32 %g, %n
br i1 %cmp36, label %for.body.preheader, label %for.end
for.body.preheader: ; preds = %entry
%0 = sext i32 %g to i64
%wide.trip.count = sext i32 %n to i64
br label %land.rhs.preheader
land.rhs.preheader: ; preds = %while.end, %for.body.preheader
%indvars.iv = phi i64 [ %0, %for.body.preheader ], [ %indvars.iv.next, %while.end ]
%arrayidx = getelementptr inbounds i32, ptr %a, i64 %indvars.iv
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%2 = trunc i64 %indvars.iv to i32
%3 = trunc i64 %indvars.iv to i32
%4 = sub i32 %3, %g
br label %land.rhs
land.rhs: ; preds = %land.rhs.preheader, %while.body
%j.034 = phi i32 [ %j.0, %while.body ], [ %4, %land.rhs.preheader ]
%i.0.pn33 = phi i32 [ %j.034, %while.body ], [ %2, %land.rhs.preheader ]
%idxprom2 = zext i32 %j.034 to i64
%arrayidx3 = getelementptr inbounds i32, ptr %a, i64 %idxprom2
%5 = load i32, ptr %arrayidx3, align 4, !tbaa !5
%cmp4 = icmp sgt i32 %5, %1
br i1 %cmp4, label %while.body, label %while.end
while.body: ; preds = %land.rhs
%idxprom7 = sext i32 %i.0.pn33 to i64
%arrayidx8 = getelementptr inbounds i32, ptr %a, i64 %idxprom7
store i32 %5, ptr %arrayidx8, align 4, !tbaa !5
%6 = load i32, ptr @cnt, align 4, !tbaa !5
%inc = add nsw i32 %6, 1
store i32 %inc, ptr @cnt, align 4, !tbaa !5
%j.0 = sub nsw i32 %j.034, %g
%cmp1 = icmp sgt i32 %j.0, -1
br i1 %cmp1, label %land.rhs, label %while.end, !llvm.loop !14
while.end: ; preds = %land.rhs, %while.body
%i.0.pn.lcssa.ph = phi i32 [ %i.0.pn33, %land.rhs ], [ %j.034, %while.body ]
%idxprom11 = sext i32 %i.0.pn.lcssa.ph to i64
%arrayidx12 = getelementptr inbounds i32, ptr %a, i64 %idxprom11
store i32 %1, ptr %arrayidx12, align 4, !tbaa !5
%indvars.iv.next = add nsw i64 %indvars.iv, 1
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
br i1 %exitcond.not, label %for.end, label %land.rhs.preheader, !llvm.loop !15
for.end: ; preds = %while.end, %entry
ret void
}
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind }
attributes #5 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
|
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define MOD 998244353
//*
//遅延セグ木ここから
//↓ここを変える
typedef struct sayouso{ll a,b;}sayouso;
typedef struct atai{ll s,len;}atai;
//↑ここを変える
typedef struct node{sayouso T;atai x;}node;
node *lsegN,*lseg;
ll lsegNUM;
//↓ここから変える
sayouso sid={1,0};
atai aid={0,1};
atai xx(atai x,atai y){
atai ret;
ret.s=(x.s+y.s)%MOD;
ret.len=x.len+y.len;
return ret;
}
atai Tx(sayouso T,atai x){
atai ret;
ret.s=(T.a*x.s+T.b*x.len)%MOD;
ret.len=x.len;
return ret;
}
sayouso TT(sayouso S,sayouso T){
sayouso ret;
ret.a=S.a*T.a%MOD;
ret.b=(S.b+S.a*T.b)%MOD;
return ret;
}
//↑ここまで変える
//要素数(2ベキ)でこれを呼ぶ
void lseguse(ll n){
lsegN=(node*)calloc(2*n,sizeof(node));
lsegNUM=n;
lseg=lsegN+lsegNUM;
rep(i,0,lsegNUM){
lseg[i].x=aid;
lseg[i].T=sid;
}
for(int i=lsegNUM-1;i>0;i--){
lsegN[i].x=xx(lsegN[2*i].x,lsegN[2*i+1].x);
lsegN[i].T=sid;
}
}
//lseg[i].xに値を与えてから初期化
void lseginit(){
for(int i=lsegNUM-1;i>0;i--)lsegN[i].x=xx(lsegN[2*i].x,lsegN[2*i+1].x);
}
void lsegupdatesub(ll l,ll r,sayouso T,ll i,ll cl,ll cr){
if(l>=r)return;
//disjointなとき
if(cr<=l||r<=cl)return;
//完全に含むとき
if(l<=cl&&cr<=r){
lsegN[i].T=TT(T,lsegN[i].T);
return;
}
//どちらでもないとき
//遅延伝播
lsegN[2*i ].T=TT(lsegN[i].T,lsegN[2*i ].T);
lsegN[2*i+1].T=TT(lsegN[i].T,lsegN[2*i+1].T);
//再帰的に更新
ll cm=(cl+cr)/2;
lsegupdatesub(l,r,T,2*i ,cl,cm);
lsegupdatesub(l,r,T,2*i+1,cm,cr);
//自身のnodeを更新
lsegN[i].x=xx(Tx(lsegN[2*i].T,lsegN[2*i].x),Tx(lsegN[2*i+1].T,lsegN[2*i+1].x));
lsegN[i].T=sid;
}
void lsegupdate(ll l,ll r,sayouso T){lsegupdatesub(l,r,T,1,0,lsegNUM);}
atai lsegcalcsub(ll l,ll r,ll i,ll cl,ll cr){
if(l>=r)return aid;
//完全に含むとき
if(l<=cl&&cr<=r)return Tx(lsegN[i].T,lsegN[i].x);
ll cm=(cl+cr)/2;
//遅延伝播(変更はないので配るだけで良い)
lsegN[2*i ].T=TT(lsegN[i].T,lsegN[2*i ].T);
lsegN[2*i+1].T=TT(lsegN[i].T,lsegN[2*i+1].T);
lsegN[i].x=Tx(lsegN[i].T,lsegN[i].x);
lsegN[i].T=sid;
//左側だけ
if(r<=cm)return lsegcalcsub(l,r,2*i ,cl,cm);
//右側だけ
if(cm<=l)return lsegcalcsub(l,r,2*i+1,cm,cr);
//両方
return xx(lsegcalcsub(l,r,2*i,cl,cm),lsegcalcsub(l,r,2*i+1,cm,cr));
}
atai lsegcalc(ll l,ll r){return lsegcalcsub(l,r,1,0,lsegNUM);}
//遅延セグ木ここまで
//*/
int main(){
int n,q;
scanf("%d%d",&n,&q);
lseguse(1<<19);
rep(i,0,n){
int t;
scanf("%d",&t);
lseg[i].x.s=t;
}
lseginit();
while(q--){
int t,l,r;
scanf("%d%d%d",&t,&l,&r);
if(t==0){
int a,b;
scanf("%d%d",&a,&b);
sayouso T={a,b};
lsegupdate(l,r,T);
}else{
printf("%lld\n",lsegcalc(l,r).s);
}
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119451/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119451/source.c"
target datalayout = "e-m:e-p270: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.sayouso = type { i64, i64 }
%struct.atai = type { i64, i64 }
%struct.node = type { %struct.sayouso, %struct.atai }
@sid = dso_local local_unnamed_addr global %struct.sayouso { i64 1, i64 0 }, align 8
@aid = dso_local local_unnamed_addr global %struct.atai { i64 0, i64 1 }, align 8
@lsegN = dso_local local_unnamed_addr global ptr null, align 8
@lsegNUM = dso_local local_unnamed_addr global i64 0, align 8
@lseg = dso_local local_unnamed_addr global ptr null, align 8
@.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 [7 x i8] c"%d%d%d\00", align 1
@.str.3 = private unnamed_addr constant [6 x i8] c"%lld\0A\00", align 1
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { i64, i64 } @xx(i64 %x.coerce0, i64 %x.coerce1, i64 %y.coerce0, i64 %y.coerce1) local_unnamed_addr #0 {
entry:
%add = add nsw i64 %y.coerce0, %x.coerce0
%rem = srem i64 %add, 998244353
%add4 = add nsw i64 %y.coerce1, %x.coerce1
%.fca.0.insert = insertvalue { i64, i64 } poison, i64 %rem, 0
%.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %add4, 1
ret { i64, i64 } %.fca.1.insert
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { i64, i64 } @Tx(i64 %T.coerce0, i64 %T.coerce1, i64 %x.coerce0, i64 %x.coerce1) local_unnamed_addr #0 {
entry:
%mul = mul nsw i64 %x.coerce0, %T.coerce0
%mul1 = mul nsw i64 %x.coerce1, %T.coerce1
%add = add nsw i64 %mul1, %mul
%rem = srem i64 %add, 998244353
%.fca.0.insert = insertvalue { i64, i64 } poison, i64 %rem, 0
%.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %x.coerce1, 1
ret { i64, i64 } %.fca.1.insert
}
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local { i64, i64 } @TT(i64 %S.coerce0, i64 %S.coerce1, i64 %T.coerce0, i64 %T.coerce1) local_unnamed_addr #0 {
entry:
%mul = mul nsw i64 %T.coerce0, %S.coerce0
%rem = srem i64 %mul, 998244353
%mul5 = mul nsw i64 %T.coerce1, %S.coerce0
%add = add nsw i64 %mul5, %S.coerce1
%rem6 = srem i64 %add, 998244353
%.fca.0.insert = insertvalue { i64, i64 } poison, i64 %rem, 0
%.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %rem6, 1
ret { i64, i64 } %.fca.1.insert
}
; Function Attrs: nofree nounwind uwtable
define dso_local void @lseguse(i64 noundef %n) local_unnamed_addr #1 {
entry:
%mul = shl nsw i64 %n, 1
%call = tail call noalias ptr @calloc(i64 noundef %mul, i64 noundef 32) #8
store ptr %call, ptr @lsegN, align 8, !tbaa !5
store i64 %n, ptr @lsegNUM, align 8, !tbaa !9
%add.ptr = getelementptr inbounds %struct.node, ptr %call, i64 %n
store ptr %add.ptr, ptr @lseg, align 8, !tbaa !5
%cmp33 = icmp sgt i64 %n, 0
br i1 %cmp33, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%xtraiter = and i64 %n, 1
%0 = icmp eq i64 %n, 1
br i1 %0, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body.preheader.new
for.body.preheader.new: ; preds = %for.body.preheader
%unroll_iter = and i64 %n, -2
br label %for.body
for.cond.cleanup.loopexit.unr-lcssa: ; preds = %for.body, %for.body.preheader
%i.034.unr = phi i64 [ 0, %for.body.preheader ], [ %inc.1, %for.body ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup, label %for.body.epil
for.body.epil: ; preds = %for.cond.cleanup.loopexit.unr-lcssa
%x.epil = getelementptr inbounds %struct.node, ptr %add.ptr, i64 %i.034.unr, i32 1
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %x.epil, ptr noundef nonnull align 8 dereferenceable(16) @aid, i64 16, i1 false), !tbaa.struct !11
%arrayidx1.epil = getelementptr inbounds %struct.node, ptr %add.ptr, i64 %i.034.unr
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx1.epil, ptr noundef nonnull align 8 dereferenceable(16) @sid, i64 16, i1 false), !tbaa.struct !11
br label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body.epil, %for.cond.cleanup.loopexit.unr-lcssa, %entry
%1 = trunc i64 %n to i32
%i2.035 = add i32 %1, -1
%cmp436 = icmp sgt i32 %i2.035, 0
br i1 %cmp436, label %for.body7.preheader, label %for.cond.cleanup6
for.body7.preheader: ; preds = %for.cond.cleanup
%2 = zext i32 %i2.035 to i64
br label %for.body7
for.body: ; preds = %for.body, %for.body.preheader.new
%i.034 = phi i64 [ 0, %for.body.preheader.new ], [ %inc.1, %for.body ]
%niter = phi i64 [ 0, %for.body.preheader.new ], [ %niter.next.1, %for.body ]
%x = getelementptr inbounds %struct.node, ptr %add.ptr, i64 %i.034, i32 1
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %x, ptr noundef nonnull align 8 dereferenceable(16) @aid, i64 16, i1 false), !tbaa.struct !11
%arrayidx1 = getelementptr inbounds %struct.node, ptr %add.ptr, i64 %i.034
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx1, ptr noundef nonnull align 8 dereferenceable(16) @sid, i64 16, i1 false), !tbaa.struct !11
%inc = or i64 %i.034, 1
%x.1 = getelementptr inbounds %struct.node, ptr %add.ptr, i64 %inc, i32 1
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %x.1, ptr noundef nonnull align 8 dereferenceable(16) @aid, i64 16, i1 false), !tbaa.struct !11
%arrayidx1.1 = getelementptr inbounds %struct.node, ptr %add.ptr, i64 %inc
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx1.1, ptr noundef nonnull align 8 dereferenceable(16) @sid, i64 16, i1 false), !tbaa.struct !11
%inc.1 = add nuw nsw i64 %i.034, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup.loopexit.unr-lcssa, label %for.body, !llvm.loop !12
for.cond.cleanup6: ; preds = %for.body7, %for.cond.cleanup
ret void
for.body7: ; preds = %for.body7.preheader, %for.body7
%3 = phi ptr [ %call, %for.body7.preheader ], [ %11, %for.body7 ]
%indvars.iv = phi i64 [ %2, %for.body7.preheader ], [ %indvars.iv.next, %for.body7 ]
%x9 = getelementptr inbounds %struct.node, ptr %3, i64 %indvars.iv, i32 1
%4 = trunc i64 %indvars.iv to i32
%mul10 = shl nuw nsw i32 %4, 1
%idxprom11 = zext i32 %mul10 to i64
%x13 = getelementptr inbounds %struct.node, ptr %3, i64 %idxprom11, i32 1
%add = or i32 %mul10, 1
%idxprom15 = zext i32 %add to i64
%x17 = getelementptr inbounds %struct.node, ptr %3, i64 %idxprom15, i32 1
%5 = load i64, ptr %x13, align 8
%6 = getelementptr inbounds { i64, i64 }, ptr %x13, i64 0, i32 1
%7 = load i64, ptr %6, align 8
%8 = load i64, ptr %x17, align 8
%9 = getelementptr inbounds { i64, i64 }, ptr %x17, i64 0, i32 1
%10 = load i64, ptr %9, align 8
%add.i = add nsw i64 %8, %5
%rem.i = srem i64 %add.i, 998244353
%add4.i = add nsw i64 %10, %7
store i64 %rem.i, ptr %x9, align 8, !tbaa.struct !11
%tmp.sroa.4.0.x9.sroa_idx = getelementptr inbounds i8, ptr %x9, i64 8
store i64 %add4.i, ptr %tmp.sroa.4.0.x9.sroa_idx, align 8, !tbaa.struct !14
%11 = load ptr, ptr @lsegN, align 8, !tbaa !5
%arrayidx20 = getelementptr inbounds %struct.node, ptr %11, i64 %indvars.iv
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx20, ptr noundef nonnull align 8 dereferenceable(16) @sid, i64 16, i1 false), !tbaa.struct !11
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%indvars = trunc i64 %indvars.iv.next to i32
%cmp4 = icmp sgt i32 %indvars, 0
br i1 %cmp4, label %for.body7, label %for.cond.cleanup6, !llvm.loop !15
}
; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2
; 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 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @lseginit() local_unnamed_addr #5 {
entry:
%0 = load i64, ptr @lsegNUM, align 8, !tbaa !9
%1 = trunc i64 %0 to i32
%i.013 = add i32 %1, -1
%cmp14 = icmp sgt i32 %i.013, 0
br i1 %cmp14, label %for.body.preheader, label %for.cond.cleanup
for.body.preheader: ; preds = %entry
%2 = zext i32 %i.013 to i64
br label %for.body
for.cond.cleanup: ; preds = %for.body, %entry
ret void
for.body: ; preds = %for.body.preheader, %for.body
%indvars.iv = phi i64 [ %2, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
%3 = load ptr, ptr @lsegN, align 8, !tbaa !5
%x = getelementptr inbounds %struct.node, ptr %3, i64 %indvars.iv, i32 1
%4 = trunc i64 %indvars.iv to i32
%mul = shl nuw nsw i32 %4, 1
%idxprom2 = zext i32 %mul to i64
%x4 = getelementptr inbounds %struct.node, ptr %3, i64 %idxprom2, i32 1
%add = or i32 %mul, 1
%idxprom6 = zext i32 %add to i64
%x8 = getelementptr inbounds %struct.node, ptr %3, i64 %idxprom6, i32 1
%5 = load i64, ptr %x4, align 8
%6 = getelementptr inbounds { i64, i64 }, ptr %x4, i64 0, i32 1
%7 = load i64, ptr %6, align 8
%8 = load i64, ptr %x8, align 8
%9 = getelementptr inbounds { i64, i64 }, ptr %x8, i64 0, i32 1
%10 = load i64, ptr %9, align 8
%add.i = add nsw i64 %8, %5
%rem.i = srem i64 %add.i, 998244353
%add4.i = add nsw i64 %10, %7
store i64 %rem.i, ptr %x, align 8, !tbaa.struct !11
%tmp.sroa.4.0.x.sroa_idx = getelementptr inbounds i8, ptr %x, i64 8
store i64 %add4.i, ptr %tmp.sroa.4.0.x.sroa_idx, align 8, !tbaa.struct !14
%indvars.iv.next = add nsw i64 %indvars.iv, -1
%indvars = trunc i64 %indvars.iv.next to i32
%cmp = icmp sgt i32 %indvars, 0
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !16
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @lsegupdatesub(i64 noundef %l, i64 noundef %r, i64 %T.coerce0, i64 %T.coerce1, i64 noundef %i, i64 noundef %cl, i64 noundef %cr) local_unnamed_addr #6 {
entry:
%cmp.not = icmp slt i64 %l, %r
%cmp1.not = icmp sgt i64 %cr, %l
%or.cond = and i1 %cmp.not, %cmp1.not
%cmp2.not = icmp sgt i64 %r, %cl
%or.cond92 = and i1 %cmp2.not, %or.cond
br i1 %or.cond92, label %if.end4, label %common.ret124
if.end4: ; preds = %entry
%cmp5.not = icmp sgt i64 %l, %cl
%cmp6.not = icmp sgt i64 %cr, %r
%or.cond93 = or i1 %cmp5.not, %cmp6.not
%0 = load ptr, ptr @lsegN, align 8, !tbaa !5
br i1 %or.cond93, label %if.end11, label %if.then7
if.then7: ; preds = %if.end4
%arrayidx = getelementptr inbounds %struct.node, ptr %0, i64 %i
%1 = load i64, ptr %arrayidx, align 8
%2 = getelementptr inbounds { i64, i64 }, ptr %arrayidx, i64 0, i32 1
%3 = load i64, ptr %2, align 8
%mul.i = mul nsw i64 %1, %T.coerce0
%rem.i = srem i64 %mul.i, 998244353
%mul5.i = mul nsw i64 %3, %T.coerce0
%add.i = add nsw i64 %mul5.i, %T.coerce1
%rem6.i = srem i64 %add.i, 998244353
store i64 %rem.i, ptr %arrayidx, align 8, !tbaa.struct !11
store i64 %rem6.i, ptr %2, align 8, !tbaa.struct !14
br label %common.ret124
common.ret124: ; preds = %entry, %if.then7, %if.end11
ret void
if.end11: ; preds = %if.end4
%mul = shl nsw i64 %i, 1
%arrayidx12 = getelementptr inbounds %struct.node, ptr %0, i64 %mul
%arrayidx15 = getelementptr inbounds %struct.node, ptr %0, i64 %i
%4 = load i64, ptr %arrayidx15, align 8
%5 = getelementptr inbounds { i64, i64 }, ptr %arrayidx15, i64 0, i32 1
%6 = load i64, ptr %5, align 8
%7 = load i64, ptr %arrayidx12, align 8
%8 = getelementptr inbounds { i64, i64 }, ptr %arrayidx12, i64 0, i32 1
%9 = load i64, ptr %8, align 8
%mul.i94 = mul nsw i64 %7, %4
%rem.i95 = srem i64 %mul.i94, 998244353
%mul5.i96 = mul nsw i64 %9, %4
%add.i97 = add nsw i64 %mul5.i96, %6
%rem6.i98 = srem i64 %add.i97, 998244353
store i64 %rem.i95, ptr %arrayidx12, align 8, !tbaa.struct !11
store i64 %rem6.i98, ptr %8, align 8, !tbaa.struct !14
%10 = load ptr, ptr @lsegN, align 8, !tbaa !5
%add = or i64 %mul, 1
%arrayidx22 = getelementptr inbounds %struct.node, ptr %10, i64 %add
%arrayidx25 = getelementptr inbounds %struct.node, ptr %10, i64 %i
%11 = load i64, ptr %arrayidx25, align 8
%12 = getelementptr inbounds { i64, i64 }, ptr %arrayidx25, i64 0, i32 1
%13 = load i64, ptr %12, align 8
%14 = load i64, ptr %arrayidx22, align 8
%15 = getelementptr inbounds { i64, i64 }, ptr %arrayidx22, i64 0, i32 1
%16 = load i64, ptr %15, align 8
%mul.i101 = mul nsw i64 %14, %11
%rem.i102 = srem i64 %mul.i101, 998244353
%mul5.i103 = mul nsw i64 %16, %11
%add.i104 = add nsw i64 %mul5.i103, %13
%rem6.i105 = srem i64 %add.i104, 998244353
store i64 %rem.i102, ptr %arrayidx22, align 8, !tbaa.struct !11
store i64 %rem6.i105, ptr %15, align 8, !tbaa.struct !14
%add32 = add nsw i64 %cr, %cl
%div = sdiv i64 %add32, 2
tail call void @lsegupdatesub(i64 noundef %l, i64 noundef %r, i64 %T.coerce0, i64 %T.coerce1, i64 noundef %mul, i64 noundef %cl, i64 noundef %div)
tail call void @lsegupdatesub(i64 noundef %l, i64 noundef %r, i64 %T.coerce0, i64 %T.coerce1, i64 noundef %add, i64 noundef %div, i64 noundef %cr)
%17 = load ptr, ptr @lsegN, align 8, !tbaa !5
%x = getelementptr inbounds %struct.node, ptr %17, i64 %i, i32 1
%arrayidx39 = getelementptr inbounds %struct.node, ptr %17, i64 %mul
%x43 = getelementptr inbounds %struct.node, ptr %17, i64 %mul, i32 1
%18 = load i64, ptr %arrayidx39, align 8
%19 = getelementptr inbounds { i64, i64 }, ptr %arrayidx39, i64 0, i32 1
%20 = load i64, ptr %19, align 8
%21 = load i64, ptr %x43, align 8
%22 = getelementptr inbounds { i64, i64 }, ptr %x43, i64 0, i32 1
%23 = load i64, ptr %22, align 8
%mul.i108 = mul nsw i64 %21, %18
%mul1.i = mul nsw i64 %23, %20
%add.i109 = add nsw i64 %mul1.i, %mul.i108
%rem.i110 = srem i64 %add.i109, 998244353
%arrayidx48 = getelementptr inbounds %struct.node, ptr %17, i64 %add
%x53 = getelementptr inbounds %struct.node, ptr %17, i64 %add, i32 1
%24 = load i64, ptr %arrayidx48, align 8
%25 = getelementptr inbounds { i64, i64 }, ptr %arrayidx48, i64 0, i32 1
%26 = load i64, ptr %25, align 8
%27 = load i64, ptr %x53, align 8
%28 = getelementptr inbounds { i64, i64 }, ptr %x53, i64 0, i32 1
%29 = load i64, ptr %28, align 8
%mul.i113 = mul nsw i64 %27, %24
%mul1.i114 = mul nsw i64 %29, %26
%add.i115 = add nsw i64 %mul1.i114, %mul.i113
%rem.i116 = srem i64 %add.i115, 998244353
%add.i119 = add nsw i64 %rem.i116, %rem.i110
%rem.i120.lhs.trunc = trunc i64 %add.i119 to i32
%rem.i120123 = srem i32 %rem.i120.lhs.trunc, 998244353
%rem.i120.sext = sext i32 %rem.i120123 to i64
%add4.i = add nsw i64 %29, %23
store i64 %rem.i120.sext, ptr %x, align 8, !tbaa.struct !11
%tmp37.sroa.4.0.x.sroa_idx = getelementptr inbounds i8, ptr %x, i64 8
store i64 %add4.i, ptr %tmp37.sroa.4.0.x.sroa_idx, align 8, !tbaa.struct !14
%30 = load ptr, ptr @lsegN, align 8, !tbaa !5
%arrayidx56 = getelementptr inbounds %struct.node, ptr %30, i64 %i
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx56, ptr noundef nonnull align 8 dereferenceable(16) @sid, i64 16, i1 false), !tbaa.struct !11
br label %common.ret124
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local void @lsegupdate(i64 noundef %l, i64 noundef %r, i64 %T.coerce0, i64 %T.coerce1) local_unnamed_addr #6 {
entry:
%0 = load i64, ptr @lsegNUM, align 8, !tbaa !9
tail call void @lsegupdatesub(i64 noundef %l, i64 noundef %r, i64 %T.coerce0, i64 %T.coerce1, i64 noundef 1, i64 noundef 0, i64 noundef %0)
ret void
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local { i64, i64 } @lsegcalcsub(i64 noundef %l, i64 noundef %r, i64 noundef %i, i64 noundef %cl, i64 noundef %cr) local_unnamed_addr #6 {
entry:
%cmp.not = icmp slt i64 %l, %r
br i1 %cmp.not, label %if.end, label %if.then
if.then: ; preds = %entry
%retval.sroa.0.0.copyload = load i64, ptr @aid, align 8, !tbaa.struct !11
%retval.sroa.6.0.copyload = load i64, ptr getelementptr inbounds (%struct.atai, ptr @aid, i64 0, i32 1), align 8, !tbaa.struct !14
br label %return
if.end: ; preds = %entry
%cmp1.not = icmp sgt i64 %l, %cl
%cmp2.not = icmp sgt i64 %cr, %r
%or.cond = or i1 %cmp1.not, %cmp2.not
br i1 %or.cond, label %if.end5, label %if.then3
if.then3: ; preds = %if.end
%0 = load ptr, ptr @lsegN, align 8, !tbaa !5
%arrayidx = getelementptr inbounds %struct.node, ptr %0, i64 %i
%x = getelementptr inbounds %struct.node, ptr %0, i64 %i, i32 1
%1 = load i64, ptr %arrayidx, align 8
%2 = getelementptr inbounds { i64, i64 }, ptr %arrayidx, i64 0, i32 1
%3 = load i64, ptr %2, align 8
%4 = load i64, ptr %x, align 8
%5 = getelementptr inbounds { i64, i64 }, ptr %x, i64 0, i32 1
%6 = load i64, ptr %5, align 8
%mul.i = mul nsw i64 %4, %1
%mul1.i = mul nsw i64 %6, %3
%add.i = add nsw i64 %mul1.i, %mul.i
%rem.i = srem i64 %add.i, 998244353
br label %return
if.end5: ; preds = %if.end
%add = add nsw i64 %cr, %cl
%div = sdiv i64 %add, 2
%7 = load ptr, ptr @lsegN, align 8, !tbaa !5
%mul = shl nsw i64 %i, 1
%arrayidx6 = getelementptr inbounds %struct.node, ptr %7, i64 %mul
%arrayidx8 = getelementptr inbounds %struct.node, ptr %7, i64 %i
%8 = load i64, ptr %arrayidx8, align 8
%9 = getelementptr inbounds { i64, i64 }, ptr %arrayidx8, i64 0, i32 1
%10 = load i64, ptr %9, align 8
%11 = load i64, ptr %arrayidx6, align 8
%12 = getelementptr inbounds { i64, i64 }, ptr %arrayidx6, i64 0, i32 1
%13 = load i64, ptr %12, align 8
%mul.i93 = mul nsw i64 %11, %8
%rem.i94 = srem i64 %mul.i93, 998244353
%mul5.i = mul nsw i64 %13, %8
%add.i95 = add nsw i64 %mul5.i, %10
%rem6.i = srem i64 %add.i95, 998244353
store i64 %rem.i94, ptr %arrayidx6, align 8, !tbaa.struct !11
store i64 %rem6.i, ptr %12, align 8, !tbaa.struct !14
%14 = load ptr, ptr @lsegN, align 8, !tbaa !5
%add15 = or i64 %mul, 1
%arrayidx16 = getelementptr inbounds %struct.node, ptr %14, i64 %add15
%arrayidx19 = getelementptr inbounds %struct.node, ptr %14, i64 %i
%15 = load i64, ptr %arrayidx19, align 8
%16 = getelementptr inbounds { i64, i64 }, ptr %arrayidx19, i64 0, i32 1
%17 = load i64, ptr %16, align 8
%18 = load i64, ptr %arrayidx16, align 8
%19 = getelementptr inbounds { i64, i64 }, ptr %arrayidx16, i64 0, i32 1
%20 = load i64, ptr %19, align 8
%mul.i98 = mul nsw i64 %18, %15
%rem.i99 = srem i64 %mul.i98, 998244353
%mul5.i100 = mul nsw i64 %20, %15
%add.i101 = add nsw i64 %mul5.i100, %17
%rem6.i102 = srem i64 %add.i101, 998244353
store i64 %rem.i99, ptr %arrayidx16, align 8, !tbaa.struct !11
store i64 %rem6.i102, ptr %19, align 8, !tbaa.struct !14
%21 = load ptr, ptr @lsegN, align 8, !tbaa !5
%arrayidx26 = getelementptr inbounds %struct.node, ptr %21, i64 %i
%x27 = getelementptr inbounds %struct.node, ptr %21, i64 %i, i32 1
%22 = load i64, ptr %arrayidx26, align 8
%23 = getelementptr inbounds { i64, i64 }, ptr %arrayidx26, i64 0, i32 1
%24 = load i64, ptr %23, align 8
%25 = load i64, ptr %x27, align 8
%26 = getelementptr inbounds { i64, i64 }, ptr %x27, i64 0, i32 1
%27 = load i64, ptr %26, align 8
%mul.i105 = mul nsw i64 %25, %22
%mul1.i106 = mul nsw i64 %27, %24
%add.i107 = add nsw i64 %mul1.i106, %mul.i105
%rem.i108 = srem i64 %add.i107, 998244353
store i64 %rem.i108, ptr %x27, align 8, !tbaa.struct !11
%28 = load ptr, ptr @lsegN, align 8, !tbaa !5
%arrayidx34 = getelementptr inbounds %struct.node, ptr %28, i64 %i
tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx34, ptr noundef nonnull align 8 dereferenceable(16) @sid, i64 16, i1 false), !tbaa.struct !11
%cmp36.not = icmp slt i64 %div, %r
br i1 %cmp36.not, label %if.end40, label %if.then37
if.then37: ; preds = %if.end5
%call39 = tail call { i64, i64 } @lsegcalcsub(i64 noundef %l, i64 noundef %r, i64 noundef %mul, i64 noundef %cl, i64 noundef %div)
br label %cleanup
if.end40: ; preds = %if.end5
%cmp41.not = icmp sgt i64 %div, %l
br i1 %cmp41.not, label %if.end46, label %if.then42
if.then42: ; preds = %if.end40
%call45 = tail call { i64, i64 } @lsegcalcsub(i64 noundef %l, i64 noundef %r, i64 noundef %add15, i64 noundef %div, i64 noundef %cr)
br label %cleanup
if.end46: ; preds = %if.end40
%call48 = tail call { i64, i64 } @lsegcalcsub(i64 noundef %l, i64 noundef %r, i64 noundef %mul, i64 noundef %cl, i64 noundef %div)
%29 = extractvalue { i64, i64 } %call48, 0
%30 = extractvalue { i64, i64 } %call48, 1
%call52 = tail call { i64, i64 } @lsegcalcsub(i64 noundef %l, i64 noundef %r, i64 noundef %add15, i64 noundef %div, i64 noundef %cr)
%31 = extractvalue { i64, i64 } %call52, 0
%32 = extractvalue { i64, i64 } %call52, 1
%add.i111 = add nsw i64 %31, %29
%rem.i112 = srem i64 %add.i111, 998244353
%add4.i = add nsw i64 %32, %30
%.fca.0.insert.i113 = insertvalue { i64, i64 } poison, i64 %rem.i112, 0
%.fca.1.insert.i114 = insertvalue { i64, i64 } %.fca.0.insert.i113, i64 %add4.i, 1
br label %cleanup
cleanup: ; preds = %if.end46, %if.then42, %if.then37
%call39.pn = phi { i64, i64 } [ %call39, %if.then37 ], [ %call45, %if.then42 ], [ %.fca.1.insert.i114, %if.end46 ]
%retval.sroa.6.0 = extractvalue { i64, i64 } %call39.pn, 1
%retval.sroa.0.0 = extractvalue { i64, i64 } %call39.pn, 0
br label %return
return: ; preds = %cleanup, %if.then3, %if.then
%retval.sroa.0.1 = phi i64 [ %retval.sroa.0.0.copyload, %if.then ], [ %rem.i, %if.then3 ], [ %retval.sroa.0.0, %cleanup ]
%retval.sroa.6.1 = phi i64 [ %retval.sroa.6.0.copyload, %if.then ], [ %6, %if.then3 ], [ %retval.sroa.6.0, %cleanup ]
%.fca.0.insert = insertvalue { i64, i64 } poison, i64 %retval.sroa.0.1, 0
%.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %retval.sroa.6.1, 1
ret { i64, i64 } %.fca.1.insert
}
; Function Attrs: nofree nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable
define dso_local { i64, i64 } @lsegcalc(i64 noundef %l, i64 noundef %r) local_unnamed_addr #6 {
entry:
%0 = load i64, ptr @lsegNUM, align 8, !tbaa !9
%call = tail call { i64, i64 } @lsegcalcsub(i64 noundef %l, i64 noundef %r, i64 noundef 1, i64 noundef 0, i64 noundef %0)
ret { i64, i64 } %call
}
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #1 {
entry:
%n = alloca i32, align 4
%q = alloca i32, align 4
%t = alloca i32, align 4
%t4 = alloca i32, align 4
%l = alloca i32, align 4
%r = 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) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %q) #9
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %q)
%call.i = call noalias dereferenceable_or_null(33554432) ptr @calloc(i64 noundef 1048576, i64 noundef 32) #8
store ptr %call.i, ptr @lsegN, align 8, !tbaa !5
store i64 524288, ptr @lsegNUM, align 8, !tbaa !9
%add.ptr.i = getelementptr inbounds %struct.node, ptr %call.i, i64 524288
store ptr %add.ptr.i, ptr @lseg, align 8, !tbaa !5
br label %for.body.i
for.body.i: ; preds = %for.body.i, %entry
%i.034.i = phi i64 [ 0, %entry ], [ %inc.i.1, %for.body.i ]
%x.i = getelementptr inbounds %struct.node, ptr %add.ptr.i, i64 %i.034.i, i32 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %x.i, ptr noundef nonnull align 8 dereferenceable(16) @aid, i64 16, i1 false), !tbaa.struct !11
%arrayidx1.i = getelementptr inbounds %struct.node, ptr %add.ptr.i, i64 %i.034.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx1.i, ptr noundef nonnull align 8 dereferenceable(16) @sid, i64 16, i1 false), !tbaa.struct !11
%inc.i = or i64 %i.034.i, 1
%x.i.1 = getelementptr inbounds %struct.node, ptr %add.ptr.i, i64 %inc.i, i32 1
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %x.i.1, ptr noundef nonnull align 8 dereferenceable(16) @aid, i64 16, i1 false), !tbaa.struct !11
%arrayidx1.i.1 = getelementptr inbounds %struct.node, ptr %add.ptr.i, i64 %inc.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx1.i.1, ptr noundef nonnull align 8 dereferenceable(16) @sid, i64 16, i1 false), !tbaa.struct !11
%inc.i.1 = add nuw nsw i64 %i.034.i, 2
%exitcond.not.i.1 = icmp eq i64 %inc.i.1, 524288
br i1 %exitcond.not.i.1, label %for.body7.i, label %for.body.i, !llvm.loop !12
for.body7.i: ; preds = %for.body.i, %for.body7.i
%0 = phi ptr [ %8, %for.body7.i ], [ %call.i, %for.body.i ]
%indvars.iv.i = phi i64 [ %indvars.iv.next.i, %for.body7.i ], [ 524287, %for.body.i ]
%x9.i = getelementptr inbounds %struct.node, ptr %0, i64 %indvars.iv.i, i32 1
%1 = trunc i64 %indvars.iv.i to i32
%mul10.i = shl nuw nsw i32 %1, 1
%idxprom11.i = zext i32 %mul10.i to i64
%x13.i = getelementptr inbounds %struct.node, ptr %0, i64 %idxprom11.i, i32 1
%add.i = or i32 %mul10.i, 1
%idxprom15.i = zext i32 %add.i to i64
%x17.i = getelementptr inbounds %struct.node, ptr %0, i64 %idxprom15.i, i32 1
%2 = load i64, ptr %x13.i, align 8
%3 = getelementptr inbounds { i64, i64 }, ptr %x13.i, i64 0, i32 1
%4 = load i64, ptr %3, align 8
%5 = load i64, ptr %x17.i, align 8
%6 = getelementptr inbounds { i64, i64 }, ptr %x17.i, i64 0, i32 1
%7 = load i64, ptr %6, align 8
%add.i.i = add nsw i64 %5, %2
%rem.i.i = srem i64 %add.i.i, 998244353
%add4.i.i = add nsw i64 %7, %4
store i64 %rem.i.i, ptr %x9.i, align 8, !tbaa.struct !11
%tmp.sroa.4.0.x9.sroa_idx.i = getelementptr inbounds i8, ptr %x9.i, i64 8
store i64 %add4.i.i, ptr %tmp.sroa.4.0.x9.sroa_idx.i, align 8, !tbaa.struct !14
%8 = load ptr, ptr @lsegN, align 8, !tbaa !5
%arrayidx20.i = getelementptr inbounds %struct.node, ptr %8, i64 %indvars.iv.i
call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %arrayidx20.i, ptr noundef nonnull align 8 dereferenceable(16) @sid, i64 16, i1 false), !tbaa.struct !11
%indvars.iv.next.i = add nsw i64 %indvars.iv.i, -1
%.not = icmp eq i64 %indvars.iv.next.i, 0
br i1 %.not, label %for.cond.preheader, label %for.body7.i, !llvm.loop !15
for.cond.preheader: ; preds = %for.body7.i
%9 = load i32, ptr %n, align 4, !tbaa !17
%cmp34 = icmp sgt i32 %9, 0
br i1 %cmp34, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %for.cond.preheader
%10 = load i64, ptr @lsegNUM, align 8, !tbaa !9
%11 = trunc i64 %10 to i32
%i.013.i = add i32 %11, -1
%cmp14.i = icmp sgt i32 %i.013.i, 0
br i1 %cmp14.i, label %for.body.preheader.i, label %lseginit.exit
for.body.preheader.i: ; preds = %for.cond.cleanup
%12 = zext i32 %i.013.i to i64
br label %for.body.i23
for.body.i23: ; preds = %for.body.i23, %for.body.preheader.i
%indvars.iv.i24 = phi i64 [ %12, %for.body.preheader.i ], [ %indvars.iv.next.i30, %for.body.i23 ]
%13 = load ptr, ptr @lsegN, align 8, !tbaa !5
%x.i25 = getelementptr inbounds %struct.node, ptr %13, i64 %indvars.iv.i24, i32 1
%14 = trunc i64 %indvars.iv.i24 to i32
%mul.i = shl nuw nsw i32 %14, 1
%idxprom2.i = zext i32 %mul.i to i64
%x4.i = getelementptr inbounds %struct.node, ptr %13, i64 %idxprom2.i, i32 1
%add.i26 = or i32 %mul.i, 1
%idxprom6.i = zext i32 %add.i26 to i64
%x8.i = getelementptr inbounds %struct.node, ptr %13, i64 %idxprom6.i, i32 1
%15 = load i64, ptr %x4.i, align 8
%16 = getelementptr inbounds { i64, i64 }, ptr %x4.i, i64 0, i32 1
%17 = load i64, ptr %16, align 8
%18 = load i64, ptr %x8.i, align 8
%19 = getelementptr inbounds { i64, i64 }, ptr %x8.i, i64 0, i32 1
%20 = load i64, ptr %19, align 8
%add.i.i27 = add nsw i64 %18, %15
%rem.i.i28 = srem i64 %add.i.i27, 998244353
%add4.i.i29 = add nsw i64 %20, %17
store i64 %rem.i.i28, ptr %x.i25, align 8, !tbaa.struct !11
%tmp.sroa.4.0.x.sroa_idx.i = getelementptr inbounds i8, ptr %x.i25, i64 8
store i64 %add4.i.i29, ptr %tmp.sroa.4.0.x.sroa_idx.i, align 8, !tbaa.struct !14
%indvars.iv.next.i30 = add nsw i64 %indvars.iv.i24, -1
%indvars.i31 = trunc i64 %indvars.iv.next.i30 to i32
%cmp.i = icmp sgt i32 %indvars.i31, 0
br i1 %cmp.i, label %for.body.i23, label %lseginit.exit, !llvm.loop !16
lseginit.exit: ; preds = %for.body.i23, %for.cond.cleanup
%21 = load i32, ptr %q, align 4, !tbaa !17
%dec36 = add nsw i32 %21, -1
store i32 %dec36, ptr %q, align 4, !tbaa !17
%tobool.not37 = icmp eq i32 %21, 0
br i1 %tobool.not37, label %while.end, label %while.body
for.body: ; preds = %for.cond.preheader, %for.body
%i.035 = phi i64 [ %inc, %for.body ], [ 0, %for.cond.preheader ]
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t) #9
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %t)
%22 = load i32, ptr %t, align 4, !tbaa !17
%conv3 = sext i32 %22 to i64
%23 = load ptr, ptr @lseg, align 8, !tbaa !5
%x = getelementptr inbounds %struct.node, ptr %23, i64 %i.035, i32 1
store i64 %conv3, ptr %x, align 8, !tbaa !19
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t) #9
%inc = add nuw nsw i64 %i.035, 1
%24 = load i32, ptr %n, align 4, !tbaa !17
%conv = sext i32 %24 to i64
%cmp = icmp slt i64 %inc, %conv
br i1 %cmp, label %for.body, label %for.cond.cleanup, !llvm.loop !23
while.body: ; preds = %lseginit.exit, %if.end
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %t4) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %l) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %r) #9
%call5 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.2, ptr noundef nonnull %t4, ptr noundef nonnull %l, ptr noundef nonnull %r)
%25 = load i32, ptr %t4, align 4, !tbaa !17
%cmp6 = icmp eq i32 %25, 0
br i1 %cmp6, label %if.then, label %if.else
if.then: ; preds = %while.body
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #9
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #9
%call8 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%26 = load i32, ptr %a, align 4, !tbaa !17
%conv10 = sext i32 %26 to i64
%27 = load i32, ptr %b, align 4, !tbaa !17
%conv12 = sext i32 %27 to i64
%28 = load i32, ptr %l, align 4, !tbaa !17
%conv13 = sext i32 %28 to i64
%29 = load i32, ptr %r, align 4, !tbaa !17
%conv14 = sext i32 %29 to i64
%30 = load i64, ptr @lsegNUM, align 8, !tbaa !9
call void @lsegupdatesub(i64 noundef %conv13, i64 noundef %conv14, i64 %conv10, i64 %conv12, i64 noundef 1, i64 noundef 0, i64 noundef %30)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %b) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) #9
br label %if.end
if.else: ; preds = %while.body
%31 = load i32, ptr %l, align 4, !tbaa !17
%conv15 = sext i32 %31 to i64
%32 = load i32, ptr %r, align 4, !tbaa !17
%conv16 = sext i32 %32 to i64
%33 = load i64, ptr @lsegNUM, align 8, !tbaa !9
%call.i32 = call { i64, i64 } @lsegcalcsub(i64 noundef %conv15, i64 noundef %conv16, i64 noundef 1, i64 noundef 0, i64 noundef %33)
%34 = extractvalue { i64, i64 } %call.i32, 0
%call19 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %34)
br label %if.end
if.end: ; preds = %if.else, %if.then
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %r) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %l) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %t4) #9
%35 = load i32, ptr %q, align 4, !tbaa !17
%dec = add nsw i32 %35, -1
store i32 %dec, ptr %q, align 4, !tbaa !17
%tobool.not = icmp eq i32 %35, 0
br i1 %tobool.not, label %while.end, label %while.body, !llvm.loop !24
while.end: ; preds = %if.end, %lseginit.exit
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %q) #9
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #9
ret i32 0
}
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #7
attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree norecurse nosync nounwind memory(readwrite, inaccessiblemem: none) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind allocsize(0,1) }
attributes #9 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = !{i64 0, i64 8, !9, i64 8, i64 8, !9}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{i64 0, i64 8, !9}
!15 = distinct !{!15, !13}
!16 = distinct !{!16, !13}
!17 = !{!18, !18, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!20, !10, i64 16}
!20 = !{!"node", !21, i64 0, !22, i64 16}
!21 = !{!"sayouso", !10, i64 0, !10, i64 8}
!22 = !{!"atai", !10, i64 0, !10, i64 8}
!23 = distinct !{!23, !13}
!24 = distinct !{!24, !13}
|
#include <stdio.h>
int main(void){
int a,b;
scanf("%d%d",&a,&b);
if(a%b==0){
printf("0");
}else{
printf("1");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119538/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119538/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%. = select i1 %cmp, i32 48, i32 49
%putchar = call i32 @putchar(i32 %.)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int N,K;
scanf("%d%d",&N,&K);
if(N%K == 0){
printf("0\n");
}else{
printf("1\n");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119581/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119581/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@str = private unnamed_addr constant [2 x i8] c"1\00", align 1
@str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %K, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @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 n,k;
scanf("%d %d",&n,&k);
if(n % k ==0){
printf("%d",0);
}else{
printf("%d",1);
};
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119624/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119624/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #3
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #3
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp ne i32 %rem, 0
%. = zext i1 %cmp to i32
%call2 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #3
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #3
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(){
int a,b;
scanf("%d %d",&a,&b);
if(a%b==0){
printf("0");
}else{
printf("1");
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119668/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119668/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %a, ptr noundef nonnull %b)
%0 = load i32, ptr %a, align 4, !tbaa !5
%1 = load i32, ptr %b, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%. = select i1 %cmp, i32 48, i32 49
%putchar = call i32 @putchar(i32 %.)
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 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include<stdio.h>
int main ()
{
int n,k;
scanf("%d%d",&n,&k);
int y;
y=n%k;
if(y==0) printf("0");
else printf("1");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119710/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119710/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%k = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %k) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n, ptr noundef nonnull %k)
%0 = load i32, ptr %n, align 4, !tbaa !5
%1 = load i32, ptr %k, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%. = select i1 %cmp, i32 48, i32 49
%putchar = call i32 @putchar(i32 %.)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %k) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int main(void){
int N,K;
scanf("%d %d",&N,&K);
if(N%K==0) printf("0\n");
else printf("1\n");
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119754/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119754/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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 [2 x i8] c"1\00", align 1
@str.3 = private unnamed_addr constant [2 x i8] c"0\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%N = alloca i32, align 4
%K = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %N) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %K) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %N, ptr noundef nonnull %K)
%0 = load i32, ptr %N, align 4, !tbaa !5
%1 = load i32, ptr %K, align 4, !tbaa !5
%rem = srem i32 %0, %1
%cmp = icmp eq i32 %rem, 0
%str.3.str = select i1 %cmp, ptr @str.3, ptr @str
%puts = call i32 @puts(ptr nonnull dereferenceable(1) %str.3.str)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %K) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %N) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
|
#include <stdio.h>
int d[9],c[9];
int main(){
int n,m;
scanf("%d%d",&n,&m);
for(int i=0;i<m;i++)scanf("%d%d",d+i,c+i);
int l,r;
if(n==1)l=0,r=10;
if(n==2)l=10,r=100;
if(n==3)l=100,r=1000;
for(int x=l;x<r;x++){
char s[9];
sprintf(s,"%d",x);
int flag=1;
for(int i=0;i<m;i++)flag&=s[d[i]-1]-'0'==c[i];
if(flag){
printf("%d",x);
return 0;
}
}
puts("-1");
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119804/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119804/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [5 x i8] c"%d%d\00", align 1
@d = dso_local global [9 x i32] zeroinitializer, align 16
@c = dso_local global [9 x i32] zeroinitializer, align 16
@.str.1 = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.2 = private unnamed_addr constant [3 x i8] c"-1\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%s = alloca [9 x i8], align 1
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 %m, align 4, !tbaa !5
%cmp60 = icmp sgt i32 %0, 0
br i1 %cmp60, label %for.body, label %for.cond.cleanup
for.cond.cleanup: ; preds = %for.body, %entry
%1 = load i32, ptr %n, align 4, !tbaa !5
%cmp5 = icmp eq i32 %1, 2
%l.1 = select i1 %cmp5, i32 10, i32 0
%r.1 = select i1 %cmp5, i32 100, i32 10
%cmp8 = icmp eq i32 %1, 3
%l.2 = select i1 %cmp8, i32 100, i32 %l.1
%r.2 = select i1 %cmp8, i32 1000, i32 %r.1
%cmp12.not65 = icmp ult i32 %l.2, %r.2
br i1 %cmp12.not65, label %for.body14, label %for.end39
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%add.ptr = getelementptr inbounds i32, ptr @d, i64 %indvars.iv
%add.ptr2 = getelementptr inbounds i32, ptr @c, i64 %indvars.iv
%call3 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %add.ptr, ptr noundef nonnull %add.ptr2)
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %m, 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.cond.cleanup, !llvm.loop !9
for.body14: ; preds = %for.cond.cleanup, %for.inc35.critedge
%x.066 = phi i32 [ %inc36, %for.inc35.critedge ], [ %l.2, %for.cond.cleanup ]
call void @llvm.lifetime.start.p0(i64 9, ptr nonnull %s) #3
%call15 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %s, ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.066) #3
%4 = load i32, ptr %m, align 4, !tbaa !5
%cmp1862 = icmp sgt i32 %4, 0
br i1 %cmp1862, label %for.body20.preheader, label %if.then31
for.body20.preheader: ; preds = %for.body14
%wide.trip.count = zext i32 %4 to i64
%xtraiter = and i64 %wide.trip.count, 1
%5 = icmp eq i32 %4, 1
br i1 %5, label %for.cond.cleanup19.unr-lcssa, label %for.body20.preheader.new
for.body20.preheader.new: ; preds = %for.body20.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body20
for.cond.cleanup19.unr-lcssa: ; preds = %for.body20, %for.body20.preheader
%and.lcssa.ph = phi i32 [ undef, %for.body20.preheader ], [ %and.1, %for.body20 ]
%indvars.iv69.unr = phi i64 [ 0, %for.body20.preheader ], [ %indvars.iv.next70.1, %for.body20 ]
%flag.063.unr = phi i32 [ 1, %for.body20.preheader ], [ %and.1, %for.body20 ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.cond.cleanup19, label %for.body20.epil
for.body20.epil: ; preds = %for.cond.cleanup19.unr-lcssa
%arrayidx.epil = getelementptr inbounds [9 x i32], ptr @d, i64 0, i64 %indvars.iv69.unr
%6 = load i32, ptr %arrayidx.epil, align 4, !tbaa !5
%sub.epil = add nsw i32 %6, -1
%idxprom21.epil = sext i32 %sub.epil to i64
%arrayidx22.epil = getelementptr inbounds [9 x i8], ptr %s, i64 0, i64 %idxprom21.epil
%7 = load i8, ptr %arrayidx22.epil, align 1, !tbaa !11
%conv.epil = sext i8 %7 to i32
%sub23.epil = add nsw i32 %conv.epil, -48
%arrayidx25.epil = getelementptr inbounds [9 x i32], ptr @c, i64 0, i64 %indvars.iv69.unr
%8 = load i32, ptr %arrayidx25.epil, align 4, !tbaa !5
%cmp26.epil = icmp eq i32 %sub23.epil, %8
%and.epil = select i1 %cmp26.epil, i32 %flag.063.unr, i32 0
br label %for.cond.cleanup19
for.cond.cleanup19: ; preds = %for.cond.cleanup19.unr-lcssa, %for.body20.epil
%and.lcssa = phi i32 [ %and.lcssa.ph, %for.cond.cleanup19.unr-lcssa ], [ %and.epil, %for.body20.epil ]
%tobool.not = icmp eq i32 %and.lcssa, 0
br i1 %tobool.not, label %for.inc35.critedge, label %if.then31
for.body20: ; preds = %for.body20, %for.body20.preheader.new
%indvars.iv69 = phi i64 [ 0, %for.body20.preheader.new ], [ %indvars.iv.next70.1, %for.body20 ]
%flag.063 = phi i32 [ 1, %for.body20.preheader.new ], [ %and.1, %for.body20 ]
%niter = phi i64 [ 0, %for.body20.preheader.new ], [ %niter.next.1, %for.body20 ]
%arrayidx = getelementptr inbounds [9 x i32], ptr @d, i64 0, i64 %indvars.iv69
%9 = load i32, ptr %arrayidx, align 8, !tbaa !5
%sub = add nsw i32 %9, -1
%idxprom21 = sext i32 %sub to i64
%arrayidx22 = getelementptr inbounds [9 x i8], ptr %s, i64 0, i64 %idxprom21
%10 = load i8, ptr %arrayidx22, align 1, !tbaa !11
%conv = sext i8 %10 to i32
%sub23 = add nsw i32 %conv, -48
%arrayidx25 = getelementptr inbounds [9 x i32], ptr @c, i64 0, i64 %indvars.iv69
%11 = load i32, ptr %arrayidx25, align 8, !tbaa !5
%cmp26 = icmp eq i32 %sub23, %11
%indvars.iv.next70 = or i64 %indvars.iv69, 1
%arrayidx.1 = getelementptr inbounds [9 x i32], ptr @d, i64 0, i64 %indvars.iv.next70
%12 = load i32, ptr %arrayidx.1, align 4, !tbaa !5
%sub.1 = add nsw i32 %12, -1
%idxprom21.1 = sext i32 %sub.1 to i64
%arrayidx22.1 = getelementptr inbounds [9 x i8], ptr %s, i64 0, i64 %idxprom21.1
%13 = load i8, ptr %arrayidx22.1, align 1, !tbaa !11
%conv.1 = sext i8 %13 to i32
%sub23.1 = add nsw i32 %conv.1, -48
%arrayidx25.1 = getelementptr inbounds [9 x i32], ptr @c, i64 0, i64 %indvars.iv.next70
%14 = load i32, ptr %arrayidx25.1, align 4, !tbaa !5
%cmp26.1 = icmp eq i32 %sub23.1, %14
%15 = select i1 %cmp26.1, i1 %cmp26, i1 false
%and.1 = select i1 %15, i32 %flag.063, i32 0
%indvars.iv.next70.1 = add nuw nsw i64 %indvars.iv69, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.cond.cleanup19.unr-lcssa, label %for.body20, !llvm.loop !12
if.then31: ; preds = %for.body14, %for.cond.cleanup19
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %x.066)
call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %s) #3
br label %cleanup41
for.inc35.critedge: ; preds = %for.cond.cleanup19
call void @llvm.lifetime.end.p0(i64 9, ptr nonnull %s) #3
%inc36 = add nuw nsw i32 %x.066, 1
%exitcond72.not = icmp eq i32 %inc36, %r.2
br i1 %exitcond72.not, label %for.end39, label %for.body14, !llvm.loop !13
for.end39: ; preds = %for.inc35.critedge, %for.cond.cleanup
%call40 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
br label %cleanup41
cleanup41: ; preds = %if.then31, %for.end39
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: 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 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}
|
#include<stdio.h>
int main(void)
{
int n,m,s,c,i;
scanf("%d%d",&n,&m);
int num[n];
int ans=0;
for(i=0;i<n;i++)
num[i] = -1;
for(i=0;i<m;i++){
scanf("%d%d",&s,&c);
if(num[s-1] == -1 || num[s-1] == c)
num[s-1] = c;
else ans = -1;
}
if(n==1){
if(num[0]==-1)
num[0] = 0;
if(ans == -1)
printf("-1");
else
printf("%d",num[0]);
}
if(n==2){
if(num[0]==0)
ans=-1;
if(num[0]==-1)
num[0]=1;
if(ans == -1)
printf("-1");
else{
for(i=0;i<n;i++){
if(num[i] == -1)
printf("0");
else
printf("%d",num[i]);
}
}
}
if(n==3){
if(num[0] == 0)
ans = -1;
if(num[0] == -1)
num[0] = 1;
if(ans == -1)
printf("-1");
else{
for(i=0;i<n;i++){
if(num[i] == -1)
printf("0");
else
printf("%d",num[i]);
}
}
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119848/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119848/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-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"-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:
%n = alloca i32, align 4
%m = alloca i32, align 4
%s = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #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
%cmp124 = icmp sgt i32 %3, 0
br i1 %cmp124, label %for.body.preheader, label %for.cond1.preheader
for.body.preheader: ; preds = %entry
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 %4, 2
call void @llvm.memset.p0.i64(ptr nonnull align 16 %vla, i8 -1, i64 %5, i1 false), !tbaa !5
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.body.preheader, %entry
%6 = load i32, ptr %m, align 4, !tbaa !5
%cmp2126 = icmp sgt i32 %6, 0
br i1 %cmp2126, label %for.body3, label %for.end17.thread
for.body3: ; preds = %for.cond1.preheader, %for.body3
%ans.0128 = phi i32 [ %spec.select121, %for.body3 ], [ 0, %for.cond1.preheader ]
%i.1127 = phi i32 [ %inc16, %for.body3 ], [ 0, %for.cond1.preheader ]
%call4 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %s, ptr noundef nonnull %c)
%7 = load i32, ptr %s, align 4, !tbaa !5
%sub = add nsw i32 %7, -1
%idxprom5 = sext i32 %sub to i64
%arrayidx6 = getelementptr inbounds i32, ptr %vla, i64 %idxprom5
%8 = load i32, ptr %arrayidx6, align 4, !tbaa !5
%cmp7 = icmp eq i32 %8, -1
%9 = load i32, ptr %c, align 4
%cmp11 = icmp eq i32 %8, %9
%or.cond = select i1 %cmp7, i1 true, i1 %cmp11
%spec.store.select120 = select i1 %or.cond, i32 %9, i32 %8
store i32 %spec.store.select120, ptr %arrayidx6, align 4
%spec.select121 = select i1 %or.cond, i32 %ans.0128, i32 -1
%inc16 = add nuw nsw i32 %i.1127, 1
%10 = load i32, ptr %m, align 4, !tbaa !5
%cmp2 = icmp slt i32 %inc16, %10
br i1 %cmp2, label %for.body3, label %for.end17, !llvm.loop !9
for.end17: ; preds = %for.body3
%.pre = load i32, ptr %n, align 4, !tbaa !5
%cmp18 = icmp eq i32 %.pre, 1
br i1 %cmp18, label %if.then19, label %if.end32
for.end17.thread: ; preds = %for.cond1.preheader
%cmp18141 = icmp eq i32 %3, 1
br i1 %cmp18141, label %if.then19.thread, label %if.end32
if.then19.thread: ; preds = %for.end17.thread
%11 = load i32, ptr %vla, align 16, !tbaa !5
%cmp21145 = icmp eq i32 %11, -1
%spec.store.select146 = select i1 %cmp21145, i32 0, i32 %11
store i32 %spec.store.select146, ptr %vla, align 16
br label %if.else28
if.then19: ; preds = %for.end17
%12 = load i32, ptr %vla, align 16, !tbaa !5
%cmp21 = icmp eq i32 %12, -1
%spec.store.select = select i1 %cmp21, i32 0, i32 %12
store i32 %spec.store.select, ptr %vla, align 16
%cmp25 = icmp eq i32 %spec.select121, -1
br i1 %cmp25, label %if.then26, label %if.else28
if.then26: ; preds = %if.then19
%call27 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end32thread-pre-split
if.else28: ; preds = %if.then19.thread, %if.then19
%spec.store.select150 = phi i32 [ %spec.store.select146, %if.then19.thread ], [ %spec.store.select, %if.then19 ]
%ans.0.lcssa143149 = phi i32 [ 0, %if.then19.thread ], [ %ans.0128, %if.then19 ]
%call30 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %spec.store.select150)
br label %if.end32thread-pre-split
if.end32thread-pre-split: ; preds = %if.else28, %if.then26
%ans.0.lcssa143148 = phi i32 [ %ans.0.lcssa143149, %if.else28 ], [ -1, %if.then26 ]
%.pr = load i32, ptr %n, align 4, !tbaa !5
br label %if.end32
if.end32: ; preds = %for.end17.thread, %if.end32thread-pre-split, %for.end17
%ans.0.lcssa142 = phi i32 [ %ans.0.lcssa143148, %if.end32thread-pre-split ], [ %spec.select121, %for.end17 ], [ 0, %for.end17.thread ]
%13 = phi i32 [ %.pr, %if.end32thread-pre-split ], [ %.pre, %for.end17 ], [ %3, %for.end17.thread ]
%cmp33 = icmp eq i32 %13, 2
br i1 %cmp33, label %if.then34, label %if.end65thread-pre-split
if.then34: ; preds = %if.end32
%14 = load i32, ptr %vla, align 16, !tbaa !5
%cmp36 = icmp eq i32 %14, 0
%cmp40 = icmp eq i32 %14, -1
%spec.store.select117 = select i1 %cmp40, i32 1, i32 %14
store i32 %spec.store.select117, ptr %vla, align 16
%cmp44122 = icmp eq i32 %ans.0.lcssa142, -1
%cmp44 = select i1 %cmp36, i1 true, i1 %cmp44122
br i1 %cmp44, label %if.then45, label %for.body50
if.then45: ; preds = %if.then34
%call46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
%.pr119.pre = load i32, ptr %n, align 4, !tbaa !5
br label %if.end65thread-pre-split
for.body50: ; preds = %if.then34, %for.inc61
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc61 ], [ 0, %if.then34 ]
%arrayidx52 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv
%15 = load i32, ptr %arrayidx52, align 4, !tbaa !5
%cmp53 = icmp eq i32 %15, -1
br i1 %cmp53, label %if.then54, label %if.else56
if.then54: ; preds = %for.body50
%putchar = call i32 @putchar(i32 48)
br label %for.inc61
if.else56: ; preds = %for.body50
%call59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %15)
br label %for.inc61
for.inc61: ; preds = %if.then54, %if.else56
%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
%cmp49 = icmp slt i64 %indvars.iv.next, %17
br i1 %cmp49, label %for.body50, label %if.end65, !llvm.loop !11
if.end65thread-pre-split: ; preds = %if.end32, %if.then45
%.pr119 = phi i32 [ %13, %if.end32 ], [ %.pr119.pre, %if.then45 ]
%ans.3.ph = phi i32 [ %ans.0.lcssa142, %if.end32 ], [ -1, %if.then45 ]
%18 = icmp eq i32 %ans.3.ph, -1
br label %if.end65
if.end65: ; preds = %for.inc61, %if.end65thread-pre-split
%19 = phi i32 [ %.pr119, %if.end65thread-pre-split ], [ %16, %for.inc61 ]
%ans.3 = phi i1 [ %18, %if.end65thread-pre-split ], [ false, %for.inc61 ]
%cmp66 = icmp eq i32 %19, 3
br i1 %cmp66, label %if.then67, label %if.end98
if.then67: ; preds = %if.end65
%20 = load i32, ptr %vla, align 16, !tbaa !5
%cmp69 = icmp eq i32 %20, 0
%cmp73 = icmp eq i32 %20, -1
%spec.store.select118 = select i1 %cmp73, i32 1, i32 %20
store i32 %spec.store.select118, ptr %vla, align 16
%cmp77 = select i1 %cmp69, i1 true, i1 %ans.3
br i1 %cmp77, label %if.then78, label %for.body83
if.then78: ; preds = %if.then67
%call79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
br label %if.end98
for.body83: ; preds = %if.then67, %for.inc94
%indvars.iv136 = phi i64 [ %indvars.iv.next137, %for.inc94 ], [ 0, %if.then67 ]
%arrayidx85 = getelementptr inbounds i32, ptr %vla, i64 %indvars.iv136
%21 = load i32, ptr %arrayidx85, align 4, !tbaa !5
%cmp86 = icmp eq i32 %21, -1
br i1 %cmp86, label %if.then87, label %if.else89
if.then87: ; preds = %for.body83
%putchar115 = call i32 @putchar(i32 48)
br label %for.inc94
if.else89: ; preds = %for.body83
%call92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %21)
br label %for.inc94
for.inc94: ; preds = %if.then87, %if.else89
%indvars.iv.next137 = add nuw nsw i64 %indvars.iv136, 1
%22 = load i32, ptr %n, align 4, !tbaa !5
%23 = sext i32 %22 to i64
%cmp82 = icmp slt i64 %indvars.iv.next137, %23
br i1 %cmp82, label %for.body83, label %if.end98, !llvm.loop !12
if.end98: ; preds = %for.inc94, %if.then78, %if.end65
call void @llvm.stackrestore.p0(ptr %2)
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %c) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #6
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3
; Function Attrs: nofree nounwind
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #4
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 nounwind willreturn memory(argmem: 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 = distinct !{!12, !10}
|
#include <stdio.h>
int main(){
int i,n,m,s[3]={-1,-1,-1},f=0,a,b;
scanf("%d",&n);
scanf("%d",&m);
for(i=0;i<m;i++){
scanf("%d %d",&a,&b);
if((s[n-a]==-1)|(s[n-a]==b)){
s[n-a]=b;
}else{
f=-1;
break;
}
}
if(f!=-1){
if(n<3){
if(s[2]>0){
f==-1;
}
s[2]=0;
}
if(n==1){
if(s[1]>0){
f=-1;
}
s[1]=0;
}
if(s[2]==0){
if(n==3){
f=-1;
}else{
if(n==2){
if(s[1]==0){
f=-1;
}else if(s[1]==-1){
s[1]=1;
}
}
}
}else if(s[2]==-1){
if(n==3){
s[2]=1;
}
}
}
for(i=0;i<3;i++){
if(s[i]==-1){
s[i]=0;
}
}
if(f!=-1){
f=s[2]*100+s[1]*10+s[0];
}
printf("%d",f);
return(0);
}
| ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119899/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119899/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%s = alloca [3 x i32], align 4
%a = alloca i32, align 4
%b = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %s) #4
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %s, i8 -1, i64 12, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) #4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %b) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp113 = icmp sgt i32 %0, 0
br i1 %cmp113, label %for.body, label %entry.if.then14_crit_edge
entry.if.then14_crit_edge: ; preds = %entry
%.pre = load i32, ptr %n, align 4
br label %if.then14
for.body: ; preds = %entry, %if.then
%i.0114 = phi i32 [ %inc, %if.then ], [ 0, %entry ]
%call2 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %a, ptr noundef nonnull %b)
%1 = load i32, ptr %n, align 4
%2 = load i32, ptr %a, align 4, !tbaa !5
%sub = sub nsw i32 %1, %2
%idxprom = sext i32 %sub to i64
%arrayidx = getelementptr inbounds [3 x i32], ptr %s, i64 0, i64 %idxprom
%3 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp3 = icmp eq i32 %3, -1
%4 = load i32, ptr %b, align 4, !tbaa !5
%cmp7 = icmp eq i32 %3, %4
%or110 = or i1 %cmp3, %cmp7
br i1 %or110, label %if.then, label %if.end74.loopexit
if.then: ; preds = %for.body
store i32 %4, ptr %arrayidx, align 4, !tbaa !5
%inc = add nuw nsw i32 %i.0114, 1
%5 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %5
br i1 %cmp, label %for.body, label %if.then14, !llvm.loop !9
if.then14: ; preds = %if.then, %entry.if.then14_crit_edge
%6 = phi i32 [ %.pre, %entry.if.then14_crit_edge ], [ %1, %if.then ]
%cmp15 = icmp slt i32 %6, 3
br i1 %cmp15, label %if.end26, label %if.end36
if.end26: ; preds = %if.then14
switch i32 %6, label %if.end74.fold.split [
i32 1, label %if.then40.thread
i32 3, label %if.end74
i32 2, label %if.then47
]
if.then40.thread: ; preds = %if.end26
%arrayidx30 = getelementptr inbounds [3 x i32], ptr %s, i64 0, i64 1
%7 = load i32, ptr %arrayidx30, align 4, !tbaa !5
%cmp31 = icmp sgt i32 %7, 0
store i32 0, ptr %arrayidx30, align 4, !tbaa !5
br label %if.end74.fold.split
if.end36: ; preds = %if.then14
%arrayidx37.phi.trans.insert = getelementptr inbounds [3 x i32], ptr %s, i64 0, i64 2
%.pre117 = load i32, ptr %arrayidx37.phi.trans.insert, align 4, !tbaa !5
%cmp38 = icmp eq i32 %.pre117, 0
br i1 %cmp38, label %if.then40, label %if.else62
if.then40: ; preds = %if.end36
switch i32 %6, label %if.end74.fold.split [
i32 3, label %if.end74
i32 2, label %if.then47
]
if.then47: ; preds = %if.end26, %if.then40
%arrayidx48 = getelementptr inbounds [3 x i32], ptr %s, i64 0, i64 1
%8 = load i32, ptr %arrayidx48, align 4, !tbaa !5
switch i32 %8, label %if.end74.fold.split111 [
i32 0, label %if.end74
i32 -1, label %if.then56
]
if.then56: ; preds = %if.then47
store i32 1, ptr %arrayidx48, align 4, !tbaa !5
br label %if.end74
if.else62: ; preds = %if.end36
%cmp64 = icmp eq i32 %.pre117, -1
%cmp67 = icmp eq i32 %6, 3
%or.cond = and i1 %cmp67, %cmp64
%spec.select126 = select i1 %or.cond, i32 1, i32 %.pre117
br label %if.end74
if.end74.fold.split: ; preds = %if.end26, %if.then40.thread, %if.then40
%f.2122124 = phi i1 [ %cmp31, %if.then40.thread ], [ false, %if.then40 ], [ false, %if.end26 ]
br label %if.end74
if.end74.fold.split111: ; preds = %if.then47
br label %if.end74
if.end74.loopexit: ; preds = %for.body
%arrayidx80.2.phi.trans.insert = getelementptr inbounds [3 x i32], ptr %s, i64 0, i64 2
%.pre118 = load i32, ptr %arrayidx80.2.phi.trans.insert, align 4, !tbaa !5
br label %if.end74
if.end74: ; preds = %if.else62, %if.end26, %if.end74.loopexit, %if.then47, %if.end74.fold.split111, %if.then40, %if.end74.fold.split, %if.then56
%9 = phi i32 [ 0, %if.then56 ], [ 0, %if.then40 ], [ 0, %if.end74.fold.split ], [ %8, %if.then47 ], [ 0, %if.end74.fold.split111 ], [ %.pre118, %if.end74.loopexit ], [ 0, %if.end26 ], [ %spec.select126, %if.else62 ]
%f.3 = phi i1 [ false, %if.then56 ], [ true, %if.then40 ], [ %f.2122124, %if.end74.fold.split ], [ true, %if.then47 ], [ false, %if.end74.fold.split111 ], [ true, %if.end74.loopexit ], [ true, %if.end26 ], [ false, %if.else62 ]
%.fr = freeze i32 %9
%10 = load i32, ptr %s, align 4, !tbaa !5
%cmp81 = icmp eq i32 %10, -1
%spec.store.select = select i1 %cmp81, i32 0, i32 %10
%arrayidx80.1 = getelementptr inbounds [3 x i32], ptr %s, i64 0, i64 1
%11 = load i32, ptr %arrayidx80.1, align 4, !tbaa !5
%cmp81.1 = icmp eq i32 %11, -1
%12 = mul nsw i32 %11, 10
%cmp81.2 = icmp eq i32 %.fr, -1
%13 = mul nsw i32 %.fr, 100
%mul = select i1 %cmp81.2, i32 0, i32 %13
%mul95 = select i1 %cmp81.1, i32 0, i32 %12
%add = add nsw i32 %mul95, %mul
%add97 = add nsw i32 %add, %spec.store.select
%f.4 = select i1 %f.3, i32 -1, i32 %add97
%call99 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %f.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
call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %s) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %m) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3
attributes #0 = { nofree nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
|
#include <stdio.h>
#include <stdlib.h>
void solve(int x) {
printf("%d", x);
exit(0);
}
int main() {
int n, m, a[3] = {-1, -1, -1}, s, c, i;
scanf("%d %d", &n, &m);
for(i = 0; i < m; i++) {
scanf("%d %d", &s, &c);
if(a[--s] == -1)
a[s] = c;
else if(a[s] != c)
solve(-1);
}
if(n == 1)
solve(a[0] == -1 ? 0 : a[0]);
else {
int r = 0;
for(i = 0; i < n; i++)
r = 10*r + (a[i] == -1 ? !i : a[i]);
solve(a[0] ? r : -1);
}
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119941/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119941/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [6 x i8] c"%d %d\00", align 1
; Function Attrs: noreturn nounwind uwtable
define dso_local void @solve(i32 noundef %x) local_unnamed_addr #0 {
entry:
%call = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %x)
tail call void @exit(i32 noundef 0) #5
unreachable
}
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2
; Function Attrs: noreturn nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%m = alloca i32, align 4
%a = alloca [3 x i32], align 4
%s = alloca i32, align 4
%c = alloca i32, align 4
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %m) #6
call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %a) #6
call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %a, i8 -1, i64 12, i1 false)
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %s) #6
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %c) #6
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %n, ptr noundef nonnull %m)
%0 = load i32, ptr %m, align 4, !tbaa !5
%cmp50 = icmp sgt i32 %0, 0
br i1 %cmp50, label %for.body, label %for.end
for.body: ; preds = %entry, %for.inc
%i.051 = phi i32 [ %inc, %for.inc ], [ 0, %entry ]
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %s, ptr noundef nonnull %c)
%1 = load i32, ptr %s, align 4, !tbaa !5
%dec = add nsw i32 %1, -1
store i32 %dec, ptr %s, align 4, !tbaa !5
%idxprom = sext i32 %dec to i64
%arrayidx = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %idxprom
%2 = load i32, ptr %arrayidx, align 4, !tbaa !5
%cmp2 = icmp eq i32 %2, -1
%3 = load i32, ptr %c, align 4, !tbaa !5
br i1 %cmp2, label %if.then, label %if.else
if.then: ; preds = %for.body
store i32 %3, ptr %arrayidx, align 4, !tbaa !5
br label %for.inc
if.else: ; preds = %for.body
%cmp7.not = icmp eq i32 %2, %3
br i1 %cmp7.not, label %for.inc, label %if.then8
if.then8: ; preds = %if.else
%call.i = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef -1)
call void @exit(i32 noundef 0) #5
unreachable
for.inc: ; preds = %if.then, %if.else
%inc = add nuw nsw i32 %i.051, 1
%4 = load i32, ptr %m, align 4, !tbaa !5
%cmp = icmp slt i32 %inc, %4
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.inc, %entry
%5 = load i32, ptr %n, align 4, !tbaa !5
%cmp10 = icmp eq i32 %5, 1
br i1 %cmp10, label %if.then11, label %for.cond16.preheader
for.cond16.preheader: ; preds = %for.end
%cmp1752 = icmp sgt i32 %5, 0
br i1 %cmp1752, label %for.body18.preheader, label %for.end30
for.body18.preheader: ; preds = %for.cond16.preheader
%wide.trip.count = zext i32 %5 to i64
%xtraiter = and i64 %wide.trip.count, 1
%6 = icmp eq i32 %5, 1
br i1 %6, label %for.end30.loopexit.unr-lcssa, label %for.body18.preheader.new
for.body18.preheader.new: ; preds = %for.body18.preheader
%unroll_iter = and i64 %wide.trip.count, 4294967294
br label %for.body18
if.then11: ; preds = %for.end
%7 = load i32, ptr %a, align 4
%cmp13 = icmp eq i32 %7, -1
%cond = select i1 %cmp13, i32 0, i32 %7
%call.i46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cond)
call void @exit(i32 noundef 0) #5
unreachable
for.body18: ; preds = %for.body18, %for.body18.preheader.new
%indvars.iv = phi i64 [ 0, %for.body18.preheader.new ], [ %indvars.iv.next.1, %for.body18 ]
%r.054 = phi i32 [ 0, %for.body18.preheader.new ], [ %add.1, %for.body18 ]
%niter = phi i64 [ 0, %for.body18.preheader.new ], [ %niter.next.1, %for.body18 ]
%mul = mul nsw i32 %r.054, 10
%arrayidx20 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %indvars.iv
%8 = load i32, ptr %arrayidx20, align 4, !tbaa !5
%cmp21 = icmp eq i32 %8, -1
%tobool.not = icmp eq i64 %indvars.iv, 0
%lnot.ext = zext i1 %tobool.not to i32
%cond27 = select i1 %cmp21, i32 %lnot.ext, i32 %8
%add = add nsw i32 %cond27, %mul
%indvars.iv.next = or i64 %indvars.iv, 1
%mul.1 = mul nsw i32 %add, 10
%arrayidx20.1 = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %indvars.iv.next
%9 = load i32, ptr %arrayidx20.1, align 4, !tbaa !5
%cmp21.1 = icmp eq i32 %9, -1
%cond27.1 = select i1 %cmp21.1, i32 0, i32 %9
%add.1 = add nsw i32 %cond27.1, %mul.1
%indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
%niter.next.1 = add i64 %niter, 2
%niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
br i1 %niter.ncmp.1, label %for.end30.loopexit.unr-lcssa.loopexit, label %for.body18, !llvm.loop !11
for.end30.loopexit.unr-lcssa.loopexit: ; preds = %for.body18
%10 = mul nsw i32 %add.1, 10
br label %for.end30.loopexit.unr-lcssa
for.end30.loopexit.unr-lcssa: ; preds = %for.end30.loopexit.unr-lcssa.loopexit, %for.body18.preheader
%add.lcssa.ph = phi i32 [ undef, %for.body18.preheader ], [ %add.1, %for.end30.loopexit.unr-lcssa.loopexit ]
%indvars.iv.unr = phi i64 [ 0, %for.body18.preheader ], [ %indvars.iv.next.1, %for.end30.loopexit.unr-lcssa.loopexit ]
%r.054.unr = phi i32 [ 0, %for.body18.preheader ], [ %10, %for.end30.loopexit.unr-lcssa.loopexit ]
%lcmp.mod.not = icmp eq i64 %xtraiter, 0
br i1 %lcmp.mod.not, label %for.end30, label %for.body18.epil
for.body18.epil: ; preds = %for.end30.loopexit.unr-lcssa
%arrayidx20.epil = getelementptr inbounds [3 x i32], ptr %a, i64 0, i64 %indvars.iv.unr
%11 = load i32, ptr %arrayidx20.epil, align 4, !tbaa !5
%cmp21.epil = icmp eq i32 %11, -1
%tobool.not.epil = icmp eq i64 %indvars.iv.unr, 0
%lnot.ext.epil = zext i1 %tobool.not.epil to i32
%cond27.epil = select i1 %cmp21.epil, i32 %lnot.ext.epil, i32 %11
%add.epil = add nsw i32 %cond27.epil, %r.054.unr
br label %for.end30
for.end30: ; preds = %for.body18.epil, %for.end30.loopexit.unr-lcssa, %for.cond16.preheader
%r.0.lcssa = phi i32 [ 0, %for.cond16.preheader ], [ %add.lcssa.ph, %for.end30.loopexit.unr-lcssa ], [ %add.epil, %for.body18.epil ]
%12 = load i32, ptr %a, align 4, !tbaa !5
%tobool32.not = icmp eq i32 %12, 0
%cond36 = select i1 %tobool32.not, i32 -1, i32 %r.0.lcssa
%call.i48 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %cond36)
call void @exit(i32 noundef 0) #5
unreachable
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #3
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1
; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4
attributes #0 = { noreturn nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { noreturn nounwind }
attributes #6 = { nounwind }
!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"Ubuntu clang version 18.0.0 (++20231007042255+8abb2ace888b-1~exp1~20231007042414.1230)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
|
#include <stdio.h>
int main(void) {
int sum=0,i,n,a[100000],r[100000];
scanf("%d",&n);
for(i=0;i<n;i++) {
scanf("%d",&a[i]);
sum += a[i];
}
r[0] = sum;
for(i=1;i<n-1;i+=2) {
r[0] -= 2*a[i];
}
printf("%d\n",r[0]);
for(i=1;i<n; i++) {
r[i] = 2*a[i-1] - r[i-1];
printf("%d\n",r[i]);
}
return 0;
} | ; ModuleID = '/data/TheStack_IR/OJ_Samples/Collated/C/Source_119992/source.c'
source_filename = "/data/TheStack_IR/OJ_Samples/Collated/C/Source_119992/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@.str = private unnamed_addr constant [3 x i8] c"%d\00", align 1
@.str.1 = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
; Function Attrs: nofree nounwind uwtable
define dso_local i32 @main() local_unnamed_addr #0 {
entry:
%n = alloca i32, align 4
%a = alloca [100000 x i32], align 16
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %n) #4
call void @llvm.lifetime.start.p0(i64 400000, ptr nonnull %a) #4
%call = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %n)
%0 = load i32, ptr %n, align 4, !tbaa !5
%cmp49 = icmp sgt i32 %0, 0
br i1 %cmp49, label %for.body, label %for.end14
for.body: ; preds = %entry, %for.body
%indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
%sum.050 = phi i32 [ %add, %for.body ], [ 0, %entry ]
%arrayidx = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv
%call1 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %arrayidx)
%1 = load i32, ptr %arrayidx, align 4, !tbaa !5
%add = add nsw i32 %1, %sum.050
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
%2 = load i32, ptr %n, align 4, !tbaa !5
%3 = sext i32 %2 to i64
%cmp = icmp slt i64 %indvars.iv.next, %3
br i1 %cmp, label %for.body, label %for.end, !llvm.loop !9
for.end: ; preds = %for.body
%cmp654 = icmp sgt i32 %2, 2
br i1 %cmp654, label %for.body7.preheader, label %for.end14
for.body7.preheader: ; preds = %for.end
%sub = add nsw i32 %2, -1
%4 = zext i32 %sub to i64
%umax = call i64 @llvm.umax.i64(i64 %4, i64 3)
%5 = add nsw i64 %umax, -2
%min.iters.check = icmp ult i64 %5, 16
br i1 %min.iters.check, label %for.body7.preheader74, label %vector.ph
vector.ph: ; preds = %for.body7.preheader
%6 = lshr i64 %5, 1
%7 = add nuw nsw i64 %6, 1
%n.mod.vf = and i64 %7, 7
%8 = icmp eq i64 %n.mod.vf, 0
%9 = select i1 %8, i64 8, i64 %n.mod.vf
%n.vec = sub nsw i64 %7, %9
%10 = shl i64 %n.vec, 1
%ind.end = or i64 %10, 1
%11 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %add, 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> [ %11, %vector.ph ], [ %18, %vector.body ]
%vec.phi71 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %19, %vector.body ]
%12 = shl i64 %index, 1
%offset.idx = or i64 %12, 1
%13 = or i64 %12, 9
%14 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %offset.idx
%15 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %13
%wide.vec = load <8 x i32>, ptr %14, align 4, !tbaa !5
%wide.vec72 = load <8 x i32>, ptr %15, align 4, !tbaa !5
%strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%strided.vec73 = shufflevector <8 x i32> %wide.vec72, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
%16 = shl nsw <4 x i32> %strided.vec, <i32 1, i32 1, i32 1, i32 1>
%17 = shl nsw <4 x i32> %strided.vec73, <i32 1, i32 1, i32 1, i32 1>
%18 = sub <4 x i32> %vec.phi, %16
%19 = sub <4 x i32> %vec.phi71, %17
%index.next = add nuw i64 %index, 8
%20 = icmp eq i64 %index.next, %n.vec
br i1 %20, label %middle.block, label %vector.body, !llvm.loop !11
middle.block: ; preds = %vector.body
%bin.rdx = add <4 x i32> %19, %18
%21 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
br label %for.body7.preheader74
for.body7.preheader74: ; preds = %for.body7.preheader, %middle.block
%indvars.iv61.ph = phi i64 [ 1, %for.body7.preheader ], [ %ind.end, %middle.block ]
%.ph = phi i32 [ %add, %for.body7.preheader ], [ %21, %middle.block ]
br label %for.body7
for.body7: ; preds = %for.body7.preheader74, %for.body7
%indvars.iv61 = phi i64 [ %indvars.iv.next62, %for.body7 ], [ %indvars.iv61.ph, %for.body7.preheader74 ]
%22 = phi i32 [ %sub11, %for.body7 ], [ %.ph, %for.body7.preheader74 ]
%arrayidx9 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %indvars.iv61
%23 = load i32, ptr %arrayidx9, align 4, !tbaa !5
%mul = shl nsw i32 %23, 1
%sub11 = sub nsw i32 %22, %mul
%indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 2
%cmp6 = icmp ult i64 %indvars.iv.next62, %4
br i1 %cmp6, label %for.body7, label %for.end14, !llvm.loop !14
for.end14: ; preds = %for.body7, %entry, %for.end
%.lcssa53 = phi i32 [ %add, %for.end ], [ 0, %entry ], [ %sub11, %for.body7 ]
%call16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.lcssa53)
%24 = load i32, ptr %n, align 4, !tbaa !5
%cmp1857 = icmp sgt i32 %24, 1
br i1 %cmp1857, label %for.body19, label %for.end35
for.body19: ; preds = %for.end14, %for.body19
%25 = phi i32 [ %sub27, %for.body19 ], [ %.lcssa53, %for.end14 ]
%indvars.iv64 = phi i64 [ %indvars.iv.next65, %for.body19 ], [ 1, %for.end14 ]
%26 = add nsw i64 %indvars.iv64, -1
%arrayidx22 = getelementptr inbounds [100000 x i32], ptr %a, i64 0, i64 %26
%27 = load i32, ptr %arrayidx22, align 4, !tbaa !5
%mul23 = shl nsw i32 %27, 1
%sub27 = sub nsw i32 %mul23, %25
%call32 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %sub27)
%indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
%28 = load i32, ptr %n, align 4, !tbaa !5
%29 = sext i32 %28 to i64
%cmp18 = icmp slt i64 %indvars.iv.next65, %29
br i1 %cmp18, label %for.body19, label %for.end35, !llvm.loop !15
for.end35: ; preds = %for.body19, %for.end14
call void @llvm.lifetime.end.p0(i64 400000, ptr nonnull %a) #4
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %n) #4
ret i32 0
}
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2
; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #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}
!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}
!15 = distinct !{!15, !10}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.